spec-driven-development
Skill9 starsChanged 29 days agoMITView on GitHub
Use when the task is a new feature, breaking change, multi-file change, or any work where approval should happen before coding begins.
103 other projects use a version of this.
Adopted by
Most recently taken up by
- thistleknot/skillstheir own version, first seen Nov 8, 2026
- mariano-aguero/spec-driven-development-skilltheir own version, first seen Nov 8, 2026
- ishandutta2007/Awesome-Agent-Skillstheir own version, first seen Nov 8, 2026
- MMACABRE/SKILLStheir own version, first seen Nov 8, 2026
- steven123397/nexuskit-skillstheir own version, first seen Nov 1, 2026
- rumotion/ai-agent-project-templatetheir own version, first seen Nov 1, 2026
Used with
Projects with it also use using-agent-skills, idea-refine and 7 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
LLl0k0laDSkillusing-agent-skills
Use when starting a session or when you need to discover which skill applies to the current task. This is the meta-skill that governs how all other skills are discovered and invoked.
Also in 44 projects that use this
LLl0k0laDSkillidea-refine
Refine ideas through structured divergent and convergent thinking. Use "idea-refine" or "ideate" to trigger.
Also in 54 projects that use this
MrCipherSmithSkillconstraint-driven-development
Use when a project needs a persistent, measurable quality bar — starting a project without documented standards, 'set up constraints', or when coverage/perf/a11y thresholds get re-debated per-PR. Produces CONSTRAINTS.md with enforceable numbers, ratchets, and a guard against silent weakening. NOT for throwaway prototypes or a one-off CI setup.
Also in 16 projects that use this
HK-hubSkillobservability-and-instrumentation
Instruments code so production behavior is visible and diagnosable. Use when adding logging, metrics, tracing, or alerting. Use when shipping any feature that runs in production and you need evidence it works. Use when production issues are reported but you can't tell what happened from the available data.
Also in 36 projects that use this
seikaikyoSkilldoubt-driven-development
對非平凡決策啟動新鮮 context 對抗審查(找碴不背書),在修正還便宜的時候抓出錯誤方向。適用:高風險改動(production、資安敏感邏輯、不可逆操作)、不熟的程式碼、要宣稱「這樣是安全的 / 可行的」之前。機械性操作與一行修改不適用。
Also in 44 projects that use this
- +4 more from LLl0k0laD
Other versions103 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 103
- addyosmani/agent-skills★ 114ksame name
- ollaya-dev/ollaya★ 1.4ksame name
- kdlbs/kandev★ 1.1ksame name
- jasonkneen/kiro★ 753same name
- shashankswe2020-ux/whoop-mcp★ 174same name
- magnus919/agent-skills★ 172same name
- FredAntB/Spec-Driven-Development★ 153same name
- tranhieutt/software_development_department★ 71same name
- drvoss/everything-copilot-cli★ 48same name
- vinvcn/addyosmani-agent-skills-zh★ 46same name
93 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository34 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- batch-fixSkill
- brainstormingSkill
- code-review-and-qualitySkill
- code-simplificationSkill
- context-engineeringSkill
- fixSkill
- handoffSkill
- implementSkill
- incremental-implementationSkill
- instructionsSkill
- lessonsSkill
- mtk-doctorSkill
- mtk-setupSkill
- mtkSkill
- planning-and-task-breakdownSkill
- pre-commit-reviewSkill
- prior-work-checkSkill
- promote-lessonSkill
- repo-healthSkill
- research-contextSkill
- security-and-hardeningSkill
- setup-auditSkill
- setup-bootstrapSkill
- setup-refreshSkill
- spec-drift-detectionSkill
- subagent-implementationSkill
- tech-stack-dotnetSkill
- tech-stack-pythonSkill
- tech-stack-typescriptSkill
- verification-before-completionSkill
- workflow-artifactsSkill
- writing-skillsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 0 are common, 4 are distinctive, and 11 are very specific to this project.
0
Common
Most of the 96 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Write the implementation spec before writing code.
- Very specific: line 41
Read the coding guidelines from the active tech stack's ## Reference Files, the stack's testing supplement, …
- Distinctive: line 46
Read 2-3 nearby files that represent the local pattern to follow.
- Very specific: line 57
Ask one question per AskUserQuestion round, starting with the highest-leverage ambiguity — the one whose answer most reshapes the spec …
- Distinctive: line 59
After each answer, re-derive the remaining ambiguities before asking the next question — answers routinely resolve later questions or …
- Very specific: line 64
If AskUserQuestion is deferred, load it via ToolSearch with select:AskUserQuestion.
- Very specific: line 75
Create docs/specs/ under the resolved root if it does not exist.
- Very specific: line 77
Version detection: Check whether docs/specs/YYYY-MM-DD-<feature-slug>.md already exists.
- Very specific: line 78
If it does not exist → write to docs/specs/YYYY-MM-DD-<feature-slug>.md (no suffix).
- Very specific: line 79
If it DOES exist → find the highest existing -vN suffix:
- Very specific: line 83
If a -vN suffix is found, write as -v(N+1).
- Very specific: line 88
Add docs/specs/* to .gitignore with the negations !docs/specs/baseline/ and !docs/specs/baseline/: per-feature specs are working artifacts, …
- Very specific: line 90
Always stop for approval before implementation.
- Distinctive: line 96
Only when the engineer asks for it, or at rigor MAX.
- Very specific: line 106
Every spec is accompanied by docs/specs/<date>-<slug>.json, validated against .claude/schemas/handoff.schema.json.
“Common” is measured: kept by at least 6 in 10 of the 96 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Spec-Driven Development
Overview
Write the implementation spec before writing code. The spec is the shared source of truth between the engineer, the command flow, and the reviewers. Code without a spec is guessing.
Tool discipline (phase-locked): spec authoring is a read + spec-artifact phase. Write only the spec artifacts (
docs/specs/<date>-<slug>.mdand its.jsonsidecar) — never source or test code. Code starts at Phase 3, after the approval gate; a source edit here is a scope violation.
Supplied spec/plan (adoption, not authoring): when the engineer hands in a complete spec or plan as the input (e.g.
docs/specs/…mdordocs/plans/…mdalready on disk),implement's Phase 0.7 adopts it as the source of truth. In that case this skill validates the supplied artifact against the schema and reconciles it against the current code (seeprior-work-check's existing-plan reconciliation) rather than re-authoring to a fresh path — never overwrite or version-bump the engineer's input. Seeimplement/SKILL.mdPhase 0.7.
When To Use
- New endpoints, handlers, routes, or views; database changes or migrations
- Multi-file work or breaking changes
- Any task where approval should happen before coding, or likely to outlast a short focused session
When NOT To Use
- Typo fixes, one-line config updates with no behavior impact, or small bug fixes that clearly stay within quick-fix scope →
fix
Modes
- Standard (default). The steps below: ambiguity gate, the spec sections, the JSON sidecar, honest
security_impact, prior-work check. - Extended spec (opt-in). Adds EARS/ANT requirements with
lint-ears.sh, the INVEST+C 16-item score, a cited Constitution Check, and a delta against a per-area baseline. Turn it on when the engineer asks for it, or when the Phase 2 rigor score lands at MAX — then add the extended sections before the Phase 2.5 gate. Record the mode in the spec header (Spec mode: extended). See Extended Spec Mode below.
Workflow
Steps
- Read the coding guidelines from the active tech stack's
## Reference Files, the stack's testing supplement,.claude/references/domain-finance.md(finance and security supplement) when scope touches auth/financial/infra, andarchitecture-principles.mdif present. Query relevant lessons:bash "$([ -n "${MTK_HELPER_ROOT:-}" ] && echo "$MTK_HELPER_ROOT/scripts/learnings.sh" || ([ -f scripts/learnings.sh ] && echo scripts/learnings.sh || echo "${CLAUDE_PLUGIN_ROOT}/scripts/learnings.sh"))" query --phase spec --files "<comma-separated paths from initial scope>" --max 8(falls back to readingtasks/lessons.md; resolve it from the main worktree when in a worktree). - Surface assumptions before planning — runtime, architecture, storage, auth, boundaries. Do not silently fill in major gaps.
- Classify scope:
internal-refactoring·new-feature·breaking-change. 3b. Dirty-worktree step. Rungit status --porcelain. Every modified or untracked path not in this change manifest goes under Risks as adirty-worktreeentry and intoout_of_scopein the sidecar, so theplan-gap-reviewercan reject any batch that touches it. - Read 2-3 nearby files that represent the local pattern to follow.
Ambiguity gate (BEFORE drafting). Detect whether the task has genuine ambiguity that would change the spec. Trigger if any of:
- Two or more plausible designs exist and the request doesn't pick one (e.g., reflection vs source-gen, sync vs async, single vs split package).
- Scope edges are undefined (e.g., "users" — authenticated only? including service accounts? soft-deleted?).
- An architectural choice is unresolved (e.g., new boundary, new persistence target, cross-slice contract).
- A success criterion would be untestable as stated.
If triggered: stop and call
AskUserQuestionwith one question per ambiguity (max 4). Each question presents 2–4 concrete options with the tradeoff in the description. Wait for answers, then proceed to drafting with answers folded into the spec — do not defer them to "Open questions" in the spec body.Interview mode (Socratic, one question per round). Switch from the batched form above to a structured interview when either: three or more ambiguities triggered, or the request is one or two sentences for clearly multi-file scope (the ask is underspecified relative to its blast radius). In interview mode:
- Ask one question per
AskUserQuestionround, starting with the highest-leverage ambiguity — the one whose answer most reshapes the spec (usually the success definition or the architectural boundary, not the naming choice). - Probe intent, not just option preference: lead with what the engineer is trying to achieve or avoid ("what should happen to in-flight payments when this flag flips?"), then offer the 2–4 concrete options informed by that framing.
- After each answer, re-derive the remaining ambiguities before asking the next question — answers routinely resolve later questions or surface new ones; a pre-computed question list goes stale after round one.
- Cap at 5 rounds. Anything still open after the cap is written into the spec as an explicit assumption with the chosen default and its rationale — never as a silent guess.
Batched mode remains the default for one or two independent ambiguities — don't stretch a two-question gate into an interview.
If
AskUserQuestionis deferred, load it viaToolSearchwithselect:AskUserQuestion. If the harness doesn't expose it, print the questions as a numbered list and stop until the engineer answers.Skip the gate when: the engineer's request already specifies the approach, the task follows an obvious existing pattern, or only one viable design fits the constraints. Document the skip in one line ("ambiguity gate skipped:
<reason>") so it's visible in the session log.When an ambiguity is version-sensitive — the right answer depends on current external best-practice, the installed package version's behavior, or a recent migration path rather than a preference — first follow
.claude/skills/research-context/SKILL.mdto produce a grounded, cited brief, then fold its recommendation into the options you present at theAskUserQuestiongate. Resolve "which design" from current information, not training-cutoff memory.- Produce a spec with these sections: Summary · Success criteria · Architecture and design · Security and compliance impact · Change manifest · Test manifest · Implementation batches · Risks and assumptions · Open questions.
- Security impact, honestly. Map each
change_manifestpath against the trust boundaries: auth, payments, audit, secrets, PII, IAM, financial state. If any path touches one,security_impactis notnone— state the level and a one-line justification. A mis-classified impact is the one spec error that silently removes reviewers later (it feeds the rigor floor and the drift check). - Elegance check: reduce file count, new abstractions, and moving parts if a simpler design exists.
- Prior-work check — run
prior-work-checkonce against the draft. A BLOCKED verdict (an existing implementation the spec would duplicate) holds the approval gate until the spec is revised. Append its output under## Prior Work Checkin the spec. - Persist the spec to disk:
- Resolve the artifact root first:
bash scripts/resolve-artifact-root.sh "<a path the change touches>". Everydocs/specs/...path below is relative to that root, not automatically the repo root. In a polyglot repo a subtree that owns its artifacts (its owndocs/specs/plus aCLAUDE.md) keeps them — writing to the repo root instead would scatter one project's specs across two locations. A repo with no such subtree resolves to the repo root, so single-project repos are unaffected. - Create
docs/specs/under the resolved root if it does not exist. - Compute the base target:
<artifact-root>/docs/specs/YYYY-MM-DD-<feature-slug>(no extension yet). - Version detection: Check whether
docs/specs/YYYY-MM-DD-<feature-slug>.mdalready exists.- If it does not exist → write to
docs/specs/YYYY-MM-DD-<feature-slug>.md(no suffix). - If it DOES exist → find the highest existing
-vNsuffix:
If als docs/specs/YYYY-MM-DD-<slug>*.md 2>/dev/null | grep -oE '\-v[0-9]+' | sort -V | tail -1-vNsuffix is found, write as-v(N+1). If the file exists but no-vNvariants do, write as-v2. - The JSON sidecar gets the same version suffix (e.g.,
docs/specs/YYYY-MM-DD-<slug>-v2.json). - Emit one line before writing:
Writing spec → docs/specs/<final-filename>.mdso the engineer can confirm the version chosen.
- If it does not exist → write to
- Also emit a machine-parseable sidecar at
docs/specs/<final-filename>.jsonwith the schema in Machine-Parseable Manifest below. This sidecar drivesspec-drift-detectionafter implementation. - This enables session recovery, human review outside chat, and reuse across sessions.
- Add
docs/specs/*to.gitignorewith the negations!docs/specs/baseline/and!docs/specs/baseline/**: per-feature specs are working artifacts, an extended-mode baseline is committed.
- Publish the spec artifact (additive, capability-gated). After the spec is on disk, follow
.claude/references/artifact-publishing.mdto create the workflow's Claude Artifact from the spec — this is the first section of a single browsable URL that later phases (plan, handoff, health) update in place. Publishing is additive: disk is the source of truth and the step is a silent no-op when theArtifacttool is unavailable orMTK_ARTIFACT_PUBLISH=0. Never publish anything not already written to disk. - Always stop for approval before implementation. When invoked from the implement workflow, this means handing control back to Phase 2.5 approval gate (which uses
AskUserQuestion). Do not silently continue to implementation.
Approval is sealed, not asserted. On approval, the implement gate records a SHA-256 approval seal over the approved spec/plan bodies — the two scope-encoding artifacts (scripts/workflow-artifact.sh seal). The todo is deliberately not sealed: it is progress state designed to mutate as batches complete, so sealing it would flip the seal STALE on the first checkbox tick. Because the seal binds the exact approved bytes, editing an approved spec or plan afterward invalidates the approval deterministically — verification-before-completion re-checks it with verify-seal (refusing completion on a STALE seal) and the spec-approval-trigger.sh hook re-queues the gate, rather than trusting a stale status: approved marker. This is why moving a success-criterion goalpost post-approval requires re-opening Phase 2.5: the seal will not match.
Extended Spec Mode
Only when the engineer asks for it, or at rigor MAX. Each item is added to the spec before the Phase 2.5 gate.
- Requirements in EARS. A
## Requirementssection where every bullet uses one template: Ubiquitous "The system shall …" · Event-driven "When<trigger>, the system shall …" · State-driven "While<state>, the system shall …" · Optional "Where<feature>, the system may …" · Unwanted "If<trigger>, then the system shall …". ANT check: if you cannot describe a counter-example for a bullet ("shall be reliable", "handle errors gracefully", "where appropriate"), rewrite or drop it. - EARS lint.
bash scripts/lint-ears.sh docs/specs/<file>.mdmust return zero violations before the gate; record the spec path in the same call (&& "$WFA" set "$MTK_WF_UUID" results.spec_path=…). It checks only the## Requirementssection. - INVEST+C score against
.claude/references/claude-ready-checklist.md. Any failing +C item is fixed before the gate; ≤13/16 goes back to draft. Cite failing item numbers. - Constitution Check. Run
bash scripts/constitution-digest.sh, then list in a## Constitution Checksection every Critical Rule or principle that constrains this design, cited by id, with one line on how the design satisfies it. A bent rule is an explicit exception with rationale; an[EXTRACTED]violation normally means redesign.spec-drift-detectionverifies what is cited here. - Delta against a baseline. Set
baseline_area(anddelta.adds/modifies/removeswhen known; removals are always explicit) so Phase 7.5 can archive it — see.claude/references/delta-spec-model.md.
Machine-Parseable Manifest (JSON Sidecar)
Every spec is accompanied by docs/specs/<date>-<slug>.json, validated against
.claude/schemas/handoff.schema.json. It is the source of truth for drift detection
and for the plan / implement sections downstream skills append. Required top-level
keys: slug, date, scope, change_manifest[] (path, action, purpose,
mechanical), public_contracts[] (kind, signature, change, surface),
success_criteria[] (id, description, verification, evidence_channel,
observable), test_manifest[], out_of_scope[], security_impact, assumptions[],
risks[]; baseline_area + delta in extended mode only;
coverage_claims[] and conditional_descopes[] when they apply. Every change_manifest
path must exist or be marked create; an [ASSUMED] entry or an unverified coverage
claim is an open decision and blocks MTK_AUTO_PROCEED.
Read .claude/references/spec-sidecar-manifest.md for the full field reference,
allowed values, and the worked example before writing or amending a sidecar.
Verification
- Spec is self-contained and scope still matches the original request
- Every file and test file appears in the manifest; the JSON sidecar matches the markdown's change_manifest, test_manifest, success_criteria, and security_impact
- Success criteria are specific and testable; assumptions are explicit
security_impacthonestly reflects touched trust boundaries (step 7)- Ambiguity gate ran or its skip was stated in one line
prior-work-checkran once with no BLOCKED verdict (step 9)- Extended mode only:
lint-ears.shreturns 0, +C score > 13/16 recorded, Constitution Check present,baseline_areaset - Spec artifact published (or gate correctly closed) per
.claude/references/artifact-publishing.md, disk written first
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

