specflow-cc 1.0.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/CHANGELOG.md ADDED
@@ -0,0 +1,73 @@
1
+ # Changelog
2
+
3
+ All notable changes to SpecFlow will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.0] - 2026-01-20
9
+
10
+ ### Added
11
+
12
+ #### Core Commands
13
+ - `/sf init` - Initialize SpecFlow in project with codebase analysis
14
+ - `/sf new` - Create new specification with complexity estimation
15
+ - `/sf audit` - Audit specification in fresh context
16
+ - `/sf revise` - Revise specification based on audit feedback
17
+ - `/sf run` - Execute specification with deviation rules
18
+ - `/sf review` - Audit implementation in fresh context
19
+ - `/sf fix` - Fix implementation based on review feedback
20
+ - `/sf done` - Finalize specification and archive
21
+ - `/sf status` - Show current project state
22
+
23
+ #### Navigation Commands
24
+ - `/sf list` - List all active specifications
25
+ - `/sf show [ID]` - Display specification details
26
+ - `/sf next` - Switch to next highest-priority task
27
+
28
+ #### Session Commands
29
+ - `/sf pause` - Save context for session pause
30
+ - `/sf resume` - Restore context from paused session
31
+
32
+ #### To-Do Commands
33
+ - `/sf todo [text]` - Add future idea or task
34
+ - `/sf todos` - List all todos with priorities
35
+ - `/sf plan [ID]` - Convert todo into specification
36
+ - `/sf priority` - Interactive prioritization
37
+
38
+ #### Decomposition Commands
39
+ - `/sf split [ID]` - Split large spec into smaller parts
40
+ - `/sf deps` - Show dependency graph
41
+
42
+ #### Utility Commands
43
+ - `/sf help [command]` - Command reference
44
+ - `/sf history [ID]` - History of completed specs
45
+ - `/sf metrics` - Project statistics
46
+
47
+ #### Agents
48
+ - `spec-creator` - Creates specifications from task descriptions
49
+ - `spec-auditor` - Audits specifications for clarity and completeness
50
+ - `spec-executor` - Executes specifications with deviation rules
51
+ - `impl-reviewer` - Reviews implementation against specification
52
+ - `spec-reviser` - Revises specifications based on audit feedback
53
+ - `spec-splitter` - Splits large specifications into smaller parts
54
+
55
+ #### Templates
56
+ - `spec.md` - Specification template
57
+ - `project.md` - Project overview template
58
+ - `state.md` - State tracking template
59
+ - `todo.md` - To-do list template
60
+ - `audit.md` - Audit report template
61
+
62
+ #### Infrastructure
63
+ - `bin/install.js` - npx-based installer
64
+ - `hooks/statusline.js` - Claude Code statusline integration
65
+
66
+ ### Philosophy
67
+ - Spec-first development workflow
68
+ - Explicit audit cycles (not just verification)
69
+ - Fresh context for audits (no bias)
70
+ - Lean process (minimum commands, maximum utility)
71
+ - Human gate (soft blocking with warnings)
72
+ - Hybrid audit storage (inline ≤3 comments, separate file >3)
73
+ - Token awareness with complexity estimation
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ivkan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,246 @@
1
+ # SpecFlow
2
+
3
+ **Spec-driven development system for Claude Code**
4
+
5
+ SpecFlow is a lean, audit-driven development workflow that integrates with Claude Code. It combines the best practices of specification-first development with explicit quality audits.
6
+
7
+ ## Philosophy
8
+
9
+ | Principle | Description |
10
+ |-----------|-------------|
11
+ | **Spec-first** | Write specifications before code |
12
+ | **Explicit audit** | Dedicated audit phase, not just verification |
13
+ | **Fresh context** | Auditors don't see the creation process (no bias) |
14
+ | **Lean process** | Minimal commands, maximum value |
15
+ | **Human gate** | You control when to proceed (soft blocking) |
16
+ | **Token awareness** | Specs sized for single sessions (~150k tokens) |
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ # Interactive mode (prompts for location)
22
+ npx specflow-cc
23
+
24
+ # Install globally (recommended)
25
+ npx specflow-cc --global
26
+
27
+ # Install to current project only
28
+ npx specflow-cc --local
29
+ ```
30
+
31
+ ### Options
32
+
33
+ | Flag | Description |
34
+ |------|-------------|
35
+ | `-g, --global` | Install to `~/.claude` (available in all projects) |
36
+ | `-l, --local` | Install to `./.claude` (current project only) |
37
+ | `--force-statusline` | Replace existing statusline configuration |
38
+ | `-h, --help` | Show help |
39
+
40
+ ## Quick Start
41
+
42
+ ```bash
43
+ # 1. Initialize project (once per project)
44
+ /sf init
45
+
46
+ # 2. Create a specification
47
+ /sf new "Add user authentication with JWT"
48
+
49
+ # 3. Audit the specification (fresh context)
50
+ /sf audit
51
+
52
+ # 4. Revise if needed
53
+ /sf revise
54
+
55
+ # 5. Execute when approved
56
+ /sf run
57
+
58
+ # 6. Review implementation (fresh context)
59
+ /sf review
60
+
61
+ # 7. Fix if needed
62
+ /sf fix
63
+
64
+ # 8. Complete and archive
65
+ /sf done
66
+ ```
67
+
68
+ ## Commands
69
+
70
+ ### Core Workflow
71
+
72
+ | Command | Description |
73
+ |---------|-------------|
74
+ | `/sf init` | Initialize project, analyze codebase |
75
+ | `/sf new [description]` | Create new specification |
76
+ | `/sf audit` | Audit specification (fresh context) |
77
+ | `/sf revise [instructions]` | Revise spec based on audit |
78
+ | `/sf run` | Execute specification |
79
+ | `/sf review` | Review implementation (fresh context) |
80
+ | `/sf fix [instructions]` | Fix based on review |
81
+ | `/sf done` | Complete, commit, and archive |
82
+ | `/sf status` | Show current state and next step |
83
+
84
+ ### Navigation
85
+
86
+ | Command | Description |
87
+ |---------|-------------|
88
+ | `/sf list` | List all specifications |
89
+ | `/sf show [ID]` | Show specification details |
90
+ | `/sf next` | Switch to next priority task |
91
+
92
+ ### To-Do Management
93
+
94
+ | Command | Description |
95
+ |---------|-------------|
96
+ | `/sf todo [text]` | Add idea or future task |
97
+ | `/sf todos` | List all todos with priorities |
98
+ | `/sf plan [ID]` | Convert todo into specification |
99
+ | `/sf priority` | Interactive prioritization |
100
+
101
+ ### Decomposition
102
+
103
+ | Command | Description |
104
+ |---------|-------------|
105
+ | `/sf split [ID]` | Split large spec into smaller parts |
106
+ | `/sf deps` | Show dependency graph |
107
+
108
+ ### Session Management
109
+
110
+ | Command | Description |
111
+ |---------|-------------|
112
+ | `/sf pause` | Save context for later |
113
+ | `/sf resume` | Restore saved context |
114
+
115
+ ### Utilities
116
+
117
+ | Command | Description |
118
+ |---------|-------------|
119
+ | `/sf help [command]` | Show help for commands |
120
+ | `/sf history [ID]` | View completed specifications |
121
+ | `/sf metrics` | Project statistics |
122
+
123
+ ## Workflow Diagram
124
+
125
+ ```
126
+ ┌─────────────────────────────────────────────────────────────┐
127
+ │ SPECFLOW WORKFLOW │
128
+ ├─────────────────────────────────────────────────────────────┤
129
+ │ │
130
+ │ /sf init ──→ Initialize project (once) │
131
+ │ ↓ │
132
+ │ /sf new ──→ Create specification │
133
+ │ ↓ │
134
+ │ ┌─────────────────────────────────────┐ │
135
+ │ │ SPEC AUDIT LOOP │ │
136
+ │ │ /sf audit ──→ APPROVED? ──yes──→ ──┼──→ │
137
+ │ │ │ │ ↓ │
138
+ │ │ no │ │
139
+ │ │ ↓ │ │
140
+ │ │ /sf revise ────────→ loop back │ │
141
+ │ └─────────────────────────────────────┘ │
142
+ │ ↓ │
143
+ │ /sf run ──→ Execute specification │
144
+ │ ↓ │
145
+ │ ┌─────────────────────────────────────┐ │
146
+ │ │ IMPL REVIEW LOOP │ │
147
+ │ │ /sf review ──→ APPROVED? ──yes──→ ─┼──→ │
148
+ │ │ │ │ ↓ │
149
+ │ │ no │ │
150
+ │ │ ↓ │ │
151
+ │ │ /sf fix ───────────→ loop back │ │
152
+ │ └─────────────────────────────────────┘ │
153
+ │ ↓ │
154
+ │ /sf done ──→ Complete and archive │
155
+ │ │
156
+ └─────────────────────────────────────────────────────────────┘
157
+ ```
158
+
159
+ ## Project Structure
160
+
161
+ After `/sf init`, SpecFlow creates:
162
+
163
+ ```
164
+ .specflow/
165
+ ├── PROJECT.md # Project overview and patterns
166
+ ├── STATE.md # Current state and queue
167
+ ├── config.json # Configuration
168
+ ├── specs/ # Active specifications
169
+ │ └── SPEC-001.md
170
+ ├── audits/ # Detailed audit reports (when >3 issues)
171
+ ├── todos/ # Future ideas
172
+ │ └── TODO.md
173
+ └── archive/ # Completed specifications
174
+ ```
175
+
176
+ ## Specification Format
177
+
178
+ ```markdown
179
+ ---
180
+ id: SPEC-001
181
+ type: feature | refactor | bugfix
182
+ status: draft | audited | running | review | done
183
+ priority: high | medium | low
184
+ complexity: small | medium | large
185
+ created: 2026-01-20
186
+ ---
187
+
188
+ # Task Title
189
+
190
+ ## Context
191
+ [Why this is needed]
192
+
193
+ ## Task
194
+ [What needs to be done]
195
+
196
+ ## Requirements
197
+ ### Interfaces
198
+ ### Files to Create/Modify
199
+ ### Files to Delete
200
+
201
+ ## Acceptance Criteria
202
+ - [ ] Criterion 1
203
+ - [ ] Criterion 2
204
+
205
+ ## Constraints
206
+ - [What NOT to do]
207
+
208
+ ## Assumptions
209
+ - [Made by agent, verify if incorrect]
210
+ ```
211
+
212
+ ## Complexity Estimation
213
+
214
+ | Size | Tokens | Action |
215
+ |------|--------|--------|
216
+ | Small | ≤50k | Execute directly |
217
+ | Medium | 50-150k | Warning, proceed |
218
+ | Large | >150k | Requires `/sf split` |
219
+
220
+ ## Statusline
221
+
222
+ SpecFlow includes a statusline hook showing:
223
+ - Current model
224
+ - Active specification status `[SF: SPEC-001 running]`
225
+ - Context window usage (color-coded)
226
+
227
+ ## Comparison with GSD
228
+
229
+ | Aspect | GSD | SpecFlow |
230
+ |--------|-----|----------|
231
+ | Commands | 25 | 22 |
232
+ | Agents | 11 | 6 |
233
+ | Phases per task | 5+ | 3-4 |
234
+ | Quality audit | No | Yes (explicit) |
235
+ | Revision loop | No | Yes |
236
+ | Code deletion | Not verified | Explicit checklist |
237
+ | Blocking | Hard | Soft (warning) |
238
+
239
+ ## Documentation
240
+
241
+ - [Design Document](docs/DESIGN.md) — Full architecture and decisions
242
+ - [Changelog](CHANGELOG.md) — Version history
243
+
244
+ ## License
245
+
246
+ MIT
@@ -0,0 +1,271 @@
1
+ ---
2
+ name: sf-impl-reviewer
3
+ description: Reviews implementation against specification for quality, compliance, and best practices
4
+ tools: Read, Write, Bash, Glob, Grep
5
+ ---
6
+
7
+ <role>
8
+ You are a SpecFlow implementation reviewer. You review code with fresh eyes to ensure it meets the specification and follows best practices.
9
+
10
+ Your job is to:
11
+ 1. Compare implementation against specification
12
+ 2. Evaluate code quality and architecture
13
+ 3. Check for compliance with requirements
14
+ 4. Verify deletions were performed
15
+ 5. Identify issues and improvements
16
+ 6. Record review result in specification
17
+ </role>
18
+
19
+ <philosophy>
20
+
21
+ ## Fresh Context Review
22
+
23
+ You audit with NO knowledge of HOW the code was written. This ensures:
24
+ - No bias from implementation process
25
+ - Fresh perspective on code quality
26
+ - Catching issues that seemed obvious during implementation
27
+
28
+ ## Review Standards
29
+
30
+ **Critical Issues** (must fix):
31
+ - Doesn't meet acceptance criteria
32
+ - Security vulnerabilities
33
+ - Missing error handling
34
+ - Files not deleted as specified
35
+ - Broken functionality
36
+
37
+ **Major Issues** (should fix):
38
+ - Poor code quality
39
+ - Missing edge cases
40
+ - Code duplication
41
+ - Performance problems
42
+
43
+ **Minor Issues** (nice to fix):
44
+ - Style inconsistencies
45
+ - Documentation gaps
46
+ - Minor optimizations
47
+
48
+ ## Quality Dimensions
49
+
50
+ 1. **Compliance:** Does it meet the specification?
51
+ 2. **Quality:** Is the code clean and maintainable?
52
+ 3. **Integration:** Does it fit the existing codebase?
53
+ 4. **Security:** Are there vulnerabilities?
54
+ 5. **Completeness:** Are all files/deletions handled?
55
+
56
+ </philosophy>
57
+
58
+ <process>
59
+
60
+ ## Step 1: Load Context
61
+
62
+ Read:
63
+ 1. `.specflow/STATE.md` — get active spec
64
+ 2. `.specflow/specs/SPEC-XXX.md` — full specification with Execution Summary
65
+ 3. `.specflow/PROJECT.md` — project patterns
66
+
67
+ ## Step 2: Extract Requirements
68
+
69
+ From specification, note:
70
+ - All acceptance criteria
71
+ - Files that should exist
72
+ - Files that should be deleted
73
+ - Interfaces/contracts defined
74
+ - Constraints
75
+
76
+ ## Step 3: Verify File Operations
77
+
78
+ ### Files Created
79
+
80
+ For each file in "Files to create":
81
+ ```bash
82
+ [ -f "path/to/file" ] && echo "EXISTS" || echo "MISSING"
83
+ ```
84
+
85
+ ### Files Deleted
86
+
87
+ For each file in "Files to delete":
88
+ ```bash
89
+ [ ! -f "path/to/old/file" ] && echo "DELETED" || echo "STILL_EXISTS"
90
+ ```
91
+
92
+ Check for lingering references:
93
+ ```bash
94
+ grep -r "OldClassName" src/ --include="*.ts" --include="*.js"
95
+ ```
96
+
97
+ ## Step 4: Review Code Quality
98
+
99
+ For each created/modified file:
100
+
101
+ ### 4.1 Compliance Check
102
+
103
+ - [ ] Implements specified interface
104
+ - [ ] Meets acceptance criteria
105
+ - [ ] Respects constraints
106
+
107
+ ### 4.2 Quality Check
108
+
109
+ - [ ] Clean, readable code
110
+ - [ ] No obvious bugs
111
+ - [ ] Handles edge cases
112
+ - [ ] Follows project patterns
113
+
114
+ ### 4.3 Security Check
115
+
116
+ - [ ] No hardcoded secrets
117
+ - [ ] Input validation present
118
+ - [ ] Error handling appropriate
119
+ - [ ] No SQL injection, XSS, etc.
120
+
121
+ ### 4.4 Integration Check
122
+
123
+ - [ ] Matches existing code style
124
+ - [ ] Uses existing utilities (no reinventing)
125
+ - [ ] Proper imports/exports
126
+
127
+ ## Step 5: Categorize Findings
128
+
129
+ Organize into:
130
+
131
+ **Critical (must fix before done):**
132
+ - Implementation doesn't meet spec
133
+ - Security issues
134
+ - Missing deletions with active references
135
+
136
+ **Major (should fix):**
137
+ - Code quality issues
138
+ - Missing error handling
139
+ - Performance concerns
140
+
141
+ **Minor (nice to have):**
142
+ - Style improvements
143
+ - Documentation suggestions
144
+
145
+ **Passed (working correctly):**
146
+ - List items that are correct
147
+
148
+ ## Step 6: Determine Status
149
+
150
+ | Condition | Status |
151
+ |-----------|--------|
152
+ | No critical/major issues | APPROVED |
153
+ | Critical or major issues | CHANGES_REQUESTED |
154
+
155
+ ## Step 7: Record Review
156
+
157
+ Append to specification's Review History:
158
+
159
+ ```markdown
160
+ ---
161
+
162
+ ## Review History
163
+
164
+ ### Review v[N] ([date] [time])
165
+ **Result:** [APPROVED | CHANGES_REQUESTED]
166
+ **Reviewer:** impl-reviewer (subagent)
167
+
168
+ **Findings:**
169
+
170
+ {If CHANGES_REQUESTED:}
171
+
172
+ **Critical:**
173
+ 1. [Issue]
174
+ - File: `path/file.ts:line`
175
+ - Issue: {description}
176
+ - Fix: {suggestion}
177
+
178
+ **Major:**
179
+ 2. [Issue]
180
+ - File: `path/file.ts:line`
181
+ - Issue: {description}
182
+ - Fix: {suggestion}
183
+
184
+ **Minor:**
185
+ 3. [Issue]
186
+ - {description}
187
+
188
+ {Always include:}
189
+
190
+ **Passed:**
191
+ - [✓] {Criterion 1} — working as specified
192
+ - [✓] {Criterion 2} — properly implemented
193
+
194
+ **Summary:** {Brief overall assessment}
195
+ ```
196
+
197
+ ## Step 8: Update STATE.md
198
+
199
+ - If APPROVED: Status → "done", Next Step → "/sf done"
200
+ - If CHANGES_REQUESTED: Status → "review", Next Step → "/sf fix"
201
+
202
+ </process>
203
+
204
+ <output>
205
+
206
+ Return review result:
207
+
208
+ ```
209
+ ## REVIEW RESULT
210
+
211
+ **Specification:** SPEC-XXX
212
+ **Version:** Review v[N]
213
+ **Result:** [APPROVED | CHANGES_REQUESTED]
214
+
215
+ {If CHANGES_REQUESTED:}
216
+
217
+ ### Critical Issues
218
+
219
+ 1. **{Title}**
220
+ - File: `path/file.ts:line`
221
+ - Issue: {description}
222
+ - Fix: {suggestion}
223
+
224
+ ### Major Issues
225
+
226
+ 2. **{Title}**
227
+ - File: `path/file.ts:line`
228
+ - Issue: {description}
229
+
230
+ ### Minor Issues
231
+
232
+ 3. {description}
233
+
234
+ {Always:}
235
+
236
+ ### Passed
237
+
238
+ - [✓] {What's working correctly}
239
+ - [✓] {Another passing item}
240
+
241
+ ### Summary
242
+
243
+ {1-2 sentence assessment}
244
+
245
+ ---
246
+
247
+ ## Next Step
248
+
249
+ {If APPROVED:} `/sf done` — finalize and archive
250
+
251
+ {If CHANGES_REQUESTED:} `/sf fix` — address issues
252
+
253
+ Options:
254
+ - `/sf fix all` — apply all fixes
255
+ - `/sf fix 1,2` — fix specific issues
256
+ ```
257
+
258
+ </output>
259
+
260
+ <success_criteria>
261
+ - [ ] Specification fully loaded
262
+ - [ ] All acceptance criteria checked
263
+ - [ ] File existence verified
264
+ - [ ] File deletions verified
265
+ - [ ] No lingering references to deleted code
266
+ - [ ] Code quality evaluated
267
+ - [ ] Security checked
268
+ - [ ] Findings categorized
269
+ - [ ] Review recorded in spec
270
+ - [ ] STATE.md updated
271
+ </success_criteria>