|
| 1 | +# DevX Guardrails Implementation Plan |
| 2 | + |
| 3 | +> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. |
| 4 | +
|
| 5 | +**Goal:** Add repo-local guardrails and one-command verification for fresh clones (AGENTS.md + Makefile + CI fmt gate). |
| 6 | + |
| 7 | +**Architecture:** Keep changes purely additive and low-risk: add small top-level docs and a `Makefile`, and extend CI with a dedicated `fmt` job. No runtime/CLI behavior changes. |
| 8 | + |
| 9 | +**Tech Stack:** Rust (cargo), GitHub Actions, MkDocs (Material + i18n), Make. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +### Task 1: Add repo-local agent/maintainer guardrails |
| 14 | + |
| 15 | +**Files:** |
| 16 | +- Create: `AGENTS.md` |
| 17 | + |
| 18 | +**Step 1: Write the file** |
| 19 | + |
| 20 | +Create `AGENTS.md` at repo root with: |
| 21 | +- public docs boundary rules (`docs-site/` only) |
| 22 | +- internal-only docs index link (`docs/internal/index.md`) |
| 23 | +- required verification commands (`make check` or raw cargo/mkdocs commands) |
| 24 | +- version/changelog rule reminder (`Cargo.toml` + `CHANGELOG.md` together when needed) |
| 25 | + |
| 26 | +**Step 2: Verify it does not affect docs publishing** |
| 27 | + |
| 28 | +Run: `python3 -m mkdocs build --strict` |
| 29 | +Expected: exit 0 (MkDocs should ignore `AGENTS.md` by default since `docs_dir: docs-site`). |
| 30 | + |
| 31 | +**Step 3: Commit** |
| 32 | + |
| 33 | +Run: |
| 34 | +```bash |
| 35 | +git add AGENTS.md |
| 36 | +git commit -m "docs: add agent guardrails" |
| 37 | +``` |
| 38 | + |
| 39 | +--- |
| 40 | + |
| 41 | +### Task 2: Add a `Makefile` for one-command verification |
| 42 | + |
| 43 | +**Files:** |
| 44 | +- Create: `Makefile` |
| 45 | + |
| 46 | +**Step 1: Add targets** |
| 47 | + |
| 48 | +Include at minimum: |
| 49 | +- `help` |
| 50 | +- `fmt` / `fmt-check` |
| 51 | +- `test` |
| 52 | +- `docs` |
| 53 | +- `docs-venv` (install `requirements-docs.txt` into `.venv-docs/`) |
| 54 | +- `check` (fmt-check + test + docs) |
| 55 | + |
| 56 | +**Step 2: Run a smoke check** |
| 57 | + |
| 58 | +Run: `make help` |
| 59 | +Expected: prints a short list of targets. |
| 60 | + |
| 61 | +Run: `make fmt-check` |
| 62 | +Expected: exit 0. |
| 63 | + |
| 64 | +**Step 3: Commit** |
| 65 | + |
| 66 | +Run: |
| 67 | +```bash |
| 68 | +git add Makefile |
| 69 | +git commit -m "chore: add make targets for local checks" |
| 70 | +``` |
| 71 | + |
| 72 | +--- |
| 73 | + |
| 74 | +### Task 3: Add CI formatting gate |
| 75 | + |
| 76 | +**Files:** |
| 77 | +- Modify: `.github/workflows/ci.yml` |
| 78 | + |
| 79 | +**Step 1: Add a `fmt` job** |
| 80 | + |
| 81 | +Add a job that: |
| 82 | +- checks out code |
| 83 | +- installs Rust toolchain |
| 84 | +- restores rust cache |
| 85 | +- runs `cargo fmt --all --check` |
| 86 | + |
| 87 | +**Step 2: Run scripts workflow unit tests (optional but preferred)** |
| 88 | + |
| 89 | +Run: `python3 -m unittest scripts.tests.test_ci_workflows` |
| 90 | +Expected: pass. |
| 91 | + |
| 92 | +**Step 3: Commit** |
| 93 | + |
| 94 | +Run: |
| 95 | +```bash |
| 96 | +git add .github/workflows/ci.yml |
| 97 | +git commit -m "ci: add cargo fmt check" |
| 98 | +``` |
| 99 | + |
| 100 | +--- |
| 101 | + |
| 102 | +### Task 4: Verification + merge |
| 103 | + |
| 104 | +**Files:** |
| 105 | +- (no new files; verify whole tree) |
| 106 | + |
| 107 | +**Step 1: Run full local verification** |
| 108 | + |
| 109 | +Run: `make check` |
| 110 | +Expected: exit 0. |
| 111 | + |
| 112 | +**Step 2: Push and merge** |
| 113 | + |
| 114 | +If working on a branch: |
| 115 | +```bash |
| 116 | +git push -u origin <branch> |
| 117 | +``` |
| 118 | + |
| 119 | +Then merge to `main` using the project’s normal workflow (fast-forward or PR). |
0 commit comments