ai-spector 0.4.2 → 0.4.4

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 (33) hide show
  1. package/package.json +1 -1
  2. package/scaffold/cursor/skills/README.md +0 -1
  3. package/scaffold/cursor/skills/_skill-router.md +2 -4
  4. package/scaffold/cursor/skills/ai-spector/SKILL.md +1 -2
  5. package/scaffold/cursor/skills/ai-spector/references/cli-failures.md +43 -167
  6. package/scaffold/cursor/skills/ai-spector/references/context-management.md +157 -0
  7. package/scaffold/cursor/skills/ai-spector/references/generate-graph.md +6 -1
  8. package/scaffold/cursor/skills/ai-spector/references/generate-workflow.md +45 -105
  9. package/scaffold/cursor/skills/ai-spector/references/project-conventions.md +0 -1
  10. package/scaffold/cursor/skills/ai-spector-generate/SKILL.md +3 -7
  11. package/scaffold/cursor/skills/ai-spector-generate-basic-design/SKILL.md +18 -16
  12. package/scaffold/cursor/skills/ai-spector-generate-basic-design/references/bd-context/api-detail.md +27 -0
  13. package/scaffold/cursor/skills/ai-spector-generate-basic-design/references/bd-context/api-list.md +26 -0
  14. package/scaffold/cursor/skills/ai-spector-generate-basic-design/references/bd-context/db-design.md +22 -0
  15. package/scaffold/cursor/skills/ai-spector-generate-basic-design/references/bd-context/screen-detail.md +26 -0
  16. package/scaffold/cursor/skills/ai-spector-generate-basic-design/references/bd-context/screen-list.md +27 -0
  17. package/scaffold/cursor/skills/ai-spector-generate-basic-design/references/runbook.md +16 -1
  18. package/scaffold/cursor/skills/ai-spector-generate-prototype/SKILL.md +17 -26
  19. package/scaffold/cursor/skills/ai-spector-generate-prototype/references/prototype-graph-context.md +115 -0
  20. package/scaffold/cursor/skills/ai-spector-generate-prototype/references/runbook.md +31 -2
  21. package/scaffold/cursor/skills/ai-spector-generate-prototype/references/theme-picker.md +2 -0
  22. package/scaffold/cursor/skills/ai-spector-generate-srs/SKILL.md +22 -20
  23. package/scaffold/cursor/skills/ai-spector-generate-srs/references/runbook.md +17 -0
  24. package/scaffold/cursor/skills/ai-spector-generate-srs/references/srs-context/data-requirements.md +10 -0
  25. package/scaffold/cursor/skills/ai-spector-generate-srs/references/srs-context/external-interfaces.md +10 -0
  26. package/scaffold/cursor/skills/ai-spector-generate-srs/references/srs-context/feature-detail.md +20 -0
  27. package/scaffold/cursor/skills/ai-spector-generate-srs/references/srs-context/introduction.md +12 -0
  28. package/scaffold/cursor/skills/ai-spector-generate-srs/references/srs-context/overall-description.md +11 -0
  29. package/scaffold/cursor/skills/ai-spector-generate-srs/references/srs-context/quality-attributes.md +11 -0
  30. package/scaffold/cursor/skills/ai-spector-generate-srs/references/srs-context/use-case-detail.md +26 -0
  31. package/scaffold/cursor/skills/ai-spector-graph/SKILL.md +1 -2
  32. package/scaffold/cursor/skills/ai-spector-generate-detail-design/SKILL.md +0 -33
  33. package/scaffold/cursor/skills/ai-spector-generate-detail-design/references/runbook.md +0 -60
@@ -4,6 +4,13 @@ Generate **static HTML** prototypes from basic-design screen specs. All setup an
4
4
 
5
5
  **User runs this command;** the agent runs CLI. On CLI failure: [cli-failures.md](../../ai-spector/references/cli-failures.md).
6
6
 
7
+ ## Context hygiene
8
+
9
+ For runs of 5+ screens, follow [context-management.md](../../ai-spector/references/context-management.md):
10
+ - **Sub-agent per screen** — delegate graph queries + screen doc reads for each screen; receive a ≤400-word summary (fields, flows, roles, errors); main agent writes from the summary.
11
+ - **Compact every 5 screens** — after writing and validating a batch of 5, `/compact` with the plan summary (remaining screens, written paths) before continuing.
12
+ - After writing a screen HTML file, discard its content from context — record only the path.
13
+
7
14
  ## Philosophy
8
15
 
9
16
  - **Screen design is source of truth** — `docs/basic-design/list-screens.md` + `docs/basic-design/screens/<slug>.md`
@@ -46,14 +53,16 @@ ai-spector prototype auth --from-config
46
53
  3. `prototype/manifest.json` → `themeName` (non-empty)
47
54
  4. `.ai-spector/.docflow/config/prototype.config.json` → `defaultTheme`
48
55
 
49
- **If no stored theme is found** and the user did **not** name one in this request, run the **[theme picker](theme-picker.md)** — do **not** ask a bare “which theme?” without recommendations.
56
+ **If no stored theme is found** and the user did **not** name one in this request, run the **[theme picker](theme-picker.md)**.
57
+
58
+ > **Do not auto-select.** Using project context to guess a theme and proceeding without a user reply is wrong — even if the rationale seems obvious. The agent's job is to recommend, not decide.
50
59
 
51
60
  Summary of the picker:
52
61
 
53
62
  1. Read project context (SRS, list-screens §1, knowledge, data-source).
54
63
  2. `ai-spector prototype themes --json` — pick **3 best-fit** themes with one-line rationale each.
55
64
  3. `ai-spector prototype preview <name> --open` for all 3 — user compares in the browser.
56
- 4. Post a numbered table; **wait for user to choose** before setup.
65
+ 4. Post a numbered table; **stop and wait for user reply** — a number, a name, or “use that one” — before running any further command.
57
66
 
58
67
  Once the user confirms (or named a theme upfront), proceed with setup; the choice is persisted and will not be asked again.
59
68
 
@@ -87,11 +96,25 @@ ai-spector prototype manifest --dry-run
87
96
 
88
97
  Read each target’s `docs/basic-design/screens/<slug>.md` — wireframe (§1.1), layout (§1.2), interactions. Read `prototype/DESIGN.md` for colors, type, spacing.
89
98
 
99
+ ### 2b. Load graph context per screen
100
+
101
+ **Required before writing each screen’s HTML.** Run the queries in [prototype-graph-context.md](./prototype-graph-context.md) for the screen being generated.
102
+
103
+ This step pulls:
104
+ - The F-xx / UC-xx the screen satisfies → business rules, required fields, flow steps, error states
105
+ - The API endpoints the screen depends on → exact form fields, response columns, error codes
106
+ - Actor roles → role-based UI sections
107
+
108
+ Do not skip this step. Screen detail docs summarize the spec; the graph has the authoritative detail. Any form field, table column, button, or error state **must be traceable to graph data** before you write it into the HTML.
109
+
90
110
  ### 3. Generate HTML
91
111
 
92
112
  For each screen in scope:
93
113
 
94
114
  - Write `prototype/src/<prototypeStem>.html` (self-contained or with sibling `.css`/`.js` in `prototype/src/`)
115
+ - All content derived from graph context (step 2b) + screen detail doc — no invented fields or labels
116
+ - Include error states and empty states for every exception flow found in the graph
117
+ - Render role-specific sections when multiple actors satisfy the screen
95
118
  - Link navigation using relative paths between screens when `list-screens.md` §2 defines flow
96
119
  - Do **not** edit `docs/**`
97
120
 
@@ -125,6 +148,12 @@ git commit -m "chore(prototype): add HTML screens (<theme>)"
125
148
  - [ ] If no stored basic auth: [auth picker](auth-picker.md) run — username/password collected, `prototype auth` executed, `prototype/htpasswd` present
126
149
  - [ ] If no stored theme: [theme picker](theme-picker.md) run — 3 recommendations, previews opened, user confirmed
127
150
  - [ ] `prototype setup` run with resolved theme
151
+ - [ ] Graph context queries run per screen ([prototype-graph-context.md](./prototype-graph-context.md)) before writing HTML
152
+ - [ ] Every form field traces to an API request field or F-xx/UC-xx field definition
153
+ - [ ] Every table column traces to an API response field or data entity
154
+ - [ ] Every button/action label matches the spec's verb (not generic copy)
155
+ - [ ] Error states and empty states included for all UC exception flows + API error codes
156
+ - [ ] Role-based sections rendered when multiple actors satisfy the screen
128
157
  - [ ] Every generated file name matches `prototypeStem` in manifest
129
158
  - [ ] Wireframe/layout from screen detail doc reflected in HTML
130
159
  - [ ] Tokens from `prototype/DESIGN.md` only (no random CDN)
@@ -1,5 +1,7 @@
1
1
  # Theme picker — recommend, preview, confirm
2
2
 
3
+ > **Hard rule: never auto-select a theme.** Inferring from project context is allowed only to produce 3 *recommendations*. The user must explicitly choose (by number, name, or "use that one") before `prototype setup` runs. Auto-picking and explaining the choice afterward is not acceptable.
4
+
3
5
  When **no theme is stored** and the user did **not** name one in this request, run this flow **before** `prototype setup`. Do not generate HTML until the user confirms a theme.
4
6
 
5
7
  Skip this flow when:
@@ -4,33 +4,35 @@ description: >-
4
4
  Generates or updates the System Requirements Specification from the traceability graph and
5
5
  docs/data-source context. Use when the user asks to generate or update SRS, requirements, use cases
6
6
  (UC-xx), features (F-xx), or files under docs/srs/. Do not use for basic design screens/APIs,
7
- detail design, HTML prototype, or graph-only analyze/index tasks.
7
+ HTML prototype, or graph-only analyze/index tasks.
8
8
  paths:
9
9
  - "docs/srs/**"
10
10
  - ".ai-spector/templates/srs/**"
11
11
  ---
12
12
 
13
- # AI Spector — Generate SRS
13
+ # Generate SRS
14
14
 
15
- **Core:** [../ai-spector/SKILL.md](../ai-spector/SKILL.md)
15
+ ## Load at start
16
+ 1. [references/runbook.md](references/runbook.md)
17
+ 2. [../ai-spector/references/generate-workflow.md](../ai-spector/references/generate-workflow.md)
16
18
 
17
- ## Required reading
19
+ ## Load when needed
18
20
 
19
- 1. [references/runbook.md](references/runbook.md) SRS-specific DAG, waves, finish
20
- 2. [../ai-spector/references/generate-workflow.md](../ai-spector/references/generate-workflow.md) — scope, confirm, per-wave checklist
21
- 3. [../ai-spector/references/generate-graph.md](../ai-spector/references/generate-graph.md) — query, merge, ingest
21
+ | Situation | Load |
22
+ |---|---|
23
+ | Language not set | [../ai-spector/references/language-picker.md](../ai-spector/references/language-picker.md) |
24
+ | Writing §1 Introduction | [references/srs-context/introduction.md](references/srs-context/introduction.md) |
25
+ | Writing §2 Overall Description | [references/srs-context/overall-description.md](references/srs-context/overall-description.md) |
26
+ | Writing §3 UC list or UC-xx detail | [references/srs-context/use-case-detail.md](references/srs-context/use-case-detail.md) |
27
+ | Writing §4 feature list or F-xx detail | [references/srs-context/feature-detail.md](references/srs-context/feature-detail.md) |
28
+ | Writing §5 Data Requirements | [references/srs-context/data-requirements.md](references/srs-context/data-requirements.md) |
29
+ | Writing §6 External Interfaces | [references/srs-context/external-interfaces.md](references/srs-context/external-interfaces.md) |
30
+ | Writing §7 Quality Attributes | [references/srs-context/quality-attributes.md](references/srs-context/quality-attributes.md) |
31
+ | Graph queries / merge | [../ai-spector/references/generate-graph.md](../ai-spector/references/generate-graph.md) |
32
+ | CLI fails | [../ai-spector/references/cli-failures.md](../ai-spector/references/cli-failures.md) |
33
+ | Run of 5+ files | [../ai-spector/references/context-management.md](../ai-spector/references/context-management.md) |
22
34
 
23
- ## Checklist
35
+ ## On CLI failure
36
+ Pause. Report full output. Offer fix + retry. Details in cli-failures.md.
24
37
 
25
- ```
26
- - [ ] language confirmed (language-picker.md — check before first write)
27
- - [ ] graph validate
28
- - [ ] runbook + generate-workflow followed
29
- - [ ] templates from .ai-spector/templates/srs/
30
- - [ ] merge + validate each wave
31
- - [ ] ai-spector index when runbook says so
32
- ```
33
-
34
- ## Natural language
35
-
36
- “generate SRS”, “write requirements”, “use case chapter”, “feature list” → this skill.
38
+ "generate SRS", "write requirements", "use case chapter", "feature list" → this skill.
@@ -8,6 +8,7 @@ Generate SRS markdown **from the traceability graph** in DAG order.
8
8
  |-----------------|----------|
9
9
  | Scope cases, waves, merge, finish, guardrails | [generate-workflow.md](../../ai-spector/references/generate-workflow.md) |
10
10
  | Graph query, ingest patch, parallelism | [generate-graph.md](../../ai-spector/references/generate-graph.md) |
11
+ | **Graph → template section mapping** | **[srs-context/](./srs-context/) — load the matching section file before writing each doc type** |
11
12
 
12
13
  ## Intent → DAG hints
13
14
 
@@ -46,6 +47,22 @@ Templates: `.ai-spector/templates/srs/`
46
47
 
47
48
  Follow [generate-workflow.md](../../ai-spector/references/generate-workflow.md) for planning and per-wave execution.
48
49
 
50
+ ## Graph context (required before writing each file)
51
+
52
+ After running queries ([generate-graph.md](../../ai-spector/references/generate-graph.md) § C), load the matching file from `srs-context/` for the doc type being written:
53
+
54
+ | Writing | Load |
55
+ |---|---|
56
+ | §1 Introduction | `srs-context/introduction.md` |
57
+ | §2 Overall Description | `srs-context/overall-description.md` |
58
+ | §3 UC list or UC-xx detail | `srs-context/use-case-detail.md` |
59
+ | §4 feature list or F-xx detail | `srs-context/feature-detail.md` |
60
+ | §5 Data Requirements | `srs-context/data-requirements.md` |
61
+ | §6 External Interfaces | `srs-context/external-interfaces.md` |
62
+ | §7 Quality Attributes | `srs-context/quality-attributes.md` |
63
+
64
+ Every UC-xx, F-xx, and actor in output must exist as a graph node. No invented identifiers.
65
+
49
66
  ## SRS-specific ingest notes
50
67
 
51
68
  - List chapters need `rendersTo` from template `doc.srs.*` nodes.
@@ -0,0 +1,10 @@
1
+ # Graph → §5 Data Requirements
2
+
3
+ Query: `doc.srs.5-data-requirements` DEPS depth 2, then each `dataEntity` node CONTEXT depth 3.
4
+
5
+ | Template section | Graph source |
6
+ |---|---|
7
+ | **Entity list** | All `dataEntity` nodes → name, description, linked F-xx via `satisfies` / `partOf` |
8
+ | **Entity fields** | `dataEntity.fields` array → name, type, required, constraints |
9
+ | **Relationships** | `relatesTo` / `dependsOn` edges between entities → cardinality from edge properties |
10
+ | **Retention rules** | Entity `retention` property or NFR nodes referencing entities |
@@ -0,0 +1,10 @@
1
+ # Graph → §6 External Interfaces
2
+
3
+ Query: `doc.srs.6-external-interfaces` DEPS depth 2, then each `api` / `externalSystem` node.
4
+
5
+ | Template section | Graph source |
6
+ |---|---|
7
+ | **6.1 User Interfaces** | Screen nodes → names, purposes; actor nodes → which screens they use |
8
+ | **6.2 Software Interfaces** | API / `externalSystem` nodes → name, protocol, purpose; `dependsOn` from F-xx |
9
+ | **6.3 Hardware Interfaces** | NFR nodes tagged `hardware` |
10
+ | **6.4 Communication Interfaces** | Protocol / integration nodes; NFR nodes tagged `communication` |
@@ -0,0 +1,20 @@
1
+ # Graph → §4 Feature detail (per F-xx)
2
+
3
+ Query: `F-xx` CONTEXT depth 4.
4
+
5
+ | Template section | Graph source |
6
+ |---|---|
7
+ | **Name / Priority / Description** | F-xx node `name`, `priority`, `description` |
8
+ | **User Story** | F-xx `userStory`; or derive from actor + description |
9
+ | **In / Out of Scope** | F-xx `scope.in`, `scope.out` arrays |
10
+ | **Related Use Cases** | UC nodes via `satisfies` inbound → UC-xx ids and names |
11
+ | **§2 Stimulus/Response** | UC `mainFlow` steps for linked UCs; actor name from actor node |
12
+ | **§2 Error Handling** | UC `exceptionFlows` + F-xx `errorHandling` array |
13
+ | **§3 Functional Requirements** | F-xx `requirements` → FR-xx-nn ids, descriptions, priority, acceptance criteria |
14
+ | **§3 Input Data** | F-xx `inputData` or entity nodes via `dependsOn` |
15
+ | **§3 Output Data** | F-xx `outputData` or entity response fields |
16
+ | **§3 UI — Screens** | Screen nodes linked via `satisfies` |
17
+ | **§3 Dependencies** | `dependsOn` edges → other F-xx or external system nodes |
18
+ | **§3 Assumptions** | F-xx `assumptions` array |
19
+
20
+ For the **§4 list chapter**: query `doc.srs.4-system-features-list` CONTEXT depth 2 → extract all `feature` nodes sorted by id; include linked UC ids.
@@ -0,0 +1,12 @@
1
+ # Graph → §1 Introduction
2
+
3
+ Query: `doc.srs.1-introduction` CONTEXT depth 2 + system root node.
4
+
5
+ | Template section | Graph source |
6
+ |---|---|
7
+ | **1.1 Product Name** | System node `name` |
8
+ | **1.1 Intended Audience** | All `actor` nodes → roles |
9
+ | **1.3 Major Features** | All `feature` nodes → F-xx names (graph only, no invented) |
10
+ | **1.3 Scope / Purpose** | System node `description` or data-source summary |
11
+ | **1.3 Out of Scope** | Nodes marked `outOfScope: true`; explicit exclusions in data-source |
12
+ | **1.4 References** | `rendersTo` / `definedIn` edges → data-source files |
@@ -0,0 +1,11 @@
1
+ # Graph → §2 Overall Description
2
+
3
+ Query: `doc.srs.2-overall-description` CONTEXT depth 3.
4
+
5
+ | Template section | Graph source |
6
+ |---|---|
7
+ | **Product perspective** | System node; `relatesTo` external systems |
8
+ | **User classes / actors** | All `actor` nodes → name, role, permissions |
9
+ | **Operating environment** | NFR nodes tagged `environment` or `infrastructure` |
10
+ | **Constraints** | NFR nodes tagged `constraint` |
11
+ | **Assumptions** | Nodes or edges tagged `assumption` |
@@ -0,0 +1,11 @@
1
+ # Graph → §7 Quality Attributes / NFR
2
+
3
+ Query: `ai-spector graph query nfr --direction both --depth 2 --json` (or NFR bundle node).
4
+
5
+ | Template section | Graph source |
6
+ |---|---|
7
+ | **Performance** | NFR `category: performance` → thresholds, response time, throughput |
8
+ | **Security** | NFR `category: security` |
9
+ | **Reliability / Availability** | NFR `category: reliability` or `availability` |
10
+ | **Scalability** | NFR `category: scalability` |
11
+ | **Maintainability** | NFR `category: maintainability` |
@@ -0,0 +1,26 @@
1
+ # Graph → §3 Use Case detail (per UC-xx)
2
+
3
+ Query: `UC-xx` CONTEXT depth 4.
4
+
5
+ | Template section | Graph source |
6
+ |---|---|
7
+ | **Name / Description** | UC node `name`, `description` |
8
+ | **Primary Actor** | Actor linked via `satisfies` or `partOf` inbound |
9
+ | **Secondary Actors** | Additional actor nodes in neighbourhood |
10
+ | **Priority** | UC node `priority` |
11
+ | **Preconditions** | UC `preconditions` array; or `dependsOn` UCs that must complete first |
12
+ | **Postconditions** | UC `postconditions` array |
13
+ | **Trigger** | UC `trigger` property |
14
+ | **§2 Main Flow** | UC `mainFlow` steps → one numbered row per step |
15
+ | **§3 Alternative Flows** | UC `alternativeFlows` → one subsection per entry |
16
+ | **§4 Exception Flows** | UC `exceptionFlows` / `errorFlows` + F-xx `errorHandling` for linked features |
17
+ | **§5 Business Rules** | F-xx `businessRules` via `satisfies` outbound → BR-xx-nn ids |
18
+ | **§6 Functional Requirements** | F-xx FR list via `satisfies` → FR-xx-nn ids |
19
+ | **§7 Input Data** | F-xx `inputData` + `dataEntity` nodes via `dependsOn` |
20
+ | **§7 Output Data** | F-xx `outputData` + `dataEntity` nodes reachable from UC |
21
+ | **§8 UI Requirements** | Screen nodes linked via `satisfies` → screen names and ids |
22
+ | **§9 Related Use Cases** | UC nodes via `relatesTo`, `includes`, `extends` edges |
23
+
24
+ For the **§3 list chapter** (not per-file): query `doc.srs.3-use-cases` CONTEXT depth 2 → extract all `useCase` nodes, sorted by id.
25
+
26
+ **Rule:** Every UC and F-xx in output must exist as a graph node. Missing node → `<!-- TODO: node missing in graph -->`.
@@ -4,8 +4,7 @@ description: >-
4
4
  Runs AI Spector traceability graph operations: analyze data-source, index refresh, graph validate,
5
5
  impact and regen scope, visualize, semantic link-graph, knowledge.json. Use when
6
6
  the user asks to analyze sources, refresh or validate the graph, see impact of changes, visualize
7
- traceability, or re-index after edits. Do not use for writing SRS, basic design, detail design, or
8
- HTML prototype content.
7
+ traceability, or re-index after edits. Do not use for writing SRS, basic design, or HTML prototype content.
9
8
  paths:
10
9
  - ".ai-spector/graph/**"
11
10
  - ".ai-spector/.docflow/**"
@@ -1,33 +0,0 @@
1
- ---
2
- name: ai-spector-generate-detail-design
3
- description: >-
4
- Generates or updates detail design and implementation specification documents under
5
- docs/detail-design/ from the traceability graph, SRS, and basic design. Use when the user asks for
6
- detail design, feature detail docs, or implementation specs. Do not use for SRS, basic design screens,
7
- or HTML prototype.
8
- paths:
9
- - "docs/detail-design/**"
10
- - ".ai-spector/templates/detail_design/**"
11
- ---
12
-
13
- # AI Spector — Generate detail 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)
22
-
23
- ## Checklist
24
-
25
- ```
26
- - [ ] language confirmed (language-picker.md — check before first write)
27
- - [ ] graph validate; SRS + basic design present
28
- - [ ] generate-workflow waves + merge per target
29
- ```
30
-
31
- ## Natural language
32
-
33
- “detail design”, “implementation spec”, “feature detail for F-03” → this skill.
@@ -1,60 +0,0 @@
1
- # Generate detail design
2
-
3
- Generate detail design markdown **from the traceability graph**, SRS, and basic design.
4
-
5
- **User runs this command;** the agent runs CLI.
6
-
7
- | Shared workflow | Document |
8
- |-----------------|----------|
9
- | Scope cases, waves, merge, guardrails | [generate-workflow.md](../../ai-spector/references/generate-workflow.md) |
10
- | Graph query + ingest | [generate-graph.md](../../ai-spector/references/generate-graph.md) |
11
-
12
- ## Prerequisites
13
-
14
- - `ai-spector graph validate` passes
15
- - SRS + basic design minimum on disk (`workflow.dependencies.json` → `generate-detail-design`)
16
-
17
- ## Config
18
-
19
- - `dag.detail-design.json`
20
- - `dag.detail-design.graph-seeds.json` (if present)
21
- - `completeness-rules.detail-design.json`
22
-
23
- Templates: `.ai-spector/templates/detail_design/`
24
-
25
- ## Intent → DAG hints
26
-
27
- Use `dag.detail-design.json` + graph `feature` nodes. Common phrases:
28
-
29
- | User phrase | Typical outputs |
30
- |-------------|-----------------|
31
- | feature detail, implementation spec | per-feature files under `docs/detail-design/` |
32
- | architecture overview, deployment, error handling | shared chapters per DAG |
33
- | one feature, checkout | that feature’s detail doc only — case 2 |
34
-
35
- Case 3 confirmation: [generate-workflow.md](../../ai-spector/references/generate-workflow.md) § Case 3.
36
-
37
- ## Required behavior
38
-
39
- Follow [generate-workflow.md](../../ai-spector/references/generate-workflow.md) (plan → waves → per-target query/write/merge/validate).
40
-
41
- 1. **Gate** — `ai-spector graph validate`
42
- 2. **Plan** — load `dag.detail-design.json`; build waves; map seeds from graph-seeds config
43
- 3. **Per target** — seed = `feature` id or detail `document` node:
44
-
45
- ```bash
46
- ai-spector graph query <seed> --direction both --depth 3 --json
47
- ```
48
-
49
- 4. Load SRS + basic-design paths from `projectionPaths` only (no full `docs/` glob)
50
- 5. Read template; write; merge `rendersTo` + `dependsOn`; validate per wave
51
- 6. **Finish** — `ai-spector index` if command scope touched many files; suggest `/summary` when workflow lists it
52
-
53
- ## Guardrails
54
-
55
- - Same wave / merge / validate rules as [generate-workflow.md](../../ai-spector/references/generate-workflow.md)
56
- - Do not read all of `docs/` manually when CLI failed — [cli-failures.md](../../ai-spector/references/cli-failures.md)
57
-
58
- ## If blocked
59
-
60
- Fix validate/query errors; ensure basic design exists. Re-run **`/generate-detail-design`**.