Simple Design — Write a Technical Design Document
You are writing a technical design document. Your job is to produce a design.md file inside docs/<feature-name>/
that gives an AI coding agent (or a human developer) a clear, actionable plan for how to implement
a feature — the architecture, data flow, interfaces, key decisions, and testing strategy.
This skill works standalone from a user's message or any input file that describes what needs to be built.
It also pairs well with simple-spec — consuming docs/<feature-name>/spec.md as input gives the
best results, but it's not required.
Folder convention
All feature artifacts live in docs/<feature-name>/:
docs/
index.json ← feature manifest
visual.md ← from simple-visual (app-level, optional)
<feature-name>/
spec.md ← from simple-spec
design.md ← THIS SKILL'S OUTPUT
design/ ← optional: detail files when design.md is split
<area>.md
issues.json ← from simple-tasks
progress-log.md ← from simple-implement
The <feature-name> token is a short kebab-case identifier that ties all artifacts together by directory.
Workflow
1. Gather context
Start by collecting as much information as you can before asking the user anything.
From the input:
- If the user points to a feature folder (e.g.,
docs/<feature-name>/), read spec.md in that folder.
This is your primary source of truth for what to build and why.
- If no feature folder is specified, check
docs/index.json for features with status "planning" or
"spec_ready" and look for a spec.md in their directory.
- If there's no spec file, treat the user's message or input file as the feature description and extract
the goals, scope, and requirements from it.
From the codebase:
- This is where the design skill does its heaviest lifting. You need to understand the existing system
deeply enough to propose changes that fit naturally.
- Durable docs first (if present): read
docs/architecture.md for the high-level system shape
and docs/adr/ for past decisions and their rationale. These tell you why the system is the way
it is and stop you from re-litigating settled decisions — reconcile any high-level claim against
the code, which remains the source of truth for detail.
- Search for and read:
- Architecture: Directory structure, module boundaries, how the app is organized.
- Data layer: Database schemas/models, ORMs, migrations, data access patterns.
- API layer: Route definitions, controllers, middleware, request/response shapes.
- Business logic: Services, domain models, shared utilities relevant to the feature area.
- UI layer (if applicable): Component structure, state management, routing.
- Tests: Existing test patterns, test utilities, what's covered and what's not.
- Config & infra: Environment variables, feature flags, deployment setup, CI/CD.
- Look for patterns the codebase already uses — the design should follow existing conventions unless
there's a strong reason to deviate (and if so, document that as a key decision).
The goal is to understand the system well enough that your design reads like it was written by someone
who works on this codebase daily.
2. Ask follow-up questions (only if needed)
After gathering context, assess what's still ambiguous. Common gaps at the design stage:
- Technical constraints: "I see you're on Postgres 14 — are you open to using native JSON columns,
or do you prefer a normalized schema?"
- Integration boundaries: "The spec mentions a webhook — should this integrate with the existing
event system in
lib/events/, or is this a separate concern?"
- Performance expectations: "The current query for listing workspaces does a full table scan.
Should the design include indexing, or is the dataset small enough that it doesn't matter?"
- Migration/rollout concerns: "There are ~50k rows in the users table. Should we plan for a
zero-downtime migration, or is a maintenance window acceptable?"
Only ask questions where the answer changes the design meaningfully. If the codebase gives you enough
signal to make a reasonable choice, make it and document it as a key decision with your rationale.
Present your questions to the user — keep it to one round of 1-4 focused questions.
Use whatever mechanism is available (a structured question tool, a chat message, etc.).
3. Write the design
Read the template at references/design_template.md in this skill's directory. Use only applicable
sections; remove unused headings and placeholders.
Key principles:
Ground everything in the actual codebase. Reference real file paths, real function names, real
table names. "We'll add a new service" is vague. "We'll add src/services/workspace-sharing.ts
following the pattern established by src/services/workspace.ts" is actionable.
Keep current state selective. List only relevant code touchpoints and why each matters; do not
reproduce the codebase survey.
Make changes actionable. Name material new or modified files, contracts, schemas, and endpoints
so implementation can begin without guessing.
Specify changed boundaries, not implementations. Include only material type/interface definitions,
function signatures, schema diffs, endpoint shapes, and file-level structure. Do not include full
function bodies or large code blocks — leave the implementation to the coding agent. If you find
yourself writing more than ~10 lines of logic inside a code block, you've crossed into implementation
territory; pull back and describe the behavior in prose or pseudocode instead.
Record only consequential decisions. Include cross-cutting, hard-to-reverse, or convention-breaking
choices and real alternatives. Zero decisions is valid. These decisions are the source
simple-distill uses for durable ADRs after the feature ships.
Use data flow when it clarifies boundaries. Describe one concrete proposed flow; include the
current flow only when the contrast matters.
Make verification specific. Map changed behavior or spec IDs to test level, location, and existing
utilities without restating the behavior.
Preserve compatibility unless the spec permits breaking changes. Describe migration or rollout
only when needed.
Avoid repeating the spec. When one exists, reference its goals, scope, acceptance criteria,
and success measures. Summarize only constraints needed to explain the design.
Use one change map. Do not repeat the same file or component changes in separate planned-change
and affected-component sections.
Concision
Research broadly; write only material facts. Keep each fact in one place and link instead of
repeating content across sections, parent/child documents, or upstream artifacts.
Prefer one file. Split only for independently implementable areas; move detail out of the parent
rather than summarizing it twice. Keep the complete design, including children, under ~4,000 words.
If that is insufficient, split the feature scope.
Before saving, remove content that does not clarify the approach, a changed contract, a material
decision or risk, or verification.
4. Save the output
- Use the same feature name from the spec (or derive a short kebab-case name if working standalone).
- Save to
docs/<feature-name>/design.md relative to the project root (create the directory if needed).
- If you split the design, save the child files under
docs/<feature-name>/design/ and make sure
design.md indexes them. Otherwise a single design.md is the complete output.
- Update
docs/index.json to set the feature status to "design_ready" (or create the entry if
working standalone).
- Tell the user the file path and give a brief summary of the technical approach.
5. Suggest next step
Let the user know the design is ready. The typical next step is to run simple-tasks to break the
design into an ordered task list (docs/<feature-name>/issues.json), then use simple-implement
or simple-run to execute. If there are open questions or risks flagged in the document, highlight
them so the user can address them before moving to task breakdown.
Important notes
- This skill produces a technical design, not a product spec — focus on how, not what or
why (the spec covers those). If you find yourself writing user stories or acceptance
criteria, you've crossed into spec territory; pull back.
- If the spec has open questions that affect the design, call them out explicitly rather than
guessing — e.g. "this design assumes X; if Y holds instead, section Z would need to change."
- If no spec exists and the input is vague, consider suggesting a spec be written first (via
simple-spec or manually) — designing against ambiguous goals leads to rework. This is a
suggestion, not a blocker; proceed with what you have if the user wants to.
1---2name: simple-design3description: Write a technical design document (docs/<feature-name>/design.md) describing how to build a feature — architecture, data flow, interfaces, key decisions, testing strategy — from a spec, user message, or codebase context. Use when the user wants to design a feature, plan an implementation approach, document architecture decisions, or turn a spec.md into its design. Triggers: "write a design doc", "design this feature", "plan the implementation", "how should we build this", "technical approach", "architecture for".4---56# Simple Design — Write a Technical Design Document78You are writing a technical design document. Your job is to produce a `design.md` file inside `docs/<feature-name>/`9that gives an AI coding agent (or a human developer) a clear, actionable plan for **how** to implement10a feature — the architecture, data flow, interfaces, key decisions, and testing strategy.1112This skill works standalone from a user's message or any input file that describes what needs to be built.13It also pairs well with **simple-spec** — consuming `docs/<feature-name>/spec.md` as input gives the14best results, but it's not required.1516## Folder convention1718All feature artifacts live in `docs/<feature-name>/`:1920```21docs/22 index.json ← feature manifest23 visual.md ← from simple-visual (app-level, optional)24 <feature-name>/25 spec.md ← from simple-spec26 design.md ← THIS SKILL'S OUTPUT27 design/ ← optional: detail files when design.md is split28 <area>.md29 issues.json ← from simple-tasks30 progress-log.md ← from simple-implement31```3233The `<feature-name>` token is a short kebab-case identifier that ties all artifacts together by directory.3435## Workflow3637### 1. Gather context3839Start by collecting as much information as you can **before** asking the user anything.4041**From the input:**42- If the user points to a feature folder (e.g., `docs/<feature-name>/`), read `spec.md` in that folder.43 This is your primary source of truth for *what* to build and *why*.44- If no feature folder is specified, check `docs/index.json` for features with status `"planning"` or45 `"spec_ready"` and look for a `spec.md` in their directory.46- If there's no spec file, treat the user's message or input file as the feature description and extract47 the goals, scope, and requirements from it.4849**From the codebase:**50- This is where the design skill does its heaviest lifting. You need to understand the existing system51 deeply enough to propose changes that fit naturally.52- **Durable docs first (if present):** read `docs/architecture.md` for the high-level system shape53 and `docs/adr/` for past decisions and their rationale. These tell you *why* the system is the way54 it is and stop you from re-litigating settled decisions — reconcile any high-level claim against55 the code, which remains the source of truth for detail.56- Search for and read:57 - **Architecture:** Directory structure, module boundaries, how the app is organized.58 - **Data layer:** Database schemas/models, ORMs, migrations, data access patterns.59 - **API layer:** Route definitions, controllers, middleware, request/response shapes.60 - **Business logic:** Services, domain models, shared utilities relevant to the feature area.61 - **UI layer** (if applicable): Component structure, state management, routing.62 - **Tests:** Existing test patterns, test utilities, what's covered and what's not.63 - **Config & infra:** Environment variables, feature flags, deployment setup, CI/CD.64- Look for patterns the codebase already uses — the design should follow existing conventions unless65 there's a strong reason to deviate (and if so, document that as a key decision).6667The goal is to understand the system well enough that your design reads like it was written by someone68who works on this codebase daily.6970### 2. Ask follow-up questions (only if needed)7172After gathering context, assess what's still ambiguous. Common gaps at the design stage:7374- **Technical constraints:** "I see you're on Postgres 14 — are you open to using native JSON columns,75 or do you prefer a normalized schema?"76- **Integration boundaries:** "The spec mentions a webhook — should this integrate with the existing77 event system in `lib/events/`, or is this a separate concern?"78- **Performance expectations:** "The current query for listing workspaces does a full table scan.79 Should the design include indexing, or is the dataset small enough that it doesn't matter?"80- **Migration/rollout concerns:** "There are ~50k rows in the users table. Should we plan for a81 zero-downtime migration, or is a maintenance window acceptable?"8283Only ask questions where the answer changes the design meaningfully. If the codebase gives you enough84signal to make a reasonable choice, make it and document it as a key decision with your rationale.8586Present your questions to the user — keep it to one round of 1-4 focused questions.87Use whatever mechanism is available (a structured question tool, a chat message, etc.).8889### 3. Write the design9091Read the template at `references/design_template.md` in this skill's directory. Use only applicable92sections; remove unused headings and placeholders.9394**Key principles:**9596- **Ground everything in the actual codebase.** Reference real file paths, real function names, real97 table names. "We'll add a new service" is vague. "We'll add `src/services/workspace-sharing.ts`98 following the pattern established by `src/services/workspace.ts`" is actionable.99100- **Keep current state selective.** List only relevant code touchpoints and why each matters; do not101 reproduce the codebase survey.102103- **Make changes actionable.** Name material new or modified files, contracts, schemas, and endpoints104 so implementation can begin without guessing.105106- **Specify changed boundaries, not implementations.** Include only material type/interface definitions,107 function signatures, schema diffs, endpoint shapes, and file-level structure. Do *not* include full108 function bodies or large code blocks — leave the implementation to the coding agent. If you find109 yourself writing more than ~10 lines of logic inside a code block, you've crossed into implementation110 territory; pull back and describe the behavior in prose or pseudocode instead.111112- **Record only consequential decisions.** Include cross-cutting, hard-to-reverse, or convention-breaking113 choices and real alternatives. Zero decisions is valid. These decisions are the source114 **simple-distill** uses for durable ADRs after the feature ships.115116- **Use data flow when it clarifies boundaries.** Describe one concrete proposed flow; include the117 current flow only when the contrast matters.118119- **Make verification specific.** Map changed behavior or spec IDs to test level, location, and existing120 utilities without restating the behavior.121122- **Preserve compatibility unless the spec permits breaking changes.** Describe migration or rollout123 only when needed.124125- **Avoid repeating the spec.** When one exists, reference its goals, scope, acceptance criteria,126 and success measures. Summarize only constraints needed to explain the design.127128- **Use one change map.** Do not repeat the same file or component changes in separate planned-change129 and affected-component sections.130131**Concision**132133Research broadly; write only material facts. Keep each fact in one place and link instead of134repeating content across sections, parent/child documents, or upstream artifacts.135136Prefer one file. Split only for independently implementable areas; move detail out of the parent137rather than summarizing it twice. Keep the complete design, including children, under ~4,000 words.138If that is insufficient, split the feature scope.139140Before saving, remove content that does not clarify the approach, a changed contract, a material141decision or risk, or verification.142143### 4. Save the output144145- Use the same feature name from the spec (or derive a short kebab-case name if working standalone).146- Save to `docs/<feature-name>/design.md` relative to the project root (create the directory if needed).147- If you split the design, save the child files under `docs/<feature-name>/design/` and make sure148 `design.md` indexes them. Otherwise a single `design.md` is the complete output.149- Update `docs/index.json` to set the feature status to `"design_ready"` (or create the entry if150 working standalone).151- Tell the user the file path and give a brief summary of the technical approach.152153### 5. Suggest next step154155Let the user know the design is ready. The typical next step is to run **simple-tasks** to break the156design into an ordered task list (`docs/<feature-name>/issues.json`), then use **simple-implement**157or **simple-run** to execute. If there are open questions or risks flagged in the document, highlight158them so the user can address them before moving to task breakdown.159160## Important notes161162- This skill produces a **technical design**, not a product spec — focus on *how*, not *what* or163 *why* (the spec covers those). If you find yourself writing user stories or acceptance164 criteria, you've crossed into spec territory; pull back.165- If the spec has open questions that affect the design, call them out explicitly rather than166 guessing — e.g. "this design assumes X; if Y holds instead, section Z would need to change."167- If no spec exists and the input is vague, consider suggesting a spec be written first (via168 **simple-spec** or manually) — designing against ambiguous goals leads to rework. This is a169 suggestion, not a blocker; proceed with what you have if the user wants to.