$npx -y skills add MagicCube/agentara --skill spec-designGuides interactive module design via Q&A before writing. Use when the user wants to design a module, class, or feature together, or when they say "/spec-design".
| 1 | # Spec Design |
| 2 | |
| 3 | Guides a collaborative, question-first design process. **Do not write design docs until ambiguities are clarified.** |
| 4 | |
| 5 | ## Process |
| 6 | |
| 7 | ### Phase 1: Clarify First (Required) |
| 8 | |
| 9 | **Always start with clarifying questions.** Do not propose a design or write a doc until the user answers. |
| 10 | |
| 11 | Read relevant code (e.g. `docs/overview.md`, related `src/` modules, config) to ground your questions. Then ask questions in categories below. |
| 12 | |
| 13 | ### Phase 2: Question Categories |
| 14 | |
| 15 | Ask 1–2 questions per category as needed. Adapt to context; not all apply. |
| 16 | |
| 17 | | Category | Examples | |
| 18 | |----------|----------| |
| 19 | | **Path / terminology** | "You said directory—do you mean file? `resolveX()` returns a file path." | |
| 20 | | **Data flow** | "Where does X come from—caller, config, or generated internally?" | |
| 21 | | **Responsibilities** | "Is this a factory, a repository, or both? What does it own vs delegate?" | |
| 22 | | **Semantics** | "Does 'resume' mean load history into context, or just set a flag?" | |
| 23 | | **Concurrency** | "Same ID—allow multiple instances? Do we need caching?" | |
| 24 | | **Error handling** | "File missing on resume—throw or return Result? Overwrite on create?" | |
| 25 | | **Injection** | "Config via constructor injection or direct import?" | |
| 26 | |
| 27 | **If something contradicts existing code or docs, ask immediately.** |
| 28 | |
| 29 | ### Phase 3: Iterate |
| 30 | |
| 31 | - Answer user answers; refine or add questions if needed |
| 32 | - Proceed to writing only when the design is clear enough to implement |
| 33 | |
| 34 | ### Phase 4: Produce |
| 35 | |
| 36 | - Write design doc to `docs/designs/{module-name}.md` |
| 37 | - **Naming**: Use kebab-case from class/module name (e.g. `SessionManager` → `session-manager.md`) |
| 38 | - **Language**: English only |
| 39 | - **Style**: Concise. No filler. Bullets and short sentences. |
| 40 | |
| 41 | ## Output Format |
| 42 | |
| 43 | Design doc structure (adjust as needed): |
| 44 | |
| 45 | ```markdown |
| 46 | # {ModuleName} Design |
| 47 | |
| 48 | One-line summary. |
| 49 | |
| 50 | ## Dependencies |
| 51 | - Imports, paths, config |
| 52 | |
| 53 | ## API |
| 54 | - Method signatures and behavior |
| 55 | |
| 56 | ## Error Handling |
| 57 | - When to throw, no graceful fallback |
| 58 | |
| 59 | ## Concurrency / Constraints |
| 60 | - Single-writer, no cache, etc. |
| 61 | ``` |
| 62 | |
| 63 | ## Anti-Patterns |
| 64 | |
| 65 | - **Rushing to write**: Asking questions and writing in the same turn |
| 66 | - **Assuming**: Filling gaps without asking (e.g. "目录" vs "文件") |
| 67 | - **Over-specifying**: Adding details the user did not confirm |
| 68 | - **Chinese in design doc**: Keep design docs in English |