specdx 0.4.0 → 0.6.0
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/.claude-plugin/plugin.json +2 -2
- package/README.md +43 -3
- package/dist/{check-PHXXA7VY.js → check-5EA2MTNN.js} +121 -27
- package/dist/check-5EA2MTNN.js.map +1 -0
- package/dist/{chunk-3YXRWQGX.js → chunk-2UUQJ2ER.js} +242 -53
- package/dist/chunk-2UUQJ2ER.js.map +1 -0
- package/dist/{chunk-NAWYG4VV.js → chunk-5XOWCPP2.js} +2 -2
- package/dist/{chunk-2BZIG7OE.js → chunk-BZL2XXMA.js} +14 -14
- package/dist/{chunk-SNQNQ2MP.js → chunk-JGD3BOPH.js} +16 -6
- package/dist/chunk-JGD3BOPH.js.map +1 -0
- package/dist/{chunk-YRQPY5NF.js → chunk-MOYYF7Q6.js} +2 -2
- package/dist/{chunk-OVIKIIR4.js → chunk-QAJZCJUJ.js} +4 -3
- package/dist/chunk-QAJZCJUJ.js.map +1 -0
- package/dist/{chunk-LJTLNXGV.js → chunk-VVZUJ6H4.js} +353 -4
- package/dist/chunk-VVZUJ6H4.js.map +1 -0
- package/dist/{chunk-HCJDCS26.js → chunk-XRWLPU24.js} +10 -1
- package/dist/chunk-XRWLPU24.js.map +1 -0
- package/dist/{diff-6C5LJ7SH.js → diff-ZT6HXHK5.js} +4 -4
- package/dist/dist-6WDWUOCV.js +26 -0
- package/dist/{dist-PK52GA7M.js → dist-A3CWALDC.js} +76 -16
- package/dist/dist-A3CWALDC.js.map +1 -0
- package/dist/{generate-K72WD455.js → generate-M6YKXUDE.js} +5 -5
- package/dist/{generate-story-NUCNYL3I.js → generate-story-BXGNKWC6.js} +4 -4
- package/dist/{generate-test-plan-Z46W3N3B.js → generate-test-plan-PZUNCNN3.js} +3 -3
- package/dist/{graph-4RNURBNP.js → graph-GKXD2IGW.js} +3 -3
- package/dist/index.d.ts +38 -0
- package/dist/index.js +463 -26
- package/dist/index.js.map +1 -1
- package/dist/{lint-2VZPNLE3.js → lint-GZX5C5EQ.js} +93 -14
- package/dist/lint-GZX5C5EQ.js.map +1 -0
- package/dist/main.js +3 -3
- package/dist/{mcp-E6PJWBDQ.js → mcp-VQAYNJQ7.js} +3 -3
- package/dist/{migrate-FKFC7UAO.js → migrate-VASWPA3L.js} +3 -3
- package/dist/{pack-DE4UBTCC.js → pack-DFUCNWVR.js} +4 -4
- package/dist/{ready-K74SLQ24.js → ready-5OFSV2OD.js} +5 -5
- package/dist/{status-IAE3BB77.js → status-5MDODW4N.js} +5 -5
- package/dist/{update-UFOHZEAK.js → update-NFXC45UT.js} +4 -4
- package/dist/{validate-EZHUB5TW.js → validate-LWRLZR3H.js} +3 -3
- package/package.json +5 -4
- package/skills/core/specdx-author-spec/SKILL.md +33 -0
- package/skills/core/specdx-author-spec/references/spec-type-reference.md +57 -0
- package/skills/core/specdx-author-spec/references/step-01-frontmatter.md +66 -0
- package/skills/core/specdx-author-spec/references/step-02-sections.md +111 -0
- package/skills/core/specdx-author-spec/references/step-03-finalize.md +48 -0
- package/skills/core/specdx-onboard/SKILL.md +54 -0
- package/skills/core/specdx-plan-from-spec/SKILL.md +76 -0
- package/skills/core/specdx-pre-commit/SKILL.md +70 -0
- package/skills/core/specdx-review-spec/SKILL.md +81 -0
- package/skills/core/specdx-router/SKILL.md +67 -0
- package/skills/core/specdx-sprint-review/SKILL.md +73 -0
- package/skills/core/specdx-start-task/SKILL.md +62 -0
- package/skills/experimental/specdx-check-drift/SKILL.md +77 -0
- package/skills/experimental/specdx-verify/SKILL.md +85 -0
- package/dist/check-PHXXA7VY.js.map +0 -1
- package/dist/chunk-3YXRWQGX.js.map +0 -1
- package/dist/chunk-HCJDCS26.js.map +0 -1
- package/dist/chunk-LJTLNXGV.js.map +0 -1
- package/dist/chunk-OVIKIIR4.js.map +0 -1
- package/dist/chunk-SNQNQ2MP.js.map +0 -1
- package/dist/dist-PK52GA7M.js.map +0 -1
- package/dist/dist-ROHCFKYT.js +0 -16
- package/dist/lint-2VZPNLE3.js.map +0 -1
- /package/dist/{chunk-NAWYG4VV.js.map → chunk-5XOWCPP2.js.map} +0 -0
- /package/dist/{chunk-2BZIG7OE.js.map → chunk-BZL2XXMA.js.map} +0 -0
- /package/dist/{chunk-YRQPY5NF.js.map → chunk-MOYYF7Q6.js.map} +0 -0
- /package/dist/{diff-6C5LJ7SH.js.map → diff-ZT6HXHK5.js.map} +0 -0
- /package/dist/{dist-ROHCFKYT.js.map → dist-6WDWUOCV.js.map} +0 -0
- /package/dist/{generate-K72WD455.js.map → generate-M6YKXUDE.js.map} +0 -0
- /package/dist/{generate-story-NUCNYL3I.js.map → generate-story-BXGNKWC6.js.map} +0 -0
- /package/dist/{generate-test-plan-Z46W3N3B.js.map → generate-test-plan-PZUNCNN3.js.map} +0 -0
- /package/dist/{graph-4RNURBNP.js.map → graph-GKXD2IGW.js.map} +0 -0
- /package/dist/{mcp-E6PJWBDQ.js.map → mcp-VQAYNJQ7.js.map} +0 -0
- /package/dist/{migrate-FKFC7UAO.js.map → migrate-VASWPA3L.js.map} +0 -0
- /package/dist/{pack-DE4UBTCC.js.map → pack-DFUCNWVR.js.map} +0 -0
- /package/dist/{ready-K74SLQ24.js.map → ready-5OFSV2OD.js.map} +0 -0
- /package/dist/{status-IAE3BB77.js.map → status-5MDODW4N.js.map} +0 -0
- /package/dist/{update-UFOHZEAK.js.map → update-NFXC45UT.js.map} +0 -0
- /package/dist/{validate-EZHUB5TW.js.map → validate-LWRLZR3H.js.map} +0 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
---
|
|
2
|
+
step: 2
|
|
3
|
+
name: Sections
|
|
4
|
+
description: Write sections one at a time, lint after every 2-3 sections
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Step 2: Write Sections
|
|
8
|
+
|
|
9
|
+
## Write sections one at a time
|
|
10
|
+
|
|
11
|
+
For each required section:
|
|
12
|
+
1. Explain what the section should contain
|
|
13
|
+
2. Ask the user for their thoughts
|
|
14
|
+
3. Draft the section
|
|
15
|
+
4. Refine based on feedback
|
|
16
|
+
|
|
17
|
+
### PRD tips
|
|
18
|
+
- Use **F1**, **F2** etc. for features — the `story-coverage` lint rule checks each has a user story
|
|
19
|
+
- Be specific in Non-Goals — this prevents scope creep
|
|
20
|
+
|
|
21
|
+
### Technical Design tips
|
|
22
|
+
- Include concrete field names and types in Data Model
|
|
23
|
+
- List specific risks with likelihood and mitigation
|
|
24
|
+
|
|
25
|
+
### ADR tips
|
|
26
|
+
- State the decision in one clear sentence, then elaborate
|
|
27
|
+
- List both positive AND negative consequences
|
|
28
|
+
|
|
29
|
+
### User Story tips
|
|
30
|
+
- Acceptance criteria should be testable
|
|
31
|
+
- Include the priority and estimate in frontmatter
|
|
32
|
+
|
|
33
|
+
### Test Plan tips
|
|
34
|
+
- Coverage matrix should map to features from the PRD
|
|
35
|
+
- Edge cases are often where bugs hide — be thorough
|
|
36
|
+
|
|
37
|
+
### API Contract tips
|
|
38
|
+
- Include both success and error response schemas
|
|
39
|
+
- Document auth requirements per endpoint
|
|
40
|
+
|
|
41
|
+
## Lint after every 2-3 sections
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx specdx lint --path <file>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Common issues:
|
|
48
|
+
|
|
49
|
+
| Issue | Fix |
|
|
50
|
+
|---|---|
|
|
51
|
+
| Vague language ("as appropriate", "etc.", "TBD") | Replace with concrete language |
|
|
52
|
+
| Missing required section | Add it, even if minimal |
|
|
53
|
+
| Broken reference | Check the referenced spec ID exists |
|
|
54
|
+
|
|
55
|
+
<HARD-GATE>
|
|
56
|
+
Do NOT skip the lint step between sections. Run `npx specdx lint --path <file>`
|
|
57
|
+
after every 2-3 sections. Do NOT write the entire spec and lint at the end.
|
|
58
|
+
</HARD-GATE>
|
|
59
|
+
|
|
60
|
+
## Sections `specdx check` parses
|
|
61
|
+
|
|
62
|
+
Three sections are read by `specdx check` and compared against code. Prose in
|
|
63
|
+
them is fine, but the entries themselves must take one of these shapes or the
|
|
64
|
+
section is reported as not assessed — which silently removes it from the
|
|
65
|
+
coverage score.
|
|
66
|
+
|
|
67
|
+
**`## Endpoints`** (api-contract) — a bullet per endpoint, a `###` heading per
|
|
68
|
+
endpoint, or both:
|
|
69
|
+
|
|
70
|
+
```markdown
|
|
71
|
+
- `GET /invoices` — list invoices
|
|
72
|
+
- POST /invoices — create an invoice
|
|
73
|
+
|
|
74
|
+
### DELETE /invoices/:id
|
|
75
|
+
|
|
76
|
+
Void an invoice.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**`## Data Model`** (technical-design) — a `###` heading per type, one field per
|
|
80
|
+
line as `- name: type`. Backticks are optional. The heading must be a single
|
|
81
|
+
identifier: `### Notes on the model` is read as prose, not as a type.
|
|
82
|
+
|
|
83
|
+
```markdown
|
|
84
|
+
### Invoice
|
|
85
|
+
|
|
86
|
+
- id: string
|
|
87
|
+
- `amountCents`: number
|
|
88
|
+
- paidAt?: Date
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**`## Test Cases`** (test-plan) — one bullet per case, optionally grouped under
|
|
92
|
+
`###` headings:
|
|
93
|
+
|
|
94
|
+
```markdown
|
|
95
|
+
### Invoices
|
|
96
|
+
|
|
97
|
+
- creates an invoice with a valid payload
|
|
98
|
+
- rejects an invoice with a negative amount
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Rationalizations to Resist
|
|
102
|
+
|
|
103
|
+
| Thought | Reality |
|
|
104
|
+
|---------|---------|
|
|
105
|
+
| "I'll lint at the end, it's faster" | Lint catches issues early. Fixing 1 issue now beats fixing 10 later. |
|
|
106
|
+
| "This section is simple, no need to lint" | Simple sections have frontmatter and reference issues too. |
|
|
107
|
+
| "The user seems in a hurry" | Shipping a broken spec wastes more time than linting. |
|
|
108
|
+
| "I already know the lint rules" | Rules evolve. Run the tool. |
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
**Next:** When all sections are written and linting clean, read `step-03-finalize.md` in this directory.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
step: 3
|
|
3
|
+
name: Finalize
|
|
4
|
+
description: Register in spec.config.yaml, run final validation
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Step 3: Finalize
|
|
8
|
+
|
|
9
|
+
## Register in spec.config.yaml
|
|
10
|
+
|
|
11
|
+
If this is a new spec, add it to `spec.config.yaml`:
|
|
12
|
+
|
|
13
|
+
```yaml
|
|
14
|
+
specs:
|
|
15
|
+
new-spec:
|
|
16
|
+
path: specs/new-spec.md
|
|
17
|
+
type: technical-design
|
|
18
|
+
requires: ["prd"]
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The `requires` field establishes dependency relationships used by `specdx graph` and `specdx pack`.
|
|
22
|
+
|
|
23
|
+
If the spec replaces an existing entry, update the path. If it's a glob pattern (e.g. `specs/stories/*.md`), no config change is needed — the new file is picked up automatically.
|
|
24
|
+
|
|
25
|
+
## Final validation
|
|
26
|
+
|
|
27
|
+
Run the full validation suite:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx specdx lint --path <file> --preset strict
|
|
31
|
+
npx specdx lint
|
|
32
|
+
npx specdx validate
|
|
33
|
+
npx specdx graph
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
This verifies:
|
|
37
|
+
- The new spec passes strict linting
|
|
38
|
+
- The full suite still passes (no broken cross-references)
|
|
39
|
+
- The config is valid
|
|
40
|
+
- The dependency graph is acyclic
|
|
41
|
+
|
|
42
|
+
## Report
|
|
43
|
+
|
|
44
|
+
Provide the user with:
|
|
45
|
+
- **Spec type** and file path
|
|
46
|
+
- **Lint status** (pass/fail, any remaining warnings)
|
|
47
|
+
- **Graph position** (what it depends on, what depends on it)
|
|
48
|
+
- **Next steps** (e.g. "run `npx specdx pack --task '...'` to include this spec in LLM context")
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specdx-onboard
|
|
3
|
+
description: "Use when a new developer joins the project, asks 'what is this project', 'explain the specs', 'how does this codebase work', 'what specs exist', or wants an overview of the spec suite. Provides a guided tour of the project's specs."
|
|
4
|
+
allowed-tools: Bash(npx specdx:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Onboard — Spec Suite Overview
|
|
8
|
+
|
|
9
|
+
Walk a new developer through the project's spec suite so they understand what exists, how specs relate, and where to start.
|
|
10
|
+
|
|
11
|
+
## Workflow
|
|
12
|
+
|
|
13
|
+
### Step 1: Get the overview
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx specdx status --format json
|
|
17
|
+
npx specdx graph
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`status` returns the project name, spec count, statuses, lint health, and stale specs. `graph` returns how the specs relate — both config `requires` edges and frontmatter `references`.
|
|
21
|
+
|
|
22
|
+
### Step 2: Load full spec content
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx specdx pack --full --format xml
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
This loads all spec content so you can reference specific details.
|
|
29
|
+
|
|
30
|
+
### Step 3: Walk through the project
|
|
31
|
+
|
|
32
|
+
Guide the developer through:
|
|
33
|
+
|
|
34
|
+
1. **What the project does** — summarise the PRD's Problem Statement and Goals
|
|
35
|
+
2. **How it's built** — summarise the Technical Design's Architecture and key decisions
|
|
36
|
+
3. **What specs exist** — list each spec with its type, status, and purpose
|
|
37
|
+
4. **How specs relate** — explain the dependency graph (what depends on what)
|
|
38
|
+
5. **Current health** — note any warnings, stale specs, or open questions
|
|
39
|
+
|
|
40
|
+
### Step 4: Invite questions
|
|
41
|
+
|
|
42
|
+
> "That's the spec landscape. What area would you like to dig into? I can explain any spec in more detail, show you the dependency chain for a specific feature, or help you find where a topic is covered."
|
|
43
|
+
|
|
44
|
+
## Tips
|
|
45
|
+
|
|
46
|
+
- Start high-level, then drill down based on the developer's questions
|
|
47
|
+
- Reference specific spec sections when explaining (e.g. "See PRD Feature F3 for details")
|
|
48
|
+
- If a spec is marked `draft`, note that it's tentative and may change
|
|
49
|
+
- If a spec is marked `superseded`, briefly mention what replaced it
|
|
50
|
+
- Use the dependency graph to explain why specs exist (e.g. "The test plan depends on the technical design because test cases reference the API endpoints defined there")
|
|
51
|
+
|
|
52
|
+
## It's working if
|
|
53
|
+
|
|
54
|
+
The reader can name what the project is for, which specs are authoritative, and where to look next — without opening a spec file. If your summary is a restatement of the spec list, it has not oriented anyone.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specdx-plan-from-spec
|
|
3
|
+
description: "Use when the user asks to plan implementation, create a plan from specs, or says 'how should I build this', 'plan this', 'create an implementation plan', or 'what's the approach'. Generates a step-by-step plan grounded in project specs."
|
|
4
|
+
allowed-tools: Bash(npx specdx:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Plan From Spec
|
|
8
|
+
|
|
9
|
+
Generate an implementation plan grounded in the project's specs.
|
|
10
|
+
|
|
11
|
+
## Workflow
|
|
12
|
+
|
|
13
|
+
### Step 1: Load spec context
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx specdx pack --task "$ARGUMENTS" --format xml --full
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Replace `$ARGUMENTS` with the user's task description.
|
|
20
|
+
|
|
21
|
+
If the output is too large (over 8000 tokens), re-run without `--full`:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx specdx pack --task "$ARGUMENTS" --format xml
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Step 2: Understand the specs
|
|
28
|
+
|
|
29
|
+
Read the packed output. Each `<spec>` has:
|
|
30
|
+
- `id` and `type` — what kind of spec
|
|
31
|
+
- `relevance` — how relevant to the task (0-1)
|
|
32
|
+
- Sections with the actual content
|
|
33
|
+
|
|
34
|
+
Focus on the highest-relevance specs first.
|
|
35
|
+
|
|
36
|
+
### Step 3: Generate the plan
|
|
37
|
+
|
|
38
|
+
Create a step-by-step implementation plan with:
|
|
39
|
+
|
|
40
|
+
1. **File targets** — which files to create or modify
|
|
41
|
+
2. **Dependency order** — what to build first based on the spec dependency graph
|
|
42
|
+
3. **Test expectations** — what tests to write for each step
|
|
43
|
+
4. **Spec references** — link each step back to the relevant spec section (e.g. "implements PRD Feature F2", "satisfies test-plan edge case 3")
|
|
44
|
+
|
|
45
|
+
### Step 4: Structure for execution
|
|
46
|
+
|
|
47
|
+
If the user has the superpowers plugin installed, structure the plan to be compatible with the `writing-plans` skill format:
|
|
48
|
+
|
|
49
|
+
- Use checkbox syntax (`- [ ]`) for each step
|
|
50
|
+
- Include exact file paths
|
|
51
|
+
- Include code snippets where helpful
|
|
52
|
+
- Group steps into logical tasks (2-5 minutes each)
|
|
53
|
+
|
|
54
|
+
If the user doesn't have superpowers, use a simpler numbered list format.
|
|
55
|
+
|
|
56
|
+
## Spec types and what they tell you
|
|
57
|
+
|
|
58
|
+
| Type | What to extract for the plan |
|
|
59
|
+
|---|---|
|
|
60
|
+
| `prd` | Feature list (F1, F2...), success criteria, non-goals (what NOT to build) |
|
|
61
|
+
| `technical-design` | Architecture, data model, API design, dependencies, risks |
|
|
62
|
+
| `user-story` | Acceptance criteria, priority, estimate |
|
|
63
|
+
| `test-plan` | Test cases, coverage matrix, edge cases |
|
|
64
|
+
| `adr` | Decisions and constraints to respect |
|
|
65
|
+
| `api-contract` | Endpoints, schemas, auth requirements |
|
|
66
|
+
|
|
67
|
+
## How to use the context
|
|
68
|
+
|
|
69
|
+
1. **Reference specs** — mention feature IDs or spec sections when your plan relates to them
|
|
70
|
+
2. **Flag gaps** — if the task needs decisions not covered by any spec, say so
|
|
71
|
+
3. **Respect non-goals** — if the PRD says "not X", don't plan for X
|
|
72
|
+
4. **Note risks** — if the technical design lists risks relevant to the task, address them in the plan
|
|
73
|
+
|
|
74
|
+
## It's working if
|
|
75
|
+
|
|
76
|
+
Every step traces to a spec section or is explicitly flagged as a gap the specs do not cover. A plan with steps that trace to neither is invention, not planning.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specdx-pre-commit
|
|
3
|
+
description: "Use when the user is about to commit, mentions committing, or says 'let's commit', 'ready to commit', 'wrap up', or 'commit this'. Checks spec health and flags drift before committing."
|
|
4
|
+
allowed-tools: Bash(npx specdx:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Pre-Commit Spec Check
|
|
8
|
+
|
|
9
|
+
Run spec health checks before committing to catch drift early.
|
|
10
|
+
|
|
11
|
+
<HARD-GATE>
|
|
12
|
+
Do NOT skip the diff step. Even if the user says "just commit", run the checks and surface the results before proceeding. Silent skipping leads to undetected spec drift.
|
|
13
|
+
</HARD-GATE>
|
|
14
|
+
|
|
15
|
+
## Workflow
|
|
16
|
+
|
|
17
|
+
### Step 1: Lint
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx specdx lint
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
If lint errors are found, report them and ask the user to fix before committing.
|
|
24
|
+
|
|
25
|
+
### Step 2: Diff
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npx specdx diff --working
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`--working` is required at this step. You are about to commit, so the changes in
|
|
32
|
+
question are still in the working tree. Plain `npx specdx diff` compares
|
|
33
|
+
committed refs only and would report "no spec changes" for the very edits being
|
|
34
|
+
committed — a false all-clear.
|
|
35
|
+
|
|
36
|
+
If the command fails (e.g. no git history), skip this step and note it.
|
|
37
|
+
|
|
38
|
+
### Step 3: Present results
|
|
39
|
+
|
|
40
|
+
**If no spec changes detected:**
|
|
41
|
+
> "No spec changes — safe to commit."
|
|
42
|
+
|
|
43
|
+
Only say this after a `--working` run. If the diff warns that spec files in the
|
|
44
|
+
working tree were not covered, the run was not `--working`. Re-run it before
|
|
45
|
+
reporting anything.
|
|
46
|
+
|
|
47
|
+
**If changes detected, present a summary:**
|
|
48
|
+
- Which specs changed and what sections were modified
|
|
49
|
+
- Downstream specs that may need updating (with staleness scores)
|
|
50
|
+
- Whether any downstream specs are flagged as stale
|
|
51
|
+
|
|
52
|
+
### Step 4: Ask the user
|
|
53
|
+
|
|
54
|
+
> "Do you want to update downstream specs before committing, or proceed as-is?"
|
|
55
|
+
|
|
56
|
+
Respect the user's decision either way.
|
|
57
|
+
|
|
58
|
+
## Rationalizations to Resist
|
|
59
|
+
|
|
60
|
+
| Thought | Reality |
|
|
61
|
+
|---------|---------|
|
|
62
|
+
| "The user just wants to commit quickly" | A 5-second check prevents hours of drift debugging. |
|
|
63
|
+
| "There are no spec files in the diff" | Code changes can still drift from specs. Run the check. |
|
|
64
|
+
| "I already ran lint earlier" | Specs may have changed since. Run it again. |
|
|
65
|
+
| "The diff command failed, so skip everything" | Report the lint results at minimum. |
|
|
66
|
+
| "`specdx diff` said no changes, so we're clear" | Without `--working` it never looked at the working tree. Re-run with the flag. |
|
|
67
|
+
|
|
68
|
+
## It's working if
|
|
69
|
+
|
|
70
|
+
You ran `specdx diff --working` and can state which specs changed, or that none did. If you said "safe to commit" from a run that never looked at the working tree, the check reported on the wrong thing.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specdx-review-spec
|
|
3
|
+
description: "Use when the user asks to review a spec, says 'is this spec good enough', 'review my spec', 'check spec quality', or 'audit this spec'. Runs multi-layer spec quality review."
|
|
4
|
+
allowed-tools: Bash(npx specdx:*) Read Agent
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Review Spec Quality
|
|
8
|
+
|
|
9
|
+
Run a three-layer review of a spec: completeness, consistency, and adversarial analysis. Each layer uses a specialized subagent.
|
|
10
|
+
|
|
11
|
+
## Workflow
|
|
12
|
+
|
|
13
|
+
### Step 1: Identify the spec to review
|
|
14
|
+
|
|
15
|
+
Ask the user which spec to review if not clear from context. Get the file path.
|
|
16
|
+
|
|
17
|
+
### Step 2: Gather context
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx specdx lint --path <spec-file> --preset strict
|
|
21
|
+
npx specdx graph
|
|
22
|
+
npx specdx status --format json
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Step 3: Run three review passes
|
|
26
|
+
|
|
27
|
+
Dispatch three subagents using the templates in the `templates/` directory next to this file's parent directory. Each subagent gets the spec path and related context.
|
|
28
|
+
|
|
29
|
+
**Pass 1 — Completeness** (use `templates/spec-reviewer.md`):
|
|
30
|
+
- Are all required sections present and non-empty?
|
|
31
|
+
- Is the frontmatter valid?
|
|
32
|
+
- Are cross-references intact?
|
|
33
|
+
|
|
34
|
+
**Pass 2 — Consistency** (use `templates/consistency-reviewer.md`):
|
|
35
|
+
- Is terminology consistent across specs?
|
|
36
|
+
- Do names and IDs align?
|
|
37
|
+
- Are versions and statuses coherent?
|
|
38
|
+
|
|
39
|
+
**Pass 3 — Adversarial** (use `templates/adversarial-reviewer.md`):
|
|
40
|
+
- What edge cases are missing?
|
|
41
|
+
- What's ambiguous?
|
|
42
|
+
- What could go wrong?
|
|
43
|
+
|
|
44
|
+
### Step 4: Aggregate results
|
|
45
|
+
|
|
46
|
+
Present a combined report:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
## Spec Review: <spec-title>
|
|
50
|
+
|
|
51
|
+
### Completeness
|
|
52
|
+
[pass 1 results]
|
|
53
|
+
|
|
54
|
+
### Consistency
|
|
55
|
+
[pass 2 results]
|
|
56
|
+
|
|
57
|
+
### Adversarial Analysis
|
|
58
|
+
[pass 3 results]
|
|
59
|
+
|
|
60
|
+
### Summary
|
|
61
|
+
- X critical issues
|
|
62
|
+
- Y improvements recommended
|
|
63
|
+
- Overall: ready for implementation | needs revision | needs major rework
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
<HARD-GATE>
|
|
67
|
+
Do NOT skip any of the three review passes. Each catches different classes of problems. A spec that passes completeness review may still have critical adversarial gaps.
|
|
68
|
+
</HARD-GATE>
|
|
69
|
+
|
|
70
|
+
## Rationalizations to Resist
|
|
71
|
+
|
|
72
|
+
| Thought | Reality |
|
|
73
|
+
|---------|---------|
|
|
74
|
+
| "The spec looks fine to me" | You're not adversarial enough. Run all three passes. |
|
|
75
|
+
| "Three passes is overkill for a small spec" | Small specs have the most gaps. Run all three. |
|
|
76
|
+
| "The completeness pass already found issues, so skip the rest" | Consistency and adversarial reviews find different issues. |
|
|
77
|
+
| "I can combine the passes into one review" | Separate passes with different prompts catch more. |
|
|
78
|
+
|
|
79
|
+
## It's working if
|
|
80
|
+
|
|
81
|
+
Each of the three passes produced at least one finding, or you can say precisely why it found nothing. Three clean passes on a first-draft spec usually means the passes were not adversarial.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specdx-router
|
|
3
|
+
description: Ask which specdx workflow fits your situation. A map over the spec-driven flow — authoring, planning, implementing, verifying, shipping — and where the human decisions sit.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
allowed-tools: Bash(npx specdx:*)
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Which specdx workflow fits?
|
|
9
|
+
|
|
10
|
+
You describe where you are. This names the workflow and the next thing to run.
|
|
11
|
+
|
|
12
|
+
It recommends and stops. It does not author a spec, build a plan, or fire the
|
|
13
|
+
skill it names — what you get back is the next thing to type.
|
|
14
|
+
|
|
15
|
+
## The main flow
|
|
16
|
+
|
|
17
|
+
Idea → spec → plan → implement → verify → commit. Most work enters at step 1
|
|
18
|
+
or step 3.
|
|
19
|
+
|
|
20
|
+
| Step | Skill | The decision it leaves you |
|
|
21
|
+
|---|---|---|
|
|
22
|
+
| 1. Capture intent | `specdx-author-spec` | Which spec type, and whether this needs a spec at all |
|
|
23
|
+
| 2. Quality-gate the spec | `specdx-review-spec` | Whether the spec is concrete enough to build from |
|
|
24
|
+
| 3. Load context | `specdx-start-task` | Nothing — run it before every coding session |
|
|
25
|
+
| 4. Plan the build | `specdx-plan-from-spec` | Slice order, and what to defer |
|
|
26
|
+
| 5. Ship it | `specdx-pre-commit` | Whether downstream specs get updated now or later |
|
|
27
|
+
|
|
28
|
+
## Route by situation
|
|
29
|
+
|
|
30
|
+
| Where you are | What to reach for |
|
|
31
|
+
|---|---|
|
|
32
|
+
| New to this repo, don't know what the specs say | `specdx-onboard` |
|
|
33
|
+
| About to write code | `specdx-start-task` — always, before the first edit |
|
|
34
|
+
| An idea that isn't written down yet | `specdx-author-spec` |
|
|
35
|
+
| A spec exists but feels vague | `specdx-review-spec` |
|
|
36
|
+
| A spec is solid, need an approach | `specdx-plan-from-spec` |
|
|
37
|
+
| About to commit | `specdx-pre-commit` |
|
|
38
|
+
| Reporting progress to other people | `specdx-sprint-review` |
|
|
39
|
+
| Wondering if the code still matches the specs | `specdx-verify` (experimental) |
|
|
40
|
+
| Wondering if the specs still match the code | `specdx-check-drift` (experimental) |
|
|
41
|
+
|
|
42
|
+
The last two are experimental: they are built on `specdx check`, whose static
|
|
43
|
+
analysis is noisy on prose-heavy specs. Treat their findings as prompts to look,
|
|
44
|
+
not as failures.
|
|
45
|
+
|
|
46
|
+
## Distinctions that are easy to get wrong
|
|
47
|
+
|
|
48
|
+
- **`specdx-start-task` vs `specdx-plan-from-spec`** — turns on whether you know
|
|
49
|
+
the approach. `start-task` loads context so you can begin. `plan-from-spec`
|
|
50
|
+
decides the order of work first. A one-file change needs the former only.
|
|
51
|
+
- **`specdx-verify` vs `specdx-check-drift`** — turns on which side you suspect.
|
|
52
|
+
`verify` asks "did I build what the spec said". `check-drift` asks "have the
|
|
53
|
+
specs fallen behind the code".
|
|
54
|
+
- **`specdx-review-spec` vs `specdx lint`** — turns on what kind of problem.
|
|
55
|
+
`lint` catches structural and mechanical faults. `review-spec` judges whether
|
|
56
|
+
the content is decision-ready.
|
|
57
|
+
|
|
58
|
+
## When you don't need any of this
|
|
59
|
+
|
|
60
|
+
A typo fix, a dependency bump, a rename with no behaviour change. Spec context
|
|
61
|
+
costs tokens and attention; spend it where intent is genuinely at stake.
|
|
62
|
+
|
|
63
|
+
## It's working if
|
|
64
|
+
|
|
65
|
+
You leave knowing the single next command to type, and why the neighbouring
|
|
66
|
+
skill was not it. If two skills still look interchangeable after reading this,
|
|
67
|
+
the router has failed — say so, because that is a bug in this file.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specdx-sprint-review
|
|
3
|
+
description: "Use when the user asks for a summary, sprint review, spec health report, progress update, or says 'how are specs looking', 'spec health', or 'what changed'. Generates a shareable spec health report."
|
|
4
|
+
allowed-tools: Bash(npx specdx:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Sprint Review — Spec Health Report
|
|
8
|
+
|
|
9
|
+
Generate a shareable summary of spec suite health and recent changes.
|
|
10
|
+
|
|
11
|
+
## Workflow
|
|
12
|
+
|
|
13
|
+
### Step 1: Get current health
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx specdx status --format json
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Parse the JSON output to understand: project name, spec count, lint health (errors/warnings), stale specs, verdict.
|
|
20
|
+
|
|
21
|
+
### Step 2: Get recent changes
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx specdx diff --format json
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
If this fails (e.g. no git history or no baseline branch), skip and note "diff unavailable".
|
|
28
|
+
|
|
29
|
+
Parse the JSON to understand: which specs changed, sections modified, downstream impact.
|
|
30
|
+
|
|
31
|
+
### Step 3: Synthesise the report
|
|
32
|
+
|
|
33
|
+
Present a markdown report covering:
|
|
34
|
+
|
|
35
|
+
1. **Health verdict** — healthy/warnings/errors with spec count
|
|
36
|
+
2. **Lint status** — errors and warnings count
|
|
37
|
+
3. **Recent changes** — specs added, modified, or removed (from diff)
|
|
38
|
+
4. **Downstream impact** — which specs may need attention, staleness scores
|
|
39
|
+
5. **Stale specs** — any specs not updated past the threshold
|
|
40
|
+
6. **Recommended actions** — concrete suggestions (e.g. "technical-design hasn't been updated since prd changed 5 days ago")
|
|
41
|
+
|
|
42
|
+
### Step 4: Format for sharing
|
|
43
|
+
|
|
44
|
+
Present the report in clean markdown that can be pasted directly into Slack, a PR description, or a standup document.
|
|
45
|
+
|
|
46
|
+
## Reading the output
|
|
47
|
+
|
|
48
|
+
The `status --format json` output looks like:
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"project": "my-project",
|
|
52
|
+
"specFiles": 3,
|
|
53
|
+
"byStatus": {"approved": 2, "draft": 1},
|
|
54
|
+
"lintHealth": {"errors": 0, "warnings": 2, "passing": 3},
|
|
55
|
+
"staleSpecs": [{"specId": "tech", "daysSinceUpdate": 15}],
|
|
56
|
+
"verdict": "warnings"
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The `diff --format json` output looks like:
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"diffs": [{"specId": "prd", "summary": "prd: 1 field(s) changed, 1 section(s) changed"}],
|
|
64
|
+
"added": [],
|
|
65
|
+
"removed": [],
|
|
66
|
+
"impact": [{"changedSpec": "prd", "downstream": [{"specId": "tech", "staleness": 0.7}]}],
|
|
67
|
+
"summary": "1 spec changed, 1 downstream affected"
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## It's working if
|
|
72
|
+
|
|
73
|
+
Someone who did not attend the work can read the report and know the suite's health and what changed. If `diff` was unavailable, the report says so rather than implying nothing changed.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specdx-start-task
|
|
3
|
+
description: Use when the user describes work they're about to do, mentions implementing a feature, asks to start a task, or says 'implement', 'build', 'add', 'fix', or 'refactor'. Loads relevant spec context before coding.
|
|
4
|
+
allowed-tools: Bash(npx specdx:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Load Spec Context
|
|
8
|
+
|
|
9
|
+
Run the following command, replacing the task description with what the user wants to work on:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx specdx pack --task "$ARGUMENTS" --format xml --full
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
If the output is too large (over 8000 tokens), re-run with compression:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx specdx pack --task "$ARGUMENTS" --format xml
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
If the command fails with "No spec.config.yaml found", tell the user the project isn't set up with specdx yet and proceed without spec context.
|
|
22
|
+
|
|
23
|
+
## Reading the output
|
|
24
|
+
|
|
25
|
+
The pack command outputs XML like this:
|
|
26
|
+
|
|
27
|
+
```xml
|
|
28
|
+
<context budget="12000" used="2349" specs="2" compressed="0">
|
|
29
|
+
<spec id="prd" type="prd" relevance="0.92" tokens="860">
|
|
30
|
+
<section name="Features">
|
|
31
|
+
- **F1**: Email login
|
|
32
|
+
- **F2**: OAuth support
|
|
33
|
+
</section>
|
|
34
|
+
</spec>
|
|
35
|
+
</context>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Each `<spec>` has a relevance score (0-1). Sections marked `compressed="true"` were collapsed because they haven't changed recently — re-run with `--full` if you need them.
|
|
39
|
+
|
|
40
|
+
## Spec types
|
|
41
|
+
|
|
42
|
+
| Type | Contains |
|
|
43
|
+
|---|---|
|
|
44
|
+
| `prd` | Problem statement, goals, non-goals, features (F1, F2...), success criteria |
|
|
45
|
+
| `technical-design` | Architecture, data model, API design, dependencies, risks, open questions |
|
|
46
|
+
| `user-story` | Description, acceptance criteria, priority, estimate |
|
|
47
|
+
| `test-plan` | Scope, test cases, coverage matrix, edge cases |
|
|
48
|
+
| `adr` | Architecture decision: context, decision, consequences |
|
|
49
|
+
| `api-contract` | Endpoints, request/response schemas, auth, error codes |
|
|
50
|
+
|
|
51
|
+
## How to use the context
|
|
52
|
+
|
|
53
|
+
For the rest of the session:
|
|
54
|
+
|
|
55
|
+
1. **Reference specs** — mention feature IDs or spec sections when your implementation relates to them
|
|
56
|
+
2. **Flag drift** — if the code or the user's request contradicts a spec, surface it clearly. Do NOT silently ignore contradictions.
|
|
57
|
+
3. **Note gaps** — if the task needs decisions not covered by any spec, say so
|
|
58
|
+
4. **Respect status** — `approved` specs are current truth; `draft` specs are tentative; `superseded` specs show as collapsed one-liners
|
|
59
|
+
|
|
60
|
+
## It's working if
|
|
61
|
+
|
|
62
|
+
You can name the specs governing the task and any constraint they impose, before the first edit. If `pack` returned no specs, that is a signal to check the task wording — not a licence to code without context.
|