For the rest of this document {DESIGN_DOC_SKILL_NAME} will refer to the name of the skill we will make that will later be used to generate design docs for this project. Default: creating-design-doc.
Once you create the base design doc template and skill, you must ask questions to the user to help clarify anything you are unsure of.
This is a joint user-agent process: ask targeted questions when unsure; do not finalize templates without user review.
Note: Templates are bundled with the skill (not in design-docs/) per Agent Skills progressive disclosure pattern.
If the repo has an existing agent config directory, use it. If multiple exist, prefer the current agent's. If none exist, create one.
Before asking questions, scan the repo to ground defaults:
If you have not already, run the $activating-memories skill to get an overview of the project.
- Languages/frameworks/build files
- CI entrypoints
- Project Specific Utility modules
- DB/migrations
- Style rules
Write design doc skill and bundled templates:
design-docs/README.md (workflow + approvals)
.{AGENT_NAME}/skills/{DESIGN_DOC_SKILL_NAME}/SKILL.md (the skill)
.{AGENT_NAME}/skills/{DESIGN_DOC_SKILL_NAME}/templates/README.md (template index)
.{AGENT_NAME}/skills/{DESIGN_DOC_SKILL_NAME}/templates/base.md (meta template with guardrails)
.{AGENT_NAME}/skills/{DESIGN_DOC_SKILL_NAME}/templates/skill.md (skill creation template)
.{AGENT_NAME}/skills/{DESIGN_DOC_SKILL_NAME}/templates/feature.md (feature template)
Run Adaptive Questioning Protocol:
- Produce "Detected Defaults Summary"
- Ask triggered questions
- Stop for answers before proceeding
Idempotency:
- Never overwrite existing templates without timestamped backup
- Add new variants to
.{AGENT_NAME}/skills/{DESIGN_DOC_SKILL_NAME}/templates/README.md
Stop and ask for [blocking] answers before proceeding.
[blocking] Test integrity policy
- "What is your rule on mocks? (only mock boundaries; prefer record/replay; never mock core transforms)"
- Why: populates guardrails + testing strategy.
[blocking] Data capture constraints
- "Can we store captured payloads under
tests/fixtures/? Any size/licensing/PII constraints?"
- Why: populates test-data acquisition plan.
[blocking] Destructive actions boundary
- "What DB reset patterns are allowed in tests? (transactions/temp schema/containers). Forbidden actions?"
- Why: prevents unsafe "delete DB to pass tests" behavior.
[important] Type discipline
- "For Python projects, what is your stance on Optional/None? (forbid unless justified; require invalid states unrepresentable)"
- Why: shapes interface-contract requirements.
[important] Review workflow
- "Stop at Template Delta Preview for approval, or write files and you review diffs?"
- Why: controls collaboration checkpoint.
- Identity and lifecycle
- Context
- Problem
- Goals / Non-goals
- Requirements (FRs / NFRs)
- Constraints and invariants (include DB + test integrity)
- Proposed design (architecture, contracts, schemas, idempotency/retries)
- Project common utilities that will be used.
- Project common utilities that will be created.
- Interface contracts (explicit signatures; Optional/None justification required)
- Alternatives considered (>=2)
- Test data acquisition plan (mandatory for external I/O / ETL)
- Testing and verification strategy (commands + CI gates + test integrity rules)
- Rollout / migration / ops (flags, backfills, observability, runbook)
- Open questions / follow-ups
- Subtasks (human-readable checklist for review)
Subtasks Section Format:
## Subtasks
### T1: [Task Title]
- **Summary**: One sentence objective
- **Scope**: What's in / what's out
- **Acceptance**: Binary pass/fail criteria
- **Status**: [ ] Not started / [~] In progress / [x] Complete
### T2: [Task Title]
...
- Reuse-first rule (anti-duplication): search existing utilities; record decision per task.
- No destructive shortcuts: never delete dev/prod data to pass tests; destructive actions require confirmation.
- Test integrity (anti-mock-cheating): mock boundaries only; prefer record/replay; do not change tests without spec change approval.
- Signature discipline (anti-vagueness): explicit types/invariants; Optional/None requires justification and handling strategy.
- Alternatives requirement: evaluate >=2 alternatives + "do nothing".
- Uncertainty protocol: ask
[blocking] questions when unsure; do not proceed.
1---2name: bootstrapping-design-docs3description: Creates design document infrastructure including templates, workflows, and a specific design doc skill. Use when setting up design docs for a new project or when the user mentions "bootstrapping-design-docs".4---5
6<NOTE>
7Use the $activate-memories skill if you have not already to get an overview of the project before proceeding.
8</NOTE>
9<objective>
101. If the `design-docs` folder does not already exist, create a repo-local `design-docs/` workspace (templates + active docs + index).
11 - If the `design-docs` folder already exists, stop and ask the user how to proceed.
122. Create a **project-specific** design doc template. If the user does not specify a specific type of design doc they want to create, we will be creating a general design document template called `base-design-doc.md` for the overall project.
133. Generate a **project-specific** design-doc skill for authoring design docs with:
14 - explicit specs (interfaces, signatures, types)
15 - mandatory test-data acquisition plan for ETL / HTTP / WebSocket work
16 - enforceable guardrails against common agent failure modes
17 - Example: The user wants to make a design doc skill for the ETL pipeline creations in the project. Then your task would be to create a `$etl-design-doc` skill.
184. Support repeated runs to create additional templates (variants) without breaking existing docs.
19
20For the rest of this document `{DESIGN_DOC_SKILL_NAME}` will refer to the name of the skill we will make that will later be used to generate design docs for this project. Default: `creating-design-doc`.
21Once you create the base design doc template and skill, you must ask questions to the user to help clarify anything you are unsure of.
22This is a **joint user-agent process**: ask targeted questions when unsure; do not finalize templates without user review.
23</objective>
24
25<outputs>
26Create (idempotent; do not overwrite without preserving history):
27
28<file_list>
29- `design-docs/README.md` - How design docs are written, reviewed, and used for delegated execution.
30- `design-docs/active/` - Directory for active design documents.
31- `design-docs/agents/` - Directory for agent-executable XML subtasks.
32- `.{AGENT_NAME}/skills/{DESIGN_DOC_SKILL_NAME}/SKILL.md` - The generated `${DESIGN_DOC_SKILL_NAME}` skill.
33- `.{AGENT_NAME}/skills/{DESIGN_DOC_SKILL_NAME}/templates/README.md` - Lists available templates and when to use them.
34- `.{AGENT_NAME}/skills/{DESIGN_DOC_SKILL_NAME}/templates/base.md` - Meta "base" design doc template (guardrails + structure).
35- `.{AGENT_NAME}/skills/{DESIGN_DOC_SKILL_NAME}/templates/<variant>.md` - Project-specific templates (e.g., `etl-pipeline.md`, `feature.md`).
36</file_list>
37
38**Note**: Templates are bundled with the skill (not in `design-docs/`) per Agent Skills progressive disclosure pattern.
39
40<output_format>
41**Design docs are written in markdown** - not XML. Markdown is easier for humans to read/edit and for agents to parse during collaboration. Agent-executable subtasks use XML in a separate file under `design-docs/agents/`.
42</output_format>
43
44<agent_name_resolution>
45Replace `{AGENT_NAME}` with the agent's config directory:
46- `.aider/` - Aider
47- `.claude/` - Claude Code
48- `.codex/` - OpenAI Codex CLI
49- `.copilot/` - GitHub Copilot
50- `.cursor/` - Cursor
51
52If the repo has an existing agent config directory, use it. If multiple exist, prefer the current agent's. If none exist, create one.
53</agent_name_resolution>
54</outputs>
55
56<preconditions>
57Before asking questions, scan the repo to ground defaults:
58If you have not already, run the $activating-memories skill to get an overview of the project.
59<scan_targets>
601. **Languages/frameworks/build files**
612. **CI entrypoints**
623. **Project Specific Utility modules**
634. **DB/migrations**
645. **Style rules**
65</scan_targets>
66</preconditions>
67
68<generation_steps>
691. **Create folder structure** (if missing):
70 - `design-docs/`
71 - `design-docs/active/`
72 - `design-docs/agents/`
73 - `.{AGENT_NAME}/skills/{DESIGN_DOC_SKILL_NAME}/`
74 - `.{AGENT_NAME}/skills/{DESIGN_DOC_SKILL_NAME}/templates/`
75
762. **Write design doc skill and bundled templates**:
77 - `design-docs/README.md` (workflow + approvals)
78 - `.{AGENT_NAME}/skills/{DESIGN_DOC_SKILL_NAME}/SKILL.md` (the skill)
79 - `.{AGENT_NAME}/skills/{DESIGN_DOC_SKILL_NAME}/templates/README.md` (template index)
80 - `.{AGENT_NAME}/skills/{DESIGN_DOC_SKILL_NAME}/templates/base.md` (meta template with guardrails)
81 - `.{AGENT_NAME}/skills/{DESIGN_DOC_SKILL_NAME}/templates/skill.md` (skill creation template)
82 - `.{AGENT_NAME}/skills/{DESIGN_DOC_SKILL_NAME}/templates/feature.md` (feature template)
833. **Run Adaptive Questioning Protocol**:
84 - Produce "Detected Defaults Summary"
85 - Ask triggered questions
86 - Stop for answers before proceeding
87
884. **Idempotency**:
89 - Never overwrite existing templates without timestamped backup
90 - Add new variants to `.{AGENT_NAME}/skills/{DESIGN_DOC_SKILL_NAME}/templates/README.md`
91</generation_steps>
92
93
94<questioning_protocol>
95Ask only questions that materially influence template contents.
96
97<question_tags>
98Every question must be tagged:
99- `[blocking]` - must be answered to generate correct template or enforce safety
100- `[important]` - significantly improves template quality / reduces future rework
101- `[optional]` - preference-level; safe defaults exist
102</question_tags>
103
104<question_budget>
105- Max 10 questions total.
106- Each question includes a one-line "why" tying to a template section, guardrail, or convention.
107</question_budget>
108
109<triggered_questions>
110Ask only what applies based on scan:
111- Migrations tooling detected -> ask DB reset/backfill/rollback/testing policy
112- HTTP/WS dependencies detected -> ask record/replay + fixture storage constraints
113- Monorepo structure detected -> ask where templates live and how commands differ
114- No tests/CI detected -> ask what canonical verification commands should be
115</triggered_questions>
116
117<template_delta_preview>
118Before writing files, show:
119- Which variants will be created
120- Repo-specific defaults that will be baked in
121- Any tightened guardrails derived from project norms
122- Any unresolved `[blocking]` items
123
124Stop and ask for `[blocking]` answers before proceeding.
125</template_delta_preview>
126</questioning_protocol>
127
128<common_questions>
129Ask only what you cannot infer from the scan:
130<question_examples>
1311. `[blocking]` **Template variants desired**
132 - "Which templates do you want generated? (e.g., `feature`, `etl_http_ws`, `db_migration`, `refactor`)"
133 - Why: determines templates bundled with skill.
134
1352. `[blocking]` **Test integrity policy**
136 - "What is your rule on mocks? (only mock boundaries; prefer record/replay; never mock core transforms)"
137 - Why: populates guardrails + testing strategy.
138
1393. `[blocking]` **Data capture constraints**
140 - "Can we store captured payloads under `tests/fixtures/`? Any size/licensing/PII constraints?"
141 - Why: populates test-data acquisition plan.
142
1434. `[blocking]` **Destructive actions boundary**
144 - "What DB reset patterns are allowed in tests? (transactions/temp schema/containers). Forbidden actions?"
145 - Why: prevents unsafe "delete DB to pass tests" behavior.
146
1475. `[important]` **Type discipline**
148 - "For Python projects, what is your stance on Optional/None? (forbid unless justified; require invalid states unrepresentable)"
149 - Why: shapes interface-contract requirements.
150
1516. `[important]` **Review workflow**
152 - "Stop at Template Delta Preview for approval, or write files and you review diffs?"
153 - Why: controls collaboration checkpoint.
154</question_examples>
155</common_questions>
156
157<base_template_sections>
158The base template MUST include these sections (in order):
159
1601. Identity and lifecycle
1612. Context
1623. Problem
1634. Goals / Non-goals
1645. Requirements (FRs / NFRs)
1656. Constraints and invariants (include DB + test integrity)
1667. Proposed design (architecture, contracts, schemas, idempotency/retries)
1678. Project common utilities that will be used.
1689. Project common utilities that will be created.
16910. Interface contracts (explicit signatures; Optional/None justification required)
17011. Alternatives considered (>=2)
17112. Test data acquisition plan (mandatory for external I/O / ETL)
17213. Testing and verification strategy (commands + CI gates + test integrity rules)
17314. Rollout / migration / ops (flags, backfills, observability, runbook)
17415. Open questions / follow-ups
17516. **Subtasks** (human-readable checklist for review)
176
177**Subtasks Section Format**:
178```markdown
179## Subtasks
180
181### T1: [Task Title]
182- **Summary**: One sentence objective
183- **Scope**: What's in / what's out
184- **Acceptance**: Binary pass/fail criteria
185- **Status**: [ ] Not started / [~] In progress / [x] Complete
186
187### T2: [Task Title]
188...
189```
190</base_template_sections>
191
192<guardrails>
193Include verbatim in the design doc skill you create under "Engineering Guardrails for Agent Execution":
194
195- **Reuse-first rule** (anti-duplication): search existing utilities; record decision per task.
196- **No destructive shortcuts**: never delete dev/prod data to pass tests; destructive actions require confirmation.
197- **Test integrity** (anti-mock-cheating): mock boundaries only; prefer record/replay; do not change tests without spec change approval.
198- **Signature discipline** (anti-vagueness): explicit types/invariants; Optional/None requires justification and handling strategy.
199- **Alternatives requirement**: evaluate >=2 alternatives + "do nothing".
200- **Uncertainty protocol**: ask `[blocking]` questions when unsure; do not proceed.
201</guardrails>
202
203
204<completion_criteria>
205- `design-docs/` exists with README + `active/` + `agents/` subdirectories
206- name of ${DESIGN_DOC_SKILL_NAME} confirmed with user.
207- `${DESIGN_DOC_SKILL_NAME}` skill exists at `.{AGENT_NAME}/skills/{DESIGN_DOC_SKILL_NAME}/`
208- Templates bundled at `.{AGENT_NAME}/skills/{DESIGN_DOC_SKILL_NAME}/templates/`
209- `base.md` includes guardrails and human-readable subtasks section format
210- At least one project-specific template variant exists with repo-specific test commands
211- Skill workflow: human-readable subtasks in main doc -> user approval -> XML in `design-docs/agents/`
212</completion_criteria>
213
214<decision_points>
215- No existing config directory -> create one for current agent
216- Multiple templates requested -> generate each as separate variant file
217- User wants immediate write vs preview -> honor preference from question 6
218</decision_points>
219
220<failure_modes>
221- Scan finds nothing -> ask user for stack/commands explicitly
222- Conflicting conventions -> note in template as "resolve before use"
223- Overwriting existing templates -> create backup with timestamp first
224</failure_modes>