design-docs
Skill517 starsChanged 3 days agoMITView on GitHub
Full execution protocol for MODE: DESIGN_DOCS — generate or sync structured, language-agnostic design docs (domain.md, technical-spec.md, behavior-spec.md, reference/) for the project under build, with a stable section-ID registry and a design changelog. Loaded on demand by the architect when the design-docs command emits a [MODE: DESIGN_DOCS ...] signal (issue #1080).
We split this skill into the rules it gives an agent
4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
If the header is malformed, report the error and stop.
- Very specific: line 32
If a spec-staleness block is active (.swarm/spec-staleness.json present), resolve/acknowledge spec staleness FIRST — otherwise design-doc …
- Very specific: line 33
Read .swarm/spec.md if present — it is the authoritative requirements source (FR-### IDs).
- Very specific: line 34
Run /swarm sdd status to resolve the effective spec before reading.
“Common” is measured: kept by at least 6 in 10 of the 5 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
Design-Doc Generation & Sync Protocol
Generate or maintain the project's structured design documentation. The work is delegated to the docs_design agent (a design-doc-author role variant of the docs agent). This mode authors a fixed set of version-controlled docs in the target project repo (NOT under .swarm/). It does NOT modify source code, does NOT call declare_scope, and does NOT touch .swarm/spec.md, CHANGELOG.md, or docs/releases/pending/*.
MODE: DESIGN_DOCS
Step 0 — Parse Header
Parse the [MODE: DESIGN_DOCS ...] header to extract:
out: output directory, project-relative (defaultdocs)lang: target language forreference/docs, orauto(defaultauto)update: boolean —true= sync existing docs to current code/spec;false= generate fresh- the trailing free text = the system description (required when
update=false)
If the header is malformed, report the error and stop.
Step 1 — Preconditions
- Confirm
design_docs.enabledis true (thedocs_designagent only exists when enabled). If it is not, tell the user to setdesign_docs.enabled: trueinopencode-swarm.jsonand stop. - If a spec-staleness block is active (
.swarm/spec-staleness.jsonpresent), resolve/acknowledge spec staleness FIRST — otherwise design-doc writes may be blocked by the guardrail, which emitsSPEC_DRIFT_BLOCK. Do not blindly retry onSPEC_DRIFT_BLOCK. - Read
.swarm/spec.mdif present — it is the authoritative requirements source (FR-### IDs). The design docs must be consistent with it. Run/swarm sdd statusto resolve the effective spec before reading.
Step 2 — Index Existing State (always)
Have the docs_design agent (or doc_scan) index <out>/ to discover any existing design docs. If <out>/reference/traceability.json exists, it is the section-ID registry — load it. Existing section IDs MUST be preserved on regeneration.
Step 3 — Generate or Sync
Dispatch the docs_design agent (the active swarm's docs_design — never the standard docs agent) with:
TASK,MODE(generate|sync),OUT_DIR,LANGUAGE- For sync:
FILES CHANGEDandCHANGES SUMMARYfrom the current phase/diff SKILLS: file:.swarm/bundled-skills/design-docs/SKILL.md(this skill)
The agent owns exactly these files under <out> and creates NOTHING else:
<out>/
├── domain.md # 100% language-agnostic. Entities in neutral notation
│ # (field: type-class), domain invariants. ZERO framework
│ # names in normative text. Section IDs: D-###
├── technical-spec.md # Language-agnostic architecture: layers, dependency rules,
│ # contract SHAPES (inputs→outputs→error-kinds), algorithms,
│ # invariants. + the traceability table. Section IDs: S-###
├── behavior-spec.md # 100% language-agnostic Given/When/Then specs. IDs: B-###
├── design-changelog.md # Keep-a-Changelog log of design-doc changes (NOT release notes)
└── reference/ # ALL [INCIDENTAL] language/framework-specific material here.
├── reference-impl.md # Exact signatures, CLI strings, SQL, code. Mapped to
│ # spec sections by ID. Section IDs: R-###
├── idiom-notes.md # "Here is how the reference solved X" — examples only.
└── traceability.json # Machine-readable section-ID registry (source of truth)Step 4 — Invariants the docs MUST satisfy
- Language-agnostic normative text:
domain.md,technical-spec.md, andbehavior-spec.mdcontain ZERO framework/library/language names in normative content. All such material lives ONLY inreference/. - Version header on every doc:
<!-- design-doc: <name> version: <phase-or-counter> generated: <ISO-8601> spec-hash: <8 chars> --> - Stable section IDs: assigned once, never renumbered.
D-###domain,S-###technical-spec,B-###behavior-spec,R-###reference. On sync, reuse every existing ID; mint new IDs only for genuinely new sections. - Traceability footer ending each section:
> Traceability: FR-012, FR-013 | invariant: <id-or-none>. - traceability.json kept in sync:
{ "schema_version": 1, "sections": [ { "section_id", "doc", "title", "spec_frs": [], "invariants": [], "code_anchors": [] } ] }.technical-spec.mdrenders a human-readable mirror table| Doc Section | Spec FR | Invariant | Code anchors |. - design-changelog.md: append one entry per generate/sync under
## [Unreleased](Added/Changed/Removed), e.g.- <ISO date> phase <N>: <sections touched> (<FR refs>). This file is SEPARATE from release-please artifacts — never editCHANGELOG.mdordocs/releases/pending/*here.
Step 5 — Verify & Report
- Confirm the agent created/updated only the allowed files and
traceability.jsonis consistent with the docs. - Confirm no normative doc names a framework (spot-check) and every section has an ID + traceability footer.
- Report
UPDATED/ADDED/REMOVED/SUMMARYback to the user.
Notes on the PHASE-WRAP sync path
During PHASE-WRAP, the deterministic design-doc drift check (runDesignDocDriftCheck) writes .swarm/doc-drift-phase-N.json. If the verdict is DOC_STALE and design_docs.enabled, dispatch docs_design in sync mode for the affected sections only, then append a design-changelog entry. This is advisory and non-blocking — never block phase completion on design-doc lag.
Other versions7 projects use a version of this.
Word for word · 1
- ZaxbyHub/opencode-swarm★ 517100% same
Edited · 0
None found.
Wrote their own version · 6
- noir-lang/noir★ 1.4ksame name
- CaliLuke/skills★ 7same name
- alexjuda/alexjuda-skills★ 0same name
- GoncaloPrata/ClaudeSkills★ 0same name
- neko3cs/skills★ 0same name
- OHNope/design-docs-kit★ 0same name
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 repository66 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- ci-fix-monitorSkill
- codebase-review-swarmSkill
- commit-prSkill
- contributingSkill
- engineering-conventionsSkill
- fork-pr-operationsSkill
- guardrail-patternsSkill
- issue-tracerSkill
- mock-to-internals-migrationSkill
- pr-review-fixSkill
- qa-sweepSkill
- research-firstSkill
- running-testsSkill
- subprocess-safetySkill
- swarm-ci-monitorSkill
- swarm-implementSkill
- swarm-pr-feedbackSkill
- swarm-pr-reviewSkill
- swarm-pr-subscribeSkill
- swarmSkill
- tech-debt-ci-reviewSkill
- test-file-splitSkill
- unswarmSkill
- writing-testsSkill
- brainstormSkill
- clarifySkill
- clarify-specSkill
- codebase-review-swarmSkill
- commit-prSkill
- consultSkill
- councilSkill
- critic-gateSkill
- deep-diveSkill
- deep-researchSkill
- discoverSkill
- durable-session-stateSkill
- editing-skillsSkill
- engineering-conventionsSkill
- executeSkill
- fork-pr-operationsSkill
- graphifySkill
- issue-ingestSkill
- issue-tracerSkill
- orchestrating-subagentsSkill
- phase-wrapSkill
- pre-phase-briefingSkill
- qa-sweepSkill
- research-firstSkill
- rust-crate-ciSkill
- specifySkill
- swarm-ci-monitorSkill
- swarm-implementSkill
- swarm-planSkill
- swarm-pr-feedbackSkill
- swarm-pr-reviewSkill
- swarm-pr-subscribeSkill
- swarm-resumeSkill
- The first 60 shown.
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.

