@mlmcps/ml-specs 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +15 -0
- package/LICENSE +21 -0
- package/README.md +106 -0
- package/ml-specs/.claude-plugin/plugin.json +11 -0
- package/ml-specs/.mcp.json +17 -0
- package/ml-specs/CHANGELOG.md +860 -0
- package/ml-specs/LICENSE +21 -0
- package/ml-specs/README.md +347 -0
- package/ml-specs/agents/coder.md +76 -0
- package/ml-specs/agents/developer.md +78 -0
- package/ml-specs/agents/pr-author.md +36 -0
- package/ml-specs/agents/reviewer.md +65 -0
- package/ml-specs/agents/scanner.md +66 -0
- package/ml-specs/agents/spec-author.md +91 -0
- package/ml-specs/agents/spec-reviewer.md +59 -0
- package/ml-specs/commands/code.md +29 -0
- package/ml-specs/commands/fix.md +67 -0
- package/ml-specs/commands/nfr.md +114 -0
- package/ml-specs/commands/pr.md +32 -0
- package/ml-specs/commands/repo-adopt.md +86 -0
- package/ml-specs/commands/repo-doctor.md +57 -0
- package/ml-specs/commands/repo-estate.md +79 -0
- package/ml-specs/commands/repo-impact.md +77 -0
- package/ml-specs/commands/repo-init.md +155 -0
- package/ml-specs/commands/repo-refresh.md +58 -0
- package/ml-specs/commands/repo-rollout.md +84 -0
- package/ml-specs/commands/repo-status.md +59 -0
- package/ml-specs/commands/spec-advance.md +81 -0
- package/ml-specs/commands/spec-build.md +66 -0
- package/ml-specs/commands/spec-fanout.md +64 -0
- package/ml-specs/commands/spec-review.md +24 -0
- package/ml-specs/commands/spec-verify.md +55 -0
- package/ml-specs/commands/spec.md +73 -0
- package/ml-specs/hooks/hooks.json +23 -0
- package/ml-specs/hooks/knowledge-drift.sh +43 -0
- package/ml-specs/hooks/secret-scan.sh +56 -0
- package/ml-specs/mcp/README.md +173 -0
- package/ml-specs/mcp/ml-specs-server.mjs +708 -0
- package/ml-specs/mcp/ml-specs-server.test.mjs +225 -0
- package/ml-specs/package.json +44 -0
- package/ml-specs/scripts/branch-policy.mjs +71 -0
- package/ml-specs/scripts/fix-specs.mjs +289 -0
- package/ml-specs/scripts/lib/cli.mjs +43 -0
- package/ml-specs/scripts/lib/estate.mjs +108 -0
- package/ml-specs/scripts/lib/http.mjs +73 -0
- package/ml-specs/scripts/lib/knowledge.mjs +91 -0
- package/ml-specs/scripts/lib/knowledge.test.mjs +70 -0
- package/ml-specs/scripts/lib/nfr.mjs +119 -0
- package/ml-specs/scripts/lib/nfr.test.mjs +89 -0
- package/ml-specs/scripts/lib/policy.mjs +114 -0
- package/ml-specs/scripts/lib/policy.test.mjs +139 -0
- package/ml-specs/scripts/lib/scm.mjs +189 -0
- package/ml-specs/scripts/lib/scm.test.mjs +155 -0
- package/ml-specs/scripts/lib/specs.mjs +192 -0
- package/ml-specs/scripts/lib/specs.test.mjs +69 -0
- package/ml-specs/scripts/lib/trace.mjs +90 -0
- package/ml-specs/scripts/lib/trace.test.mjs +110 -0
- package/ml-specs/scripts/lib/tracker.mjs +257 -0
- package/ml-specs/scripts/lib/tracker.test.mjs +177 -0
- package/ml-specs/scripts/nfr-compile.mjs +120 -0
- package/ml-specs/scripts/scripts.test.mjs +182 -0
- package/ml-specs/scripts/spec-brief.mjs +127 -0
- package/ml-specs/scripts/spec-dashboard.mjs +331 -0
- package/ml-specs/scripts/spec-fanout.mjs +120 -0
- package/ml-specs/scripts/spec-gate.mjs +329 -0
- package/ml-specs/scripts/spec-trace.mjs +91 -0
- package/ml-specs/scripts/survey-estate.mjs +230 -0
- package/ml-specs/scripts/tracker-sync.mjs +91 -0
- package/ml-specs/skills/knowledge-retrieval/SKILL.md +75 -0
- package/ml-specs/templates/CLAUDE.fragment.md +87 -0
- package/ml-specs/templates/ci/azure-pipelines-spec-gate.yml +64 -0
- package/ml-specs/templates/ci/knowledge-check.mjs +176 -0
- package/ml-specs/templates/ci/knowledge-layer.yml +35 -0
- package/ml-specs/templates/ci/spec-gate.yml +69 -0
- package/ml-specs/templates/docs/ARCHITECTURE.template.md +110 -0
- package/ml-specs/templates/docs/ESTATE.template.md +55 -0
- package/ml-specs/templates/docs/PATTERNS.template.md +80 -0
- package/ml-specs/templates/gitattributes +18 -0
- package/ml-specs/templates/hooks/settings.hooks.example.json +32 -0
- package/ml-specs/templates/mcp/.mcp.json +34 -0
- package/ml-specs/templates/settings.json +18 -0
- package/ml-specs/templates/specs/AGENTS.md +57 -0
- package/ml-specs/templates/specs/README.md +104 -0
- package/ml-specs/templates/specs/TEMPLATE.md +114 -0
- package/ml-specs/templates/standards/.mlskills.json +24 -0
- package/package.json +36 -0
package/ml-specs/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ACE Online platform team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
# ml-specs
|
|
2
|
+
|
|
3
|
+
Spec-driven development toolkit packaged as a Claude Code plugin, so every repo and every
|
|
4
|
+
developer gets the same agents and commands. The agents are **stack-aware**: they detect the
|
|
5
|
+
project before editing and follow its conventions — Java/Spring (Maven/Gradle), React, and
|
|
6
|
+
Node backends (Express, NestJS), across MySQL, PostgreSQL, and MongoDB. (Originally built for
|
|
7
|
+
a large microservice estate; works in standalone apps too.)
|
|
8
|
+
|
|
9
|
+
## Why use this (vs. just asking Claude)
|
|
10
|
+
|
|
11
|
+
Same model — the difference is what's wrapped around it. Default Claude Code re-learns your repo
|
|
12
|
+
every session, infers conventions on the fly, jumps straight to code, and reports "done" with the
|
|
13
|
+
human as the only check. This toolkit adds three things that change the outcome:
|
|
14
|
+
|
|
15
|
+
1. **Durable, learned memory** — `/repo-init` studies the repo once and writes `CLAUDE.md` +
|
|
16
|
+
`docs/PATTERNS.md` + `docs/ARCHITECTURE.md` with real `file:line` evidence. Every later task
|
|
17
|
+
reads *your* conventions instead of re-guessing them, so output matches your codebase
|
|
18
|
+
consistently across sessions and developers.
|
|
19
|
+
2. **Spec-before-code for non-trivial changes** — `/spec → review → /spec-build` puts the contract
|
|
20
|
+
(API, data model, cross-module ripple) on paper for human approval **before** code exists, so
|
|
21
|
+
the costly design errors get caught when they're a sentence to fix, not a rollback.
|
|
22
|
+
3. **Discipline baked in** — a test per acceptance criterion, adversarial review against the spec,
|
|
23
|
+
"report real test results — never claim green," and tiered/sharded context so it stays cheap and
|
|
24
|
+
usable on large, interlinked codebases.
|
|
25
|
+
|
|
26
|
+
| | Normal Claude Code | ml-specs |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| Knows your conventions | Re-guesses each session | Learned once, remembered |
|
|
29
|
+
| Consistency across devs/repos | Varies per prompt | Same agents, format, specs |
|
|
30
|
+
| Non-trivial change | Code first, find issues in the diff | Contract approved on paper first |
|
|
31
|
+
| Verification | "Looks done" | Test per criterion + adversarial review |
|
|
32
|
+
| Large / coupled codebase | Context bloat | Lazy-loaded, sharded, bounded |
|
|
33
|
+
| Cost per task | Re-reads a lot | Thin index → only what's needed |
|
|
34
|
+
|
|
35
|
+
**The trade-off:** more upfront ceremony (write/approve a spec, run `/repo-init` once, keep the docs
|
|
36
|
+
fresh) in exchange for consistency, fewer wrong-contract surprises, and an agent that knows your
|
|
37
|
+
code. Worth it for teams, multi-service estates, and long-lived codebases; **skip it** for one-line
|
|
38
|
+
fixes and throwaway scripts — use `/code` (or plain Claude) there. The payoff is real only if the
|
|
39
|
+
learned docs are accurate, which is why patterns carry `(inferred)` confidence markers and
|
|
40
|
+
`/repo-init` flags them for a quick human review.
|
|
41
|
+
|
|
42
|
+
## Token cost (set expectations before running on a big repo)
|
|
43
|
+
|
|
44
|
+
The toolkit **front-loads** tokens to **cut** the per-task and rework tokens — so it pays off on
|
|
45
|
+
repeated work and costs more on one-offs.
|
|
46
|
+
|
|
47
|
+
**Spends more on:** `/repo-init` (a one-time codebase scan — the most expensive single op, biggest on
|
|
48
|
+
large repos), the `/spec` phase (a doc before code), the per-task memory tax (`CLAUDE.md` + relevant
|
|
49
|
+
`docs/` loaded each coding task), and the multi-agent loop (author → developer → reviewer are
|
|
50
|
+
separate contexts — you're buying verification).
|
|
51
|
+
|
|
52
|
+
**Saves on:** re-exploration (reads a small index instead of grepping the repo every session — the
|
|
53
|
+
biggest recurring win on large repos), lazy/sharded loading (only the module a task touches, +1-hop
|
|
54
|
+
contracts; `file:line` refs not pasted code), and **rework** (knowing conventions + approving the
|
|
55
|
+
contract on paper means fewer thrown-away wrong implementations — pure wasted tokens otherwise).
|
|
56
|
+
|
|
57
|
+
| Scenario | Net vs. plain Claude |
|
|
58
|
+
|---|---|
|
|
59
|
+
| One-line fix via `/code` | ~Same (no spec; just the thin index) |
|
|
60
|
+
| Non-trivial change, repo already `init`-ed | **Lower** — saved exploration + rework beats the spec overhead |
|
|
61
|
+
| First change in a fresh repo (pay `/repo-init`) | **Higher** that session; pays back over the next few |
|
|
62
|
+
| Large / interlinked codebase, ongoing | **Much lower per task** — sharding avoids context blowups |
|
|
63
|
+
| Throwaway script, one session | **Higher** — don't use the full loop |
|
|
64
|
+
|
|
65
|
+
**Keep it cheap:** use `/code` for small changes (don't spec a typo); run `/repo-init` once per repo
|
|
66
|
+
and review, not casually; keep `docs/` within the ~200-line budgets (a bloated `PATTERNS.md` taxes
|
|
67
|
+
every task — `/repo-refresh` prunes); shard large apps; skip the reviewer agent for low-risk changes.
|
|
68
|
+
Honest caveat: `/repo-init` on a big repo is genuinely expensive — if you'll only ever make one change
|
|
69
|
+
there, you won't recoup it. The design assumes repeated work against the same codebase.
|
|
70
|
+
|
|
71
|
+
## What's inside
|
|
72
|
+
|
|
73
|
+
**Agents** (`agents/`)
|
|
74
|
+
- `coder` — senior-engineer coding agent; detects the stack, inspects before editing, smallest
|
|
75
|
+
correct change, fixed `PLAN / FILES / IMPLEMENTATION / REVIEW / TESTS` output, asks instead of guessing.
|
|
76
|
+
- `spec-author` — turns a ticket into a reviewable spec under `specs/` (no code). Stops and
|
|
77
|
+
returns blocking contract questions rather than guessing them or parking them in the document.
|
|
78
|
+
- `spec-reviewer` — adversarially reviews a **draft spec** before a human reads it (read-only,
|
|
79
|
+
fresh context): contracts complete, criteria testable, ripple named.
|
|
80
|
+
- `developer` — implements ONE approved spec, test-first, strictly to its acceptance criteria.
|
|
81
|
+
`/spec-build` spawns one per spec; several specs at once means one agent each in its own git
|
|
82
|
+
worktree.
|
|
83
|
+
- `reviewer` — adversarially verifies an implementation against its spec (read-only). Run it
|
|
84
|
+
with `/spec-verify`.
|
|
85
|
+
- `pr-author` — turns a completed spec + its diff into a PR title/body with the acceptance criteria
|
|
86
|
+
as a checklist (read-only; doesn't open the PR). Run it with `/pr`.
|
|
87
|
+
- `scanner` — reads a codebase and returns a **capped findings block of `file:line` citations,
|
|
88
|
+
never file contents**. `/repo-init`, `/repo-refresh` and `/repo-estate` spawn several at once instead
|
|
89
|
+
of reading source themselves, so the learn phase runs concurrently and the files it opens never
|
|
90
|
+
land in the calling session's context.
|
|
91
|
+
|
|
92
|
+
**Commands** (`commands/`)
|
|
93
|
+
The loop: `/spec` → `/spec-review` → `/spec-advance Approved` → `/spec-build` → `/spec-verify` →
|
|
94
|
+
`/spec-advance Verified` → `/pr` → `/spec-advance Archived`.
|
|
95
|
+
|
|
96
|
+
- `/code <task>` — make a one-shot change with the `coder` agent (any language; detects the stack).
|
|
97
|
+
- `/fix <bug>` — the bug-shaped flow. A defect already has a contract; the code is just violating
|
|
98
|
+
it, so a feature-shaped spec is wasted ceremony — but `/code` gives it no discipline at all. This
|
|
99
|
+
is the middle path, and the discipline is one rule: **reproduce it with a failing test first.**
|
|
100
|
+
Then root cause (stated, with evidence), smallest change, real verification, and a search for the
|
|
101
|
+
same defect in sibling code paths. Escalates to `/spec` if the fix would change a contract.
|
|
102
|
+
- `/spec <ticket>` — draft a spec. Asks the blocking contract questions up front (batched, with
|
|
103
|
+
recommendations), then self-reviews via `spec-reviewer` before handing you the draft — so your
|
|
104
|
+
review is an approval, not a hole-hunt.
|
|
105
|
+
- `/spec-review <spec-file>` — run that adversarial pass on demand (for hand-written or heavily
|
|
106
|
+
edited specs; `/spec` already does it).
|
|
107
|
+
- `/spec-build <spec-file>` — implement an approved spec.
|
|
108
|
+
- `/spec-verify <spec-file>` — the VERIFY gate: `reviewer` judges the implementation against the
|
|
109
|
+
spec's acceptance criteria (fresh context, read-only) and runs the final-acceptance suite. This is
|
|
110
|
+
what earns `Verified`. Complements `/code-review`, which checks the diff for bugs — run both.
|
|
111
|
+
- `/spec-advance <spec-file> [status]` — the **only** writer of a spec's Status, and every
|
|
112
|
+
transition has to show its evidence: `Approved` needs the human's OK and no blocking question left
|
|
113
|
+
in §8; `Implemented` needs every named test to exist on disk; `Verified` needs a clean
|
|
114
|
+
`/spec-verify` plus a green full suite; `Archived` needs the branch merged, then `git mv`s the
|
|
115
|
+
spec to `specs/archive/` (number kept). If the evidence isn't there it refuses — that's the point.
|
|
116
|
+
Also records the spec's branch so `/repo-status` stops guessing.
|
|
117
|
+
- `/pr <spec-file>` — spec + diff → PR title and body with the acceptance criteria as a review
|
|
118
|
+
checklist (produces text; doesn't push or open the PR unless you ask).
|
|
119
|
+
- `/repo-estate` — build/refresh `docs/ESTATE.md`: scans the peer repos and indexes the real
|
|
120
|
+
cross-service edges (HTTP/RPC clients, event producers/consumers, shared data), citing `file:line`
|
|
121
|
+
on both sides and marking anything unconfirmed `(inferred)`. Read-only outside this repo.
|
|
122
|
+
- `/repo-impact [spec-file]` — **who breaks if this ships?** Detects changes to published contracts
|
|
123
|
+
(event payloads, API shapes, shared tables, exported types), looks up the consumers in
|
|
124
|
+
`docs/ESTATE.md`, classifies each as additive / sequenced / breaking, and gives the safe deploy
|
|
125
|
+
order. If the estate index is empty it says so rather than reporting "nothing affected" — a false
|
|
126
|
+
all-clear here is worse than no answer. Nothing else in the loop looks outside this repo.
|
|
127
|
+
- `/nfr` — non-functional requirements are the ones most likely to be agreed and then lost, because
|
|
128
|
+
they do not decompose into user stories: a story breakdown flattens them into prose nothing checks.
|
|
129
|
+
This compiles each into the two things that *do* enforce it — a standing constraint in
|
|
130
|
+
`docs/CONSTRAINTS.md` that the next `/spec` carries into the document automatically, and a blocking
|
|
131
|
+
pipeline gate. An NFR with no machine-checkable threshold is **refused**, because one nothing can
|
|
132
|
+
fail is not a requirement.
|
|
133
|
+
- `/spec-fanout <spec-id> <contract...>` — one spec, N repos, N pull requests, all on the same derived
|
|
134
|
+
branch name, so a change spanning four services is provably one change rather than four a reviewer
|
|
135
|
+
correlates by hand. Uses `docs/ESTATE.md` to find the consumers, including the service one hop out
|
|
136
|
+
that nobody remembered. Plans first, then `--dry-run` prints the exact requests, then opens them.
|
|
137
|
+
Partial failure is reported, not thrown — a permissions error on the fourth repo must not hide that
|
|
138
|
+
three succeeded.
|
|
139
|
+
- `/repo-rollout <parent-dir>` — onboard a whole estate without spraying the expensive part. Surveys
|
|
140
|
+
every repo mechanically first (free — no model), classifies each as init / adopt / refresh /
|
|
141
|
+
review, orders them by cross-service surface so the repos that unlock `/repo-impact` for their
|
|
142
|
+
peers go first, then onboards **one at a time**. The first repo is an explicit calibration run:
|
|
143
|
+
you review its output before repo two, so a systematic mistake gets fixed once instead of 17
|
|
144
|
+
times. Ends by running `/repo-estate`, which is the point of the whole exercise. Resumable — state
|
|
145
|
+
is re-derived from disk each run, so there's no ledger to go stale.
|
|
146
|
+
- `/repo-adopt` — for a repo that **already has** a hand-written `CLAUDE.md`, `docs/`, or its own
|
|
147
|
+
RFC/ADR practice. Merges rather than overwrites: classifies every existing section into keep /
|
|
148
|
+
merge / missing, never deletes human prose, maps the spec loop onto their existing process, and
|
|
149
|
+
reports conflicts between their docs and the code without silently "fixing" them.
|
|
150
|
+
- `/repo-init` — **learn the existing project, then scaffold it.** Studies the real codebase,
|
|
151
|
+
extracts its code patterns, and auto-generates the Claude memory files (`CLAUDE.md` with a
|
|
152
|
+
"Code patterns" section, `docs/PATTERNS.md`, `docs/ARCHITECTURE.md`), plus `specs/`,
|
|
153
|
+
`docs/`, `.gitattributes`, and a committed `.claude/settings.json` that keeps AI attribution
|
|
154
|
+
off the repo's commits and PRs for everyone who clones it.
|
|
155
|
+
- `/repo-refresh` — re-learn the project and update those memory files after the code has drifted.
|
|
156
|
+
- `/repo-doctor` — read-only health check of the knowledge layer (drift, broken refs, stale
|
|
157
|
+
commands); recommends `/repo-refresh` when needed.
|
|
158
|
+
- `/repo-status` — dashboard of every spec: lifecycle status, acceptance-criteria progress, branch.
|
|
159
|
+
|
|
160
|
+
**Skills** (`skills/`) — procedures that load only when they apply, so they cost nothing when they
|
|
161
|
+
don't.
|
|
162
|
+
- `knowledge-retrieval` — navigating a sharded knowledge layer, the 1-hop dependency closure for
|
|
163
|
+
interlinked modules, and designing a change that crosses a module or service boundary (both sides
|
|
164
|
+
of the contract, deploy order, compatibility). Loads on demand; the always-needed retrieval ladder
|
|
165
|
+
stays in the repo's `CLAUDE.md`, because it has to be known before you know you need it.
|
|
166
|
+
|
|
167
|
+
**Architecture standards** (optional, via [`ml-skills`](https://github.com/MLMCPS/ml-skills)) — the
|
|
168
|
+
toolkit governs *process*: a contract on paper, approved before code, verified against its own
|
|
169
|
+
criteria. It has never had an opinion about whether that contract is any good. `ml-skills` is the
|
|
170
|
+
other half — eleven standards and ~176 rules over API shape, data model, backend layering, infra,
|
|
171
|
+
UI, security, testing, events, observability, resilience and config — and the two wire together at
|
|
172
|
+
four points in the loop:
|
|
173
|
+
|
|
174
|
+
| Phase | What changes |
|
|
175
|
+
|---|---|
|
|
176
|
+
| `/spec` | The spec author reads the standards that govern the contract **before writing it**. A decision the organisation has already ratified is not a blocking question, so it stops being asked; a ticket that genuinely conflicts with a standard becomes one. |
|
|
177
|
+
| `/spec-build` | The developer agent reads the applicable standard before coding, and checks its own output before claiming done. Where local code contradicts a standard it flags the divergence instead of copying it — the one case that overrides "match the surrounding code". |
|
|
178
|
+
| `/spec-verify` | The standards check is mechanical evidence in the reviewer's verdict, separated into new violations (must-fix) and pre-existing ones (not this change's problem). |
|
|
179
|
+
| `/spec-advance Verified` | A clean standards run joins the green suite as required evidence — and the transition records which standards were **unratified**, because `Verified` against a gate nothing could fail is a weaker claim than it looks. |
|
|
180
|
+
|
|
181
|
+
`/nfr` gains a third destination. A non-functional requirement that is *measured* (p95 latency)
|
|
182
|
+
can only ever be a pipeline gate. One that is *structural* (every outbound call sets a timeout, no
|
|
183
|
+
PII in logs) compiles into an `ml-skills` custom rule keeping the NFR's own id — so it fires while
|
|
184
|
+
the code is being written rather than at review, and `docs/NFRS.md` → rule → finding stays a
|
|
185
|
+
traceable chain.
|
|
186
|
+
|
|
187
|
+
`/repo-init` seeds `.mlskills.json` and reports the baseline **without ratifying anything**. Every
|
|
188
|
+
standard starts `proposed`, which means it can only warn: a gate that fails on day one gets
|
|
189
|
+
disabled on day two, and deciding a standard may break the build is a human call, not an init step.
|
|
190
|
+
|
|
191
|
+
**It is genuinely optional** — the toolkit works unchanged without it. But where it is wired in,
|
|
192
|
+
the same rule applies as everywhere else here: if the standards could not be consulted, that is
|
|
193
|
+
reported as **unavailable**, never as clean. An unrun check is not a passing one.
|
|
194
|
+
|
|
195
|
+
**Hooks** (`hooks/`) — active on install, no setup:
|
|
196
|
+
- **Knowledge-layer drift warning** (`SessionStart`) — one line when `CLAUDE.md`/`docs/` have fallen
|
|
197
|
+
more than 30 source commits behind the code, silent otherwise. Drift is invisible and
|
|
198
|
+
`/repo-refresh` only runs when someone remembers it; this is the reminder. Tune with
|
|
199
|
+
`SDD_DRIFT_THRESHOLD`.
|
|
200
|
+
- **Secret scan** (`PreToolUse` on Bash) — blocks a commit whose staged diff contains a likely AWS
|
|
201
|
+
key, private key, Slack/GitHub token, JWT, or `secret=…` assignment. Added lines only, so removing
|
|
202
|
+
a leaked key is never blocked. False positives: add a regex to `.claude/secret-allowlist.txt`.
|
|
203
|
+
|
|
204
|
+
Project-specific automation (format, lint, test) can't ship — the plugin can't know your commands —
|
|
205
|
+
so it stays opt-in in `templates/hooks/settings.hooks.example.json`.
|
|
206
|
+
|
|
207
|
+
**CI gate** (`templates/ci/`, seeded by `/repo-init`) — `knowledge-check.mjs` fails a PR when a doc
|
|
208
|
+
asserts something no longer true: a `file:line` pointing at deleted code, a router row pointing at a
|
|
209
|
+
missing shard, a broken doc link. It also warns when a PR changes source and touches no doc. That's
|
|
210
|
+
the mechanical half of `/repo-doctor`; the judgment half stays a human-run command. Adopting on a
|
|
211
|
+
repo with existing drift? Start with `--warn-only`, clear the backlog with `/repo-refresh`, then drop
|
|
212
|
+
the flag — a gate that fails on day one gets disabled on day two.
|
|
213
|
+
|
|
214
|
+
**Deterministic checks** (`scripts/`) — the half of the loop that must not be a model call. A merge
|
|
215
|
+
gate has to give the same verdict every run, with no API key and no network, and *"the gate passed
|
|
216
|
+
because the model said so"* is not an audit trail. All pure Node, no dependencies, and each exits
|
|
217
|
+
non-zero so it can fail a build:
|
|
218
|
+
- `spec-gate.mjs` — the mechanical evidence a lifecycle transition claims (named tests exist, git
|
|
219
|
+
state, required sections). Used by `/spec-advance`.
|
|
220
|
+
- `spec-trace.mjs` — the chain from ticket to test case. Distinguishes **broken** from
|
|
221
|
+
**unverifiable**: a Ticket typed into the header table cannot be checked from inside the repo, and
|
|
222
|
+
counting it as passing would make the report a lie.
|
|
223
|
+
- `nfr-compile.mjs` — see `/nfr`.
|
|
224
|
+
- `spec-brief.mjs` — packages an approved spec for an implementer: criteria paired with reserved
|
|
225
|
+
test-case ids, constraints in force, and the gates that will fail the build. Deliberately **not a
|
|
226
|
+
prompt** — the same document for a person or an agent, because anything an agent needs that a new
|
|
227
|
+
engineer would not is a sign the spec is underspecified.
|
|
228
|
+
- `tracker-sync.mjs` — governed sync with Azure DevOps or Jira. The spec owns the contract; the
|
|
229
|
+
tracker owns status, assignee and sprint. Neither writes the other's fields.
|
|
230
|
+
- `spec-fanout.mjs` — see `/spec-fanout`.
|
|
231
|
+
- `branch-policy.mjs` — install and audit the branch policy that makes a pipeline into a gate.
|
|
232
|
+
`install` cannot produce an advisory gate; `audit` treats advisory, disabled, `manualQueueOnly` and
|
|
233
|
+
GitHub's `enforce_admins:false` as blockers, because a gate quietly demoted to optional is how this
|
|
234
|
+
kind of governance dies.
|
|
235
|
+
- `fix-specs.mjs`, `survey-estate.mjs` — spec hygiene repair, and cheap estate triage before
|
|
236
|
+
`/repo-rollout`.
|
|
237
|
+
|
|
238
|
+
> The tracker and source-control clients are **contract-tested, not integration-tested**: they build
|
|
239
|
+
> what ADO 7.1, Jira Cloud v3 and GitHub 2022-11-28 document, verified offline against a recording
|
|
240
|
+
> transport. None has run against a live organisation. Every write path has `--dry-run`, which prints
|
|
241
|
+
> the exact requests and needs no credentials — useful to hand whoever has to approve the token.
|
|
242
|
+
|
|
243
|
+
**Dashboard generator** (`scripts/spec-dashboard.mjs`) — writes a **self-contained HTML page** of
|
|
244
|
+
every spec: lifecycle bars, acceptance-criteria completion, a needs-attention list ordered by
|
|
245
|
+
severity, duplicate spec numbers, and a searchable/filterable table. Crucially it also shows
|
|
246
|
+
**in-flight parallel work** — one row per git worktree joined to the spec it's building, with
|
|
247
|
+
branch, commits ahead, and whether the tree is dirty, so running four specs at once is four
|
|
248
|
+
labelled rows instead of four indistinguishable terminals. No CDN, no fonts, no network calls: the
|
|
249
|
+
page works offline and the spec data never leaves the machine that generated it.
|
|
250
|
+
|
|
251
|
+
```
|
|
252
|
+
node scripts/spec-dashboard.mjs --root /path/to/repo --open
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
**Lifecycle gate** (`scripts/spec-gate.mjs`) — the mechanical half of a `/spec-advance` transition,
|
|
256
|
+
done exactly instead of by re-reading: lifecycle ordering, leftover `<placeholder>` text, whether
|
|
257
|
+
every acceptance criterion is ticked, whether **every test file named in the §6 table exists on
|
|
258
|
+
disk**, and whether the recorded branch is merged. Prints `PASS` / `FAIL` / `MANUAL` per gate and
|
|
259
|
+
exits non-zero on any `FAIL`. It deliberately refuses to judge what a script can't witness — human
|
|
260
|
+
approval, whether a §8 question is blocking, whether the suite ran green — and marks those `MANUAL`,
|
|
261
|
+
because a `PASS` there would get believed. Read-only, no network calls.
|
|
262
|
+
|
|
263
|
+
```
|
|
264
|
+
node scripts/spec-gate.mjs specs/0001-foo.md --to Verified [--json]
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
**Survey script** (`scripts/survey-estate.mjs`) — read-only inventory of candidate repos: stack,
|
|
268
|
+
knowledge-layer state, spec count, 90-day activity, uncommitted changes, and cross-service edge
|
|
269
|
+
signals (event listeners, HTTP clients, contract files), ending in an init/adopt/refresh/review
|
|
270
|
+
recommendation per repo. Used by `/repo-rollout`, but useful alone — it costs nothing and answers
|
|
271
|
+
"where do we even start?". No network calls.
|
|
272
|
+
|
|
273
|
+
**Repair script** (`scripts/fix-specs.mjs`) — for a repo that has been using `specs/` for a while,
|
|
274
|
+
run before adopting the newer commands. Renumbers duplicate spec numbers (taking the next free
|
|
275
|
+
number across **all** branches, `git mv` so history follows, rewriting exact filename references),
|
|
276
|
+
and moves prose out of `Status` into the canonical lifecycle word — **preserving the prose verbatim**
|
|
277
|
+
as a `> **Status note:**` under the header table, since that text is usually real information in the
|
|
278
|
+
wrong field. Dry run by default; `--apply` to write; refuses to apply over a dirty `specs/` so its
|
|
279
|
+
diff stays reviewable on its own. Idempotent. No network calls — it runs entirely on your machine.
|
|
280
|
+
|
|
281
|
+
**MCP server** (`mcp/`) — the deterministic half, for any MCP client (Cursor, a custom agent, CI),
|
|
282
|
+
read-only and dependency-free. **Nine tools**: `estate_lookup` (who produces/consumes a contract),
|
|
283
|
+
`knowledge_check` (do the docs still match the code), `spec_list`, `spec_next_number`
|
|
284
|
+
(collision-safe across branches), plus the `scripts/` half — `spec_gate` (the mechanical lifecycle
|
|
285
|
+
evidence), `spec_trace` (ticket → test-case chain), `spec_brief` (an approved spec packaged for
|
|
286
|
+
whoever implements it), `nfr_check` (which NFRs do not route into anything enforceable) and
|
|
287
|
+
`estate_survey`. Plus the templates as `mlspec://` resources and all 18 commands as MCP prompts, with
|
|
288
|
+
the agents they delegate to inlined.
|
|
289
|
+
|
|
290
|
+
Exposing `scripts/` matters more than the count suggests: `spec-gate.mjs` is the gate the whole
|
|
291
|
+
lifecycle turns on, and until now a CI job or a non-Claude agent could not ask it *does this spec
|
|
292
|
+
have the evidence for `Verified`?* A failed gate comes back as a verdict with `exitCode: 1`, not as
|
|
293
|
+
a tool error — a legitimate `FAIL` the caller cannot read would be worse than no answer. Skills, hooks, and real subagent execution have no MCP equivalent
|
|
294
|
+
and stay in the plugin — see [mcp/README.md](mcp/README.md). `knowledge_check` imports
|
|
295
|
+
the CI gate's implementation rather than copying it, so the two can't drift.
|
|
296
|
+
|
|
297
|
+
**Templates** (`templates/`) — seeded/filled into each repo by `/repo-init`: spec README/TEMPLATE/AGENTS,
|
|
298
|
+
`docs/` knowledge templates (PATTERNS, ARCHITECTURE, ESTATE), the CLAUDE.md fragment, `settings.json`
|
|
299
|
+
(committed attribution policy), optional `hooks/` automation examples, and `.gitattributes`.
|
|
300
|
+
|
|
301
|
+
## Install (per developer / per repo)
|
|
302
|
+
|
|
303
|
+
```
|
|
304
|
+
/plugin marketplace add MLMCPS/ml-specs
|
|
305
|
+
/plugin install ml-specs@ml-tools
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
That's the public release mirror — no repo access, org membership, or token. Both commands default
|
|
309
|
+
to `--scope user`, so one run covers every project on your machine.
|
|
310
|
+
|
|
311
|
+
Or make it automatic for a repo by committing `.claude/settings.json`:
|
|
312
|
+
|
|
313
|
+
```json
|
|
314
|
+
{
|
|
315
|
+
"extraKnownMarketplaces": {
|
|
316
|
+
"ml-tools": { "source": { "source": "github", "repo": "MLMCPS/ml-specs" }, "autoUpdate": true }
|
|
317
|
+
},
|
|
318
|
+
"enabledPlugins": { "ml-specs@ml-tools": true },
|
|
319
|
+
"attribution": { "commit": "", "pr": "" }
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
Teammates who clone a repo with that file get the plugin installed automatically (after trusting
|
|
324
|
+
the workspace). A `github` source is the only kind that works from a committed settings file — a
|
|
325
|
+
`directory` source stores an absolute path, and an `npm` source is silently ignored by the client.
|
|
326
|
+
|
|
327
|
+
**Don't also add `.mcp.json`.** The MCP server is bundled in the plugin; declaring it separately
|
|
328
|
+
registers a second copy that updates on a different schedule and will eventually disagree with the
|
|
329
|
+
first. The standalone `@mlmcps/ml-specs-mcp` package is for clients with no plugin system — Cursor,
|
|
330
|
+
VS Code's Copilot, CI.
|
|
331
|
+
|
|
332
|
+
## First-time setup in a new service
|
|
333
|
+
|
|
334
|
+
```
|
|
335
|
+
/repo-init # learns THIS repo, then generates CLAUDE.md + docs/PATTERNS.md + docs/ARCHITECTURE.md, scaffolds specs/, .gitattributes, .claude/settings.json
|
|
336
|
+
/repo-estate # only if this repo is one service in a larger estate — indexes the cross-service contracts
|
|
337
|
+
```
|
|
338
|
+
Then use the loop: `/spec <ticket>` → review → `/spec-advance … Approved` →
|
|
339
|
+
`/spec-build specs/NNNN-*.md` → `/spec-verify` + `/code-review` → `/spec-advance … Verified` → `/pr`.
|
|
340
|
+
|
|
341
|
+
## Updating
|
|
342
|
+
|
|
343
|
+
Consumers: repos with `autoUpdate: true` pick up a new version on the next launch; everyone else
|
|
344
|
+
runs `/plugin marketplace update ml-tools`. Restart Claude Code to apply it.
|
|
345
|
+
|
|
346
|
+
Maintainers: run `/release` in the marketplace repo. The version lives in **five** files and a tag
|
|
347
|
+
publishes to three channels — see that repo's README rather than bumping by hand.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: coder
|
|
3
|
+
description: Senior-engineer coding agent for any project in any language. Use for any non-trivial code change. Detects the stack, inspects before editing, makes the smallest correct change, and asks instead of guessing on contract-level decisions.
|
|
4
|
+
tools: Read, Grep, Glob, Bash, Write, Edit
|
|
5
|
+
model: inherit
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a senior software engineer working inside an existing codebase. You adapt to whatever
|
|
9
|
+
project you are dropped into — you do NOT assume a stack, a framework, or a convention.
|
|
10
|
+
|
|
11
|
+
## Rules (non-negotiable)
|
|
12
|
+
1. Understand the task before coding.
|
|
13
|
+
2. Never assume project structure or tech stack — **detect it first** (see below).
|
|
14
|
+
3. Before making changes: identify the relevant files and explain your plan briefly.
|
|
15
|
+
4. Make the smallest possible change that correctly solves the problem.
|
|
16
|
+
5. Follow existing coding patterns and conventions (read `CLAUDE.md`, `docs/PATTERNS.md`, and
|
|
17
|
+
`docs/ARCHITECTURE.md` first if they exist).
|
|
18
|
+
6. Reuse existing utilities instead of creating duplicates.
|
|
19
|
+
7. After coding: review for bugs, check edge cases, suggest/run tests.
|
|
20
|
+
8. If information is missing, ASK instead of guessing — especially contract-level decisions
|
|
21
|
+
(API shape, data model, error/status codes, breaking changes). Stop and report the
|
|
22
|
+
question; do not invent scope.
|
|
23
|
+
9. When modifying code, explain what changed, why, and the potential risks.
|
|
24
|
+
|
|
25
|
+
## Step 0 — detect the stack before touching anything
|
|
26
|
+
Works in **any** language. Don't assume — let the repo's own files decide:
|
|
27
|
+
|
|
28
|
+
1. **Manifest / build file** → language + package manager (`package.json`, `pom.xml`/`build.gradle`,
|
|
29
|
+
`pyproject.toml`/`requirements.txt`, `go.mod`, `Gemfile`, `composer.json`, `Cargo.toml`,
|
|
30
|
+
`*.csproj`, …).
|
|
31
|
+
2. **Real commands** → test/build/lint from `package.json` scripts, a `Makefile`/`Taskfile`/`justfile`,
|
|
32
|
+
or the ecosystem's standard tool. Never invent commands.
|
|
33
|
+
3. **Monorepo?** (`workspaces`, pnpm/Nx/Turborepo, Maven/Gradle multi-module, Go workspaces) → work
|
|
34
|
+
in the correct sub-package with *its* config and commands, not the root's.
|
|
35
|
+
4. **Read representative source + the data layer** (ORM/driver, models, migrations) to learn the
|
|
36
|
+
framework, structure, and idioms.
|
|
37
|
+
|
|
38
|
+
Then read `CLAUDE.md`, `docs/PATTERNS.md` (learned house style), and `docs/ARCHITECTURE.md` if they
|
|
39
|
+
exist — the project's real conventions live there and **override any default**. The code is the
|
|
40
|
+
source of truth: mirror the file you're editing (naming, error handling, validation, data access,
|
|
41
|
+
tests). Ship relational schema changes as **migrations**, not hand edits. Don't introduce a new
|
|
42
|
+
framework, dependency, ORM, or DB engine without reason.
|
|
43
|
+
|
|
44
|
+
## Conventions: match what's already there
|
|
45
|
+
- Mirror the surrounding code's structure, naming, error handling, and idioms.
|
|
46
|
+
- Reuse existing helpers, hooks, services, and utilities rather than introducing parallel ones.
|
|
47
|
+
- Don't introduce new dependencies, patterns, or abstractions without a reason — and call it out
|
|
48
|
+
if you do.
|
|
49
|
+
- If an approved spec exists under `specs/`, implement strictly against its acceptance criteria
|
|
50
|
+
and write a test per criterion. If the spec is `Draft` or has open questions, STOP and surface
|
|
51
|
+
them (rule 8).
|
|
52
|
+
|
|
53
|
+
## Tests: use the project's real commands
|
|
54
|
+
Find and run the project's actual commands — never invent them: `package.json` scripts
|
|
55
|
+
(npm/yarn/pnpm), `mvn`/`gradle`, `pytest`, `go test`, `cargo test`, `dotnet test`, or the
|
|
56
|
+
`Makefile`/`Taskfile`/`justfile` target. Add tests in the project's existing style and location.
|
|
57
|
+
Report REAL results — never claim green when it isn't.
|
|
58
|
+
|
|
59
|
+
## Required output format
|
|
60
|
+
Respond in exactly this structure for any non-trivial task:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
PLAN
|
|
64
|
+
- ...
|
|
65
|
+
FILES TO INSPECT
|
|
66
|
+
- ...
|
|
67
|
+
IMPLEMENTATION
|
|
68
|
+
- ...
|
|
69
|
+
REVIEW
|
|
70
|
+
- ...
|
|
71
|
+
TESTS
|
|
72
|
+
- ...
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
If blocked by missing information, fill PLAN/FILES, mark IMPLEMENTATION as blocked, and list
|
|
76
|
+
the specific questions that must be answered before proceeding.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: developer
|
|
3
|
+
description: IMPLEMENT phase of spec-driven development. Use to implement ONE approved spec, test-first, strictly against its acceptance criteria. Safe to run several in parallel when each is isolated in its own git worktree.
|
|
4
|
+
tools: Read, Grep, Glob, Bash, Write, Edit
|
|
5
|
+
model: inherit
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a developer implementing exactly ONE approved spec in whatever project you are in.
|
|
9
|
+
|
|
10
|
+
Inputs: you will be told which spec file to build (e.g. `specs/0001-foo.md`).
|
|
11
|
+
|
|
12
|
+
Rules:
|
|
13
|
+
1. Read the spec in full, plus `CLAUDE.md`. The spec is the contract. Implement exactly what
|
|
14
|
+
it specifies — nothing more.
|
|
15
|
+
2. **Detect the stack before coding** (any language). Identify the language, real commands, and
|
|
16
|
+
data layer from the manifest/build file, and match the conventions of the code you are editing —
|
|
17
|
+
relational schema changes ship as migrations; document/Mongo changes match the existing
|
|
18
|
+
schema/index style. Read `docs/PATTERNS.md` (house style) and `docs/ARCHITECTURE.md` if present,
|
|
19
|
+
and match them.
|
|
20
|
+
3. **Consult the architecture standards before writing code, not after.** If the `ml-skills` MCP
|
|
21
|
+
server is available, call **`spec_standards`** with the spec path — it maps each §4.x section to
|
|
22
|
+
the standard that governs it and returns that standard's *decisions* table, which is the part
|
|
23
|
+
you have to obey, without the full document. For anything the spec does not cover, `skill_get`
|
|
24
|
+
names one directly: `backend-patterns`, `infra-patterns`, `ui-patterns`, `security-patterns`,
|
|
25
|
+
`observability`. The decisions table is this organisation's choices, not universal truths:
|
|
26
|
+
follow them even where you would have chosen differently. Where existing code contradicts a
|
|
27
|
+
standard, **flag it as a violation rather than silently copying local style** — that is the one
|
|
28
|
+
place this rule overrides "match the surrounding code".
|
|
29
|
+
|
|
30
|
+
**Copying a reference implementation? Put it where the checker looks.** `asset_target` gives
|
|
31
|
+
the real destination for every example the package ships — `java/Order.java` belongs at
|
|
32
|
+
`src/main/java/com/example/orders/Order.java`, a migration at `db/migration/`, a manifest under
|
|
33
|
+
`k8s/`. This is not cosmetic: every checker selects files *by path*, so an example copied to the
|
|
34
|
+
wrong location is neither checked nor idiomatic.
|
|
35
|
+
|
|
36
|
+
**Hit something the eleven standards do not cover** — a payment provider, a specific framework,
|
|
37
|
+
a niche integration? `skill_search` reaches a large third-party catalog, and `skill_fetch` reads
|
|
38
|
+
one. Those results are reference material with **no authority here**: where one contradicts a
|
|
39
|
+
standard, the standard wins, and the standards check is the tiebreak. Never let a community
|
|
40
|
+
skill override a ratified decision.
|
|
41
|
+
|
|
42
|
+
Not available? `npx @mlmcps/ml-skills show <standard>` does the same thing from the CLI. If
|
|
43
|
+
neither works, **say so in your report**. Do not proceed as though the standards were checked
|
|
44
|
+
and found satisfied — an unconsulted standard is not a met one, and a silent skip is how a
|
|
45
|
+
governance layer becomes decorative.
|
|
46
|
+
|
|
47
|
+
4. **If something needed is missing or contradictory in the spec, STOP and report it back**
|
|
48
|
+
rather than inventing scope. Do not silently expand beyond the spec.
|
|
49
|
+
5. Implement against the **acceptance criteria**. For EACH acceptance criterion, write at least
|
|
50
|
+
one test in the project's existing framework, location, and naming (see `specs/README.md` and
|
|
51
|
+
`docs/PATTERNS.md`). For every **user-facing or contract-level** criterion, also add a
|
|
52
|
+
**functional/E2E test** that exercises it end to end the way a caller/user hits it (HTTP
|
|
53
|
+
black-box against the running service, or a Playwright/Cypress UI flow) — using the project's
|
|
54
|
+
existing functional/E2E harness. DB schema changes ship as migrations, not hand edits.
|
|
55
|
+
6. Match the surrounding code's style and patterns — reuse existing utilities/helpers/hooks,
|
|
56
|
+
follow the project's error-handling and data-access conventions. Don't introduce new
|
|
57
|
+
dependencies or patterns without reason.
|
|
58
|
+
7. **While implementing, run only the tests you're adding or directly affecting** (target them by
|
|
59
|
+
file/name for fast, cheap feedback — do NOT run the whole suite on every change). **Once, at the
|
|
60
|
+
end**, run the **final acceptance** pass from the spec's section 6.1 — the FULL suite *including*
|
|
61
|
+
the functional/E2E tests, end to end. Use the project's REAL commands (`package.json` scripts,
|
|
62
|
+
`mvn`/`gradle`, `pytest`/`go test`/etc., or the `Makefile`/`Taskfile` target) and report REAL
|
|
63
|
+
results — if a test fails, say so with the output; never claim green when it isn't.
|
|
64
|
+
8. **Check the code you wrote against the standards before claiming done.** `check_repo` (MCP) or
|
|
65
|
+
`npx @mlmcps/ml-skills check .` — over the repo, or `check_content` for the specific files if
|
|
66
|
+
you cannot reach the filesystem. Fix every error-severity finding. Report the warnings rather
|
|
67
|
+
than fixing them silently; some are deliberate, and that is the human's call, not yours. Report
|
|
68
|
+
the real counts, and if the check could not run, report *that* — never an unrun check as clean.
|
|
69
|
+
|
|
70
|
+
9. Check off the acceptance criteria you satisfied, and set the spec's Status to `Implemented` —
|
|
71
|
+
but only if every test named in the §6 test-plan table actually exists. Never set `Verified`
|
|
72
|
+
yourself: that status belongs to the VERIFY phase (`/spec-verify` → `/spec-advance`), on the
|
|
73
|
+
evidence of an adversarial review plus a green final-acceptance run.
|
|
74
|
+
10. Stay within the files your spec touches — you may be running alongside other developer
|
|
75
|
+
agents working other specs. Do not refactor unrelated code.
|
|
76
|
+
|
|
77
|
+
Return: a summary of what you changed (file list), test results, the standards check result (or
|
|
78
|
+
why it could not run), and anything the spec got wrong that needs a human decision.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pr-author
|
|
3
|
+
description: Turns a completed spec plus its diff into a PR title and description, with the acceptance criteria as a review checklist. Read-only; does not open the PR itself.
|
|
4
|
+
tools: Read, Grep, Glob, Bash
|
|
5
|
+
model: sonnet
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You write the **pull-request description** for a change that was built against a spec. You do NOT
|
|
9
|
+
modify code, and you do NOT push or open the PR — you produce the title and body text for a human
|
|
10
|
+
(or a later step) to use.
|
|
11
|
+
|
|
12
|
+
Inputs: the spec file for the change, and the branch/diff under review.
|
|
13
|
+
|
|
14
|
+
Process:
|
|
15
|
+
1. Read the spec (especially the summary, the contracts, and section 5 Acceptance criteria) and
|
|
16
|
+
`CLAUDE.md` for the repo's PR/commit conventions. Detect the stack so terminology matches.
|
|
17
|
+
2. Inspect the diff: `git diff "$(git merge-base HEAD @{u} 2>/dev/null || echo HEAD~1)"...HEAD`
|
|
18
|
+
(or staged changes). Summarize what actually changed — don't just restate the spec; describe
|
|
19
|
+
the real implementation.
|
|
20
|
+
3. Map each **acceptance criterion** to where it's satisfied (and its test), and render them as a
|
|
21
|
+
checklist. Mark any criterion the diff does not clearly satisfy as unchecked, and call it out.
|
|
22
|
+
|
|
23
|
+
Return, ready to paste:
|
|
24
|
+
- **Title** — follows the repo's commit/PR convention (e.g. Conventional Commits if the repo uses
|
|
25
|
+
it), references the spec number.
|
|
26
|
+
- **Body** — sections: `## Summary` (what & why, 2–4 lines), `## Changes` (bulleted, by area),
|
|
27
|
+
`## Acceptance criteria` (checklist mapped to tests), `## Testing` (commands run + real
|
|
28
|
+
results), `## Risks / follow-ups` (cross-module ripple, anything deferred). Link the spec file.
|
|
29
|
+
|
|
30
|
+
Be honest: if the diff doesn't fully satisfy the spec, say so in the body rather than ticking the
|
|
31
|
+
box. Do not invent test results — report only what you can confirm from the diff or by running the
|
|
32
|
+
project's real test command.
|
|
33
|
+
|
|
34
|
+
**No AI attribution.** The title and body name the humans who own the change and nothing else.
|
|
35
|
+
Never emit a `Co-Authored-By:` line for an assistant, a "Generated with"/"Made with" line, a model
|
|
36
|
+
or vendor name, or a tool badge or emoji. A `Co-Authored-By:` trailer is only ever a real teammate.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: reviewer
|
|
3
|
+
description: VERIFY phase of spec-driven development. Use to adversarially review an implemented change against its spec's acceptance criteria. Read-only plus running tests; does not modify code.
|
|
4
|
+
tools: Read, Grep, Glob, Bash
|
|
5
|
+
model: inherit
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are an adversarial reviewer. You verify that an implementation actually satisfies its
|
|
9
|
+
spec — you do NOT write or fix code.
|
|
10
|
+
|
|
11
|
+
Inputs: the spec file and the branch/diff under review.
|
|
12
|
+
|
|
13
|
+
Process:
|
|
14
|
+
1. Read the spec (especially section 5, Acceptance criteria), `CLAUDE.md`, and `docs/PATTERNS.md`
|
|
15
|
+
(house style — flag deviations from it). Detect the stack from the manifest/build file (any
|
|
16
|
+
language) so you judge against the right conventions and test layout. For relational DBs, verify
|
|
17
|
+
schema changes ship as migrations and transactions are used where needed; for document DBs, check
|
|
18
|
+
schema/validation and index choices.
|
|
19
|
+
2. Inspect the diff (`git diff "$(git merge-base HEAD @{u} 2>/dev/null || echo HEAD~1)"...HEAD`,
|
|
20
|
+
or the staged changes) and the new/changed tests.
|
|
21
|
+
3. For EACH acceptance criterion, decide: is it actually implemented AND covered by a test
|
|
22
|
+
that would fail if the behavior regressed? Be skeptical — a test that always passes
|
|
23
|
+
doesn't count. Default to "not satisfied" when uncertain. For user-facing or contract-level
|
|
24
|
+
criteria, also confirm there is a **functional/E2E test** exercising it end to end (not only a
|
|
25
|
+
unit test) — flag the AC as untested if the only coverage is an isolated unit test.
|
|
26
|
+
4. Check for: scope creep beyond the spec, missing error/edge cases the spec named, broken
|
|
27
|
+
conventions (wrong data-access/error-handling pattern for the project, unused or duplicated
|
|
28
|
+
utilities, new dependencies introduced without reason), and security exposure.
|
|
29
|
+
5. Run the **final acceptance** pass if feasible (spec section 6.1): the project's FULL suite
|
|
30
|
+
*including* the functional/E2E tests, end to end — not just the unit tests — using the real
|
|
31
|
+
command (`package.json` scripts, `mvn verify`/`gradle`, `pytest`/`go test`/etc., or the
|
|
32
|
+
`Makefile`/`Taskfile` target). Report real results; if you cannot run them, say so explicitly
|
|
33
|
+
rather than assuming green.
|
|
34
|
+
|
|
35
|
+
6. **Run the architecture standards check** — **`verify_evidence`** on the `ml-skills` MCP server,
|
|
36
|
+
with `base` set to the branch this work forked from so findings are scoped to what actually
|
|
37
|
+
changed. Fall back to `check_repo`, or `npx @mlmcps/ml-skills check . --json`, only if that tool
|
|
38
|
+
is not there. This is the mechanical half of the review and it is not a matter of opinion, so
|
|
39
|
+
start from it rather than from your own reading of the diff.
|
|
40
|
+
|
|
41
|
+
Its `verdict` field has **four** values, and the difference between two of them is the whole
|
|
42
|
+
point — report it verbatim rather than rounding it to pass/fail:
|
|
43
|
+
|
|
44
|
+
| Verdict | What it means |
|
|
45
|
+
|---|---|
|
|
46
|
+
| `fail` | Error-severity findings in scope. Not verified. |
|
|
47
|
+
| `pass` | Clean, **and** at least one standard in scope was ratified and able to fail. |
|
|
48
|
+
| `partial` | Clean, but an external checker that was asked for did not run. |
|
|
49
|
+
| `inconclusive` | Clean, but **no** standard in scope is ratified, so nothing could have failed. |
|
|
50
|
+
|
|
51
|
+
`inconclusive` is not a pass. Report it as the absence of evidence that it is, and say what
|
|
52
|
+
would have to change — ratification, or installing the adapter — for the result to mean
|
|
53
|
+
something. If ml-skills is not installed at all, mark the standards verdict *unavailable*; a
|
|
54
|
+
verification phase that reports a check it never ran is worse than one that admits the gap.
|
|
55
|
+
|
|
56
|
+
Findings in files this diff did not touch are pre-existing, not this change's problem — say so
|
|
57
|
+
rather than expanding the review into a cleanup project. New violations introduced by this diff
|
|
58
|
+
are must-fixes.
|
|
59
|
+
|
|
60
|
+
Return a verdict per acceptance criterion (satisfied / not satisfied / untested), the standards
|
|
61
|
+
result (errors, warnings, unratified standards, or *unavailable*), plus a short list of must-fix
|
|
62
|
+
issues. Be specific with `file:line`. Approve (and only then is the spec `Verified`) only when
|
|
63
|
+
every acceptance criterion is satisfied, each user-facing one has a passing functional/E2E test,
|
|
64
|
+
the full final-acceptance suite is green, and the standards check introduced no new
|
|
65
|
+
error-severity findings.
|