Architecture Spec Writer
Purpose
Turn a chosen architecture into a document that is strong enough to guide implementation.
This skill is for:
- architecture specs
- design docs
- tech specs
- engineering design records
- implementation-facing system design documents
The output should function as a contract:
- what is being built
- what is not being built
- what must remain true
- how components interact
- how correctness is validated
- how rollout happens
- what is still unresolved
Use when
Use this skill when:
- the target architecture is already mostly chosen
- the user wants the design written down cleanly
- implementation will likely happen in multiple sessions or by multiple actors
- ambiguity around interfaces, rollout, observability, or validation needs to be removed
Typical trigger phrases:
- "собери design doc"
- "сделай tech spec"
- "оформи архитектуру в документ"
- "напиши инженерный спек"
- "write a design doc for this architecture"
- "prepare a technical spec"
Do not use when
Do not use this skill for:
- choosing between architecture options
- generic brainstorming
- product PRDs or roadmap docs
- implementation milestone planning
- bug fixing
- repository exploration with no design-writing goal
If the user has not yet chosen an architectural direction, use an architecture-options-analysis skill first.
If the user already has a design and now needs phased execution, use an implementation-plan skill instead.
Inputs
Expected inputs:
- chosen architecture or target design direction
- current system context
- affected modules, interfaces, or flows
- explicit constraints
- any existing notes, diagrams, or partial design text
Optional inputs:
- migration constraints
- backward compatibility expectations
- SLO, latency, throughput, or reliability constraints
- ownership boundaries
- deployment constraints
- compliance or security requirements
Outputs
Always produce:
- a written spec document in the repository
- the path to that document
- a compact summary for the user
- a list of unresolved questions if the design is not fully closed
Document principles
The document must be:
- implementation-oriented
- concrete
- minimal
- explicit about boundaries
- explicit about risks
- explicit about validation
- explicit about unresolved points
The document must not:
- add speculative abstractions
- hide uncertainty behind broad language
- include generic filler
- over-specify details that do not affect implementation
Constraints
- Treat the chosen architecture as the anchor; do not reopen options analysis unless the design is clearly inconsistent.
- Prefer existing repository design-doc conventions when they exist.
- Keep the spec self-contained enough that later implementation sessions can use it as durable project memory.
- If a section does not change implementation, rollout, observability, or validation, it probably does not belong.
- Open questions must be material; do not use them as a dumping ground for low-value thoughts.
Procedure
Reconstruct the design context.
Before writing the spec, identify:
- what exists now
- what is changing
- what is already decided
- what remains undecided
- which parts of the system are affected
Identify the document scope.
Make clear:
- what this spec covers
- what it intentionally does not cover
- whether the spec is for one module, one subsystem, or a cross-cutting change
Choose the document location.
Prefer existing repository conventions.
Otherwise use:
docs/design/<short-slug>.md
- or another architecture/design-doc folder already used in the repo
Write the document as an engineering contract.
The spec must contain:
- Title
- Goal
- Non-goals
- Current state
- Target design
- Invariants
- Interfaces / contracts
- Data flow / control flow
- Dependencies
- Failure modes
- Rollout / migration plan
- Observability
- Validation plan
- Open questions
Make the goal precise.
State:
- the problem being solved
- the intended outcome
- the key success condition
Avoid broad motivation sections that do not change implementation.
Write strong non-goals.
Explicitly rule out adjacent work that is not part of this design.
Non-goals must constrain implementation scope, not just decorate the document.
State invariants.
Capture the properties that must remain true after the change, for example:
- API compatibility guarantees
- consistency requirements
- ordering guarantees
- idempotency
- latency or reliability expectations
- ownership or security boundaries
Describe interfaces and contracts concretely.
For each important boundary, describe:
- inputs and outputs
- shape, schema, or types
- ownership
- call or dependency direction
- compatibility expectations
- error behavior where relevant
Describe data flow and control flow.
Explain:
- where requests or data enter
- how they move through the system
- where transformations happen
- where state is read or written
- where coordination, retries, batching, caching, or queuing happen
Keep this operational, not rhetorical.
List dependencies and assumptions.
Include:
- internal module dependencies
- external services or libraries
- infrastructure assumptions
- runtime assumptions
- deployment or storage assumptions
- Enumerate failure modes.
Include realistic failure modes such as:
- partial writes
- stale caches
- schema mismatch
- retries and duplication
- timeout or overload paths
- ordering bugs
- rollout incompatibility
- monitoring blind spots
For each major failure mode, specify at least one mitigation or detection path.
- Specify rollout and migration.
Make rollout concrete:
- what changes first
- whether dual-path support is needed
- whether backfill or migration is needed
- what can be rolled back
- where compatibility shims exist
- how to cut over safely
- Specify observability.
The spec should define:
- what metrics matter
- what logs or traces are needed
- what failure signals should surface quickly
- what success indicators confirm healthy rollout
- Specify validation.
The validation plan must be lightweight but credible.
Prefer:
- focused unit tests
- narrow integration checks
- schema or contract validation
- smoke tests
- migration-specific checks
Avoid broad heavy validation unless the design truly depends on it.
- End with open questions.
Only include open questions that materially affect implementation or rollout.
Do not use this section as a dumping ground.
Decision rules
Contract rule
If a section does not change implementation, validation, rollout, or operations, it probably does not belong in the spec.
Non-goal rule
A weak non-goals section means the implementation boundary is still unclear.
Interface rule
If an interface is important enough to change implementation, it must be written explicitly.
Failure-mode rule
If a realistic failure mode is omitted, the spec is incomplete.
Rollout rule
If the change cannot be deployed in one clean step, the spec must describe the transition.
Validation rule
Every architecturally meaningful behavior change should have a named validation path.
Minimality rule
Do not add extra architecture, patterns, or abstractions to make the document look more sophisticated.
Optional subagent use
For larger systems, explicitly spawn bounded subagents before finalizing the spec:
- one subagent to map current interfaces and affected modules
- one subagent to inspect rollout and compatibility surface
- one subagent to identify observability and validation hooks
Wait for the memos, then write the final document.
Do not spawn subagents for a small local design doc.
References
Use the supporting references when needed:
references/spec-template.md
references/interfaces-and-invariants-checklist.md
references/rollout-observability-validation-checklist.md
Definition of done
- A spec document exists in the repository.
- Scope and non-goals are explicit.
- Invariants, interfaces, failure modes, rollout, observability, and validation are concrete enough to guide implementation.
- Open questions are real and materially relevant.
- The document reads like an engineering contract, not generic architecture prose.
Required final response format
Return:
- Spec document:
<path>
- Goal
- Non-goals
- Main interfaces
- Main failure modes
- Rollout shape
- Validation shape
- Open questions
Positive examples
Use this skill for:
- "собери design doc"
- "сделай tech spec по выбранной архитектуре"
- "оформи модуль в инженерный документ"
- "напиши architecture spec"
- "turn this chosen design into an implementation-facing spec"
Negative examples
Do not use this skill for:
- "сравни варианты архитектуры"
- "сделай план реализации по этапам"
- "почини баг"
- "сделай summary"
- "распиши roadmap"
1---2name: architecture-spec-writer3description: Write a concrete architecture spec, design doc, or tech spec for an already chosen software architecture or technical direction. Trigger when the user asks to write a design doc, tech spec, architecture spec, implementation spec, or phrases like "собери design doc", "напиши tech spec", "оформи архитектуру в документ", "сделай инженерный спек", or similar. The document must act as an engineering contract for implementation: define the goal, non-goals, invariants, interfaces, data flow, dependencies, failure modes, rollout plan, observability, validation plan, and open questions. Keep it concrete and implementation-oriented. Do not produce corporate filler, vague future-proofing, or decorative sections with no execution value. Do not use for architecture option comparison, generic brainstorming, product requirements docs, or a detailed milestone plan after the design is already fixed.4---56# Architecture Spec Writer78## Purpose910Turn a chosen architecture into a document that is strong enough to guide implementation.1112This skill is for:13- architecture specs14- design docs15- tech specs16- engineering design records17- implementation-facing system design documents1819The output should function as a contract:20- what is being built21- what is not being built22- what must remain true23- how components interact24- how correctness is validated25- how rollout happens26- what is still unresolved2728## Use when2930Use this skill when:31- the target architecture is already mostly chosen32- the user wants the design written down cleanly33- implementation will likely happen in multiple sessions or by multiple actors34- ambiguity around interfaces, rollout, observability, or validation needs to be removed3536Typical trigger phrases:37- "собери design doc"38- "сделай tech spec"39- "оформи архитектуру в документ"40- "напиши инженерный спек"41- "write a design doc for this architecture"42- "prepare a technical spec"4344## Do not use when4546Do not use this skill for:47- choosing between architecture options48- generic brainstorming49- product PRDs or roadmap docs50- implementation milestone planning51- bug fixing52- repository exploration with no design-writing goal5354If the user has not yet chosen an architectural direction, use an architecture-options-analysis skill first.55If the user already has a design and now needs phased execution, use an implementation-plan skill instead.5657## Inputs5859Expected inputs:60- chosen architecture or target design direction61- current system context62- affected modules, interfaces, or flows63- explicit constraints64- any existing notes, diagrams, or partial design text6566Optional inputs:67- migration constraints68- backward compatibility expectations69- SLO, latency, throughput, or reliability constraints70- ownership boundaries71- deployment constraints72- compliance or security requirements7374## Outputs7576Always produce:771. a written spec document in the repository782. the path to that document793. a compact summary for the user804. a list of unresolved questions if the design is not fully closed8182## Document principles8384The document must be:85- implementation-oriented86- concrete87- minimal88- explicit about boundaries89- explicit about risks90- explicit about validation91- explicit about unresolved points9293The document must not:94- add speculative abstractions95- hide uncertainty behind broad language96- include generic filler97- over-specify details that do not affect implementation9899## Constraints100101- Treat the chosen architecture as the anchor; do not reopen options analysis unless the design is clearly inconsistent.102- Prefer existing repository design-doc conventions when they exist.103- Keep the spec self-contained enough that later implementation sessions can use it as durable project memory.104- If a section does not change implementation, rollout, observability, or validation, it probably does not belong.105- Open questions must be material; do not use them as a dumping ground for low-value thoughts.106107## Procedure1081091. Reconstruct the design context.110 Before writing the spec, identify:111 - what exists now112 - what is changing113 - what is already decided114 - what remains undecided115 - which parts of the system are affected1161172. Identify the document scope.118 Make clear:119 - what this spec covers120 - what it intentionally does not cover121 - whether the spec is for one module, one subsystem, or a cross-cutting change1221233. Choose the document location.124 Prefer existing repository conventions.125 Otherwise use:126 - `docs/design/<short-slug>.md`127 - or another architecture/design-doc folder already used in the repo1281294. Write the document as an engineering contract.130 The spec must contain:131 - Title132 - Goal133 - Non-goals134 - Current state135 - Target design136 - Invariants137 - Interfaces / contracts138 - Data flow / control flow139 - Dependencies140 - Failure modes141 - Rollout / migration plan142 - Observability143 - Validation plan144 - Open questions1451465. Make the goal precise.147 State:148 - the problem being solved149 - the intended outcome150 - the key success condition151 Avoid broad motivation sections that do not change implementation.1521536. Write strong non-goals.154 Explicitly rule out adjacent work that is not part of this design.155 Non-goals must constrain implementation scope, not just decorate the document.1561577. State invariants.158 Capture the properties that must remain true after the change, for example:159 - API compatibility guarantees160 - consistency requirements161 - ordering guarantees162 - idempotency163 - latency or reliability expectations164 - ownership or security boundaries1651668. Describe interfaces and contracts concretely.167 For each important boundary, describe:168 - inputs and outputs169 - shape, schema, or types170 - ownership171 - call or dependency direction172 - compatibility expectations173 - error behavior where relevant1741759. Describe data flow and control flow.176 Explain:177 - where requests or data enter178 - how they move through the system179 - where transformations happen180 - where state is read or written181 - where coordination, retries, batching, caching, or queuing happen182 Keep this operational, not rhetorical.18318410. List dependencies and assumptions.185 Include:186 - internal module dependencies187 - external services or libraries188 - infrastructure assumptions189 - runtime assumptions190 - deployment or storage assumptions19119211. Enumerate failure modes.193 Include realistic failure modes such as:194 - partial writes195 - stale caches196 - schema mismatch197 - retries and duplication198 - timeout or overload paths199 - ordering bugs200 - rollout incompatibility201 - monitoring blind spots202203 For each major failure mode, specify at least one mitigation or detection path.20420512. Specify rollout and migration.206 Make rollout concrete:207 - what changes first208 - whether dual-path support is needed209 - whether backfill or migration is needed210 - what can be rolled back211 - where compatibility shims exist212 - how to cut over safely21321413. Specify observability.215 The spec should define:216 - what metrics matter217 - what logs or traces are needed218 - what failure signals should surface quickly219 - what success indicators confirm healthy rollout22022114. Specify validation.222 The validation plan must be lightweight but credible.223 Prefer:224 - focused unit tests225 - narrow integration checks226 - schema or contract validation227 - smoke tests228 - migration-specific checks229230 Avoid broad heavy validation unless the design truly depends on it.23123215. End with open questions.233 Only include open questions that materially affect implementation or rollout.234 Do not use this section as a dumping ground.235236## Decision rules237238### Contract rule239240If a section does not change implementation, validation, rollout, or operations, it probably does not belong in the spec.241242### Non-goal rule243244A weak non-goals section means the implementation boundary is still unclear.245246### Interface rule247248If an interface is important enough to change implementation, it must be written explicitly.249250### Failure-mode rule251252If a realistic failure mode is omitted, the spec is incomplete.253254### Rollout rule255256If the change cannot be deployed in one clean step, the spec must describe the transition.257258### Validation rule259260Every architecturally meaningful behavior change should have a named validation path.261262### Minimality rule263264Do not add extra architecture, patterns, or abstractions to make the document look more sophisticated.265266## Optional subagent use267268For larger systems, explicitly spawn bounded subagents before finalizing the spec:269- one subagent to map current interfaces and affected modules270- one subagent to inspect rollout and compatibility surface271- one subagent to identify observability and validation hooks272273Wait for the memos, then write the final document.274Do not spawn subagents for a small local design doc.275276## References277278Use the supporting references when needed:279- `references/spec-template.md`280- `references/interfaces-and-invariants-checklist.md`281- `references/rollout-observability-validation-checklist.md`282283## Definition of done284285- A spec document exists in the repository.286- Scope and non-goals are explicit.287- Invariants, interfaces, failure modes, rollout, observability, and validation are concrete enough to guide implementation.288- Open questions are real and materially relevant.289- The document reads like an engineering contract, not generic architecture prose.290291## Required final response format292293Return:294- Spec document: `<path>`295- Goal296- Non-goals297- Main interfaces298- Main failure modes299- Rollout shape300- Validation shape301- Open questions302303## Positive examples304305Use this skill for:306- "собери design doc"307- "сделай tech spec по выбранной архитектуре"308- "оформи модуль в инженерный документ"309- "напиши architecture spec"310- "turn this chosen design into an implementation-facing spec"311312## Negative examples313314Do not use this skill for:315- "сравни варианты архитектуры"316- "сделай план реализации по этапам"317- "почини баг"318- "сделай summary"319- "распиши roadmap"