superspec 0.1.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/LICENSE +21 -0
- package/README.md +328 -0
- package/dist/cli/commands/archive.d.ts +7 -0
- package/dist/cli/commands/archive.d.ts.map +1 -0
- package/dist/cli/commands/archive.js +322 -0
- package/dist/cli/commands/archive.js.map +1 -0
- package/dist/cli/commands/init.d.ts +6 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +306 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/list.d.ts +9 -0
- package/dist/cli/commands/list.d.ts.map +1 -0
- package/dist/cli/commands/list.js +268 -0
- package/dist/cli/commands/list.js.map +1 -0
- package/dist/cli/commands/show.d.ts +6 -0
- package/dist/cli/commands/show.d.ts.map +1 -0
- package/dist/cli/commands/show.js +273 -0
- package/dist/cli/commands/show.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +8 -0
- package/dist/cli/commands/validate.d.ts.map +1 -0
- package/dist/cli/commands/validate.js +209 -0
- package/dist/cli/commands/validate.js.map +1 -0
- package/dist/cli/commands/verify.d.ts +7 -0
- package/dist/cli/commands/verify.d.ts.map +1 -0
- package/dist/cli/commands/verify.js +328 -0
- package/dist/cli/commands/verify.js.map +1 -0
- package/dist/cli/commands/view.d.ts +6 -0
- package/dist/cli/commands/view.d.ts.map +1 -0
- package/dist/cli/commands/view.js +290 -0
- package/dist/cli/commands/view.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +87 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/ui/display.d.ts +189 -0
- package/dist/cli/ui/display.d.ts.map +1 -0
- package/dist/cli/ui/display.js +449 -0
- package/dist/cli/ui/display.js.map +1 -0
- package/dist/cli/ui/index.d.ts +12 -0
- package/dist/cli/ui/index.d.ts.map +1 -0
- package/dist/cli/ui/index.js +71 -0
- package/dist/cli/ui/index.js.map +1 -0
- package/dist/cli/ui/interactive.d.ts +21 -0
- package/dist/cli/ui/interactive.d.ts.map +1 -0
- package/dist/cli/ui/interactive.js +60 -0
- package/dist/cli/ui/interactive.js.map +1 -0
- package/dist/cli/ui/palette.d.ts +301 -0
- package/dist/cli/ui/palette.d.ts.map +1 -0
- package/dist/cli/ui/palette.js +673 -0
- package/dist/cli/ui/palette.js.map +1 -0
- package/dist/cli/ui/prompts.d.ts +62 -0
- package/dist/cli/ui/prompts.d.ts.map +1 -0
- package/dist/cli/ui/prompts.js +119 -0
- package/dist/cli/ui/prompts.js.map +1 -0
- package/dist/cli/ui/spinner.d.ts +38 -0
- package/dist/cli/ui/spinner.d.ts.map +1 -0
- package/dist/cli/ui/spinner.js +72 -0
- package/dist/cli/ui/spinner.js.map +1 -0
- package/dist/core/config/project-config.d.ts +100 -0
- package/dist/core/config/project-config.d.ts.map +1 -0
- package/dist/core/config/project-config.js +87 -0
- package/dist/core/config/project-config.js.map +1 -0
- package/dist/core/parsers/spec-parser.d.ts +48 -0
- package/dist/core/parsers/spec-parser.d.ts.map +1 -0
- package/dist/core/parsers/spec-parser.js +322 -0
- package/dist/core/parsers/spec-parser.js.map +1 -0
- package/dist/core/validation/spec-validator.d.ts +32 -0
- package/dist/core/validation/spec-validator.d.ts.map +1 -0
- package/dist/core/validation/spec-validator.js +242 -0
- package/dist/core/validation/spec-validator.js.map +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/package.json +66 -0
- package/schemas/superspec-workflow/schema.yaml +166 -0
- package/templates/design.md +71 -0
- package/templates/plan.md +78 -0
- package/templates/proposal.md +36 -0
- package/templates/spec.md +57 -0
- package/templates/tasks.md +29 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SuperSpec - Unified Spec-Driven Development Framework
|
|
3
|
+
*
|
|
4
|
+
* Core Principle:
|
|
5
|
+
* Every Scenario becomes a test, every test traces to a Scenario.
|
|
6
|
+
*
|
|
7
|
+
* @module superspec
|
|
8
|
+
*/
|
|
9
|
+
// Core exports
|
|
10
|
+
export { validateSpec, validateSpecSet } from './core/validation/spec-validator.js';
|
|
11
|
+
export { parseSpec, parseDeltaSpec, serializeSpec } from './core/parsers/spec-parser.js';
|
|
12
|
+
export { loadProjectConfig, getDefaultConfig, serializeConfig } from './core/config/project-config.js';
|
|
13
|
+
/**
|
|
14
|
+
* SuperSpec version
|
|
15
|
+
*/
|
|
16
|
+
export const VERSION = '0.1.0';
|
|
17
|
+
/**
|
|
18
|
+
* Core principles (Iron Laws)
|
|
19
|
+
*/
|
|
20
|
+
export const IRON_LAWS = {
|
|
21
|
+
TDD: 'NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST',
|
|
22
|
+
SPECS: 'SPECS ARE TRUTH. CHANGES ARE PROPOSALS.',
|
|
23
|
+
SUPERSPEC: 'EVERY SCENARIO BECOMES A TEST. EVERY TEST TRACES TO A SCENARIO.',
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Workflow phases
|
|
27
|
+
*/
|
|
28
|
+
export const WORKFLOW_PHASES = [
|
|
29
|
+
'brainstorm',
|
|
30
|
+
'plan',
|
|
31
|
+
'execute',
|
|
32
|
+
'verify',
|
|
33
|
+
'archive',
|
|
34
|
+
];
|
|
35
|
+
/**
|
|
36
|
+
* Brainstorm sub-phases
|
|
37
|
+
*/
|
|
38
|
+
export const BRAINSTORM_PHASES = [
|
|
39
|
+
'explore',
|
|
40
|
+
'propose',
|
|
41
|
+
'design',
|
|
42
|
+
'spec',
|
|
43
|
+
];
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,eAAe;AACf,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAGpF,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAGzF,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGvG;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAE/B;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,GAAG,EAAE,iDAAiD;IACtD,KAAK,EAAE,yCAAyC;IAChD,SAAS,EAAE,iEAAiE;CACpE,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,YAAY;IACZ,MAAM;IACN,SAAS;IACT,QAAQ;IACR,SAAS;CACD,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,SAAS;IACT,SAAS;IACT,QAAQ;IACR,MAAM;CACE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "superspec",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "SuperSpec - Unified spec-driven development framework",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"superspec": "dist/cli/index.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"dev": "tsc --watch",
|
|
13
|
+
"test": "vitest",
|
|
14
|
+
"test:coverage": "vitest --coverage",
|
|
15
|
+
"lint": "eslint src/",
|
|
16
|
+
"typecheck": "tsc --noEmit",
|
|
17
|
+
"clean": "rm -rf dist/",
|
|
18
|
+
"prepublishOnly": "npm run build"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"superspec",
|
|
22
|
+
"tdd",
|
|
23
|
+
"specification",
|
|
24
|
+
"development",
|
|
25
|
+
"workflow",
|
|
26
|
+
"testing",
|
|
27
|
+
"bdd",
|
|
28
|
+
"documentation"
|
|
29
|
+
],
|
|
30
|
+
"author": "Hank Liu",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/HankLiu447/superspec.git"
|
|
35
|
+
},
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/HankLiu447/superspec/issues"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://github.com/HankLiu447/superspec#readme",
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@inquirer/prompts": "^8.2.0",
|
|
42
|
+
"chalk": "^5.3.0",
|
|
43
|
+
"commander": "^12.1.0",
|
|
44
|
+
"glob": "^10.3.10",
|
|
45
|
+
"gray-matter": "^4.0.3",
|
|
46
|
+
"ora": "^9.0.0",
|
|
47
|
+
"yaml": "^2.3.4",
|
|
48
|
+
"zod": "^3.22.4"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@types/node": "^20.11.0",
|
|
52
|
+
"@typescript-eslint/eslint-plugin": "^6.19.0",
|
|
53
|
+
"@typescript-eslint/parser": "^6.19.0",
|
|
54
|
+
"eslint": "^8.56.0",
|
|
55
|
+
"typescript": "^5.3.3",
|
|
56
|
+
"vitest": "^1.2.0"
|
|
57
|
+
},
|
|
58
|
+
"engines": {
|
|
59
|
+
"node": ">=18.0.0"
|
|
60
|
+
},
|
|
61
|
+
"files": [
|
|
62
|
+
"dist/",
|
|
63
|
+
"templates/",
|
|
64
|
+
"schemas/"
|
|
65
|
+
]
|
|
66
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
name: superspec-workflow
|
|
2
|
+
version: 2
|
|
3
|
+
description: |
|
|
4
|
+
SuperSpec unified spec-driven development workflow.
|
|
5
|
+
|
|
6
|
+
Flow: brainstorm → plan → execute → verify → archive
|
|
7
|
+
|
|
8
|
+
Brainstorm is a progressive flow: Explore → Propose → Design → Spec
|
|
9
|
+
|
|
10
|
+
artifacts:
|
|
11
|
+
# ============================================
|
|
12
|
+
# Phase 1: Brainstorm (Explore → Propose → Design → Spec)
|
|
13
|
+
# ============================================
|
|
14
|
+
- id: brainstorm
|
|
15
|
+
generates:
|
|
16
|
+
- proposal.md
|
|
17
|
+
- design.md
|
|
18
|
+
- "specs/**/*.md"
|
|
19
|
+
description: |
|
|
20
|
+
Progressive design flow from exploration to specifications.
|
|
21
|
+
Four phases: Explore → Propose → Design → Spec
|
|
22
|
+
instruction: |
|
|
23
|
+
Use the brainstorm skill for a progressive flow:
|
|
24
|
+
|
|
25
|
+
**Phase 1: EXPLORE**
|
|
26
|
+
- Free-form exploration
|
|
27
|
+
- Ask clarifying questions (one at a time)
|
|
28
|
+
- Investigate codebase
|
|
29
|
+
- Visualize with ASCII diagrams
|
|
30
|
+
- Challenge assumptions
|
|
31
|
+
|
|
32
|
+
Transition: "Problem is clear enough, let's define the change scope"
|
|
33
|
+
|
|
34
|
+
**Phase 2: PROPOSE**
|
|
35
|
+
- Define Why (problem/opportunity)
|
|
36
|
+
- Define What Changes
|
|
37
|
+
- Define Capabilities (new/modified)
|
|
38
|
+
- Define Impact
|
|
39
|
+
- Generate proposal.md
|
|
40
|
+
|
|
41
|
+
Transition: "Change scope is defined, let's design the technical approach"
|
|
42
|
+
|
|
43
|
+
**Phase 3: DESIGN**
|
|
44
|
+
- Present 2-3 approaches with trade-offs
|
|
45
|
+
- Compare and recommend
|
|
46
|
+
- Document technical decisions
|
|
47
|
+
- Generate design.md
|
|
48
|
+
|
|
49
|
+
Transition: "Technical approach is decided, let's define the specifications"
|
|
50
|
+
|
|
51
|
+
**Phase 4: SPEC**
|
|
52
|
+
- Define Requirements (system SHALL...)
|
|
53
|
+
- Define Scenarios (WHEN/THEN) - each becomes a test
|
|
54
|
+
- Generate specs/*.md
|
|
55
|
+
|
|
56
|
+
Output:
|
|
57
|
+
- superspec/changes/[id]/proposal.md
|
|
58
|
+
- superspec/changes/[id]/design.md
|
|
59
|
+
- superspec/changes/[id]/specs/[capability]/spec.md
|
|
60
|
+
requires: []
|
|
61
|
+
|
|
62
|
+
# ============================================
|
|
63
|
+
# Phase 2: Planning
|
|
64
|
+
# ============================================
|
|
65
|
+
- id: plan
|
|
66
|
+
generates: plan.md
|
|
67
|
+
description: TDD implementation plan based on Specs
|
|
68
|
+
template: plan.md
|
|
69
|
+
instruction: |
|
|
70
|
+
Create TDD implementation plan. Each Scenario becomes a test.
|
|
71
|
+
|
|
72
|
+
Structure for each task:
|
|
73
|
+
- **Spec Reference**: Link to Requirement and Scenario
|
|
74
|
+
- **Files**: Create/Modify/Test paths
|
|
75
|
+
- **Step 1**: Write failing test (RED) - based on Scenario
|
|
76
|
+
- **Step 2**: Run to verify failure
|
|
77
|
+
- **Step 3**: Implement minimal code (GREEN)
|
|
78
|
+
- **Step 4**: Run to verify pass
|
|
79
|
+
- **Step 5**: Refactor (if needed)
|
|
80
|
+
- **Step 6**: Commit with Spec reference
|
|
81
|
+
|
|
82
|
+
Scenario → Test mapping:
|
|
83
|
+
```
|
|
84
|
+
#### Scenario: Valid login → test('Valid login', () => {
|
|
85
|
+
- WHEN valid credentials // WHEN
|
|
86
|
+
- THEN grants access expect(login(valid).granted).toBe(true);
|
|
87
|
+
});
|
|
88
|
+
```
|
|
89
|
+
requires:
|
|
90
|
+
- brainstorm
|
|
91
|
+
|
|
92
|
+
- id: tasks
|
|
93
|
+
generates: tasks.md
|
|
94
|
+
description: Implementation task checklist
|
|
95
|
+
template: tasks.md
|
|
96
|
+
instruction: |
|
|
97
|
+
Create task checklist from plan.md.
|
|
98
|
+
|
|
99
|
+
Format:
|
|
100
|
+
- [ ] X.Y Write test for Scenario: [name]
|
|
101
|
+
- Spec: Requirement X → Scenario Y
|
|
102
|
+
- [ ] X.Z Implement [feature]
|
|
103
|
+
- [ ] X.W Commit
|
|
104
|
+
|
|
105
|
+
Each task: 2-5 minutes, verifiable, references Spec.
|
|
106
|
+
requires:
|
|
107
|
+
- plan
|
|
108
|
+
|
|
109
|
+
# ============================================
|
|
110
|
+
# Apply Phase: TDD Implementation
|
|
111
|
+
# ============================================
|
|
112
|
+
apply:
|
|
113
|
+
requires: [tasks]
|
|
114
|
+
tracks: tasks.md
|
|
115
|
+
instruction: |
|
|
116
|
+
Execute plan using TDD and subagent-driven development.
|
|
117
|
+
|
|
118
|
+
**Per Task Flow:**
|
|
119
|
+
1. Dispatch Implementer subagent
|
|
120
|
+
- TDD: Write test (RED) → Implement (GREEN) → Refactor
|
|
121
|
+
- Self-review
|
|
122
|
+
|
|
123
|
+
2. Dispatch Spec Reviewer subagent
|
|
124
|
+
- Verify: Implementation matches Requirement + Scenarios
|
|
125
|
+
- Check: No missing features, no extra features
|
|
126
|
+
|
|
127
|
+
3. Dispatch Quality Reviewer (after spec passes)
|
|
128
|
+
- Check: Error handling, type safety, SOLID
|
|
129
|
+
- Classify: Critical / Important / Suggestion
|
|
130
|
+
|
|
131
|
+
4. Mark task complete
|
|
132
|
+
|
|
133
|
+
After all tasks: Final code review.
|
|
134
|
+
|
|
135
|
+
# ============================================
|
|
136
|
+
# Verify Phase
|
|
137
|
+
# ============================================
|
|
138
|
+
verify:
|
|
139
|
+
requires: [apply]
|
|
140
|
+
instruction: |
|
|
141
|
+
Verify implementation matches specifications.
|
|
142
|
+
|
|
143
|
+
Checks:
|
|
144
|
+
1. Every Requirement has implementation
|
|
145
|
+
2. Every Scenario has test
|
|
146
|
+
3. All tests pass
|
|
147
|
+
4. No features outside Specs
|
|
148
|
+
|
|
149
|
+
Run: `superspec validate [change-id] --strict`
|
|
150
|
+
|
|
151
|
+
# ============================================
|
|
152
|
+
# Archive Phase
|
|
153
|
+
# ============================================
|
|
154
|
+
archive:
|
|
155
|
+
requires: [verify]
|
|
156
|
+
instruction: |
|
|
157
|
+
Archive change and apply deltas to main specs.
|
|
158
|
+
|
|
159
|
+
Steps:
|
|
160
|
+
1. Verify all tests pass
|
|
161
|
+
2. Apply Deltas to superspec/specs/
|
|
162
|
+
3. Move to superspec/changes/archive/YYYY-MM-DD-[id]/
|
|
163
|
+
4. Finish branch (merge/PR/keep/discard)
|
|
164
|
+
5. Clean up worktree
|
|
165
|
+
|
|
166
|
+
Run: `superspec archive [change-id] --yes`
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Design: [Feature Name]
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
[Background, current state, constraints]
|
|
5
|
+
|
|
6
|
+
## Goals / Non-Goals
|
|
7
|
+
|
|
8
|
+
### Goals
|
|
9
|
+
- [What this design achieves]
|
|
10
|
+
|
|
11
|
+
### Non-Goals
|
|
12
|
+
- [What this design explicitly excludes]
|
|
13
|
+
|
|
14
|
+
## Approaches Considered
|
|
15
|
+
|
|
16
|
+
### Approach A: [Name]
|
|
17
|
+
[Description]
|
|
18
|
+
|
|
19
|
+
**Pros:**
|
|
20
|
+
- [Advantage 1]
|
|
21
|
+
- [Advantage 2]
|
|
22
|
+
|
|
23
|
+
**Cons:**
|
|
24
|
+
- [Disadvantage 1]
|
|
25
|
+
- [Disadvantage 2]
|
|
26
|
+
|
|
27
|
+
### Approach B: [Name]
|
|
28
|
+
[Description]
|
|
29
|
+
|
|
30
|
+
**Pros:**
|
|
31
|
+
- [Advantages]
|
|
32
|
+
|
|
33
|
+
**Cons:**
|
|
34
|
+
- [Disadvantages]
|
|
35
|
+
|
|
36
|
+
### Approach C: [Name] (if applicable)
|
|
37
|
+
[Description]
|
|
38
|
+
|
|
39
|
+
## Decision
|
|
40
|
+
|
|
41
|
+
**Chosen Approach:** [A/B/C]
|
|
42
|
+
|
|
43
|
+
**Rationale:**
|
|
44
|
+
[Why this approach was selected]
|
|
45
|
+
|
|
46
|
+
## Trade-offs
|
|
47
|
+
[What we're giving up and why it's acceptable]
|
|
48
|
+
|
|
49
|
+
## Technical Details
|
|
50
|
+
|
|
51
|
+
### Architecture
|
|
52
|
+
[High-level architecture description]
|
|
53
|
+
|
|
54
|
+
### Key Components
|
|
55
|
+
- [Component 1]: [Purpose]
|
|
56
|
+
- [Component 2]: [Purpose]
|
|
57
|
+
|
|
58
|
+
### Data Flow
|
|
59
|
+
```
|
|
60
|
+
[ASCII diagram of data flow]
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Risks and Mitigations
|
|
64
|
+
| Risk | Mitigation |
|
|
65
|
+
|------|------------|
|
|
66
|
+
| [Risk 1] | [How to mitigate] |
|
|
67
|
+
| [Risk 2] | [How to mitigate] |
|
|
68
|
+
|
|
69
|
+
## Open Questions
|
|
70
|
+
- [Question 1]
|
|
71
|
+
- [Question 2]
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# [Feature] Implementation Plan
|
|
2
|
+
|
|
3
|
+
> **For Claude:** REQUIRED SKILL: Use superspec:execute to implement this plan.
|
|
4
|
+
|
|
5
|
+
**Goal:** [One sentence describing what this builds]
|
|
6
|
+
|
|
7
|
+
**Architecture:** [2-3 sentences about approach]
|
|
8
|
+
|
|
9
|
+
**Tech Stack:** [Key technologies/libraries]
|
|
10
|
+
|
|
11
|
+
**Related Documents:**
|
|
12
|
+
- Design: `superspec/changes/[id]/design.md`
|
|
13
|
+
- Specs: `superspec/changes/[id]/specs/[capability]/spec.md`
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Task 1: [Component/Feature Name]
|
|
18
|
+
|
|
19
|
+
**Spec Reference:** `### Requirement: [Name]`
|
|
20
|
+
|
|
21
|
+
**Files:**
|
|
22
|
+
- Create: `exact/path/to/new-file.ts`
|
|
23
|
+
- Modify: `exact/path/to/existing.ts:123-145`
|
|
24
|
+
- Test: `tests/exact/path/to/test.ts`
|
|
25
|
+
|
|
26
|
+
### Step 1.1: Write failing test (RED)
|
|
27
|
+
|
|
28
|
+
**Scenario:** `#### Scenario: [Name]`
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
// WHEN [condition from Scenario]
|
|
32
|
+
// THEN [result from Scenario]
|
|
33
|
+
test('[Scenario Name]', async () => {
|
|
34
|
+
// WHEN
|
|
35
|
+
const result = await action(input);
|
|
36
|
+
|
|
37
|
+
// THEN
|
|
38
|
+
expect(result).toEqual(expected);
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Run:** `npm test -- --grep "[Scenario Name]"`
|
|
43
|
+
**Expected:** FAIL - "[function] is not defined"
|
|
44
|
+
|
|
45
|
+
### Step 1.2: Implement minimal code (GREEN)
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
export async function action(input: Input): Promise<Output> {
|
|
49
|
+
// Minimal implementation to pass test
|
|
50
|
+
return expected;
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Run:** `npm test -- --grep "[Scenario Name]"`
|
|
55
|
+
**Expected:** PASS
|
|
56
|
+
|
|
57
|
+
### Step 1.3: Refactor (if needed)
|
|
58
|
+
|
|
59
|
+
[Clean up code while keeping tests green]
|
|
60
|
+
|
|
61
|
+
### Step 1.4: Commit
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
git add tests/path/test.ts src/path/file.ts
|
|
65
|
+
git commit -m "feat([capability]): implement [scenario]
|
|
66
|
+
|
|
67
|
+
Refs: superspec/changes/[id]/specs/[capability]/spec.md
|
|
68
|
+
Requirement: [Name]
|
|
69
|
+
Scenario: [Name]"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Task 2: [Next Component]
|
|
75
|
+
|
|
76
|
+
**Spec Reference:** `### Requirement: [Name]`
|
|
77
|
+
|
|
78
|
+
[Repeat structure...]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Change: [Brief Description]
|
|
2
|
+
|
|
3
|
+
## Why
|
|
4
|
+
[1-2 sentences on problem/opportunity]
|
|
5
|
+
|
|
6
|
+
What problem does this solve?
|
|
7
|
+
Why is this the right time to address it?
|
|
8
|
+
|
|
9
|
+
## What Changes
|
|
10
|
+
- [Change item 1]
|
|
11
|
+
- [Change item 2]
|
|
12
|
+
- [**BREAKING**: Mark breaking changes]
|
|
13
|
+
|
|
14
|
+
## Capabilities
|
|
15
|
+
|
|
16
|
+
### New Capabilities
|
|
17
|
+
<!-- List new specs to create - each becomes superspec/changes/[id]/specs/[name]/spec.md -->
|
|
18
|
+
- [capability-1]: [brief description]
|
|
19
|
+
|
|
20
|
+
### Modified Capabilities
|
|
21
|
+
<!-- List existing specs that will change - check superspec/specs/ first -->
|
|
22
|
+
- [existing-capability]: [what changes]
|
|
23
|
+
|
|
24
|
+
## Impact
|
|
25
|
+
- Affected specs: [list]
|
|
26
|
+
- Affected code: [key files/systems]
|
|
27
|
+
- Affected APIs: [endpoints]
|
|
28
|
+
- Dependencies: [new/changed dependencies]
|
|
29
|
+
|
|
30
|
+
<!--
|
|
31
|
+
NOTE: Design Considerations (approaches, trade-offs, technical decisions)
|
|
32
|
+
should be documented in design.md, NOT in this file.
|
|
33
|
+
|
|
34
|
+
This file focuses on WHY and WHAT.
|
|
35
|
+
design.md focuses on HOW.
|
|
36
|
+
-->
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# [Capability Name] Specification
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
[1-2 sentences explaining what this capability provides]
|
|
5
|
+
|
|
6
|
+
## Requirements
|
|
7
|
+
|
|
8
|
+
### Requirement: [Requirement Name]
|
|
9
|
+
The system SHALL [behavior description].
|
|
10
|
+
|
|
11
|
+
#### Scenario: [Scenario Name]
|
|
12
|
+
- **WHEN** [trigger condition]
|
|
13
|
+
- **THEN** [expected result]
|
|
14
|
+
- **AND** [additional result] (optional)
|
|
15
|
+
|
|
16
|
+
#### Scenario: [Another Scenario]
|
|
17
|
+
- **WHEN** [different condition]
|
|
18
|
+
- **THEN** [different result]
|
|
19
|
+
|
|
20
|
+
### Requirement: [Another Requirement]
|
|
21
|
+
The system SHALL [another behavior].
|
|
22
|
+
|
|
23
|
+
#### Scenario: [Scenario Name]
|
|
24
|
+
- **WHEN** [condition]
|
|
25
|
+
- **THEN** [result]
|
|
26
|
+
|
|
27
|
+
<!--
|
|
28
|
+
Delta Spec Format (for changes to existing specs):
|
|
29
|
+
|
|
30
|
+
## ADDED Requirements
|
|
31
|
+
|
|
32
|
+
### Requirement: [New Feature]
|
|
33
|
+
The system SHALL [new behavior].
|
|
34
|
+
|
|
35
|
+
#### Scenario: [New Scenario]
|
|
36
|
+
- **WHEN** [condition]
|
|
37
|
+
- **THEN** [result]
|
|
38
|
+
|
|
39
|
+
## MODIFIED Requirements
|
|
40
|
+
|
|
41
|
+
### Requirement: [Existing Feature Name - MUST MATCH EXACTLY]
|
|
42
|
+
The system SHALL [updated behavior - FULL CONTENT REQUIRED].
|
|
43
|
+
|
|
44
|
+
#### Scenario: [Updated Scenario]
|
|
45
|
+
- **WHEN** [updated condition]
|
|
46
|
+
- **THEN** [updated result]
|
|
47
|
+
|
|
48
|
+
## REMOVED Requirements
|
|
49
|
+
|
|
50
|
+
### Requirement: [Deprecated Feature]
|
|
51
|
+
**Reason**: [Why removing]
|
|
52
|
+
**Migration**: [How to handle existing usage]
|
|
53
|
+
|
|
54
|
+
## RENAMED Requirements
|
|
55
|
+
- FROM: `### Requirement: Old Name`
|
|
56
|
+
- TO: `### Requirement: New Name`
|
|
57
|
+
-->
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Implementation Tasks for [Change ID]
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
- Total Tasks: X
|
|
5
|
+
- Completed: 0
|
|
6
|
+
- In Progress: 0
|
|
7
|
+
- Pending: X
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 1. [Phase/Component Name]
|
|
12
|
+
|
|
13
|
+
- [ ] 1.1 Write test for Scenario: [name]
|
|
14
|
+
- Spec: `### Requirement: X` → `#### Scenario: Y`
|
|
15
|
+
- [ ] 1.2 Implement [function/component]
|
|
16
|
+
- [ ] 1.3 Commit: feat([cap]): [description]
|
|
17
|
+
|
|
18
|
+
## 2. [Next Phase]
|
|
19
|
+
|
|
20
|
+
- [ ] 2.1 Write test for Scenario: [name]
|
|
21
|
+
- Spec: `### Requirement: X` → `#### Scenario: Y`
|
|
22
|
+
- [ ] 2.2 Implement [function/component]
|
|
23
|
+
- [ ] 2.3 Commit
|
|
24
|
+
|
|
25
|
+
## 3. [Final Phase]
|
|
26
|
+
|
|
27
|
+
- [ ] 3.1 Integration tests
|
|
28
|
+
- [ ] 3.2 Final review
|
|
29
|
+
- [ ] 3.3 Documentation updates
|