@dv.nghiem/flowdeck 0.3.2 → 0.3.4
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/README.md +18 -13
- package/dist/hooks/orchestrator-guard-hook.d.ts +4 -1
- package/dist/hooks/orchestrator-guard-hook.d.ts.map +1 -1
- package/dist/hooks/session-idle-hook.d.ts.map +1 -1
- package/dist/hooks/telemetry-hook.d.ts +14 -1
- package/dist/hooks/telemetry-hook.d.ts.map +1 -1
- package/dist/hooks/telemetry-hook.test.d.ts +2 -0
- package/dist/hooks/telemetry-hook.test.d.ts.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +583 -240
- package/dist/tools/council.d.ts.map +1 -1
- package/dist/tools/delegate.d.ts.map +1 -1
- package/dist/tools/dispatch-routing.d.ts +6 -0
- package/dist/tools/dispatch-routing.d.ts.map +1 -0
- package/dist/tools/memory-status.d.ts +3 -0
- package/dist/tools/memory-status.d.ts.map +1 -0
- package/dist/tools/run-pipeline.d.ts.map +1 -1
- package/docs/commands.md +102 -9
- package/docs/installation.md +6 -17
- package/docs/intelligence.md +18 -33
- package/docs/optimization-baseline.md +21 -0
- package/docs/quick-start.md +44 -23
- package/docs/rules.md +9 -36
- package/docs/workflows.md +18 -17
- package/package.json +4 -2
- package/src/commands/fd-execute.md +192 -0
- package/src/commands/fd-new-feature.md +44 -157
- package/src/commands/fd-new-project.md +1 -2
- package/src/commands/fd-plan.md +1 -1
- package/src/commands/fd-suggest.md +84 -0
- package/src/commands/fd-verify.md +126 -0
- package/src/rules/README.md +10 -0
- package/src/rules/common/agent-orchestration.md +5 -5
- package/src/rules/common/coding-style.md +17 -0
- package/src/rules/typescript/patterns.md +1 -1
- package/src/skills/backend-patterns/SKILL.md +6 -0
- package/src/skills/clean-architecture/SKILL.md +6 -0
- package/src/skills/cqrs/SKILL.md +6 -0
- package/src/skills/ddd-architecture/SKILL.md +6 -0
- package/src/skills/event-driven-architecture/SKILL.md +6 -0
- package/src/skills/hexagonal-architecture/SKILL.md +6 -0
- package/src/skills/layered-architecture/SKILL.md +6 -0
- package/src/skills/postgres-patterns/SKILL.md +6 -0
- package/src/skills/saga-architecture/SKILL.md +6 -0
package/docs/workflows.md
CHANGED
|
@@ -15,20 +15,20 @@ FlowDeck commands are the single entry point for all operations. Each command em
|
|
|
15
15
|
```
|
|
16
16
|
/fd-new-project
|
|
17
17
|
↓
|
|
18
|
-
|
|
18
|
+
/fd-new-feature → .planning/phases/phase-N/FEATURE.md (feature defined)
|
|
19
19
|
↓
|
|
20
|
-
|
|
20
|
+
/fd-discuss → .planning/phases/phase-N/DISCUSS.md (locked decisions)
|
|
21
21
|
↓
|
|
22
|
-
|
|
22
|
+
/fd-plan → .planning/phases/phase-N/PLAN.md (confirmed plan)
|
|
23
23
|
↓
|
|
24
|
-
|
|
24
|
+
/fd-execute → implemented, tested, reviewed code (via TDD)
|
|
25
25
|
↓
|
|
26
|
-
|
|
26
|
+
/fd-verify → verification report (tests, review, security, deploy check)
|
|
27
27
|
↓
|
|
28
|
-
|
|
28
|
+
/fd-checkpoint → .planning/STATE.md saved
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
Each step gates the next. `/fd-
|
|
31
|
+
Each step gates the next. `/fd-discuss` requires a defined feature. `/fd-plan` requires confirmed decisions from `DISCUSS.md`. `/fd-execute` requires a confirmed `PLAN.md`. `/fd-verify` confirms all checks pass before marking the feature as complete.
|
|
32
32
|
|
|
33
33
|
---
|
|
34
34
|
|
|
@@ -38,34 +38,35 @@ Each step gates the next. `/fd-plan` will not proceed without a confirmed `DISCU
|
|
|
38
38
|
|---------|---------|------------|
|
|
39
39
|
| `/fd-new-project` | Bootstrap a new project | @orchestrator |
|
|
40
40
|
| `/fd-map-codebase` | Analyse and index the codebase | @mapper (×6 parallel) |
|
|
41
|
-
| `/fd-
|
|
41
|
+
| `/fd-new-feature` | Initialize a new feature | @orchestrator |
|
|
42
42
|
| `/fd-discuss` | Pre-planning discussion | @discusser |
|
|
43
43
|
| `/fd-plan` | Generate a phase plan | @planner, @plan-checker |
|
|
44
|
-
| `/fd-roadmap` | View / update project roadmap | @orchestrator |
|
|
45
|
-
| `/fd-dashboard` | Visual progress dashboard | — |
|
|
46
44
|
| `/fd-ask` | Smart agent dispatch | various |
|
|
47
|
-
| `/fd-
|
|
45
|
+
| `/fd-execute` | Implement feature via TDD | @orchestrator, @coder, @tester, @reviewer |
|
|
46
|
+
| `/fd-verify` | Verify feature completion | @tester, @reviewer, @security-auditor |
|
|
48
47
|
| `/fd-fix-bug` | Fix a bug with TDD | @debug-specialist, @tester, @coder |
|
|
49
|
-
| `/fd-review-code` | Code review | @reviewer, @researcher, @tester |
|
|
50
48
|
| `/fd-write-docs` | Generate documentation | @writer, @reviewer |
|
|
51
49
|
| `/fd-deploy-check` | Pre-deploy safety check | @tester, @security-auditor, @reviewer |
|
|
52
|
-
| `/fd-
|
|
50
|
+
| `/fd-status` | View project progress | — |
|
|
53
51
|
| `/fd-checkpoint` | Save a session checkpoint | — |
|
|
54
52
|
| `/fd-resume` | Resume from checkpoint | — |
|
|
55
53
|
| `/fd-multi-repo` | Multi-repo orchestration | @multi-repo-coordinator, @architect |
|
|
54
|
+
| `/fd-translate-intent` | Convert vague requests to ranked implementation options | @architect, @researcher |
|
|
55
|
+
| `/fd-suggest` | Suggest high-value feature opportunities from codebase signals | @researcher, @architect |
|
|
56
|
+
| `/fd-quick` | Fast focused task execution | @coder or selected specialist |
|
|
57
|
+
| `/fd-reflect` | Post-session reflection and skill capture | @auto-learner |
|
|
58
|
+
| `/fd-doctor` | Installation and environment diagnostics | @orchestrator |
|
|
56
59
|
|
|
57
60
|
---
|
|
58
61
|
|
|
59
62
|
## Analysis Commands
|
|
60
63
|
|
|
61
|
-
|
|
64
|
+
Analysis workflows are currently exposed through:
|
|
62
65
|
|
|
63
66
|
| Command | Purpose | Flags |
|
|
64
67
|
|---------|---------|-------|
|
|
65
|
-
| `/fd-analyze-change` | Combined impact analysis | `--impact`, `--blast-radius`, `--regression`, `--test-gap`, `--volatility` |
|
|
66
|
-
| `/fd-guarded-edit` | Edit gate decision | auto/confirm/review/block |
|
|
67
|
-
| `/fd-evaluate-risk` | Standalone risk assessment | — |
|
|
68
68
|
| `/fd-translate-intent` | Intent to concrete options | `assumptions`, `recommended_option` |
|
|
69
|
+
| `/fd-suggest` | Suggest feature opportunities from volatility, failures, and decisions | `--category`, `--limit` |
|
|
69
70
|
|
|
70
71
|
---
|
|
71
72
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dv.nghiem/flowdeck",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "FlowDeck — structured planning and execution workflows for OpenCode",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -29,7 +29,9 @@
|
|
|
29
29
|
"postinstall": "node postinstall.mjs",
|
|
30
30
|
"prepublishOnly": "bun run clean && bun run build",
|
|
31
31
|
"test": "bun test",
|
|
32
|
-
"typecheck": "tsc --noEmit"
|
|
32
|
+
"typecheck": "tsc --noEmit",
|
|
33
|
+
"validate:skills": "node scripts/validate-skills.mjs",
|
|
34
|
+
"validate:docs": "node scripts/validate-docs.mjs"
|
|
33
35
|
},
|
|
34
36
|
"keywords": ["opencode", "plugin", "ai", "workflow", "planning"],
|
|
35
37
|
"author": "DVNghiem",
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Execute feature implementation from PLAN.md — TDD pipeline with coder, tester, reviewer, and STATE.md update
|
|
3
|
+
argument-hint: [--phase=N] [--override]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Execute
|
|
7
|
+
|
|
8
|
+
Implement the current phase's plan using the full FlowDeck TDD agent pipeline.
|
|
9
|
+
|
|
10
|
+
**Input:** $ARGUMENTS — optional `--phase=N` to target a specific phase, `--override` to bypass guards
|
|
11
|
+
|
|
12
|
+
## Pre-flight
|
|
13
|
+
|
|
14
|
+
1. Check `.planning/` exists — if not, error: "Run /fd-new-project first."
|
|
15
|
+
2. Check `plan_confirmed: true` in STATE.md — if not, error: "Confirm plan first with /fd-plan."
|
|
16
|
+
3. Read `.planning/phases/phase-<N>/PLAN.md` to get implementation steps.
|
|
17
|
+
4. Read `.codebase/ARCHITECTURE.md` if it exists — pass as context.
|
|
18
|
+
|
|
19
|
+
## TDD Cycle Per Step
|
|
20
|
+
|
|
21
|
+
Each plan step follows the TDD cycle:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
BEHAVIOR → RED → GREEN → REFACTOR → next step
|
|
25
|
+
↑_________| |
|
|
26
|
+
(loop if needed) Only if GREEN
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Process
|
|
30
|
+
|
|
31
|
+
### Step 1: Guard Check
|
|
32
|
+
|
|
33
|
+
Verify prerequisites:
|
|
34
|
+
- `.planning/` directory exists
|
|
35
|
+
- `.codebase/` directory exists
|
|
36
|
+
- `STATE.md` has `plan_confirmed: true`
|
|
37
|
+
- `PLAN.md` exists in current phase directory
|
|
38
|
+
|
|
39
|
+
Initialize TDD state:
|
|
40
|
+
```yaml
|
|
41
|
+
tdd:
|
|
42
|
+
stage: behavior
|
|
43
|
+
cycle: 1
|
|
44
|
+
behaviors: []
|
|
45
|
+
regression_test_links: []
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Step 2: Load Plan
|
|
49
|
+
|
|
50
|
+
Read the active PLAN.md from the current phase directory.
|
|
51
|
+
Parse the tasks list and identify which steps are complete.
|
|
52
|
+
|
|
53
|
+
### Step 3: Define Behaviors
|
|
54
|
+
|
|
55
|
+
Spawn `@orchestrator` to generate behavior checklist from PLAN.md:
|
|
56
|
+
- Acceptance cases for each step
|
|
57
|
+
- Edge cases to test
|
|
58
|
+
- Expected behaviors
|
|
59
|
+
|
|
60
|
+
Store in TDD state.
|
|
61
|
+
|
|
62
|
+
### Step 4: Identify Next Step
|
|
63
|
+
|
|
64
|
+
From PLAN.md, find the first step NOT in `steps_complete`.
|
|
65
|
+
Check TDD stage — only proceed if stage is appropriate for the step.
|
|
66
|
+
|
|
67
|
+
### Step 5: Write Failing Tests (RED)
|
|
68
|
+
|
|
69
|
+
Spawn `@tester` to write tests for the step's behavior:
|
|
70
|
+
- **Tests MUST fail** before implementation
|
|
71
|
+
- Cover acceptance cases and edge cases
|
|
72
|
+
- Use AAA pattern (Arrange-Act-Assert)
|
|
73
|
+
|
|
74
|
+
### Step 6: Confirm RED
|
|
75
|
+
|
|
76
|
+
Run failing tests:
|
|
77
|
+
- **GUARD: Do NOT proceed to Step 7 until tests fail**
|
|
78
|
+
- If tests pass unexpectedly, tests don't correctly describe behavior
|
|
79
|
+
|
|
80
|
+
### Step 7: Implement Minimum (GREEN)
|
|
81
|
+
|
|
82
|
+
Spawn `@coder` to implement:
|
|
83
|
+
- **Minimum code** to make failing tests pass
|
|
84
|
+
- No speculative features
|
|
85
|
+
- No over-engineering
|
|
86
|
+
|
|
87
|
+
### Step 8: Confirm GREEN
|
|
88
|
+
|
|
89
|
+
Run tests:
|
|
90
|
+
- **GUARD: Do NOT proceed to Step 9 until tests pass**
|
|
91
|
+
- If tests fail, return to Step 7
|
|
92
|
+
|
|
93
|
+
### Step 9: Refactor (REFACTOR)
|
|
94
|
+
|
|
95
|
+
Only if GREEN:
|
|
96
|
+
- Clean up code for this step
|
|
97
|
+
- Remove dead code
|
|
98
|
+
- Improve readability
|
|
99
|
+
- **GUARD: Do not refactor if not GREEN**
|
|
100
|
+
|
|
101
|
+
### Step 10: Verify
|
|
102
|
+
|
|
103
|
+
Run full test suite:
|
|
104
|
+
- All tests must pass
|
|
105
|
+
- If any fails, revert refactoring
|
|
106
|
+
|
|
107
|
+
### Step 11: Review Step
|
|
108
|
+
|
|
109
|
+
Spawn `@reviewer` to check:
|
|
110
|
+
- Code quality, security, conventions
|
|
111
|
+
- TDD discipline followed
|
|
112
|
+
- Test coverage >= 80%
|
|
113
|
+
- No missing or weak tests (flag as major finding)
|
|
114
|
+
|
|
115
|
+
### Step 12: Update State
|
|
116
|
+
|
|
117
|
+
Mark step complete via planning-state tool:
|
|
118
|
+
```yaml
|
|
119
|
+
steps_complete: [N, ...]
|
|
120
|
+
last_action: "Step N complete via TDD: [behavior]"
|
|
121
|
+
tdd:
|
|
122
|
+
stage: behavior # Ready for next step
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Step 13: Loop or Complete
|
|
126
|
+
|
|
127
|
+
If more steps pending:
|
|
128
|
+
- Return to Step 3 (define behaviors for next step)
|
|
129
|
+
|
|
130
|
+
If all steps complete:
|
|
131
|
+
- Update phase status to "complete"
|
|
132
|
+
- Update ROADMAP.md progress
|
|
133
|
+
- Present completion summary
|
|
134
|
+
|
|
135
|
+
## Wave-Based Execution
|
|
136
|
+
|
|
137
|
+
WF-03 respects wave structure from PLAN.md:
|
|
138
|
+
- Wave 1 steps execute first (with TDD cycle per step)
|
|
139
|
+
- Wave 2 steps execute after Wave 1 completes
|
|
140
|
+
- Wave 3 steps execute after Wave 2 completes
|
|
141
|
+
- No intra-wave dependencies (parallel execution)
|
|
142
|
+
|
|
143
|
+
## Guards Summary
|
|
144
|
+
|
|
145
|
+
| Transition | Guard | If Violated |
|
|
146
|
+
|-----------|-------|-------------|
|
|
147
|
+
| behavior → red | Test written and fails | Block until test fails |
|
|
148
|
+
| red → green | Test exists and fails | Block until test passes |
|
|
149
|
+
| green → refactor | Tests are green | Block until green |
|
|
150
|
+
| refactor → verify | All tests pass | Block until all pass |
|
|
151
|
+
|
|
152
|
+
## Override Mechanism
|
|
153
|
+
|
|
154
|
+
User can override with `/fd-execute --override`:
|
|
155
|
+
- Every override is logged in `override_log`
|
|
156
|
+
- Surface override in next review
|
|
157
|
+
- Flag in deploy check
|
|
158
|
+
|
|
159
|
+
## Error Handling
|
|
160
|
+
|
|
161
|
+
D-03: Fail fast with clear error
|
|
162
|
+
- If guard check fails: abort with clear error and remediation
|
|
163
|
+
- If @coder fails: report failure, offer retry or skip
|
|
164
|
+
- If @reviewer finds critical issues: return to Step 7 for fixes
|
|
165
|
+
- No partial state saved on error
|
|
166
|
+
|
|
167
|
+
## State Updates
|
|
168
|
+
|
|
169
|
+
STATE.md updates after each step:
|
|
170
|
+
```yaml
|
|
171
|
+
steps_complete: [1, 2] # Added after step 2
|
|
172
|
+
steps_pending: [3, 4, 5] # Removed step 2
|
|
173
|
+
last_action: "Step 2 TDD complete: [behavior] (RED→GREEN→REFACTOR)"
|
|
174
|
+
tdd:
|
|
175
|
+
stage: behavior
|
|
176
|
+
cycle: 2
|
|
177
|
+
behaviors_completed: 2
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Full phase completion:
|
|
181
|
+
```yaml
|
|
182
|
+
status: complete
|
|
183
|
+
last_action: "Phase N TDD complete — all steps finished"
|
|
184
|
+
tdd:
|
|
185
|
+
stage: complete
|
|
186
|
+
cycles_used: N
|
|
187
|
+
behaviors_completed: M
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Completion
|
|
191
|
+
|
|
192
|
+
Report: feature implemented, tests status, reviewer findings, files changed. Suggest running `/fd-verify`.
|
|
@@ -1,192 +1,79 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
3
|
-
argument-hint: [feature description]
|
|
2
|
+
description: Start a new feature — initialize feature context in .planning/, capture description, and guide through discuss → plan → execute → verify
|
|
3
|
+
argument-hint: [feature name or description]
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# New Feature
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Initialize a new feature and guide through the full FlowDeck feature workflow.
|
|
9
9
|
|
|
10
|
-
**Input:** $ARGUMENTS — description of the feature to
|
|
10
|
+
**Input:** $ARGUMENTS — name or short description of the feature to build
|
|
11
11
|
|
|
12
12
|
## Pre-flight
|
|
13
13
|
|
|
14
14
|
1. Check `.planning/` exists — if not, error: "Run /fd-new-project first."
|
|
15
|
-
2.
|
|
16
|
-
3.
|
|
17
|
-
4. Read `.codebase/ARCHITECTURE.md` if it exists — pass as context.
|
|
18
|
-
|
|
19
|
-
## TDD Cycle Per Step
|
|
20
|
-
|
|
21
|
-
Each plan step follows the TDD cycle:
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
BEHAVIOR → RED → GREEN → REFACTOR → next step
|
|
25
|
-
↑_________| |
|
|
26
|
-
(loop if needed) Only if GREEN
|
|
27
|
-
```
|
|
15
|
+
2. Read `.planning/STATE.md` to determine the current phase number N.
|
|
16
|
+
3. Create `.planning/phases/phase-<N>/` directory if it does not exist.
|
|
28
17
|
|
|
29
18
|
## Process
|
|
30
19
|
|
|
31
|
-
### Step 1:
|
|
32
|
-
|
|
33
|
-
Verify prerequisites:
|
|
34
|
-
- `.planning/` directory exists
|
|
35
|
-
- `.codebase/` directory exists
|
|
36
|
-
- `STATE.md` has `plan_confirmed: true`
|
|
37
|
-
- `PLAN.md` exists in current phase directory
|
|
38
|
-
|
|
39
|
-
Initialize TDD state:
|
|
40
|
-
```yaml
|
|
41
|
-
tdd:
|
|
42
|
-
stage: behavior
|
|
43
|
-
cycle: 1
|
|
44
|
-
behaviors: []
|
|
45
|
-
regression_test_links: []
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### Step 2: Load Plan
|
|
49
|
-
|
|
50
|
-
Read the active PLAN.md from the current phase directory.
|
|
51
|
-
Parse the tasks list and identify which steps are complete.
|
|
52
|
-
|
|
53
|
-
### Step 3: Define Behaviors
|
|
54
|
-
|
|
55
|
-
Spawn `@orchestrator` to generate behavior checklist from PLAN.md:
|
|
56
|
-
- Acceptance cases for each step
|
|
57
|
-
- Edge cases to test
|
|
58
|
-
- Expected behaviors
|
|
59
|
-
|
|
60
|
-
Store in TDD state.
|
|
61
|
-
|
|
62
|
-
### Step 4: Identify Next Step
|
|
63
|
-
|
|
64
|
-
From PLAN.md, find the first step NOT in `steps_complete`.
|
|
65
|
-
Check TDD stage — only proceed if stage is appropriate for the step.
|
|
66
|
-
|
|
67
|
-
### Step 5: Write Failing Tests (RED)
|
|
20
|
+
### Step 1: Capture Feature Description
|
|
68
21
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
- Cover acceptance cases and edge cases
|
|
72
|
-
- Use AAA pattern (Arrange-Act-Assert)
|
|
22
|
+
If $ARGUMENTS is empty, ask the user:
|
|
23
|
+
> "What feature do you want to build? Describe it in one or two sentences."
|
|
73
24
|
|
|
74
|
-
|
|
25
|
+
Use the provided description as the feature name/summary.
|
|
75
26
|
|
|
76
|
-
|
|
77
|
-
- **GUARD: Do NOT proceed to Step 7 until tests fail**
|
|
78
|
-
- If tests pass unexpectedly, tests don't correctly describe behavior
|
|
27
|
+
### Step 2: Initialize Feature Context
|
|
79
28
|
|
|
80
|
-
|
|
29
|
+
Create `.planning/phases/phase-<N>/FEATURE.md`:
|
|
81
30
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
- No speculative features
|
|
85
|
-
- No over-engineering
|
|
31
|
+
```markdown
|
|
32
|
+
# Feature: $ARGUMENTS
|
|
86
33
|
|
|
87
|
-
|
|
34
|
+
**Phase:** <N>
|
|
35
|
+
**Created:** <current timestamp>
|
|
36
|
+
**Status:** defined
|
|
88
37
|
|
|
89
|
-
|
|
90
|
-
- **GUARD: Do NOT proceed to Step 9 until tests pass**
|
|
91
|
-
- If tests fail, return to Step 7
|
|
38
|
+
## Description
|
|
92
39
|
|
|
93
|
-
|
|
40
|
+
$ARGUMENTS
|
|
94
41
|
|
|
95
|
-
|
|
96
|
-
- Clean up code for this step
|
|
97
|
-
- Remove dead code
|
|
98
|
-
- Improve readability
|
|
99
|
-
- **GUARD: Do not refactor if not GREEN**
|
|
42
|
+
## Acceptance Criteria
|
|
100
43
|
|
|
101
|
-
|
|
44
|
+
(to be defined in /fd-discuss)
|
|
102
45
|
|
|
103
|
-
|
|
104
|
-
- All tests must pass
|
|
105
|
-
- If any fails, revert refactoring
|
|
46
|
+
## Out of Scope
|
|
106
47
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
Spawn `@reviewer` to check:
|
|
110
|
-
- Code quality, security, conventions
|
|
111
|
-
- TDD discipline followed
|
|
112
|
-
- Test coverage >= 80%
|
|
113
|
-
- No missing or weak tests (flag as major finding)
|
|
114
|
-
|
|
115
|
-
### Step 12: Update State
|
|
116
|
-
|
|
117
|
-
Mark step complete via planning-state tool:
|
|
118
|
-
```yaml
|
|
119
|
-
steps_complete: [N, ...]
|
|
120
|
-
last_action: "Step N complete via TDD: [behavior]"
|
|
121
|
-
tdd:
|
|
122
|
-
stage: behavior # Ready for next step
|
|
48
|
+
(to be defined in /fd-discuss)
|
|
123
49
|
```
|
|
124
50
|
|
|
125
|
-
### Step
|
|
126
|
-
|
|
127
|
-
If more steps pending:
|
|
128
|
-
- Return to Step 3 (define behaviors for next step)
|
|
129
|
-
|
|
130
|
-
If all steps complete:
|
|
131
|
-
- Update phase status to "complete"
|
|
132
|
-
- Update ROADMAP.md progress
|
|
133
|
-
- Present completion summary
|
|
134
|
-
|
|
135
|
-
## Wave-Based Execution
|
|
136
|
-
|
|
137
|
-
WF-03 respects wave structure from PLAN.md:
|
|
138
|
-
- Wave 1 steps execute first (with TDD cycle per step)
|
|
139
|
-
- Wave 2 steps execute after Wave 1 completes
|
|
140
|
-
- Wave 3 steps execute after Wave 2 completes
|
|
141
|
-
- No intra-wave dependencies (parallel execution)
|
|
51
|
+
### Step 3: Update STATE.md
|
|
142
52
|
|
|
143
|
-
|
|
53
|
+
Update the current phase entry in STATE.md:
|
|
54
|
+
- Set `feature` to the feature name/description
|
|
55
|
+
- Set `status` to `defined`
|
|
56
|
+
- Set `last_action` to `"Feature defined: $ARGUMENTS"`
|
|
144
57
|
|
|
145
|
-
|
|
146
|
-
|-----------|-------|-------------|
|
|
147
|
-
| behavior → red | Test written and fails | Block until test fails |
|
|
148
|
-
| red → green | Test exists and fails | Block until test passes |
|
|
149
|
-
| green → refactor | Tests are green | Block until green |
|
|
150
|
-
| refactor → verify | All tests pass | Block until all pass |
|
|
58
|
+
### Step 4: Present Feature Workflow
|
|
151
59
|
|
|
152
|
-
|
|
60
|
+
Report what was created and present the next steps clearly:
|
|
153
61
|
|
|
154
|
-
User can override with `/fd-new-feature --override`:
|
|
155
|
-
- Every override is logged in `override_log`
|
|
156
|
-
- Surface override in next review
|
|
157
|
-
- Flag in deploy check
|
|
158
|
-
|
|
159
|
-
## Error Handling
|
|
160
|
-
|
|
161
|
-
D-03: Fail fast with clear error
|
|
162
|
-
- If guard check fails: abort with clear error and remediation
|
|
163
|
-
- If @coder fails: report failure, offer retry or skip
|
|
164
|
-
- If @reviewer finds critical issues: return to Step 7 for fixes
|
|
165
|
-
- No partial state saved on error
|
|
166
|
-
|
|
167
|
-
## State Updates
|
|
168
|
-
|
|
169
|
-
STATE.md updates after each step:
|
|
170
|
-
```yaml
|
|
171
|
-
steps_complete: [1, 2] # Added after step 2
|
|
172
|
-
steps_pending: [3, 4, 5] # Removed step 2
|
|
173
|
-
last_action: "Step 2 TDD complete: [behavior] (RED→GREEN→REFACTOR)"
|
|
174
|
-
tdd:
|
|
175
|
-
stage: behavior
|
|
176
|
-
cycle: 2
|
|
177
|
-
behaviors_completed: 2
|
|
178
62
|
```
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
63
|
+
✅ Feature initialized: $ARGUMENTS
|
|
64
|
+
Phase: <N>
|
|
65
|
+
File: .planning/phases/phase-<N>/FEATURE.md
|
|
66
|
+
|
|
67
|
+
Next steps (in order):
|
|
68
|
+
1. /fd-discuss — capture requirements, scope, and acceptance criteria
|
|
69
|
+
2. /fd-plan — create implementation plan from discussion decisions
|
|
70
|
+
3. /fd-execute — run TDD pipeline to implement the plan
|
|
71
|
+
4. /fd-verify — run full test + review + deploy-check pipeline
|
|
188
72
|
```
|
|
189
73
|
|
|
190
|
-
##
|
|
74
|
+
## Error Handling
|
|
75
|
+
|
|
76
|
+
- If `.planning/` not found: error "Run /fd-new-project first."
|
|
77
|
+
- If STATE.md not found: error "Project not initialized. Run /fd-new-project first."
|
|
78
|
+
- No partial state saved on error.
|
|
191
79
|
|
|
192
|
-
Report: feature implemented, tests status, reviewer findings, files changed.
|
|
@@ -111,6 +111,5 @@ confirmed_at: none
|
|
|
111
111
|
```
|
|
112
112
|
|
|
113
113
|
5. Report success with the list of files created and next steps:
|
|
114
|
-
- Run `/fd-
|
|
115
|
-
- Run `/fd-plan` to create an implementation plan
|
|
114
|
+
- Run `/fd-new-feature` to define your first feature
|
|
116
115
|
- Edit `.planning/config.json` directly to change settings
|
package/src/commands/fd-plan.md
CHANGED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Analyze codebase and suggest new features with implementation instructions
|
|
3
|
+
argument-hint: [--category=TYPE] [--limit=N]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Suggest Features
|
|
7
|
+
|
|
8
|
+
Analyze the codebase and generate actionable feature suggestions with implementation guidance.
|
|
9
|
+
|
|
10
|
+
**Input:** $ARGUMENTS (optional --category for focus area: tools|hooks|agents|skills, --limit for number of suggestions, default 5)
|
|
11
|
+
|
|
12
|
+
## Process
|
|
13
|
+
|
|
14
|
+
### Step 1: Detect Environment
|
|
15
|
+
|
|
16
|
+
Check if `.planning/` directory exists:
|
|
17
|
+
- If it exists: Use current project context, analyze within existing architecture
|
|
18
|
+
- If not: This is a standalone analysis, scan the codebase root
|
|
19
|
+
|
|
20
|
+
### Step 2: Run Analysis Tools
|
|
21
|
+
|
|
22
|
+
Execute tools to gather insight data:
|
|
23
|
+
|
|
24
|
+
1. **Volatility Map** — `volatility-map` tool to find high-change areas (instability signals)
|
|
25
|
+
2. **Decision Trace** — `decision-trace` tool to find incomplete orTODO decisions
|
|
26
|
+
3. **Failure Replay** — `failure-replay` tool to find recurring failure patterns
|
|
27
|
+
4. **Codebase State** — `codebase-state` tool to get overall project structure
|
|
28
|
+
|
|
29
|
+
### Step 3: Scan for Gaps
|
|
30
|
+
|
|
31
|
+
Analyze the codebase structure to identify gaps:
|
|
32
|
+
|
|
33
|
+
- **Tools** — Are all tool categories covered? (planning, state, execution, analysis)
|
|
34
|
+
- **Hooks** — Are lifecycle hooks comprehensive?
|
|
35
|
+
- **Agents** — Are agent types sufficient for common tasks?
|
|
36
|
+
- **Skills** — Are there skill coverage gaps for major frameworks?
|
|
37
|
+
|
|
38
|
+
### Step 4: Generate Suggestions
|
|
39
|
+
|
|
40
|
+
For each valid suggestion (up to --limit), produce:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
## Suggestion N: [Feature Name]
|
|
44
|
+
|
|
45
|
+
**Category:** tools|hooks|agents|skills
|
|
46
|
+
**Impact:** HIGH|MEDIUM|LOW
|
|
47
|
+
**Complexity:** HIGH|MEDIUM|LOW
|
|
48
|
+
|
|
49
|
+
### Problem Statement
|
|
50
|
+
[What issue this solves, with evidence from analysis]
|
|
51
|
+
|
|
52
|
+
### Proposed Solution
|
|
53
|
+
[Brief description of the approach]
|
|
54
|
+
|
|
55
|
+
### Implementation Steps
|
|
56
|
+
1. [Step with TDD approach - write test first]
|
|
57
|
+
2. [Step referencing existing patterns]
|
|
58
|
+
3. [Step with integration points]
|
|
59
|
+
|
|
60
|
+
### Files Affected
|
|
61
|
+
- `src/tools/xxx.ts` or `src/hooks/xxx.ts` or `src/agents/xxx.ts`
|
|
62
|
+
- `src/skills/xxx/SKILL.md` (if applicable)
|
|
63
|
+
- `docs/xxx.md` (if applicable)
|
|
64
|
+
|
|
65
|
+
### Integration
|
|
66
|
+
- How this connects to existing FlowDeck tools/agents
|
|
67
|
+
- Any new dependencies or configuration needed
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Step 5: Rank and Present
|
|
71
|
+
|
|
72
|
+
Sort suggestions by impact/complexity ratio (highest first).
|
|
73
|
+
|
|
74
|
+
Present:
|
|
75
|
+
```
|
|
76
|
+
# Feature Suggestions
|
|
77
|
+
|
|
78
|
+
Found N suggestions ranked by impact:
|
|
79
|
+
|
|
80
|
+
[Suggestions 1-N]
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
Run /fd-discuss [topic] to start a discussion on any suggestion.
|
|
84
|
+
```
|