ai-spector 0.3.5 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/README.md +32 -21
  2. package/assets/themes/airbnb/DESIGN.md +246 -0
  3. package/assets/themes/airbnb/SUMMARY.md +7 -0
  4. package/assets/themes/airtable/DESIGN.md +89 -0
  5. package/assets/themes/airtable/SUMMARY.md +7 -0
  6. package/assets/themes/apple/DESIGN.md +313 -0
  7. package/assets/themes/apple/SUMMARY.md +7 -0
  8. package/assets/themes/binance/DESIGN.md +345 -0
  9. package/assets/themes/binance/SUMMARY.md +7 -0
  10. package/assets/themes/bmw/DESIGN.md +180 -0
  11. package/assets/themes/bmw/SUMMARY.md +7 -0
  12. package/assets/themes/bugatti/DESIGN.md +268 -0
  13. package/assets/themes/bugatti/SUMMARY.md +7 -0
  14. package/assets/themes/cal/DESIGN.md +259 -0
  15. package/assets/themes/cal/SUMMARY.md +7 -0
  16. package/assets/themes/claude/DESIGN.md +312 -0
  17. package/assets/themes/claude/SUMMARY.md +7 -0
  18. package/assets/themes/clay/DESIGN.md +304 -0
  19. package/assets/themes/clay/SUMMARY.md +7 -0
  20. package/assets/themes/clickhouse/DESIGN.md +281 -0
  21. package/assets/themes/clickhouse/SUMMARY.md +7 -0
  22. package/assets/themes/cohere/DESIGN.md +266 -0
  23. package/assets/themes/cohere/SUMMARY.md +7 -0
  24. package/assets/themes/coinbase/DESIGN.md +129 -0
  25. package/assets/themes/coinbase/SUMMARY.md +7 -0
  26. package/assets/themes/composio/DESIGN.md +307 -0
  27. package/assets/themes/composio/SUMMARY.md +7 -0
  28. package/assets/themes/cursor/DESIGN.md +309 -0
  29. package/assets/themes/cursor/SUMMARY.md +7 -0
  30. package/assets/themes/elevenlabs/DESIGN.md +265 -0
  31. package/assets/themes/elevenlabs/SUMMARY.md +7 -0
  32. package/assets/themes/expo/DESIGN.md +281 -0
  33. package/assets/themes/expo/SUMMARY.md +7 -0
  34. package/assets/themes/ferrari/DESIGN.md +314 -0
  35. package/assets/themes/ferrari/SUMMARY.md +7 -0
  36. package/assets/themes/framer/DESIGN.md +246 -0
  37. package/assets/themes/framer/SUMMARY.md +7 -0
  38. package/assets/themes/hashicorp/DESIGN.md +278 -0
  39. package/assets/themes/hashicorp/SUMMARY.md +7 -0
  40. package/assets/themes/ibm/DESIGN.md +332 -0
  41. package/assets/themes/ibm/SUMMARY.md +7 -0
  42. package/assets/themes/intercom/DESIGN.md +146 -0
  43. package/assets/themes/intercom/SUMMARY.md +7 -0
  44. package/assets/themes/kraken/DESIGN.md +125 -0
  45. package/assets/themes/kraken/SUMMARY.md +7 -0
  46. package/assets/themes/lamborghini/DESIGN.md +288 -0
  47. package/assets/themes/lamborghini/SUMMARY.md +7 -0
  48. package/assets/themes/linear.app/DESIGN.md +367 -0
  49. package/assets/themes/linear.app/SUMMARY.md +7 -0
  50. package/assets/themes/lovable/DESIGN.md +298 -0
  51. package/assets/themes/lovable/SUMMARY.md +7 -0
  52. package/assets/themes/meta/DESIGN.md +366 -0
  53. package/assets/themes/meta/SUMMARY.md +7 -0
  54. package/assets/themes/minimax/DESIGN.md +257 -0
  55. package/assets/themes/minimax/SUMMARY.md +7 -0
  56. package/assets/themes/mintlify/DESIGN.md +326 -0
  57. package/assets/themes/mintlify/SUMMARY.md +7 -0
  58. package/assets/themes/miro/DESIGN.md +108 -0
  59. package/assets/themes/miro/SUMMARY.md +7 -0
  60. package/assets/themes/mistral.ai/DESIGN.md +261 -0
  61. package/assets/themes/mistral.ai/SUMMARY.md +7 -0
  62. package/assets/themes/mongodb/DESIGN.md +266 -0
  63. package/assets/themes/mongodb/SUMMARY.md +7 -0
  64. package/assets/themes/nike/DESIGN.md +363 -0
  65. package/assets/themes/nike/SUMMARY.md +7 -0
  66. package/assets/themes/notion/DESIGN.md +309 -0
  67. package/assets/themes/notion/SUMMARY.md +7 -0
  68. package/assets/themes/nvidia/DESIGN.md +293 -0
  69. package/assets/themes/nvidia/SUMMARY.md +7 -0
  70. package/assets/themes/ollama/DESIGN.md +267 -0
  71. package/assets/themes/ollama/SUMMARY.md +7 -0
  72. package/assets/themes/opencode.ai/DESIGN.md +281 -0
  73. package/assets/themes/opencode.ai/SUMMARY.md +7 -0
  74. package/assets/themes/pinterest/DESIGN.md +230 -0
  75. package/assets/themes/pinterest/SUMMARY.md +7 -0
  76. package/assets/themes/playstation/DESIGN.md +364 -0
  77. package/assets/themes/playstation/SUMMARY.md +7 -0
  78. package/assets/themes/posthog/DESIGN.md +256 -0
  79. package/assets/themes/posthog/SUMMARY.md +7 -0
  80. package/assets/themes/raycast/DESIGN.md +268 -0
  81. package/assets/themes/raycast/SUMMARY.md +7 -0
  82. package/assets/themes/renault/DESIGN.md +311 -0
  83. package/assets/themes/renault/SUMMARY.md +7 -0
  84. package/assets/themes/replicate/DESIGN.md +261 -0
  85. package/assets/themes/replicate/SUMMARY.md +7 -0
  86. package/assets/themes/resend/DESIGN.md +303 -0
  87. package/assets/themes/resend/SUMMARY.md +7 -0
  88. package/assets/themes/revolut/DESIGN.md +185 -0
  89. package/assets/themes/revolut/SUMMARY.md +7 -0
  90. package/assets/themes/runwayml/DESIGN.md +244 -0
  91. package/assets/themes/runwayml/SUMMARY.md +7 -0
  92. package/assets/themes/sanity/DESIGN.md +357 -0
  93. package/assets/themes/sanity/SUMMARY.md +7 -0
  94. package/assets/themes/sentry/DESIGN.md +262 -0
  95. package/assets/themes/sentry/SUMMARY.md +7 -0
  96. package/assets/themes/shopify/DESIGN.md +350 -0
  97. package/assets/themes/shopify/SUMMARY.md +7 -0
  98. package/assets/themes/spacex/DESIGN.md +194 -0
  99. package/assets/themes/spacex/SUMMARY.md +7 -0
  100. package/assets/themes/spotify/DESIGN.md +246 -0
  101. package/assets/themes/spotify/SUMMARY.md +7 -0
  102. package/assets/themes/stripe/DESIGN.md +322 -0
  103. package/assets/themes/stripe/SUMMARY.md +7 -0
  104. package/assets/themes/supabase/DESIGN.md +255 -0
  105. package/assets/themes/supabase/SUMMARY.md +7 -0
  106. package/assets/themes/superhuman/DESIGN.md +252 -0
  107. package/assets/themes/superhuman/SUMMARY.md +7 -0
  108. package/assets/themes/tesla/DESIGN.md +286 -0
  109. package/assets/themes/tesla/SUMMARY.md +7 -0
  110. package/assets/themes/theverge/DESIGN.md +339 -0
  111. package/assets/themes/theverge/SUMMARY.md +7 -0
  112. package/assets/themes/together.ai/DESIGN.md +263 -0
  113. package/assets/themes/together.ai/SUMMARY.md +7 -0
  114. package/assets/themes/uber/DESIGN.md +295 -0
  115. package/assets/themes/uber/SUMMARY.md +7 -0
  116. package/assets/themes/vercel/DESIGN.md +310 -0
  117. package/assets/themes/vercel/SUMMARY.md +7 -0
  118. package/assets/themes/voltagent/DESIGN.md +323 -0
  119. package/assets/themes/voltagent/SUMMARY.md +7 -0
  120. package/assets/themes/warp/DESIGN.md +253 -0
  121. package/assets/themes/warp/SUMMARY.md +7 -0
  122. package/assets/themes/webflow/DESIGN.md +92 -0
  123. package/assets/themes/webflow/SUMMARY.md +7 -0
  124. package/assets/themes/wired/DESIGN.md +278 -0
  125. package/assets/themes/wired/SUMMARY.md +7 -0
  126. package/assets/themes/wise/DESIGN.md +173 -0
  127. package/assets/themes/wise/SUMMARY.md +7 -0
  128. package/assets/themes/x.ai/DESIGN.md +257 -0
  129. package/assets/themes/x.ai/SUMMARY.md +7 -0
  130. package/assets/themes/zapier/DESIGN.md +328 -0
  131. package/assets/themes/zapier/SUMMARY.md +7 -0
  132. package/dist/cli.js +55 -2
  133. package/dist/cli.js.map +1 -1
  134. package/dist/commands/analyze.d.ts +1 -1
  135. package/dist/commands/analyze.js +3 -3
  136. package/dist/commands/analyze.js.map +1 -1
  137. package/dist/commands/init.d.ts.map +1 -1
  138. package/dist/commands/init.js +7 -3
  139. package/dist/commands/init.js.map +1 -1
  140. package/dist/commands/prototype.d.ts +26 -0
  141. package/dist/commands/prototype.d.ts.map +1 -0
  142. package/dist/commands/prototype.js +150 -0
  143. package/dist/commands/prototype.js.map +1 -0
  144. package/dist/commands/sync-cursor.d.ts +1 -1
  145. package/dist/commands/sync-cursor.js +2 -2
  146. package/dist/commands/sync-cursor.js.map +1 -1
  147. package/dist/commands/validate.d.ts.map +1 -1
  148. package/dist/commands/validate.js +1 -1
  149. package/dist/commands/validate.js.map +1 -1
  150. package/dist/config/load.d.ts +3 -0
  151. package/dist/config/load.d.ts.map +1 -1
  152. package/dist/config/load.js +7 -0
  153. package/dist/config/load.js.map +1 -1
  154. package/dist/graph/doc-extract.d.ts.map +1 -1
  155. package/dist/graph/doc-extract.js +115 -102
  156. package/dist/graph/doc-extract.js.map +1 -1
  157. package/dist/markdown/parse.d.ts +25 -0
  158. package/dist/markdown/parse.d.ts.map +1 -0
  159. package/dist/markdown/parse.js +100 -0
  160. package/dist/markdown/parse.js.map +1 -0
  161. package/dist/prototype/build-manifest.d.ts +18 -0
  162. package/dist/prototype/build-manifest.d.ts.map +1 -0
  163. package/dist/prototype/build-manifest.js +79 -0
  164. package/dist/prototype/build-manifest.js.map +1 -0
  165. package/dist/prototype/config.d.ts +9 -0
  166. package/dist/prototype/config.d.ts.map +1 -0
  167. package/dist/prototype/config.js +64 -0
  168. package/dist/prototype/config.js.map +1 -0
  169. package/dist/prototype/parse-screen-index.d.ts +10 -0
  170. package/dist/prototype/parse-screen-index.d.ts.map +1 -0
  171. package/dist/prototype/parse-screen-index.js +96 -0
  172. package/dist/prototype/parse-screen-index.js.map +1 -0
  173. package/dist/prototype/themes.d.ts +6 -0
  174. package/dist/prototype/themes.d.ts.map +1 -0
  175. package/dist/prototype/themes.js +55 -0
  176. package/dist/prototype/themes.js.map +1 -0
  177. package/dist/prototype/types.d.ts +49 -0
  178. package/dist/prototype/types.d.ts.map +1 -0
  179. package/dist/prototype/types.js +2 -0
  180. package/dist/prototype/types.js.map +1 -0
  181. package/dist/prototype/validate.d.ts +16 -0
  182. package/dist/prototype/validate.d.ts.map +1 -0
  183. package/dist/prototype/validate.js +82 -0
  184. package/dist/prototype/validate.js.map +1 -0
  185. package/dist/types.d.ts +1 -1
  186. package/dist/types.d.ts.map +1 -1
  187. package/dist/visualize/html.d.ts.map +1 -1
  188. package/dist/visualize/html.js +492 -282
  189. package/dist/visualize/html.js.map +1 -1
  190. package/package.json +8 -2
  191. package/scaffold/.ai-spector/.docflow/config/prototype.config.json +9 -0
  192. package/scaffold/cursor/WORKFLOW.md +63 -0
  193. package/scaffold/cursor/commands/_cli-failures.md +3 -149
  194. package/scaffold/cursor/commands/_workflow.md +9 -8
  195. package/scaffold/cursor/mcp.json +1 -15
  196. package/scaffold/cursor/skills/README.md +34 -0
  197. package/scaffold/cursor/skills/_skill-router.md +33 -14
  198. package/scaffold/cursor/skills/ai-spector/SKILL.md +31 -30
  199. package/scaffold/cursor/skills/ai-spector/references/cli-failures.md +185 -0
  200. package/scaffold/cursor/skills/ai-spector/references/generate-graph.md +130 -0
  201. package/scaffold/cursor/skills/ai-spector/references/generate-workflow.md +120 -0
  202. package/scaffold/cursor/{commands/_graph.md → skills/ai-spector/references/graph.md} +3 -4
  203. package/scaffold/cursor/{commands/_prerequisites.md → skills/ai-spector/references/prerequisites.md} +3 -3
  204. package/scaffold/cursor/skills/ai-spector/references/project-conventions.md +27 -0
  205. package/scaffold/cursor/skills/ai-spector-generate/SKILL.md +13 -33
  206. package/scaffold/cursor/skills/ai-spector-generate-basic-design/SKILL.md +33 -0
  207. package/scaffold/cursor/skills/ai-spector-generate-basic-design/references/runbook.md +83 -0
  208. package/scaffold/cursor/skills/ai-spector-generate-detail-design/SKILL.md +32 -0
  209. package/scaffold/cursor/skills/ai-spector-generate-detail-design/references/runbook.md +60 -0
  210. package/scaffold/cursor/skills/ai-spector-generate-prototype/SKILL.md +34 -0
  211. package/scaffold/cursor/skills/ai-spector-generate-prototype/references/runbook.md +113 -0
  212. package/scaffold/cursor/skills/ai-spector-generate-srs/SKILL.md +35 -0
  213. package/scaffold/cursor/skills/ai-spector-generate-srs/references/runbook.md +69 -0
  214. package/scaffold/cursor/skills/ai-spector-graph/SKILL.md +33 -26
  215. package/scaffold/cursor/skills/ai-spector-graph/references/analyze.md +86 -0
  216. package/scaffold/cursor/skills/ai-spector-graph/references/graph-commands.md +15 -0
  217. package/scaffold/cursor/{commands → skills/ai-spector-graph/references}/impact.md +3 -3
  218. package/scaffold/cursor/{commands → skills/ai-spector-graph/references}/index.md +7 -15
  219. package/scaffold/cursor/{commands → skills/ai-spector-graph/references}/link-graph.md +2 -2
  220. package/scaffold/cursor/{commands → skills/ai-spector-graph/references}/summary.md +1 -1
  221. package/scaffold/cursor/{commands → skills/ai-spector-graph/references}/sync-graph.md +2 -2
  222. package/scaffold/cursor/{commands → skills/ai-spector-graph/references}/validate-graph.md +3 -3
  223. package/scaffold/cursor/{commands → skills/ai-spector-graph/references}/visualize-graph.md +2 -2
  224. package/scaffold/cursor/skills/ai-spector-resolve-comments/SKILL.md +18 -29
  225. package/scaffold/cursor/{commands/resolve-comments.md → skills/ai-spector-resolve-comments/references/runbook.md} +2 -2
  226. package/scaffold/docs/data-source/README.md +2 -2
  227. package/scaffold/prototype/CLAUDE.md +7 -0
  228. package/scaffold/prototype/README.md +34 -0
  229. package/scaffold/prototype/manifest.json +6 -0
  230. package/scaffold/prototype/screen-map.json +6 -0
  231. package/scaffold/prototype/src/.gitkeep +0 -0
  232. package/scaffold/cursor/commands/_generate-graph.md +0 -150
  233. package/scaffold/cursor/commands/analyze.md +0 -112
  234. package/scaffold/cursor/commands/generate-basic-design.md +0 -165
  235. package/scaffold/cursor/commands/generate-detail-design.md +0 -19
  236. package/scaffold/cursor/commands/generate-srs.md +0 -183
  237. package/scaffold/cursor/commands/graph-impact.md +0 -5
@@ -0,0 +1,185 @@
1
+ # CLI and tool failures (mandatory agent behavior)
2
+
3
+ When any `ai-spector` command **fails** (non-zero exit, throws, or empty/invalid JSON when `--json` was required), or a **required tool** fails unexpectedly (MCP, terminal, network):
4
+
5
+ 1. **Pause** the current step — no templates, no subagents, no writing `docs/srs/**`, no silent fallbacks.
6
+ 2. **Report** using the response format below (verbatim CLI/tool output).
7
+ 3. **Offer recovery** — always present **fix and retry** (recommended) and, when safe, a **bounded workaround** the agent can execute if the user approves.
8
+ 4. **Wait for the user** (or apply [auto-fix without asking](#agent-may-fix-without-asking-small-local) only for trivial local fixes).
9
+ 5. After fix or approved workaround, **continue the same task** from the failed step (re-run the same CLI when possible).
10
+
11
+ **Default:** fix and retry. **Workarounds** are allowed only with explicit user approval and the guardrails in [Workaround catalog](#workaround-catalog-user-approval-required).
12
+
13
+ ---
14
+
15
+ ## Recovery flow
16
+
17
+ ```text
18
+ Tool/CLI fails
19
+ → pause + report (Blocked format)
20
+ → propose Option 1 (fix & retry) + Option 2 (workaround, if any) + Option 3 (pause)
21
+ → user picks (or auto-fix for trivial cases)
22
+ → execute choice → re-run same CLI at next checkpoint when possible
23
+ ```
24
+
25
+ | User says | Agent does |
26
+ |-----------|------------|
27
+ | **1**, “fix”, “retry”, “yes fix” | Apply fix steps (or ask for one missing input), re-run **the same** failed command/step |
28
+ | **2**, “workaround”, “continue anyway” | Follow [Workaround catalog](#workaround-catalog-user-approval-required); state trade-offs; merge/validate when writing docs |
29
+ | **3**, “pause”, “stop”, no reply yet | Stop; do not generate or bulk-read docs; user re-runs the task later |
30
+ | “you figure it out” / “use your judgment” | Prefer **fix and retry** first; if blocked after one retry, propose the **smallest** approved workaround and ask once |
31
+
32
+ Do **not** leave the user stuck with only “run `/analyze` again” when you can propose a concrete fix **or** a bounded workaround.
33
+
34
+ ---
35
+
36
+ ## Forbidden (unless user explicitly approves a workaround)
37
+
38
+ | Do not | Why |
39
+ |--------|-----|
40
+ | Hand-edit `traceability.graph.json` at scale | Bypasses merge/validate; drifts from `knowledge.json` |
41
+ | Implement graph BFS/search in the agent | Duplicates `graph query` / `graph impact` |
42
+ | Glob or read all of `docs/srs/**` because query failed | Hides missing graph or bad seed id |
43
+ | Use `.ai-spector/index/*.md` as **primary** context when validate/query failed | Index is fallback only after **successful** CLI with thin graph |
44
+ | Skip `graph merge` and “fill SRS from memory” | Breaks traceability |
45
+ | Silently continue after `graph validate` errors | Generation will be wrong or inconsistent |
46
+ | Tell the user “run this CLI yourself” without offering to run it | Agent owns CLI in this workflow |
47
+ | Continue generation after CLI failure **without** user choosing fix, workaround, or pause | User must not be blocked silently or bypassed silently |
48
+
49
+ **Allowed after successful CLI:** If `graph query --json` succeeds but `nodes` has no domain entries, say so and suggest **analyze** — still do not bulk-read `docs/srs/**`.
50
+
51
+ ---
52
+
53
+ ## Response format (copy this structure)
54
+
55
+ ```markdown
56
+ ## Blocked: <task or slash-command> — <CLI | tool> failed
57
+
58
+ **Command / tool:** `ai-spector <subcommand> …` or `<MCP tool name>`
59
+ **Exit code:** <n> (if applicable)
60
+
61
+ **Output:**
62
+ \`\`\`
63
+ <paste full stdout/stderr or tool error>
64
+ \`\`\`
65
+
66
+ **What this means:** <one or two sentences>
67
+
68
+ **How to fix (recommended):**
69
+ 1. <step agent or user can take>
70
+ 2. <step>
71
+ 3. Re-run the same step: `<exact command>` or **/<slash-command>**
72
+
73
+ **Workaround (optional):** <only if bounded and useful — e.g. “read these 2 projection paths and draft section X; merge after index recovers”>
74
+ **Trade-off if workaround:** <traceability / staleness risk in plain language>
75
+
76
+ **What would you like to do?**
77
+ 1. **Fix and retry** (recommended) — <one-line summary of fix path>
78
+ 2. **Workaround** — <one-line summary; skip only if none applies>
79
+ 3. **Pause** — stop here; you fix environment and say “retry” or re-run the task
80
+
81
+ Reply with **1**, **2**, **3**, or tell me your preference.
82
+ ```
83
+
84
+ For **optional** steps (e.g. `graph visualize --open`), you may use a shorter **Interrupted** header but still offer fix vs skip.
85
+
86
+ ---
87
+
88
+ ## Workaround catalog (user approval required)
89
+
90
+ Use only when the user chooses **2** or explicitly accepts the trade-off. Prefer the **smallest** scope that unblocks the task; return to CLI as soon as it works.
91
+
92
+ | Situation | Workaround | Guardrails | Restore traceability |
93
+ |-----------|------------|------------|----------------------|
94
+ | `graph query` fails once (cwd, typo) | Fix cwd/seed id; one retry | No doc writes until query succeeds | Re-run query before write |
95
+ | `graph query` OK but thin `nodes` | Read only `projectionPaths` + cited `docs/data-source/**` | Named paths only; no `docs/srs/**` glob | `graph merge` + `validate` after draft |
96
+ | `graph validate` — one bad id/edge | Patch **single** node/edge; re-validate | No mass graph surgery | `validate` must pass before next wave |
97
+ | `graph merge` — one bad `listedInSection` | Fix id in `knowledge.json`; re-merge | No hand-merge of full graph | Same |
98
+ | `index` fails on one path | Skip that path if command allows; fix path and re-index | Do not skip required wave index without user OK | Re-run **index** for skipped paths |
99
+ | Optional visualize fails | Skip open; continue pipeline | User chose workaround | None |
100
+ | Terminal/env (not git, missing `uv`) | Agent runs install/init steps user approves | No destructive deletes without ask | Re-run failed CLI |
101
+ | Generation blocked only by **upstream** missing SRS | User approves generating prerequisite layer first | Run prerequisite wave with normal merge/validate | Full pipeline order |
102
+
103
+ After any workaround that wrote docs or graph patches: **`graph validate`** (and **`index`** when the command doc requires) before the next wave.
104
+
105
+ ---
106
+
107
+ ## Common failures → fixes
108
+
109
+ ### `ai-spector: command not found`
110
+
111
+ - **Means:** Package not installed or not on PATH.
112
+ - **Fix:** `npm install ai-spector` in the project; agent uses `npx ai-spector …` from project root.
113
+
114
+ ### `Could not find project root` / missing `docflow.config.json`
115
+
116
+ - **Means:** `init` not run or wrong working directory.
117
+ - **Fix:** Run `npx ai-spector init` from project root; agent `cd`s to workspace root before CLI.
118
+
119
+ ### `ai-spector analyze` fails
120
+
121
+ - **Means:** Registry/templates or graph bootstrap broke.
122
+ - **Fix:** Show full error; check `.ai-spector/registry/section-registry.json` exists; re-run `init` if config is corrupt; do not proceed to merge.
123
+
124
+ ### `graph merge` — `No domain entries in knowledge.json`
125
+
126
+ - **Means:** Analyze extract did not populate staging.
127
+ - **Fix:** Re-run `/analyze`; ensure `docs/data-source/` has real markdown files with UC/F/actor content; fill `knowledge.json` with at least one `useCase` or `feature`.
128
+ - **Workaround (user OK):** Manually add minimal entries to `knowledge.json` then re-merge.
129
+
130
+ ### `graph merge` — `Merge edge missing target node` / section id
131
+
132
+ - **Means:** `listedInSection` points to a section id not in the graph.
133
+ - **Fix:** Use a section id from `section-registry.json` (e.g. `sec.srs.3-use-cases.l3.3.32-list-use-case`) or omit `listedInSection` for defaults; re-run merge.
134
+
135
+ ### `graph validate` — `DOC-SECTION-COVERAGE` on `doc.bd.list-api` / `doc.bd.list-screen` / `doc.bd.db-design`
136
+
137
+ - **Means:** Basic-design **list chapter** documents exist in the graph without child `section` nodes (common after a projection-only `graph merge` before bootstrap/index).
138
+ - **Fix:** From project root run **`npx ai-spector index`** (or ask to **refresh index**). Ensure `.ai-spector/templates/basic_design/` exists (`npx ai-spector init`). Then re-run **`graph merge`** for your patch and **`graph validate`**.
139
+
140
+ ### `graph validate` — `DOMAIN-ANCHORED` / `SECTION-TREE` / `SCHEMA`
141
+
142
+ - **Means:** Graph inconsistent with rules.
143
+ - **Fix:** Paste each `[ERROR]` line; prefer re-run **analyze** (merge) over manual JSON surgery; for one bad id, agent may patch **only** that node/edge then re-validate.
144
+
145
+ ### `graph query <id>` — seed missing or empty subgraph
146
+
147
+ - **Means:** Wrong id, or domain not merged.
148
+ - **Fix:** Run **visualize-graph** or `graph query` with a known id from `knowledge.json`; run **analyze** if no `useCase`/`feature` nodes.
149
+
150
+ ### `graph query` — invalid JSON / parse error
151
+
152
+ - **Means:** CLI crashed or wrong cwd.
153
+ - **Fix:** Re-run from project root; if repeat, report as tool bug with full stderr.
154
+
155
+ ### `graph impact --git` — not a git repository / no changes
156
+
157
+ - **Means:** `--git` needs a git working tree with staged or unstaged diffs.
158
+ - **Fix:** Initialize git (`git init`) and make edits, or use **impact** with a short description, editor selection, or `--file` / `--heading` instead of `--git`.
159
+
160
+ ### `graph impact --git` — could not map diff to graph seeds
161
+
162
+ - **Means:** Changed paths are not linked to `document` / `section` nodes (e.g. only `README.md` or `src/`).
163
+ - **Fix:** Run impact on doc paths under `docs/` or `.ai-spector/`; or **impact** with a short description of the traceability change.
164
+
165
+ ### Stale graph or indexes after manual edits or generate SRS
166
+
167
+ - **Means:** User changed `docs/data-source/`, SRS outputs, or templates without re-running ingest; graph still shows template-only domain nodes.
168
+ - **Fix:** Run **`ai-spector index`**. For fully stale domain detail, re-run **`/analyze`** → fresh `knowledge.json`.
169
+
170
+ ---
171
+
172
+ ## Agent may fix without asking (small, local)
173
+
174
+ - Create missing parent dirs under `.ai-spector/` if `init` was incomplete.
175
+ - Correct a **single** typo in `knowledge.json` id or `listedInSection` then re-run `graph merge`.
176
+ - Re-run the **same** failed command once after an obvious fix (e.g. `cd` to project root).
177
+ - Wrong CLI flags the agent introduced — fix and retry immediately.
178
+
179
+ ## Agent must ask user before
180
+
181
+ - Deleting `traceability.graph.json` or re-running `init --force`.
182
+ - Large manual edits to graph or generated SRS.
183
+ - Changing bundled templates or `workflow.dependencies.json`.
184
+ - Any [workaround](#workaround-catalog-user-approval-required) not listed above or that skips **validate** before the next generation wave.
185
+ - Bulk reads under `docs/srs/**` or `docs/basic-design/**` as primary context.
@@ -0,0 +1,130 @@
1
+ # Graph-first generation (shared)
2
+
3
+ Used by **SRS**, **basic design**, and **detail design** generation skills.
4
+
5
+ | Orchestration (scope, confirm, wave checklist, finish) | [generate-workflow.md](./generate-workflow.md) |
6
+ | Per-command DAG + intent tables | each skill's `references/runbook.md` |
7
+
8
+ **Principle:** Accuracy over speed. The graph is the planner, context loader, and registry of what was written.
9
+
10
+ **Parallelism:** Allowed **only inside a DAG wave**. Never across waves.
11
+
12
+ ## Edge presets (use these in queries — don't copy-paste long lists)
13
+
14
+ | Preset name | Edges | Use for |
15
+ |-------------|-------|---------|
16
+ | `CONTEXT` | `listedIn,definedIn,describedIn,satisfies,dependsOn,rendersTo,partOf,contains` | Target neighborhood — what exists and where it lives |
17
+ | `DEPS` | `rendersTo,dependsOn,listedIn,satisfies,partOf,contains` | Dependency context — what upstream docs look like |
18
+ | `IMPACT` | `satisfies,tracesTo,dependsOn,references,relatesTo` | What a change would affect |
19
+
20
+ ## Agent rules
21
+
22
+ 1. **Plan from DAG** — build waves from `dag.*.json`; map each DAG node → graph seed via `dag.*.graph-seeds.json`.
23
+ 2. **Context before write** — for **every** target run the CONTEXT query; read `projectionPaths`. No invented UC/F text.
24
+ 3. **Merge once per wave, not per file** — write all files in a wave, then do one batch merge + one validate. Do not merge after every file.
25
+ 4. **No shortcuts** — no glob `docs/srs/**`, no skipping validate, no batching targets that have a DAG dependency on each other.
26
+
27
+ ## CLI workflow
28
+
29
+ ### A. Gate (once per command)
30
+
31
+ ```bash
32
+ ai-spector graph validate
33
+ ```
34
+
35
+ ### B. Plan — waves
36
+
37
+ Assign each DAG node to wave `0`, `1`, `2`, …:
38
+
39
+ - **Wave 0:** nodes with empty `dependsOn`
40
+ - **Wave k:** nodes whose `dependsOn` are all in waves `< k`
41
+
42
+ **Same wave = parallel OK.** Example: after `srs.feature-details`, both `srs.data-requirements` and `srs.external-interfaces` are in the same wave → generate both in one batch.
43
+
44
+ Present plan as:
45
+
46
+ | Wave | DAG ids (parallel OK) | Seeds | Blocked until |
47
+ |------|----------------------|-------|---------------|
48
+ | 0 | … | … | — |
49
+ | 1 | … | … | wave 0 merged + validate |
50
+
51
+ ### C. Before writing each target
52
+
53
+ **Dependency context** (once per wave, for each DAG `dependsOn`):
54
+
55
+ ```bash
56
+ ai-spector graph query <depSeedId> --direction both --depth 2 --edges DEPS --json
57
+ ```
58
+
59
+ **Target neighborhood:**
60
+
61
+ ```bash
62
+ ai-spector graph query <targetSeedId> --direction both --depth 4 --edges CONTEXT --json
63
+ ```
64
+
65
+ **When regenerating** (unsure what changed):
66
+
67
+ ```bash
68
+ ai-spector graph impact <targetSeedId> --change content_change --json
69
+ ```
70
+
71
+ ### D. Write
72
+
73
+ - Read template from `.ai-spector/templates/` (DAG `template` field). If missing → stop and ask user to run `npx ai-spector init`.
74
+ - Fill for this target only; keep all required headings; replace placeholders with graph-backed content.
75
+ - Cross-check every UC/F reference against `nodes` from query JSON.
76
+ - Add section anchors `<!-- section:sec.... -->` where templates expect them.
77
+
78
+ ### E. Ingest (once per wave — not per file)
79
+
80
+ After **all files in a wave** are written, write a single patch covering the whole wave:
81
+
82
+ ```json
83
+ {
84
+ "version": 1,
85
+ "nodes": [],
86
+ "edges": [
87
+ { "type": "rendersTo", "from": "doc.srs.3-use-cases", "to": "docs/srs/3-use-cases.md" },
88
+ { "type": "dependsOn", "from": "doc.srs.3-use-cases", "to": "doc.srs.1-introduction" }
89
+ ]
90
+ }
91
+ ```
92
+
93
+ ```bash
94
+ ai-spector graph merge .ai-spector/.docflow/extract/projection-patch.json
95
+ ai-spector graph validate
96
+ ```
97
+
98
+ Then — for SRS and basic-design waves — run index before starting the next wave:
99
+
100
+ ```bash
101
+ ai-spector index
102
+ ```
103
+
104
+ **Exception:** if a file within the wave is a dependency for another file in the **same** wave (unusual — check the DAG), merge that file's `rendersTo` before writing the dependent. For standard DAGs this never happens within a wave.
105
+
106
+ ### F. Per-domain detail files
107
+
108
+ For `mode: perFeature` / `perDomain` (SRS):
109
+
110
+ - Seed = domain id (`UC-01`, `F-01`), not only chapter document.
111
+ - Query with `--depth 4` + CONTEXT edges; include inbound `satisfies`.
112
+ - Batch all per-domain files in their wave; merge all `rendersTo` once at wave end.
113
+
114
+ For `mode: perEndpoint` / `perScreen` (basic design):
115
+
116
+ - **perEndpoint:** read `docs/basic-design/api-list.md` §3; one file per row under `docs/basic-design/api/<slug>.md`.
117
+ - **perScreen:** read `docs/basic-design/list-screens.md` §4; one file per screen under `docs/basic-design/screens/<slug>.md`.
118
+ - Ingest `doc.bd.api-*` / `doc.bd.screen-*` with `contains` from list chapter in the wave-end merge.
119
+
120
+ ## Accuracy checklist
121
+
122
+ - [ ] `graph query` run for target and every DAG dependency with existing files
123
+ - [ ] All UC/F ids in markdown exist as graph nodes
124
+ - [ ] Wave-end `rendersTo` + `dependsOn` merged in one patch
125
+ - [ ] `graph validate` passes before next wave
126
+ - [ ] No placeholder lorem / empty tables unless marked TBD in `gaps.json`
127
+
128
+ ## On CLI failure
129
+
130
+ [cli-failures.md](./cli-failures.md) — pause; offer fix / workaround / pause; do not generate from memory.
@@ -0,0 +1,120 @@
1
+ # Document generation workflow (shared)
2
+
3
+ Used by **SRS**, **basic design**, and **detail design** generation skills.
4
+
5
+ | Topic | Document |
6
+ |-------|----------|
7
+ | Graph query, merge patch shape, waves algorithm | [generate-graph.md](./generate-graph.md) |
8
+ | CLI failure recovery (fix / workaround / pause) | [cli-failures.md](./cli-failures.md) |
9
+ | Layer-specific DAG, intent tables, waves | each skill’s `references/runbook.md` |
10
+
11
+ **Not used by** HTML prototype generation (`ai-spector-generate-prototype` runbook).
12
+
13
+ ## Philosophy
14
+
15
+ - **Accuracy over speed** — full graph context before every write; ingest before the next wave.
16
+ - **Graph in, graph out** — query neighbors + dependencies before; `rendersTo` + `dependsOn` after ([generate-graph.md](./generate-graph.md) § E).
17
+ - **Parallel when safe** — only targets in the **same DAG wave** with dependencies already merged + validated (and **indexed** when the command doc requires it).
18
+
19
+ ## Scope — three ways to choose targets
20
+
21
+ Each generate command defines its DAG and intent hints. The pattern is always:
22
+
23
+ | Case | User input | Agent behavior |
24
+ |------|------------|----------------|
25
+ | **1 — All** | “generate all SRS” / full layer | Plan every DAG node (+ per-domain expansions). Respect `good` on disk unless user asked to regenerate. |
26
+ | **2 — Explicit paths** | paths in chat (`docs/…/file.md`) | Map paths → DAG nodes → seeds. Include **dependency closure**. Batch only within the same wave. |
27
+ | **3 — Words** | “API list and screens” | Proposed scope table → **user confirms** → generate. **Do not write until approved.** |
28
+
29
+ Paths are repo-relative. Mixed args: treat paths as case 2, free text as case 3.
30
+
31
+ ## Case 3 — confirm before write (mandatory)
32
+
33
+ 1. Parse the request against that command’s `dag.*.json`, `dag.*.graph-seeds.json`, and graph domain nodes.
34
+ 2. Build a **proposed scope** table (columns: DAG id, output path, seed, reason, prerequisites / deps).
35
+ 3. Include **dependency closure** — ancestors that are `missing_file` / `missing_content` run in earlier waves unless the user skips deps.
36
+ 4. Ask:
37
+
38
+ ```text
39
+ I plan to generate the following (N items, waves X–Y). Prerequisites run first.
40
+ Reply **yes** to proceed, **no** to cancel, or edit the list.
41
+ ```
42
+
43
+ 5. **Stop** without explicit **yes**. Do not write on assumption.
44
+ 6. If ambiguous (e.g. “features” = list vs all detail files), ask **one** clarifying question before the table.
45
+
46
+ Command-specific phrase → DAG mappings live in each `generate-*.md` (not here).
47
+
48
+ ## Prerequisites (all DAG generate commands)
49
+
50
+ 1. Merged graph — normally after **analyze** (data-source ingest).
51
+ 2. Gate:
52
+
53
+ ```bash
54
+ ai-spector graph validate
55
+ ```
56
+
57
+ On errors, pause and follow recovery in [cli-failures.md](./cli-failures.md).
58
+
59
+ 3. `workflow.dependencies.json` entry for that command (SRS minimum, etc.).
60
+
61
+ ## Plan (once per invocation)
62
+
63
+ 1. **Select targets** (case 1 / 2 / 3; case 3 = confirm first).
64
+ 2. Topological sort selected nodes + required dependency ancestors.
65
+ 3. Map each node via `dag.*.graph-seeds.json` → query seeds + ingest document ids.
66
+ 4. Classify disk per output: `good` | `missing_content` | `missing_file` — do not overwrite `good` without user intent.
67
+ 5. Assign **waves** ([generate-graph.md](./generate-graph.md) § Waves). Present wave table (brief for cases 1–2; case 3 table already confirmed).
68
+
69
+ ## Per wave, then per target
70
+
71
+ For **each wave** in order:
72
+
73
+ ### Wave checklist
74
+
75
+ ```
76
+ - [ ] All targets in this wave identified (parallel OK within wave only)
77
+ - [ ] For each target: graph query deps + target (_generate-graph § C)
78
+ - [ ] Read template from .ai-spector/templates/ — never invent structure
79
+ - [ ] Write file(s)
80
+ - [ ] Merge projection patch (rendersTo + dependsOn) for this wave
81
+ - [ ] ai-spector graph validate — pass before next wave
82
+ - [ ] ai-spector index when command doc requires (basic design: every wave; SRS: see generate-srs.md)
83
+ ```
84
+
85
+ ### Per target (summary)
86
+
87
+ Details: [generate-graph.md](./generate-graph.md) § C–E.
88
+
89
+ 1. **Query** — dependency seeds (depth 2) + target seed (depth 4); `graph impact` when regenerating.
90
+ 2. **Read** — `projectionPaths` and cited `docs/data-source/**` only; no glob of entire `docs/`.
91
+ 3. **Write** — from DAG template; graph-backed UC/F/API/screen names only.
92
+ 4. **Ingest** — merge patch; validate before leaving the wave.
93
+
94
+ **Forbidden:** targets from different waves in one batch; next wave before merge + validate; skipping `rendersTo` on generated docs.
95
+
96
+ ### Log (optional)
97
+
98
+ Append one line per target to `.ai-spector/.docflow/logs/generate-<layer>.log` (create dir if needed): timestamp, seed, path, validate OK.
99
+
100
+ ## Finish (end of command)
101
+
102
+ 1. `ai-spector graph validate`
103
+ 2. `ai-spector index` if not already run after the last wave (required for SRS — see `generate-srs.md`)
104
+ 3. Suggest the command doc’s summary command (`/summary srs`, `/summary basic-design`, …) when listed there
105
+ 4. Optional: `/visualize-graph` for review
106
+
107
+ Index flags: `--skip-doc-semantics` to skip UC/F body parsing; `--graph-only` for structure + merge only.
108
+
109
+ ## Guardrails
110
+
111
+ - **Parallel only within a wave** — never across waves; never when A `dependsOn` B in the DAG.
112
+ - **Every target** gets its own `graph query` + dependency queries before write.
113
+ - **Every wave** ends with merge + validate (and **index** when the command doc says so) before the next wave.
114
+ - **Case 3** requires explicit user **yes** before any write.
115
+ - On `graph query` / `merge` / `validate` / `index` failure → pause and recover per [cli-failures.md](./cli-failures.md).
116
+ - Prefer graph `nodes`/`edges` over stale `knowledge.json` for generation text.
117
+
118
+ ## If blocked
119
+
120
+ [cli-failures.md](./cli-failures.md). Re-run the same task after fixes. Common upstream fix: **analyze** first, or generate SRS before basic design.
@@ -1,20 +1,19 @@
1
1
  # Graph CLI (for agents)
2
2
 
3
- **Users do not run these.** Slash commands invoke CLI. Workflow: [_workflow.md](./_workflow.md). **On failure:** [_cli-failures.md](./_cli-failures.md).
3
+ **Users do not run these.** Slash commands invoke CLI. Workflow: [_workflow.md](./_workflow.md). **On failure:** [cli-failures.md](./cli-failures.md).
4
4
 
5
5
  Run from project root: `npx ai-spector …` if needed.
6
6
 
7
7
  ## Every CLI invocation
8
8
 
9
9
  1. Run the command; capture **exit code**, **stdout**, **stderr**.
10
- 2. If non-zero or `--json` is unparseable → **stop**; report per `_cli-failures.md`.
10
+ 2. If non-zero or `--json` is unparseable → **pause**; report and offer fix / workaround / pause per `cli-failures.md`.
11
11
  3. On success, use CLI output only — do not re-derive graph state in the agent.
12
12
 
13
13
  ## Commands
14
14
 
15
15
  ```bash
16
16
  ai-spector analyze
17
- ai-spector graphify update
18
17
  ai-spector graph merge --from-knowledge
19
18
  ai-spector graph validate
20
19
  ai-spector graph visualize [--open]
@@ -32,7 +31,7 @@ ai-spector graph query <depDocId> --edges rendersTo,dependsOn,listedIn,satisfies
32
31
  ai-spector graph impact <seedId> --change content_change --json
33
32
  ```
34
33
 
35
- **Generate:** query **before** write; **`graph merge`** projection patch **after** each file (`rendersTo` + `dependsOn`). See `_generate-graph.md`.
34
+ **Generate:** query **before** write; **`graph merge`** projection patch **after** each file (`rendersTo` + `dependsOn`). See `generate-graph.md`.
36
35
 
37
36
  Use `projectionPaths`, `nodes`, `edges` from JSON. **If command fails or JSON invalid:** stop — do not glob `docs/srs/**`.
38
37
 
@@ -1,13 +1,13 @@
1
1
  # Workflow prerequisites (shared)
2
2
 
3
- User workflow: [**_workflow.md**](./_workflow.md). **CLI failures:** [**_cli-failures.md**](./_cli-failures.md). Agent CLI: [**_graph.md**](./_graph.md).
3
+ User workflow: [**_workflow.md**](./_workflow.md). **CLI failures:** [**cli-failures.md**](./cli-failures.md). Agent CLI: [**_graph.md**](./_graph.md).
4
4
 
5
5
  Load `.ai-spector/.docflow/config/workflow.dependencies.json` for the active step.
6
6
 
7
7
  ## When checks fail
8
8
 
9
9
  1. **Stop immediately** — do not read `.ai-spector/templates/`, spawn subagents, or write outputs.
10
- 2. Reply with the **Blocked** format in [_cli-failures.md](./_cli-failures.md) (include full CLI output).
10
+ 2. Reply with the **Blocked** format in [cli-failures.md](./cli-failures.md) (include full CLI output; offer fix / workaround / pause).
11
11
  3. Help the user fix the issue; re-run the failed CLI; then continue the slash command.
12
12
 
13
13
  ## Graph context (only after CLI succeeds)
@@ -16,7 +16,7 @@ Load `.ai-spector/.docflow/config/workflow.dependencies.json` for the active ste
16
16
  2. Per target: **`ai-spector graph query <seedId> --json`** — parse JSON; use `projectionPaths` and `nodes`.
17
17
  3. Open **only** those paths (+ targeted `docs/data-source/**` if still insufficient).
18
18
 
19
- **If validate or query fails:** follow [_cli-failures.md](./_cli-failures.md) — do **not** fall back to index or full-tree reads.
19
+ **If validate or query fails:** follow [cli-failures.md](./cli-failures.md) — do **not** fall back to index or full-tree reads unless the user approves a listed workaround.
20
20
 
21
21
  **If query succeeds but has no domain nodes:** tell the user; suggest **`/analyze`** — still no `docs/srs/**` glob.
22
22
 
@@ -0,0 +1,27 @@
1
+ # AI Spector project conventions
2
+
3
+ ## Init and upgrades
4
+
5
+ ```bash
6
+ npx ai-spector init # first time
7
+ npx ai-spector sync-cursor # refresh commands/skills after package upgrade
8
+ ```
9
+
10
+ Missing templates → `npx ai-spector init --force`.
11
+
12
+ ## Document layers
13
+
14
+ | Layer | Directory |
15
+ |-------|-----------|
16
+ | Source input | `docs/data-source/` |
17
+ | SRS | `docs/srs/` |
18
+ | Basic design | `docs/basic-design/` |
19
+ | Detail design | `docs/detail-design/` |
20
+ | HTML prototype | `prototype/src/` |
21
+
22
+ ## Generation discipline (all layers)
23
+
24
+ 1. Read template from `.ai-spector/templates/` — never invent section structure.
25
+ 2. Query graph before writing (`ai-spector graph query`).
26
+ 3. Merge projection patches after each wave (`graph merge`).
27
+ 4. Validate when the command doc requires it.
@@ -1,41 +1,21 @@
1
1
  ---
2
2
  name: ai-spector-generate
3
3
  description: >-
4
- AI Spector document generation SRS, basic design, detail design from traceability graph.
5
- Use for /generate-srs, /generate-basic-design, /generate-detail-design, or when user asks to
6
- generate, write, or update requirements specs, SRS chapters, basic design, detail design, or docs under docs/srs docs/basic-design.
4
+ Routes ambiguous document-generation requests to the correct AI Spector layer skill (SRS, basic
5
+ design, detail design, or HTML prototype). Use only when the user says generate docs or generate
6
+ requirements without naming a layer. Do not use when the request clearly targets SRS, screens, APIs,
7
+ detail design, or prototype HTML.
7
8
  ---
8
9
 
9
- # AI Spector — Generate
10
+ # AI Spector — Generate (router)
10
11
 
11
- **Core rules:** `.cursor/skills/ai-spector/SKILL.md`
12
- **Graph context:** `.cursor/commands/_generate-graph.md`, `_graph.md`
12
+ Ask one question or infer from context, then **switch skill** and read that skill’s runbook:
13
13
 
14
- ## Route to command doc
14
+ | Layer | Skill |
15
+ |-------|-------|
16
+ | Requirements / SRS | `ai-spector-generate-srs` |
17
+ | Screens, APIs, DB | `ai-spector-generate-basic-design` |
18
+ | Implementation detail | `ai-spector-generate-detail-design` |
19
+ | HTML mockups | `ai-spector-generate-prototype` |
15
20
 
16
- | Trigger | Read first | Notes |
17
- |---------|------------|-------|
18
- | `/generate-srs`, SRS, requirements spec | `commands/generate-srs.md` | DAG waves, `graph query`, templates in `.ai-spector/templates/srs/` |
19
- | `/generate-basic-design`, screens, APIs, DB design | `commands/generate-basic-design.md` | `templates/basic_design/` |
20
- | `/generate-detail-design` | `commands/generate-detail-design.md` | `templates/detail_design/` |
21
-
22
- ## Before generating
23
-
24
- 1. **`ai-spector graph validate`** should pass (or run `/validate-graph` first).
25
- 2. **Read the template** from `.ai-spector/templates/` — never guess structure.
26
- 3. After each wave: **`graph merge`** projection patch with `rendersTo` + `dependsOn`.
27
- 4. After SRS generation: recommend **`/index`**.
28
-
29
- ## Natural language → command
30
-
31
- | User says | Action |
32
- |-----------|--------|
33
- | "generate SRS", "write requirements", "create use case docs" | `generate-srs.md` |
34
- | "basic design", "screen list", "API design doc" | `generate-basic-design.md` |
35
- | "detail design", "feature detail doc" | `generate-detail-design.md` |
36
-
37
- Confirm scope when user describes generation in natural language (not explicit paths).
38
-
39
- ## Generate discipline
40
-
41
- Accuracy over speed — batch only same-wave independent targets; merge + validate after each wave.
21
+ **Core:** [../ai-spector/SKILL.md](../ai-spector/SKILL.md) · **Pipeline:** [../../WORKFLOW.md](../../WORKFLOW.md)
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: ai-spector-generate-basic-design
3
+ description: >-
4
+ Generates or updates basic design documents from the traceability graph and SRS: screen list and
5
+ screen details, API list and endpoint details, database design under docs/basic-design/. Use when
6
+ the user asks for basic design, wireframes, screen map, API design, ERD, or list-screens.md. Do not
7
+ use for SRS-only work, detail design, HTML prototype, or graph analyze/index without doc generation.
8
+ paths:
9
+ - "docs/basic-design/**"
10
+ - ".ai-spector/templates/basic_design/**"
11
+ ---
12
+
13
+ # AI Spector — Generate basic design
14
+
15
+ **Core:** [../ai-spector/SKILL.md](../ai-spector/SKILL.md)
16
+
17
+ ## Required reading
18
+
19
+ 1. [references/runbook.md](references/runbook.md)
20
+ 2. [../ai-spector/references/generate-workflow.md](../ai-spector/references/generate-workflow.md)
21
+ 3. [../ai-spector/references/generate-graph.md](../ai-spector/references/generate-graph.md) § perEndpoint / perScreen
22
+
23
+ ## Checklist
24
+
25
+ ```
26
+ - [ ] graph validate; SRS on disk
27
+ - [ ] index after every wave (mandatory)
28
+ - [ ] one file per endpoint row / Screen Index row — not per F-xx
29
+ ```
30
+
31
+ ## Natural language
32
+
33
+ “basic design”, “screen list”, “API list”, “wireframe for login” → this skill.