Skip to content

Commit 351e839

Browse files
committed
docs: add devx guardrails design and plan
1 parent 7aa09a7 commit 351e839

2 files changed

Lines changed: 172 additions & 0 deletions

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# DevX Guardrails Design (AGENTS.md + Makefile + CI fmt gate)
2+
3+
**Status:** approved
4+
**Date:** 2026-03-08
5+
6+
## Goal
7+
8+
Make a fresh clone easier to work on and harder to accidentally “do the wrong thing” by adding lightweight, repo-local guardrails:
9+
10+
- clear agent/maintainer rules (`AGENTS.md`)
11+
- one-command local verification (`Makefile`)
12+
- a fast CI gate for formatting (`cargo fmt --check`)
13+
14+
## Non-goals
15+
16+
- No behavior changes to runtime/CLI/providers.
17+
- No new release/version bump work.
18+
- No new lints that could create high-noise failures (clippy can be added later if desired).
19+
- No restructuring of public docs site navigation.
20+
21+
## Proposed changes
22+
23+
### 1) `AGENTS.md` in repo root (`meos/`)
24+
25+
Add an agent-facing contract covering:
26+
27+
- public vs internal docs boundary (`docs-site/` only publishes; `docs/internal/` never published)
28+
- required “evidence before claims” verification commands
29+
- where to put design/plan docs (`docs/plans/`)
30+
- versioning rule (Cargo workspace version + `CHANGELOG.md` move together when required)
31+
- common commands / paths (config, docs build, release check)
32+
33+
### 2) `Makefile` in repo root (`meos/`)
34+
35+
Provide stable, discoverable commands for common checks:
36+
37+
- `make fmt-check`
38+
- `make test`
39+
- `make docs` (strict mkdocs build)
40+
- `make check` (fmt + tests + docs)
41+
- `make docs-venv` to install docs dependencies into `.venv-docs/` (which is already gitignored)
42+
43+
### 3) CI: add a formatting gate
44+
45+
Add a `cargo fmt --all --check` job to `.github/workflows/ci.yml` so formatting issues fail early and consistently.
46+
47+
## Verification (local)
48+
49+
- `make check`
50+
51+
## Rollout
52+
53+
Land as a small, DX-only change set on `main`.
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
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

Comments
 (0)