ai-spector 0.4.2 → 0.4.3
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.
- package/package.json +1 -1
- package/scaffold/cursor/skills/ai-spector/references/cli-failures.md +43 -167
- package/scaffold/cursor/skills/ai-spector/references/context-management.md +157 -0
- package/scaffold/cursor/skills/ai-spector/references/generate-graph.md +5 -0
- package/scaffold/cursor/skills/ai-spector/references/generate-workflow.md +45 -105
- package/scaffold/cursor/skills/ai-spector-generate-basic-design/SKILL.md +17 -15
- package/scaffold/cursor/skills/ai-spector-generate-basic-design/references/bd-context/api-detail.md +27 -0
- package/scaffold/cursor/skills/ai-spector-generate-basic-design/references/bd-context/api-list.md +26 -0
- package/scaffold/cursor/skills/ai-spector-generate-basic-design/references/bd-context/db-design.md +22 -0
- package/scaffold/cursor/skills/ai-spector-generate-basic-design/references/bd-context/screen-detail.md +26 -0
- package/scaffold/cursor/skills/ai-spector-generate-basic-design/references/bd-context/screen-list.md +27 -0
- package/scaffold/cursor/skills/ai-spector-generate-basic-design/references/runbook.md +15 -0
- package/scaffold/cursor/skills/ai-spector-generate-detail-design/SKILL.md +12 -14
- package/scaffold/cursor/skills/ai-spector-generate-prototype/SKILL.md +16 -25
- package/scaffold/cursor/skills/ai-spector-generate-prototype/references/prototype-graph-context.md +115 -0
- package/scaffold/cursor/skills/ai-spector-generate-prototype/references/runbook.md +27 -0
- package/scaffold/cursor/skills/ai-spector-generate-srs/SKILL.md +26 -24
- package/scaffold/cursor/skills/ai-spector-generate-srs/references/runbook.md +17 -0
- package/scaffold/cursor/skills/ai-spector-generate-srs/references/srs-context/data-requirements.md +10 -0
- package/scaffold/cursor/skills/ai-spector-generate-srs/references/srs-context/external-interfaces.md +10 -0
- package/scaffold/cursor/skills/ai-spector-generate-srs/references/srs-context/feature-detail.md +20 -0
- package/scaffold/cursor/skills/ai-spector-generate-srs/references/srs-context/introduction.md +12 -0
- package/scaffold/cursor/skills/ai-spector-generate-srs/references/srs-context/overall-description.md +11 -0
- package/scaffold/cursor/skills/ai-spector-generate-srs/references/srs-context/quality-attributes.md +11 -0
- package/scaffold/cursor/skills/ai-spector-generate-srs/references/srs-context/use-case-detail.md +26 -0
package/scaffold/cursor/skills/ai-spector-generate-basic-design/references/bd-context/api-detail.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Graph → API Detail (per endpoint)
|
|
2
|
+
|
|
3
|
+
Queries:
|
|
4
|
+
```bash
|
|
5
|
+
ai-spector graph query <F-xx> --direction both --depth 4 --edges CONTEXT --json
|
|
6
|
+
ai-spector graph query <UC-xx> --direction both --depth 3 --edges CONTEXT --json
|
|
7
|
+
ai-spector graph query <entityId> --direction both --depth 2 --edges CONTEXT --json
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
| Template section | Graph source |
|
|
11
|
+
|---|---|
|
|
12
|
+
| **Summary / Operation ID** | UC `name`; camelCase from method + entity |
|
|
13
|
+
| **Source Requirement** | F-xx id + name; UC-xx id + name |
|
|
14
|
+
| **Auth** | Actor `authRequired`; UC precondition `authenticated` |
|
|
15
|
+
| **Path params** | Entity field `pk: true`; UC flow step passing an id |
|
|
16
|
+
| **Query params** | UC filter/search flow steps; F-xx filter requirements |
|
|
17
|
+
| **Request body** | F-xx `inputData` → name, type, required, validation; UC `mainFlow` input steps |
|
|
18
|
+
| **Response 2xx** | F-xx `outputData` + entity `fields` for returned object |
|
|
19
|
+
| **Response 400** | F-xx `errorHandling` validation; entity field constraints |
|
|
20
|
+
| **Response 401/403** | Actor auth; UC precondition violations |
|
|
21
|
+
| **Response 404** | UC exception "resource not found" |
|
|
22
|
+
| **Response 409** | UC exception "already exists" / "conflict" |
|
|
23
|
+
| **§2 Data Model** | Entity `fields`; `relatesTo` edges for nested objects |
|
|
24
|
+
| **§3 Error Codes** | All UC exception flows + F-xx error handling → HTTP codes |
|
|
25
|
+
| **§4 Rate Limiting** | NFR nodes tagged `rateLimit` or `performance` |
|
|
26
|
+
|
|
27
|
+
**Rule:** Every request field → F-xx `inputData` or UC flow input. Every response field → entity `fields` or F-xx `outputData`. No invented fields.
|
package/scaffold/cursor/skills/ai-spector-generate-basic-design/references/bd-context/api-list.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Graph → API List
|
|
2
|
+
|
|
3
|
+
Queries:
|
|
4
|
+
```bash
|
|
5
|
+
ai-spector graph query doc.bd.list-api --direction both --depth 3 --edges CONTEXT --json
|
|
6
|
+
ai-spector graph query doc.srs.6-external-interfaces --direction both --depth 2 --edges DEPS --json
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Derive each endpoint — **no invented endpoints**:
|
|
10
|
+
|
|
11
|
+
| Endpoint rule | Graph evidence required |
|
|
12
|
+
|---|---|
|
|
13
|
+
| GET list | `dataEntity` + UC with list/search flow |
|
|
14
|
+
| GET detail | `dataEntity` + UC with single-record read |
|
|
15
|
+
| POST create | `dataEntity` + UC with create/submit flow |
|
|
16
|
+
| PUT/PATCH update | `dataEntity` + UC with edit flow |
|
|
17
|
+
| DELETE | `dataEntity` + UC with delete/archive flow |
|
|
18
|
+
| Auth (login/logout) | Actor node + auth UC |
|
|
19
|
+
|
|
20
|
+
| Column | Graph source |
|
|
21
|
+
|---|---|
|
|
22
|
+
| **Method** | Action type: GET/POST/PUT/DELETE |
|
|
23
|
+
| **Path** | Entity name + UC slug; plural snake_case collections |
|
|
24
|
+
| **Summary** | UC `name` or F-xx `name` |
|
|
25
|
+
| **Auth required** | Actor `authRequired`; UC precondition `authenticated` |
|
|
26
|
+
| **Source F-xx / UC-xx** | F-xx and UC-xx nodes that `satisfies` this endpoint |
|
package/scaffold/cursor/skills/ai-spector-generate-basic-design/references/bd-context/db-design.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Graph → DB Design
|
|
2
|
+
|
|
3
|
+
Queries:
|
|
4
|
+
```bash
|
|
5
|
+
ai-spector graph query doc.bd.db-design --direction both --depth 4 --edges CONTEXT --json
|
|
6
|
+
ai-spector graph query <entityId> --direction both --depth 3 --edges CONTEXT --json # per entity
|
|
7
|
+
ai-spector graph query doc.srs.5-data-requirements --direction both --depth 2 --edges DEPS --json
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
| Template section | Graph source |
|
|
11
|
+
|---|---|
|
|
12
|
+
| **§1 DBMS** | NFR nodes tagged `infrastructure` or `database`; data-source mentions |
|
|
13
|
+
| **§2 ERD entities** | All `dataEntity` nodes → table names (snake_case) |
|
|
14
|
+
| **§2 ERD relationships** | `relatesTo` / `dependsOn` edges between entities → cardinality from edge `label` |
|
|
15
|
+
| **§3 Table list** | All `dataEntity` nodes → `description` |
|
|
16
|
+
| **§4 Fields** | Entity `fields` array → name, type, required, constraints, default |
|
|
17
|
+
| **§4 Primary key** | Field with `pk: true` or id convention |
|
|
18
|
+
| **§4 Foreign keys** | `relatesTo` / `dependsOn` edges → FK = `<target>_id` unless node specifies |
|
|
19
|
+
| **§4 Indexes** | Entity `indexes` array; NFR performance constraints on this entity |
|
|
20
|
+
| **§4 Constraints** | Field `validationRules` + NFR constraint nodes |
|
|
21
|
+
|
|
22
|
+
**Rule:** Every table → `dataEntity` node. Every FK → edge. No tables without graph backing.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Graph → Screen Detail (per screen)
|
|
2
|
+
|
|
3
|
+
Queries:
|
|
4
|
+
```bash
|
|
5
|
+
ai-spector graph query doc.bd.screen-<slug> --direction both --depth 4 --edges CONTEXT --json
|
|
6
|
+
ai-spector graph query <UC-xx> --direction both --depth 4 --edges CONTEXT --json
|
|
7
|
+
ai-spector graph query <F-xx> --direction both --depth 3 --edges CONTEXT --json
|
|
8
|
+
ai-spector graph query <api-node> --direction both --depth 2 --edges DEPS --json
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
| Template section | Graph source |
|
|
12
|
+
|---|---|
|
|
13
|
+
| **Purpose / User Role** | UC `name` + description; actor node name(s) |
|
|
14
|
+
| **§1.1 Wireframe components** | UC `mainFlow` actor actions → form/button/list; UC `postconditions` → success state |
|
|
15
|
+
| **§1.2 Layout** | Input steps → form; output steps → display/table; nav steps → breadcrumb/back |
|
|
16
|
+
| **§1.3 Form fields** | API request body (F-xx `inputData`) → one input per field |
|
|
17
|
+
| **§1.3 Table columns** | API response body (entity `fields`) → one column per field |
|
|
18
|
+
| **§1.3 Buttons** | UC `mainFlow` action verbs → button labels |
|
|
19
|
+
| **§1.4 Primary actions** | UC `mainFlow` actor steps |
|
|
20
|
+
| **§1.4 Navigation** | UC `postconditions` target; `list-screens.md` §2 flow |
|
|
21
|
+
| **§1.5 Field validation** | F-xx `inputData.validationRules`; entity field constraints |
|
|
22
|
+
| **§1.5 Defaults** | F-xx `inputData.defaultValue`; entity field `default` |
|
|
23
|
+
| **Error / empty states** | UC `exceptionFlows` → one state per exception; API 404 → empty; API 400 → inline |
|
|
24
|
+
| **Role sections** | Multiple actors → mark each section with actor role |
|
|
25
|
+
|
|
26
|
+
**Rule:** Every form field → API request or F-xx `inputData`. Every column → API response or entity field. Every button label → UC flow verb. No invented content.
|
package/scaffold/cursor/skills/ai-spector-generate-basic-design/references/bd-context/screen-list.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Graph → Screen List
|
|
2
|
+
|
|
3
|
+
Queries:
|
|
4
|
+
```bash
|
|
5
|
+
ai-spector graph query doc.bd.list-screen --direction both --depth 3 --edges CONTEXT --json
|
|
6
|
+
ai-spector graph query doc.srs.3-use-cases --direction both --depth 2 --edges DEPS --json
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Derive each screen — **no invented screens**:
|
|
10
|
+
|
|
11
|
+
| Screen rule | Graph evidence |
|
|
12
|
+
|---|---|
|
|
13
|
+
| One screen per UC with actor-facing interaction steps | UC `mainFlow` with actor actions |
|
|
14
|
+
| List/dashboard per browsable entity | `dataEntity` + UC with list/search flow |
|
|
15
|
+
| Detail/form per creatable or editable entity | `dataEntity` + UC with create/edit flow |
|
|
16
|
+
| Auth screens | Actor node + login/auth UC |
|
|
17
|
+
| Role variants | Multiple actors on same UC → separate screens or role tabs |
|
|
18
|
+
|
|
19
|
+
| Column | Graph source |
|
|
20
|
+
|---|---|
|
|
21
|
+
| **Screen ID** | S-xx sequentially |
|
|
22
|
+
| **Screen Name** | UC name or entity name + action |
|
|
23
|
+
| **Purpose** | UC one-line description |
|
|
24
|
+
| **User Role** | Actor node(s) satisfying this UC |
|
|
25
|
+
| **Related F-xx / UC-xx** | UC and F-xx nodes this screen satisfies |
|
|
26
|
+
|
|
27
|
+
**§2 Navigation Flow:** UC `postconditions` → target screen after action completes.
|
|
@@ -8,6 +8,7 @@ Generate basic design markdown **from the traceability graph** and upstream SRS.
|
|
|
8
8
|
|-----------------|----------|
|
|
9
9
|
| Scope cases, waves, merge, finish, guardrails | [generate-workflow.md](../../ai-spector/references/generate-workflow.md) |
|
|
10
10
|
| Graph query, ingest, perEndpoint/perScreen | [generate-graph.md](../../ai-spector/references/generate-graph.md) |
|
|
11
|
+
| **Graph → template section mapping** | **[bd-context/](./bd-context/) — load the matching section file before writing each doc type** |
|
|
11
12
|
|
|
12
13
|
**Upstream:** SRS on disk (minimum per `workflow.dependencies.json`). Do not invent APIs/screens not grounded in graph + SRS.
|
|
13
14
|
|
|
@@ -43,6 +44,20 @@ Templates: `.ai-spector/templates/basic_design/`
|
|
|
43
44
|
|
|
44
45
|
**Reindex every wave (mandatory):** `graph merge` does not parse markdown bodies. Without index after wave 0, wave 1 cannot expand endpoint rows; without index after wave 1, wave 2 cannot expand Screen Index rows.
|
|
45
46
|
|
|
47
|
+
## Graph context (required before writing each file)
|
|
48
|
+
|
|
49
|
+
After running queries ([generate-graph.md](../../ai-spector/references/generate-graph.md) § C), load the matching file from `bd-context/` for the doc type being written:
|
|
50
|
+
|
|
51
|
+
| Writing | Load |
|
|
52
|
+
|---|---|
|
|
53
|
+
| DB design | `bd-context/db-design.md` |
|
|
54
|
+
| API list | `bd-context/api-list.md` |
|
|
55
|
+
| API detail (per endpoint) | `bd-context/api-detail.md` |
|
|
56
|
+
| Screen list | `bd-context/screen-list.md` |
|
|
57
|
+
| Screen detail (per screen) | `bd-context/screen-detail.md` |
|
|
58
|
+
|
|
59
|
+
Every endpoint, table, and screen must trace to graph nodes. No invented structure.
|
|
60
|
+
|
|
46
61
|
## Basic-design-specific write rules
|
|
47
62
|
|
|
48
63
|
- **List chapters first** — names from `api-list.md` / `list-screens.md` tables; not one file per `F-xx`.
|
|
@@ -10,24 +10,22 @@ paths:
|
|
|
10
10
|
- ".ai-spector/templates/detail_design/**"
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
#
|
|
14
|
-
|
|
15
|
-
**Core:** [../ai-spector/SKILL.md](../ai-spector/SKILL.md)
|
|
16
|
-
|
|
17
|
-
## Required reading
|
|
13
|
+
# Generate Detail Design
|
|
18
14
|
|
|
15
|
+
## Load at start
|
|
19
16
|
1. [references/runbook.md](references/runbook.md)
|
|
20
17
|
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
18
|
|
|
23
|
-
##
|
|
19
|
+
## Load when needed
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
| Situation | Load |
|
|
22
|
+
|---|---|
|
|
23
|
+
| Language not set | [../ai-spector/references/language-picker.md](../ai-spector/references/language-picker.md) |
|
|
24
|
+
| Graph queries / merge | [../ai-spector/references/generate-graph.md](../ai-spector/references/generate-graph.md) |
|
|
25
|
+
| CLI fails | [../ai-spector/references/cli-failures.md](../ai-spector/references/cli-failures.md) |
|
|
26
|
+
| Run of 5+ files | [../ai-spector/references/context-management.md](../ai-spector/references/context-management.md) |
|
|
30
27
|
|
|
31
|
-
##
|
|
28
|
+
## On CLI failure
|
|
29
|
+
Pause. Report full output. Offer fix + retry. Details in cli-failures.md.
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
"detail design", "implementation spec", "feature detail for F-03" → this skill.
|
|
@@ -10,33 +10,24 @@ paths:
|
|
|
10
10
|
- "prototype/**"
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
#
|
|
13
|
+
# Generate Prototype
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
## Load at start
|
|
16
|
+
1. [references/runbook.md](references/runbook.md)
|
|
16
17
|
|
|
17
|
-
##
|
|
18
|
+
## Load when needed
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
| Situation | Load |
|
|
21
|
+
|---|---|
|
|
22
|
+
| Language not set | [../ai-spector/references/language-picker.md](../ai-spector/references/language-picker.md) |
|
|
23
|
+
| No theme stored | [references/theme-picker.md](references/theme-picker.md) |
|
|
24
|
+
| No basic auth stored | [references/auth-picker.md](references/auth-picker.md) |
|
|
25
|
+
| Before writing each screen HTML | [references/prototype-graph-context.md](references/prototype-graph-context.md) |
|
|
26
|
+
| Run of 5+ screens | [../ai-spector/references/context-management.md](../ai-spector/references/context-management.md) |
|
|
27
|
+
| CLI fails | [../ai-spector/references/cli-failures.md](../ai-spector/references/cli-failures.md) |
|
|
22
28
|
|
|
23
|
-
##
|
|
29
|
+
## On CLI failure
|
|
30
|
+
Pause. Report full output. Offer fix + retry. Details in cli-failures.md.
|
|
24
31
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- [ ] list-screens + screen detail docs exist
|
|
28
|
-
- [ ] basic auth resolved (config basicAuth + prototype/htpasswd → **auth picker if none**)
|
|
29
|
-
- [ ] theme resolved (request → theme.json → manifest → config → **theme picker if none**)
|
|
30
|
-
- [ ] if picker: 3 recommendations + previews opened + user confirmed before setup
|
|
31
|
-
- [ ] prototype setup (with --theme when needed; persists when user named a theme)
|
|
32
|
-
- [ ] one .html per screen; prototypeStem from manifest
|
|
33
|
-
- [ ] prototype manifest && prototype validate --strict
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## Natural language
|
|
37
|
-
|
|
38
|
-
“HTML prototype”, “mockup screens”, “prototype with stripe theme” → this skill.
|
|
39
|
-
|
|
40
|
-
“Help me pick a theme”, “what theme fits my app?”, “show me theme options” → [theme-picker.md](references/theme-picker.md) (even before generating).
|
|
41
|
-
|
|
42
|
-
Constraints: `prototype/CLAUDE.md` in the project repo.
|
|
32
|
+
"HTML prototype", "mockup screens", "prototype with stripe theme" → this skill.
|
|
33
|
+
"Help me pick a theme" → load theme-picker.md directly.
|
package/scaffold/cursor/skills/ai-spector-generate-prototype/references/prototype-graph-context.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Graph context for prototype generation
|
|
2
|
+
|
|
3
|
+
Run these queries **before writing each screen's HTML**. The graph holds the authoritative spec — screen detail docs often summarize it; the graph has the full picture.
|
|
4
|
+
|
|
5
|
+
Skip this document only when the graph has zero nodes for the screen (brand-new project with no graph yet). In that case, note the gap and generate from screen detail doc alone.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Step 1 — Screen node + neighborhood
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
ai-spector graph query doc.bd.screen-<slug> --direction both --depth 4 --edges CONTEXT --json
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
What to extract from the result:
|
|
16
|
+
|
|
17
|
+
| Field / edge | Use in HTML |
|
|
18
|
+
|---|---|
|
|
19
|
+
| `satisfies` → F-xx nodes | Business rules, field constraints, success/error states |
|
|
20
|
+
| `satisfies` → UC-xx nodes | Actor roles, preconditions, flow steps, postconditions |
|
|
21
|
+
| `dependsOn` → `doc.bd.api-*` nodes | Form fields, request params, response columns |
|
|
22
|
+
| `contains` → section nodes | Section headings and subsections already defined |
|
|
23
|
+
| `tracesTo` → SRS nodes | NFR constraints (e.g. required, max length, format) |
|
|
24
|
+
|
|
25
|
+
If `doc.bd.screen-<slug>` is not found in the graph, try `screen-<slug>` or the screenId from `list-screens.md`.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Step 2 — Feature detail (per linked F-xx)
|
|
30
|
+
|
|
31
|
+
For each F-xx found in Step 1 `satisfies` edges:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
ai-spector graph query F-<n> --direction both --depth 3 --edges CONTEXT --json
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Extract:
|
|
38
|
+
- **Functional requirements** listed under the feature → must-have UI behaviours
|
|
39
|
+
- **Field definitions** (`rendersTo` → detail design docs if present)
|
|
40
|
+
- **Business rules** (validation, conditional visibility, permissions)
|
|
41
|
+
- **Actor** that performs / views this feature → drives role-based UI variants
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Step 3 — Use-case detail (per linked UC-xx)
|
|
46
|
+
|
|
47
|
+
For each UC-xx found in Step 1 `satisfies` edges:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
ai-spector graph query UC-<n> --direction both --depth 3 --edges CONTEXT --json
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Extract:
|
|
54
|
+
- **Primary actor** → who the screen is for; if multiple actors, plan role tabs or conditional sections
|
|
55
|
+
- **Preconditions** → what state must be shown before the main action (e.g. "must be logged in" → redirect guard state)
|
|
56
|
+
- **Main flow steps** → maps directly to the interactive sequence in the HTML (form → submit → result)
|
|
57
|
+
- **Alternative / exception flows** → error states and empty states to include
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Step 4 — API endpoint detail (per linked API)
|
|
62
|
+
|
|
63
|
+
For each `doc.bd.api-*` node found in Step 1 `dependsOn` edges:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
ai-spector graph query doc.bd.api-<slug> --direction both --depth 2 --edges DEPS --json
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Extract:
|
|
70
|
+
- **Request body fields** → form inputs (name, type, required/optional, format hints)
|
|
71
|
+
- **Response body fields** → table columns, card properties, display labels
|
|
72
|
+
- **HTTP method + path** → drives the form `action` hint and confirmation copy
|
|
73
|
+
- **Error codes** → error message copy and UI states (404 → empty state, 400 → inline validation, 401 → redirect)
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Step 5 — Actor / permission check
|
|
78
|
+
|
|
79
|
+
If the screen serves multiple actors (e.g. Admin + End User):
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
ai-spector graph query <actorId> --direction both --depth 2 --edges CONTEXT --json
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Use actor data to:
|
|
86
|
+
- Render role-specific sections (admin actions gated behind a permission check visual)
|
|
87
|
+
- Show the correct navigation items for each role
|
|
88
|
+
- Label buttons and headings with the actor's natural language (not just "user")
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Synthesis — before writing the HTML
|
|
93
|
+
|
|
94
|
+
Compile answers to these questions from the query results. Do **not** invent answers not grounded in graph data — leave a `<!-- TODO: not in spec -->` comment instead.
|
|
95
|
+
|
|
96
|
+
| Question | Source |
|
|
97
|
+
|---|---|
|
|
98
|
+
| What fields does the form have? | API request body (Step 4) |
|
|
99
|
+
| What columns / data does the list/detail show? | API response body (Step 4) |
|
|
100
|
+
| What validation rules apply? | F-xx business rules (Step 2) |
|
|
101
|
+
| What error states must exist? | UC exception flows (Step 3) + API error codes (Step 4) |
|
|
102
|
+
| What empty state must exist? | UC preconditions + API 404 handling |
|
|
103
|
+
| Which actors see what? | Actor roles (Step 3 + 5) |
|
|
104
|
+
| What is the navigation target after the main action? | UC postconditions + `list-screens.md` §2 flow |
|
|
105
|
+
| Any NFR constraints (length limits, formats)? | SRS `tracesTo` nodes (Step 1) |
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Accuracy rules
|
|
110
|
+
|
|
111
|
+
1. **Every form field must trace to** an API request field, an F-xx field definition, or a UC data requirement. Remove any field that has no graph backing.
|
|
112
|
+
2. **Every table column must trace to** an API response field or a data entity property. No invented columns.
|
|
113
|
+
3. **Every button / action must trace to** a UC main flow step or F-xx functional requirement. Label it with the spec's language, not generic copy ("Save" is fine only if the spec says save; use the spec's verb if it differs).
|
|
114
|
+
4. **Error and empty states are mandatory** when the UC has exception flows or the API returns error codes. A screen with only the happy-path is incomplete.
|
|
115
|
+
5. **Role-based sections are mandatory** when more than one actor satisfies the screen. Use a visual separator or tab — do not silently drop one actor's view.
|
|
@@ -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`
|
|
@@ -87,11 +94,25 @@ ai-spector prototype manifest --dry-run
|
|
|
87
94
|
|
|
88
95
|
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
96
|
|
|
97
|
+
### 2b. Load graph context per screen
|
|
98
|
+
|
|
99
|
+
**Required before writing each screen’s HTML.** Run the queries in [prototype-graph-context.md](./prototype-graph-context.md) for the screen being generated.
|
|
100
|
+
|
|
101
|
+
This step pulls:
|
|
102
|
+
- The F-xx / UC-xx the screen satisfies → business rules, required fields, flow steps, error states
|
|
103
|
+
- The API endpoints the screen depends on → exact form fields, response columns, error codes
|
|
104
|
+
- Actor roles → role-based UI sections
|
|
105
|
+
|
|
106
|
+
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.
|
|
107
|
+
|
|
90
108
|
### 3. Generate HTML
|
|
91
109
|
|
|
92
110
|
For each screen in scope:
|
|
93
111
|
|
|
94
112
|
- Write `prototype/src/<prototypeStem>.html` (self-contained or with sibling `.css`/`.js` in `prototype/src/`)
|
|
113
|
+
- All content derived from graph context (step 2b) + screen detail doc — no invented fields or labels
|
|
114
|
+
- Include error states and empty states for every exception flow found in the graph
|
|
115
|
+
- Render role-specific sections when multiple actors satisfy the screen
|
|
95
116
|
- Link navigation using relative paths between screens when `list-screens.md` §2 defines flow
|
|
96
117
|
- Do **not** edit `docs/**`
|
|
97
118
|
|
|
@@ -125,6 +146,12 @@ git commit -m "chore(prototype): add HTML screens (<theme>)"
|
|
|
125
146
|
- [ ] If no stored basic auth: [auth picker](auth-picker.md) run — username/password collected, `prototype auth` executed, `prototype/htpasswd` present
|
|
126
147
|
- [ ] If no stored theme: [theme picker](theme-picker.md) run — 3 recommendations, previews opened, user confirmed
|
|
127
148
|
- [ ] `prototype setup` run with resolved theme
|
|
149
|
+
- [ ] Graph context queries run per screen ([prototype-graph-context.md](./prototype-graph-context.md)) before writing HTML
|
|
150
|
+
- [ ] Every form field traces to an API request field or F-xx/UC-xx field definition
|
|
151
|
+
- [ ] Every table column traces to an API response field or data entity
|
|
152
|
+
- [ ] Every button/action label matches the spec's verb (not generic copy)
|
|
153
|
+
- [ ] Error states and empty states included for all UC exception flows + API error codes
|
|
154
|
+
- [ ] Role-based sections rendered when multiple actors satisfy the screen
|
|
128
155
|
- [ ] Every generated file name matches `prototypeStem` in manifest
|
|
129
156
|
- [ ] Wireframe/layout from screen detail doc reflected in HTML
|
|
130
157
|
- [ ] Tokens from `prototype/DESIGN.md` only (no random CDN)
|
|
@@ -10,27 +10,29 @@ paths:
|
|
|
10
10
|
- ".ai-spector/templates/srs/**"
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
#
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
13
|
+
# Generate SRS
|
|
14
|
+
|
|
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)
|
|
18
|
+
|
|
19
|
+
## Load when needed
|
|
20
|
+
|
|
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) |
|
|
34
|
+
|
|
35
|
+
## On CLI failure
|
|
36
|
+
Pause. Report full output. Offer fix + retry. Details in cli-failures.md.
|
|
37
|
+
|
|
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.
|
package/scaffold/cursor/skills/ai-spector-generate-srs/references/srs-context/data-requirements.md
ADDED
|
@@ -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 |
|
package/scaffold/cursor/skills/ai-spector-generate-srs/references/srs-context/external-interfaces.md
ADDED
|
@@ -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` |
|
package/scaffold/cursor/skills/ai-spector-generate-srs/references/srs-context/feature-detail.md
ADDED
|
@@ -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 |
|
package/scaffold/cursor/skills/ai-spector-generate-srs/references/srs-context/overall-description.md
ADDED
|
@@ -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` |
|
package/scaffold/cursor/skills/ai-spector-generate-srs/references/srs-context/quality-attributes.md
ADDED
|
@@ -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` |
|
package/scaffold/cursor/skills/ai-spector-generate-srs/references/srs-context/use-case-detail.md
ADDED
|
@@ -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 -->`.
|