deepflow 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/.claude/agents/reasoner.md +60 -0
- package/.claude/commands/df/execute.md +190 -0
- package/.claude/commands/df/plan.md +171 -0
- package/.claude/commands/df/spec.md +99 -0
- package/.claude/commands/df/verify.md +169 -0
- package/.claude/skills/atomic-commits/SKILL.md +64 -0
- package/.claude/skills/code-completeness/SKILL.md +63 -0
- package/.claude/skills/gap-discovery/SKILL.md +45 -0
- package/LICENSE +21 -0
- package/README.md +138 -0
- package/VERSION +1 -0
- package/bin/install.js +187 -0
- package/hooks/df-check-update.js +129 -0
- package/hooks/df-statusline.js +111 -0
- package/package.json +40 -0
- package/templates/config-template.yaml +42 -0
- package/templates/plan-template.md +41 -0
- package/templates/spec-template.md +40 -0
- package/templates/state-template.md +47 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: reasoner
|
|
3
|
+
description: Complex analysis and reasoning. Use for prioritization, debugging, architectural decisions, and comparing specs against code. Handles tasks requiring deep thinking.
|
|
4
|
+
model: opus
|
|
5
|
+
tools: Read, Grep, Glob, Edit, Bash
|
|
6
|
+
skills:
|
|
7
|
+
- code-completeness
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Reasoner
|
|
11
|
+
|
|
12
|
+
Complex reasoning tasks requiring deep analysis.
|
|
13
|
+
|
|
14
|
+
## Capabilities
|
|
15
|
+
|
|
16
|
+
- Prioritize tasks by dependencies and impact
|
|
17
|
+
- Debug failures with systematic analysis
|
|
18
|
+
- Compare specs against implementation
|
|
19
|
+
- Make architectural decisions
|
|
20
|
+
- Analyze trade-offs
|
|
21
|
+
|
|
22
|
+
## When to Use
|
|
23
|
+
|
|
24
|
+
| Task | Why Reasoner |
|
|
25
|
+
|------|--------------|
|
|
26
|
+
| Prioritization | Dependency graphs, impact analysis |
|
|
27
|
+
| Debugging | Hypothesis testing, root cause |
|
|
28
|
+
| Spec comparison | Gap analysis, conflict detection |
|
|
29
|
+
| Architecture | Trade-off evaluation |
|
|
30
|
+
|
|
31
|
+
## Process
|
|
32
|
+
|
|
33
|
+
1. Understand the problem fully
|
|
34
|
+
2. Gather relevant context
|
|
35
|
+
3. Analyze systematically
|
|
36
|
+
4. Present findings with rationale
|
|
37
|
+
5. Recommend action
|
|
38
|
+
|
|
39
|
+
## Return Format
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
## Analysis
|
|
43
|
+
|
|
44
|
+
{What was analyzed}
|
|
45
|
+
|
|
46
|
+
## Findings
|
|
47
|
+
|
|
48
|
+
{Key discoveries with evidence}
|
|
49
|
+
|
|
50
|
+
## Recommendation
|
|
51
|
+
|
|
52
|
+
{Suggested action with rationale}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Rules
|
|
56
|
+
|
|
57
|
+
- Think before acting
|
|
58
|
+
- Show reasoning, not just conclusions
|
|
59
|
+
- Cite evidence (file:line)
|
|
60
|
+
- Be decisive - recommend, don't waffle
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# /df:execute — Execute Tasks from Plan
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
Implement tasks from PLAN.md with parallel agents and atomic commits.
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
```
|
|
8
|
+
/df:execute
|
|
9
|
+
/df:execute T1 T2 # Execute specific tasks only
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Skills & Agents
|
|
13
|
+
- Skill: `atomic-commits` — Clean commit protocol
|
|
14
|
+
- Agent: `general-purpose` (Sonnet) — Task implementation
|
|
15
|
+
- Agent: `reasoner` (Opus) — Debugging failures
|
|
16
|
+
|
|
17
|
+
## Behavior
|
|
18
|
+
|
|
19
|
+
### 1. LOAD PLAN
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
Load:
|
|
23
|
+
- PLAN.md (required)
|
|
24
|
+
- specs/*.md (for context)
|
|
25
|
+
- .specflow/config.yaml (if exists)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
If PLAN.md missing:
|
|
29
|
+
```
|
|
30
|
+
No PLAN.md found. Run /df:plan first.
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 2. IDENTIFY READY TASKS
|
|
34
|
+
|
|
35
|
+
Find tasks where:
|
|
36
|
+
- Status is `[ ]` (not done)
|
|
37
|
+
- All `blocked_by` tasks are `[x]` (complete)
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
Ready: [T1, T2, T5] # No blockers
|
|
41
|
+
Blocked: [T3, T4] # Waiting on dependencies
|
|
42
|
+
Done: []
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 3. EXECUTE IN PARALLEL
|
|
46
|
+
|
|
47
|
+
**Spawn `general-purpose` agents** (Sonnet) for ready tasks:
|
|
48
|
+
|
|
49
|
+
| Ready Tasks | Agents |
|
|
50
|
+
|-------------|--------|
|
|
51
|
+
| 1-3 | All parallel |
|
|
52
|
+
| 4-10 | 5 parallel, queue rest |
|
|
53
|
+
| 10+ | 5 parallel, queue rest |
|
|
54
|
+
|
|
55
|
+
Each agent uses `atomic-commits` skill for commit protocol.
|
|
56
|
+
|
|
57
|
+
**Critical rule: 1 writer per file**
|
|
58
|
+
If T1 and T2 both modify `src/api.ts`, execute sequentially.
|
|
59
|
+
|
|
60
|
+
**On failure:** Spawn `reasoner` agent (Opus) for debugging.
|
|
61
|
+
|
|
62
|
+
### 4. PER-TASK EXECUTION
|
|
63
|
+
|
|
64
|
+
Each executor agent:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
1. READ spec requirements for this task
|
|
68
|
+
2. READ existing code context
|
|
69
|
+
3. IMPLEMENT the task completely
|
|
70
|
+
- No stubs
|
|
71
|
+
- No placeholders
|
|
72
|
+
- No TODO comments
|
|
73
|
+
4. VERIFY implementation works
|
|
74
|
+
- Run related tests if they exist
|
|
75
|
+
- Check TypeScript/lint if applicable
|
|
76
|
+
5. COMMIT atomically
|
|
77
|
+
- Format: feat({spec}): {task description}
|
|
78
|
+
- One task = one commit
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### 5. UPDATE PLAN
|
|
82
|
+
|
|
83
|
+
After each task completes:
|
|
84
|
+
```markdown
|
|
85
|
+
- [x] **T1**: Create upload API endpoint ✓ (abc1234)
|
|
86
|
+
- Files: src/api/upload.ts
|
|
87
|
+
- Blocked by: none
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### 6. ITERATE
|
|
91
|
+
|
|
92
|
+
After wave completes:
|
|
93
|
+
```
|
|
94
|
+
Wave 1 complete: T1 ✓, T2 ✓
|
|
95
|
+
|
|
96
|
+
Unblocked: T3, T4 now ready
|
|
97
|
+
Executing wave 2...
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Repeat until all tasks done or blocked.
|
|
101
|
+
|
|
102
|
+
### 7. REPORT
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
✓ Execution complete
|
|
106
|
+
|
|
107
|
+
Tasks completed: 5/5
|
|
108
|
+
Commits: 5
|
|
109
|
+
Failed: 0
|
|
110
|
+
|
|
111
|
+
All specs implemented. Run /df:verify to confirm.
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Or if partial:
|
|
115
|
+
```
|
|
116
|
+
⚠ Execution paused
|
|
117
|
+
|
|
118
|
+
Tasks completed: 3/5
|
|
119
|
+
Blocked: T4 (waiting on T3)
|
|
120
|
+
Failed: T3 (see error below)
|
|
121
|
+
|
|
122
|
+
Error in T3:
|
|
123
|
+
[error details]
|
|
124
|
+
|
|
125
|
+
Fix the issue and run /df:execute to continue.
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Rules
|
|
129
|
+
|
|
130
|
+
### Parallelism
|
|
131
|
+
- **Read operations**: Unlimited parallel
|
|
132
|
+
- **Write operations**: Max 5 parallel, 1 per file
|
|
133
|
+
- **Build/test**: Always sequential
|
|
134
|
+
|
|
135
|
+
### Commits
|
|
136
|
+
- One task = one commit
|
|
137
|
+
- Format: `feat({spec}): {description}`
|
|
138
|
+
- Include task ID in commit body
|
|
139
|
+
- Never commit broken code
|
|
140
|
+
|
|
141
|
+
### Completeness
|
|
142
|
+
- No stubs or placeholders
|
|
143
|
+
- No `// TODO` comments
|
|
144
|
+
- Implement fully or don't commit
|
|
145
|
+
|
|
146
|
+
### Conflict Avoidance
|
|
147
|
+
```
|
|
148
|
+
If T1 writes to src/api.ts
|
|
149
|
+
And T2 writes to src/api.ts
|
|
150
|
+
Then execute T1, wait, then T2
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Agent Spawning
|
|
154
|
+
|
|
155
|
+
```yaml
|
|
156
|
+
executor_agents:
|
|
157
|
+
max_parallel: 5
|
|
158
|
+
per_file_limit: 1
|
|
159
|
+
|
|
160
|
+
model_selection:
|
|
161
|
+
implement: sonnet
|
|
162
|
+
debug: opus
|
|
163
|
+
|
|
164
|
+
commit_after: each_task
|
|
165
|
+
push_after: all_complete # Not every commit
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Example Session
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
/df:execute
|
|
172
|
+
|
|
173
|
+
Loading PLAN.md...
|
|
174
|
+
Found 5 tasks, 3 ready (no blockers)
|
|
175
|
+
|
|
176
|
+
Wave 1: Executing T1, T2, T5 in parallel...
|
|
177
|
+
T1: Create upload API endpoint... ✓ (abc1234)
|
|
178
|
+
T2: Add validation middleware... ✓ (def5678)
|
|
179
|
+
T5: Integrate color-thief... ✓ (ghi9012)
|
|
180
|
+
|
|
181
|
+
Wave 2: T3, T4 now unblocked
|
|
182
|
+
T3: Implement S3 upload... ✓ (jkl3456)
|
|
183
|
+
T4: Complete thumbnails... ✓ (mno7890)
|
|
184
|
+
|
|
185
|
+
✓ Execution complete
|
|
186
|
+
Tasks: 5/5
|
|
187
|
+
Commits: 5
|
|
188
|
+
|
|
189
|
+
Run /df:verify to confirm specs satisfied.
|
|
190
|
+
```
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# /df:plan — Generate Task Plan from Specs
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
Compare specs against codebase, identify gaps, generate prioritized task list.
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
```
|
|
8
|
+
/df:plan
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Skills & Agents
|
|
12
|
+
- Skill: `code-completeness` — Find TODOs, stubs, incomplete work
|
|
13
|
+
- Agent: `reasoner` (Opus) — Complex analysis and prioritization
|
|
14
|
+
|
|
15
|
+
## Behavior
|
|
16
|
+
|
|
17
|
+
### 1. LOAD CONTEXT
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
Load:
|
|
21
|
+
- specs/*.md (all spec files)
|
|
22
|
+
- PLAN.md (if exists, prior state)
|
|
23
|
+
- .specflow/config.yaml (if exists)
|
|
24
|
+
|
|
25
|
+
Determine source_dir from config or default to src/
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### 2. ANALYZE CODEBASE
|
|
29
|
+
|
|
30
|
+
**Spawn Explore agents** (haiku, read-only) with dynamic count:
|
|
31
|
+
|
|
32
|
+
| File Count | Agents |
|
|
33
|
+
|------------|--------|
|
|
34
|
+
| <20 | 3-5 |
|
|
35
|
+
| 20-100 | 10-15 |
|
|
36
|
+
| 100-500 | 25-40 |
|
|
37
|
+
| 500+ | 50-100 (cap) |
|
|
38
|
+
|
|
39
|
+
**Use `code-completeness` skill patterns** to search for:
|
|
40
|
+
- Implementations matching spec requirements
|
|
41
|
+
- TODO, FIXME, HACK comments
|
|
42
|
+
- Stub functions, placeholder returns
|
|
43
|
+
- Skipped tests, incomplete coverage
|
|
44
|
+
|
|
45
|
+
### 3. COMPARE & PRIORITIZE
|
|
46
|
+
|
|
47
|
+
**Spawn `reasoner` agent** (Opus) for complex analysis:
|
|
48
|
+
|
|
49
|
+
| Status | Meaning | Action |
|
|
50
|
+
|--------|---------|--------|
|
|
51
|
+
| DONE | Fully implemented | Mark complete |
|
|
52
|
+
| PARTIAL | Stub or incomplete | Task to complete |
|
|
53
|
+
| MISSING | Not found in code | Task to implement |
|
|
54
|
+
| CONFLICT | Code contradicts spec | Flag for review |
|
|
55
|
+
|
|
56
|
+
Reasoner prioritizes by dependencies, impact, and risk.
|
|
57
|
+
|
|
58
|
+
### 4. PRIORITIZE
|
|
59
|
+
|
|
60
|
+
Order tasks by:
|
|
61
|
+
1. **Dependencies** — Blockers first
|
|
62
|
+
2. **Impact** — Core features before enhancements
|
|
63
|
+
3. **Risk** — Unknowns early (reduce risk)
|
|
64
|
+
|
|
65
|
+
### 5. OUTPUT PLAN.md
|
|
66
|
+
|
|
67
|
+
```markdown
|
|
68
|
+
# Plan
|
|
69
|
+
|
|
70
|
+
Generated: {timestamp}
|
|
71
|
+
Specs analyzed: {count}
|
|
72
|
+
|
|
73
|
+
## Spec Gaps
|
|
74
|
+
[If any specs need updates, list here]
|
|
75
|
+
- [ ] specs/X.md: Missing error handling definition
|
|
76
|
+
|
|
77
|
+
## Tasks
|
|
78
|
+
|
|
79
|
+
### {spec-name}
|
|
80
|
+
|
|
81
|
+
- [ ] **T1**: {task description}
|
|
82
|
+
- Files: {files to create/modify}
|
|
83
|
+
- Blocked by: none
|
|
84
|
+
|
|
85
|
+
- [ ] **T2**: {task description}
|
|
86
|
+
- Files: {files}
|
|
87
|
+
- Blocked by: T1
|
|
88
|
+
|
|
89
|
+
### {another-spec}
|
|
90
|
+
|
|
91
|
+
- [ ] **T3**: {task description}
|
|
92
|
+
- Files: {files}
|
|
93
|
+
- Blocked by: none
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 6. REPORT
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
✓ Plan generated
|
|
100
|
+
|
|
101
|
+
Specs analyzed: {n}
|
|
102
|
+
Tasks created: {n}
|
|
103
|
+
Spec gaps found: {n}
|
|
104
|
+
|
|
105
|
+
Ready to execute: {n} tasks (no blockers)
|
|
106
|
+
|
|
107
|
+
Next: Run /df:execute to start implementation
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Rules
|
|
111
|
+
- **Plan only** — Do NOT implement anything
|
|
112
|
+
- **Confirm before assume** — Search code before marking "missing"
|
|
113
|
+
- **One task = one logical unit** — Atomic, committable
|
|
114
|
+
- Prefer existing utilities over new code
|
|
115
|
+
- Flag spec gaps, don't silently ignore
|
|
116
|
+
|
|
117
|
+
## Agent Spawning Rules
|
|
118
|
+
|
|
119
|
+
```yaml
|
|
120
|
+
search_agents:
|
|
121
|
+
base: 10
|
|
122
|
+
per_files: 20 # 1 agent per 20 files
|
|
123
|
+
cap: 100
|
|
124
|
+
|
|
125
|
+
analyze_agents:
|
|
126
|
+
base: 5
|
|
127
|
+
per_specs: 2 # 1 agent per 2 specs
|
|
128
|
+
cap: 20
|
|
129
|
+
|
|
130
|
+
model_selection:
|
|
131
|
+
search: sonnet
|
|
132
|
+
analyze: opus
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Example Output
|
|
136
|
+
|
|
137
|
+
```markdown
|
|
138
|
+
# Plan
|
|
139
|
+
|
|
140
|
+
Generated: 2025-01-28 14:30
|
|
141
|
+
Specs analyzed: 2
|
|
142
|
+
|
|
143
|
+
## Spec Gaps
|
|
144
|
+
- [ ] specs/image-upload.md: No error handling for S3 failures defined
|
|
145
|
+
|
|
146
|
+
## Tasks
|
|
147
|
+
|
|
148
|
+
### image-upload
|
|
149
|
+
|
|
150
|
+
- [ ] **T1**: Create upload API endpoint
|
|
151
|
+
- Files: src/api/upload.ts (create)
|
|
152
|
+
- Blocked by: none
|
|
153
|
+
|
|
154
|
+
- [ ] **T2**: Add file validation middleware
|
|
155
|
+
- Files: src/middleware/validate.ts (create)
|
|
156
|
+
- Blocked by: none
|
|
157
|
+
|
|
158
|
+
- [ ] **T3**: Implement S3 upload service
|
|
159
|
+
- Files: src/services/storage.ts (create)
|
|
160
|
+
- Blocked by: T1
|
|
161
|
+
|
|
162
|
+
- [ ] **T4**: Complete thumbnail generation
|
|
163
|
+
- Files: src/services/image.ts:45 (stub found)
|
|
164
|
+
- Blocked by: T3
|
|
165
|
+
|
|
166
|
+
### color-extraction
|
|
167
|
+
|
|
168
|
+
- [ ] **T5**: Integrate color-thief library
|
|
169
|
+
- Files: src/services/color.ts (create)
|
|
170
|
+
- Blocked by: T1
|
|
171
|
+
```
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# /df:spec — Generate Spec from Conversation
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
Transform conversation context into a structured specification file.
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
```
|
|
8
|
+
/df:spec <name>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Skills
|
|
12
|
+
Uses: `gap-discovery` — Proactive requirement gap identification
|
|
13
|
+
|
|
14
|
+
## Behavior
|
|
15
|
+
|
|
16
|
+
### 1. GAP CHECK
|
|
17
|
+
Before generating, use the `gap-discovery` skill to analyze conversation.
|
|
18
|
+
|
|
19
|
+
**Required clarity:**
|
|
20
|
+
- [ ] Core objective clear
|
|
21
|
+
- [ ] Scope boundaries defined (what's in/out)
|
|
22
|
+
- [ ] Key constraints identified
|
|
23
|
+
- [ ] Success criteria stated
|
|
24
|
+
|
|
25
|
+
**If gaps exist**, ask targeted questions (see skill for categories).
|
|
26
|
+
|
|
27
|
+
Max 5 questions per round. Wait for answers before proceeding.
|
|
28
|
+
|
|
29
|
+
### 2. GENERATE SPEC
|
|
30
|
+
|
|
31
|
+
Once gaps covered, create `specs/{name}.md`:
|
|
32
|
+
|
|
33
|
+
```markdown
|
|
34
|
+
# {Name}
|
|
35
|
+
|
|
36
|
+
## Objective
|
|
37
|
+
[One sentence: what this achieves for the user]
|
|
38
|
+
|
|
39
|
+
## Requirements
|
|
40
|
+
- REQ-1: [Requirement]
|
|
41
|
+
- REQ-2: [Requirement]
|
|
42
|
+
- REQ-3: [Requirement]
|
|
43
|
+
|
|
44
|
+
## Constraints
|
|
45
|
+
- [Constraint 1]
|
|
46
|
+
- [Constraint 2]
|
|
47
|
+
|
|
48
|
+
## Out of Scope
|
|
49
|
+
- [Explicitly excluded item]
|
|
50
|
+
|
|
51
|
+
## Acceptance Criteria
|
|
52
|
+
- [ ] [Testable criterion 1]
|
|
53
|
+
- [ ] [Testable criterion 2]
|
|
54
|
+
- [ ] [Testable criterion 3]
|
|
55
|
+
|
|
56
|
+
## Technical Notes
|
|
57
|
+
[Any implementation hints, preferred approaches, or context]
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 3. CONFIRM
|
|
61
|
+
|
|
62
|
+
After writing:
|
|
63
|
+
```
|
|
64
|
+
✓ Created specs/{name}.md
|
|
65
|
+
|
|
66
|
+
Requirements: {count}
|
|
67
|
+
Acceptance criteria: {count}
|
|
68
|
+
|
|
69
|
+
Next: Run /df:plan to generate tasks
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Rules
|
|
73
|
+
- Do NOT generate spec if critical gaps remain
|
|
74
|
+
- Ask maximum 5 questions per round (not overwhelming)
|
|
75
|
+
- Requirements must be testable
|
|
76
|
+
- Acceptance criteria must be verifiable
|
|
77
|
+
- Keep specs concise (<100 lines)
|
|
78
|
+
|
|
79
|
+
## Example
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
USER: I want to add image upload
|
|
83
|
+
|
|
84
|
+
CLAUDE: A few questions before I create the spec:
|
|
85
|
+
|
|
86
|
+
1. **File types**: Just images (jpg/png), or also gifs/videos?
|
|
87
|
+
2. **Size limit**: Max file size?
|
|
88
|
+
3. **Storage**: Local, S3, or other?
|
|
89
|
+
4. **Auth**: Anyone can upload, or logged-in users only?
|
|
90
|
+
|
|
91
|
+
USER: jpg/png/webp only, max 10MB, S3, logged-in only
|
|
92
|
+
|
|
93
|
+
CLAUDE: ✓ Created specs/image-upload.md
|
|
94
|
+
|
|
95
|
+
Requirements: 4
|
|
96
|
+
Acceptance criteria: 5
|
|
97
|
+
|
|
98
|
+
Next: Run /df:plan to generate tasks
|
|
99
|
+
```
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# /df:verify — Verify Specs Satisfied
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
Check that implemented code satisfies spec requirements and acceptance criteria.
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
```
|
|
8
|
+
/df:verify
|
|
9
|
+
/df:verify image-upload # Verify specific spec only
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Skills & Agents
|
|
13
|
+
- Skill: `code-completeness` — Find incomplete implementations
|
|
14
|
+
- Agent: `Explore` (Haiku) — Fast codebase scanning
|
|
15
|
+
|
|
16
|
+
## Behavior
|
|
17
|
+
|
|
18
|
+
### 1. LOAD CONTEXT
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
Load:
|
|
22
|
+
- specs/*.md (requirements to verify)
|
|
23
|
+
- PLAN.md (task completion status)
|
|
24
|
+
- Source code (actual implementation)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 2. VERIFY EACH SPEC
|
|
28
|
+
|
|
29
|
+
For each spec file, check:
|
|
30
|
+
|
|
31
|
+
#### Requirements Coverage
|
|
32
|
+
```
|
|
33
|
+
For each REQ-N in spec:
|
|
34
|
+
- Find implementation in code
|
|
35
|
+
- Verify it meets the requirement
|
|
36
|
+
- Mark: ✓ satisfied | ✗ missing | ⚠ partial
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
#### Acceptance Criteria
|
|
40
|
+
```
|
|
41
|
+
For each criterion:
|
|
42
|
+
- Can it be verified? (testable)
|
|
43
|
+
- Is there evidence it passes?
|
|
44
|
+
- Mark: ✓ | ✗ | ⚠
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
#### Implementation Quality
|
|
48
|
+
|
|
49
|
+
Use `code-completeness` skill patterns to check for:
|
|
50
|
+
- Stub functions (not fully implemented)
|
|
51
|
+
- TODO/FIXME comments (incomplete work)
|
|
52
|
+
- Placeholder returns (fake implementations)
|
|
53
|
+
- Skipped tests (untested code)
|
|
54
|
+
|
|
55
|
+
### 3. GENERATE REPORT
|
|
56
|
+
|
|
57
|
+
**If all pass:**
|
|
58
|
+
```
|
|
59
|
+
✓ Verification complete
|
|
60
|
+
|
|
61
|
+
specs/image-upload.md
|
|
62
|
+
Requirements: 4/4 ✓
|
|
63
|
+
Acceptance criteria: 5/5 ✓
|
|
64
|
+
Quality: No stubs or TODOs
|
|
65
|
+
|
|
66
|
+
specs/color-extraction.md
|
|
67
|
+
Requirements: 2/2 ✓
|
|
68
|
+
Acceptance criteria: 3/3 ✓
|
|
69
|
+
Quality: No stubs or TODOs
|
|
70
|
+
|
|
71
|
+
All specs satisfied.
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**If issues found:**
|
|
75
|
+
```
|
|
76
|
+
⚠ Verification found issues
|
|
77
|
+
|
|
78
|
+
specs/image-upload.md
|
|
79
|
+
Requirements: 3/4
|
|
80
|
+
✗ REQ-4: Error handling for S3 failures
|
|
81
|
+
Expected: Graceful error with retry option
|
|
82
|
+
Found: No error handling in src/services/storage.ts
|
|
83
|
+
|
|
84
|
+
Acceptance criteria: 4/5
|
|
85
|
+
⚠ "Upload shows progress bar"
|
|
86
|
+
Found: Progress callback exists but UI not connected
|
|
87
|
+
|
|
88
|
+
Quality:
|
|
89
|
+
⚠ src/services/image.ts:67 — TODO: optimize for large files
|
|
90
|
+
|
|
91
|
+
Action needed:
|
|
92
|
+
1. Add S3 error handling (REQ-4)
|
|
93
|
+
2. Connect progress UI
|
|
94
|
+
3. Complete TODO in image.ts
|
|
95
|
+
|
|
96
|
+
Run /df:plan to generate fix tasks, or fix manually.
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### 4. UPDATE STATE
|
|
100
|
+
|
|
101
|
+
Write findings to STATE.md:
|
|
102
|
+
```markdown
|
|
103
|
+
## Verification Log
|
|
104
|
+
|
|
105
|
+
### 2025-01-28 15:30
|
|
106
|
+
Verified: image-upload, color-extraction
|
|
107
|
+
Result: 1 spec gap, 2 quality issues
|
|
108
|
+
Action: Generated fix tasks
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Verification Levels
|
|
112
|
+
|
|
113
|
+
| Level | Check | Method |
|
|
114
|
+
|-------|-------|--------|
|
|
115
|
+
| L1: Exists | File/function exists | Glob/Grep |
|
|
116
|
+
| L2: Substantive | Real code, not stub | Read + analyze |
|
|
117
|
+
| L3: Wired | Integrated into system | Trace imports/calls |
|
|
118
|
+
| L4: Tested | Has passing tests | Run tests |
|
|
119
|
+
|
|
120
|
+
Default: L1-L3 (L4 optional, can be slow)
|
|
121
|
+
|
|
122
|
+
## Rules
|
|
123
|
+
- Verify against spec, not assumptions
|
|
124
|
+
- Flag partial implementations
|
|
125
|
+
- Report TODO/FIXME as quality issues
|
|
126
|
+
- Don't auto-fix — report findings for `/df:plan`
|
|
127
|
+
|
|
128
|
+
## Agent Usage
|
|
129
|
+
|
|
130
|
+
Spawn `Explore` agents (Haiku) for fast read-only scanning:
|
|
131
|
+
- 1-2 agents per spec (based on spec size)
|
|
132
|
+
- Cap: 10 parallel agents
|
|
133
|
+
- Read-only: safe to parallelize heavily
|
|
134
|
+
|
|
135
|
+
## Example
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
/df:verify
|
|
139
|
+
|
|
140
|
+
Verifying 2 specs...
|
|
141
|
+
|
|
142
|
+
specs/image-upload.md
|
|
143
|
+
├─ REQ-1: Upload endpoint ✓
|
|
144
|
+
│ src/api/upload.ts exports POST /api/upload
|
|
145
|
+
├─ REQ-2: File validation ✓
|
|
146
|
+
│ src/middleware/validate.ts checks type, size
|
|
147
|
+
├─ REQ-3: S3 storage ✓
|
|
148
|
+
│ src/services/storage.ts implements uploadToS3()
|
|
149
|
+
└─ REQ-4: Thumbnails ✓
|
|
150
|
+
src/services/image.ts implements generateThumbnail()
|
|
151
|
+
|
|
152
|
+
Acceptance: 5/5 ✓
|
|
153
|
+
Quality: Clean
|
|
154
|
+
|
|
155
|
+
specs/color-extraction.md
|
|
156
|
+
├─ REQ-1: Extract colors ✓
|
|
157
|
+
└─ REQ-2: Palette display ⚠
|
|
158
|
+
Found: Component exists but not exported
|
|
159
|
+
|
|
160
|
+
Acceptance: 2/3
|
|
161
|
+
Quality: 1 TODO found
|
|
162
|
+
|
|
163
|
+
Summary:
|
|
164
|
+
Specs: 2
|
|
165
|
+
Passed: 1
|
|
166
|
+
Issues: 1
|
|
167
|
+
|
|
168
|
+
Run /df:plan to generate fix tasks.
|
|
169
|
+
```
|