@dv.nghiem/flowdeck 0.2.3 → 0.3.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/README.md +24 -41
- package/dist/hooks/memory-hook.d.ts +21 -0
- package/dist/hooks/memory-hook.d.ts.map +1 -0
- package/dist/hooks/orchestrator-guard-hook.d.ts +2 -1
- package/dist/hooks/orchestrator-guard-hook.d.ts.map +1 -1
- package/dist/hooks/todo-hook.d.ts +1 -7
- package/dist/hooks/todo-hook.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +649 -310
- package/dist/services/memory-store.d.ts +40 -0
- package/dist/services/memory-store.d.ts.map +1 -0
- package/dist/services/telemetry.d.ts +1 -1
- package/dist/services/telemetry.d.ts.map +1 -1
- package/dist/tools/memory-search.d.ts +3 -0
- package/dist/tools/memory-search.d.ts.map +1 -0
- package/docs/commands/fd-doctor.md +21 -0
- package/docs/commands/fd-quick.md +33 -0
- package/docs/commands/fd-reflect.md +23 -0
- package/docs/commands/fd-status.md +31 -0
- package/docs/commands/fd-translate-intent.md +17 -0
- package/docs/commands.md +209 -271
- package/docs/configuration.md +2 -1
- package/docs/index.md +22 -28
- package/docs/memory.md +69 -0
- package/docs/quick-start.md +1 -1
- package/docs/workflows.md +72 -320
- package/package.json +1 -2
- package/src/commands/fd-deploy-check.md +189 -34
- package/src/commands/fd-discuss.md +44 -6
- package/src/commands/fd-fix-bug.md +47 -20
- package/src/commands/fd-map-codebase.md +66 -18
- package/src/commands/fd-multi-repo.md +130 -6
- package/src/commands/fd-new-feature.md +164 -21
- package/src/commands/fd-new-project.md +14 -1
- package/src/commands/fd-plan.md +66 -44
- package/src/commands/fd-quick.md +60 -0
- package/src/commands/fd-reflect.md +41 -2
- package/src/commands/fd-status.md +84 -0
- package/src/commands/fd-write-docs.md +55 -23
- package/src/rules/README.md +8 -7
- package/src/skills/agent-harness-construction/SKILL.md +227 -0
- package/src/skills/api-design/SKILL.md +5 -0
- package/src/skills/backend-patterns/SKILL.md +105 -0
- package/src/skills/clean-architecture/SKILL.md +85 -0
- package/src/skills/cqrs/SKILL.md +230 -0
- package/src/skills/ddd-architecture/SKILL.md +104 -0
- package/src/skills/django-patterns/SKILL.md +304 -0
- package/src/skills/django-tdd/SKILL.md +297 -0
- package/src/skills/event-driven-architecture/SKILL.md +152 -0
- package/src/skills/frontend-pattern/SKILL.md +159 -0
- package/src/skills/hexagonal-architecture/SKILL.md +80 -0
- package/src/skills/layered-architecture/SKILL.md +64 -0
- package/src/skills/postgres-patterns/SKILL.md +74 -0
- package/src/skills/python-patterns/SKILL.md +5 -0
- package/src/skills/saga-architecture/SKILL.md +113 -0
- package/dist/tools/run-parallel.d.ts +0 -4
- package/dist/tools/run-parallel.d.ts.map +0 -1
- package/docs/command-migration.md +0 -175
- package/docs/commands/fd-analyze-change.md +0 -107
- package/docs/commands/fd-dashboard.md +0 -11
- package/docs/commands/fd-evaluate-risk.md +0 -134
- package/docs/commands/fd-guarded-edit.md +0 -105
- package/docs/commands/fd-progress.md +0 -11
- package/docs/commands/fd-review-code.md +0 -29
- package/docs/commands/fd-roadmap.md +0 -10
- package/docs/commands/fd-settings.md +0 -10
- package/docs/parallel-execution.md +0 -227
- package/src/commands/fd-analyze-change.md +0 -57
- package/src/commands/fd-approve.md +0 -64
- package/src/commands/fd-blast-radius.md +0 -49
- package/src/commands/fd-dashboard.md +0 -57
- package/src/commands/fd-evaluate-risk.md +0 -62
- package/src/commands/fd-guarded-edit.md +0 -69
- package/src/commands/fd-impact-radar.md +0 -51
- package/src/commands/fd-learn.md +0 -36
- package/src/commands/fd-progress.md +0 -50
- package/src/commands/fd-regression-predict.md +0 -57
- package/src/commands/fd-review-code.md +0 -62
- package/src/commands/fd-review-route.md +0 -54
- package/src/commands/fd-roadmap.md +0 -46
- package/src/commands/fd-settings.md +0 -57
- package/src/commands/fd-test-gap.md +0 -54
- package/src/commands/fd-volatility-map.md +0 -64
- package/src/commands/fd-workspace-status.md +0 -34
- package/src/skills/parallel-execute/SKILL.md +0 -92
- package/src/workflows/debug-flow.md +0 -119
- package/src/workflows/deploy-check-flow.md +0 -98
- package/src/workflows/discuss-flow.md +0 -97
- package/src/workflows/execute-flow.md +0 -233
- package/src/workflows/execute-phase.md +0 -145
- package/src/workflows/fix-bug-flow.md +0 -210
- package/src/workflows/map-codebase-flow.md +0 -92
- package/src/workflows/multi-repo-flow.md +0 -226
- package/src/workflows/parallel-execution-flow.md +0 -236
- package/src/workflows/plan-flow.md +0 -126
- package/src/workflows/plan-phase.md +0 -101
- package/src/workflows/refactor-flow.md +0 -122
- package/src/workflows/review-code-flow.md +0 -105
- package/src/workflows/spec-driven-flow.md +0 -43
- package/src/workflows/write-docs-flow.md +0 -95
|
@@ -1,14 +1,32 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Cross-repo change orchestration — analyze-repos → identify-dependencies → plan-changes → execute-per-repo → verify-integration
|
|
3
3
|
argument-hint: [list | add <path> [name] | remove <name> | status]
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Multi-Repo
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Orchestrates a feature or fix that spans multiple repositories in a microservice architecture.
|
|
9
9
|
|
|
10
10
|
**Input:** $ARGUMENTS
|
|
11
11
|
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
- A feature requires changes in two or more services
|
|
15
|
+
- An API contract is changing in an upstream service with downstream consumers
|
|
16
|
+
- A shared library is being upgraded with a breaking change
|
|
17
|
+
- You need a coordinated rollout across services
|
|
18
|
+
|
|
19
|
+
Do not use for single-repo work. Use `/new-feature` instead.
|
|
20
|
+
|
|
21
|
+
## Prerequisites
|
|
22
|
+
|
|
23
|
+
Before running this flow:
|
|
24
|
+
1. `.planning/config.json` has a `sub_repos` array with the relevant repos registered
|
|
25
|
+
2. All `path` values in the registry resolve to actual directories on disk
|
|
26
|
+
3. A description of the intended change is available (from `/discuss` or passed directly)
|
|
27
|
+
|
|
28
|
+
If the registry is empty or not set up, run `/multi-repo --add` first.
|
|
29
|
+
|
|
12
30
|
## Behavior
|
|
13
31
|
|
|
14
32
|
### List (`list` or no arguments)
|
|
@@ -19,10 +37,12 @@ Read `.planning/config.json` → `repos` array. Display:
|
|
|
19
37
|
════════════════════════════════════
|
|
20
38
|
MULTI-REPO REGISTRY
|
|
21
39
|
════════════════════════════════════
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
shared
|
|
25
|
-
|
|
40
|
+
user-service ../user-service upstream-api node+typescript
|
|
41
|
+
order-service ../order-service downstream-consumer node+typescript
|
|
42
|
+
shared-types ../shared-types shared-lib node+typescript
|
|
43
|
+
api-gateway ../api-gateway gateway nginx+lua
|
|
44
|
+
|
|
45
|
+
Path check: all 4 repos resolved ✅
|
|
26
46
|
```
|
|
27
47
|
|
|
28
48
|
### Add (`add <path> [name]`)
|
|
@@ -51,6 +71,110 @@ WORKSPACE STATUS
|
|
|
51
71
|
Overall: 1 in progress, 1 complete, 1 planned
|
|
52
72
|
```
|
|
53
73
|
|
|
74
|
+
## Execution Flow
|
|
75
|
+
|
|
76
|
+
### Step 1: Analyze Repos
|
|
77
|
+
|
|
78
|
+
`@multi-repo-coordinator` reads `.planning/config.json` and produces a registry summary.
|
|
79
|
+
|
|
80
|
+
If any path fails to resolve, the flow stops here with a clear error. The registry must be clean before proceeding.
|
|
81
|
+
|
|
82
|
+
### Step 2: Identify Dependencies
|
|
83
|
+
|
|
84
|
+
`@multi-repo-coordinator` and `@architect` work together to:
|
|
85
|
+
|
|
86
|
+
1. Build the dependency graph from service roles and actual API references (scan client code, package.json, service mesh config)
|
|
87
|
+
2. Classify the requested change as breaking or non-breaking for each affected service
|
|
88
|
+
3. Produce the ordered change list
|
|
89
|
+
|
|
90
|
+
If any circular dependency is detected, the flow stops and reports the cycle. Circular dependencies cannot be resolved automatically.
|
|
91
|
+
|
|
92
|
+
### Step 3: Plan Changes
|
|
93
|
+
|
|
94
|
+
`@architect` produces the cross-repo CHANGE PLAN using contract-first development:
|
|
95
|
+
|
|
96
|
+
1. Write the new API contract or type definition before any implementation starts
|
|
97
|
+
2. Confirm the contract covers all required changes without unnecessary scope creep
|
|
98
|
+
3. Produce a per-repo task list ordered by the dependency graph
|
|
99
|
+
|
|
100
|
+
### Step 4: Execute Per Repo
|
|
101
|
+
|
|
102
|
+
Changes execute in dependency order. For each repo:
|
|
103
|
+
|
|
104
|
+
1. `@coder` implements the changes in that repo
|
|
105
|
+
2. `@tester` writes and runs tests for that repo's changes
|
|
106
|
+
3. No downstream repo starts until the upstream repo's changes pass tests
|
|
107
|
+
|
|
108
|
+
For non-breaking changes, `@coder` and `@tester` for a given repo run in parallel. For breaking changes, `@tester` must verify the upstream before `@coder` starts on any downstream.
|
|
109
|
+
|
|
110
|
+
If a repo's `@coder` or `@tester` fails, that repo and all downstream repos in the dependency chain are paused. Upstream repos that completed are not rolled back — they remain deployed. The flow resumes once the failing repo is fixed.
|
|
111
|
+
|
|
112
|
+
### Step 5: Verify Integration
|
|
113
|
+
|
|
114
|
+
After all per-repo changes are complete, `@tester` and `@reviewer` run cross-repo verification:
|
|
115
|
+
|
|
116
|
+
**@tester (integration):**
|
|
117
|
+
```
|
|
118
|
+
Task: Run end-to-end integration tests covering the full change path
|
|
119
|
+
Scope: user-service → order-service interaction via the new preferences endpoint
|
|
120
|
+
Test environment: staging (all services deployed to stage)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**@reviewer (cross-repo review):**
|
|
124
|
+
```
|
|
125
|
+
Task: Review all changed files across all repos
|
|
126
|
+
Check: contract adherence, no breaking changes introduced unintentionally,
|
|
127
|
+
consistent error handling patterns across services
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Both run in parallel. Integration tests failing in stage block the production rollout for the entire change set.
|
|
131
|
+
|
|
132
|
+
## Rollout After Integration Pass
|
|
133
|
+
|
|
134
|
+
Once integration is verified in staging, deploy in dependency order:
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
1. shared-types → publish to package registry (semver minor)
|
|
138
|
+
2. user-service → canary (5% traffic, 15 min) → stage ✅ → prod
|
|
139
|
+
3. order-service → canary (after user-service prod) → stage ✅ → prod
|
|
140
|
+
4. api-gateway → canary (after order-service prod) → stage ✅ → prod
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
No downstream service enters its canary phase until the upstream service is confirmed stable in production.
|
|
144
|
+
|
|
145
|
+
## Conflict Handling
|
|
146
|
+
|
|
147
|
+
If `@multi-repo-coordinator` detects a conflict during Step 2 or Step 3 (two concurrent changes that are incompatible), the flow pauses:
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
FLOW PAUSED — Conflict Requires Resolution
|
|
151
|
+
|
|
152
|
+
Service A (user-service): removing `legacyUserId` from response
|
|
153
|
+
Service B (order-service PR #47): new consumer of `legacyUserId`
|
|
154
|
+
Classification: Breaking API collision
|
|
155
|
+
|
|
156
|
+
Resolution options:
|
|
157
|
+
A. Versioned endpoint: keep /v1/users (with legacyUserId) + add /v2/users (without)
|
|
158
|
+
B. Coordinate: block order-service PR #47 until user-service migration is complete
|
|
159
|
+
C. Reverse: defer the user-service removal until order-service removes its dependency
|
|
160
|
+
|
|
161
|
+
Owner teams: platform (user-service), commerce (order-service)
|
|
162
|
+
Decision required before this flow can continue.
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
The flow does not auto-resolve conflicts. It surfaces them clearly, names the options, and waits for human direction.
|
|
166
|
+
|
|
167
|
+
## Error Handling
|
|
168
|
+
|
|
169
|
+
| Condition | Action |
|
|
170
|
+
|-----------|--------|
|
|
171
|
+
| Registry path not found on disk | Stop at Step 1; report which path failed |
|
|
172
|
+
| Circular dependency in graph | Stop at Step 2; show the cycle |
|
|
173
|
+
| Contract review rejected | Stop at Step 3; rework contract before proceeding |
|
|
174
|
+
| Repo's tests fail | Pause that repo and all dependents; upstream remains deployed |
|
|
175
|
+
| Integration test fails | Block production rollout; report which test failed and why |
|
|
176
|
+
| Conflict detected | Pause flow; surface options; wait for human decision |
|
|
177
|
+
|
|
54
178
|
## Config Format
|
|
55
179
|
|
|
56
180
|
`.planning/config.json` repos entry:
|
|
@@ -11,38 +11,181 @@ Implement a new feature using the full FlowDeck agent pipeline.
|
|
|
11
11
|
|
|
12
12
|
## Pre-flight
|
|
13
13
|
|
|
14
|
-
1. Check `.planning
|
|
14
|
+
1. Check `.planning/` exists — if not, error: "Run /fd-new-project first."
|
|
15
15
|
2. Check `plan_confirmed: true` in STATE.md — if not, error: "Confirm plan first with /fd-plan."
|
|
16
16
|
3. Read `.planning/phases/phase-<N>/PLAN.md` to get implementation steps.
|
|
17
17
|
4. Read `.codebase/ARCHITECTURE.md` if it exists — pass as context.
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## TDD Cycle Per Step
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Each plan step follows the TDD cycle:
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
```
|
|
24
|
+
BEHAVIOR → RED → GREEN → REFACTOR → next step
|
|
25
|
+
↑_________| |
|
|
26
|
+
(loop if needed) Only if GREEN
|
|
27
|
+
```
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
- **@coder**: Implement the feature following PLAN.md steps, CONVENTIONS.md patterns, and TDD discipline
|
|
29
|
-
- Write failing tests FIRST (RED)
|
|
30
|
-
- Implement minimum code to pass (GREEN)
|
|
31
|
-
- Refactor if needed (REFACTOR)
|
|
29
|
+
## Process
|
|
32
30
|
|
|
33
|
-
###
|
|
34
|
-
- **@tester**: Run test suite, verify new tests pass, check coverage
|
|
35
|
-
- **@reviewer**: Review implementation for quality, security, and convention compliance
|
|
31
|
+
### Step 1: Guard Check
|
|
36
32
|
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
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
|
|
40
38
|
|
|
41
|
-
|
|
39
|
+
Initialize TDD state:
|
|
40
|
+
```yaml
|
|
41
|
+
tdd:
|
|
42
|
+
stage: behavior
|
|
43
|
+
cycle: 1
|
|
44
|
+
behaviors: []
|
|
45
|
+
regression_test_links: []
|
|
46
|
+
```
|
|
42
47
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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-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
|
+
```
|
|
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
|
+
```
|
|
46
189
|
|
|
47
190
|
## Completion
|
|
48
191
|
|
|
@@ -98,6 +98,19 @@ confirmed_at: none
|
|
|
98
98
|
|
|
99
99
|
3. Also create `.planning/phases/phase-1/` directory.
|
|
100
100
|
|
|
101
|
-
4.
|
|
101
|
+
4. Create `.planning/config.json` with default settings:
|
|
102
|
+
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"model_profile": "balanced",
|
|
106
|
+
"tdd_enforced": true,
|
|
107
|
+
"approval_required": false,
|
|
108
|
+
"volatility_threshold": 0.7,
|
|
109
|
+
"default_agent": "orchestrator"
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
5. Report success with the list of files created and next steps:
|
|
102
114
|
- Run `/fd-discuss` to capture project decisions
|
|
103
115
|
- Run `/fd-plan` to create an implementation plan
|
|
116
|
+
- Edit `.planning/config.json` directly to change settings
|
package/src/commands/fd-plan.md
CHANGED
|
@@ -5,75 +5,97 @@ argument-hint: [--phase=N] [--yes]
|
|
|
5
5
|
|
|
6
6
|
# Plan
|
|
7
7
|
|
|
8
|
-
Create a detailed implementation plan from confirmed
|
|
8
|
+
Create a detailed implementation plan from confirmed DISCUSS.md decisions.
|
|
9
9
|
|
|
10
10
|
**Input:** $ARGUMENTS (optional `--phase=N` to target a specific phase, `--yes` to skip confirmation)
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Process
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
2. Determine phase: use `--phase=N` from arguments, or read current phase from STATE.md.
|
|
16
|
-
3. Check `.planning/phases/phase-<N>/DISCUSS.md` exists — if not, return error: "Run /fd-discuss first."
|
|
14
|
+
### Step 1: Guard Check
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
D-06: Verify DISCUSS.md exists and is confirmed.
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
If no DISCUSS.md found:
|
|
19
|
+
```
|
|
20
|
+
Error: DISCUSS.md not found. Run /discuss [topic] first.
|
|
21
|
+
```
|
|
23
22
|
|
|
23
|
+
If DISCUSS.md exists but not confirmed:
|
|
24
|
+
```
|
|
25
|
+
Error: DISCUSS.md not yet confirmed. Complete the discuss phase first.
|
|
24
26
|
```
|
|
25
|
-
═══════════════════════════════════════════
|
|
26
|
-
PLAN PHASE <N> — AWAITING CONFIRMATION
|
|
27
|
-
═══════════════════════════════════════════
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
<preview of D-XX lines>
|
|
28
|
+
Abort with clear error message in both cases.
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
═══════════════════════════════════════════
|
|
34
|
-
```
|
|
30
|
+
### Step 2: Load Context
|
|
35
31
|
|
|
36
|
-
|
|
32
|
+
Read:
|
|
33
|
+
- `.codebase/PROJECT.md` (project context)
|
|
34
|
+
- `.planning/STATE.md` (current phase and position)
|
|
35
|
+
- `.planning/phases/phase-<N>/DISCUSS.md` (D-XX decisions to trace in plan)
|
|
37
36
|
|
|
38
|
-
|
|
37
|
+
### Step 3: Draft Plan
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
Create PLAN.md with:
|
|
40
|
+
- Tasks that trace to D-XX decisions from DISCUSS.md
|
|
41
|
+
- Each task includes `<action>` referencing relevant D-XX decisions
|
|
42
|
+
- Wave assignments for parallel execution
|
|
43
|
+
- File dependencies between tasks
|
|
41
44
|
|
|
42
|
-
|
|
43
|
-
2. Generate `.planning/phases/phase-<N>/PLAN.md`:
|
|
45
|
+
### Step 4: Validate Plan
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
Verify:
|
|
48
|
+
- All requirements from ROADMAP.md for current phase are addressed
|
|
49
|
+
- All D-XX decisions from DISCUSS.md are traced in plan tasks
|
|
50
|
+
- No tasks that contradict prior decisions
|
|
47
51
|
|
|
48
|
-
|
|
49
|
-
**Created:** <timestamp>
|
|
50
|
-
**Source:** DISCUSS.md (<X> decisions)
|
|
52
|
+
If validation fails, return to Step 3 to revise.
|
|
51
53
|
|
|
52
|
-
|
|
54
|
+
### Step 5: Review Plan
|
|
53
55
|
|
|
54
|
-
|
|
55
|
-
- D-
|
|
56
|
+
Present draft plan to user:
|
|
57
|
+
- Show all tasks and their D-XX decision traces
|
|
58
|
+
- Show wave structure
|
|
59
|
+
- Show file dependencies
|
|
56
60
|
|
|
57
|
-
|
|
61
|
+
### Step 6: PAUSE CONFIRM
|
|
58
62
|
|
|
59
|
-
-
|
|
60
|
-
- [ ] Step 2: <concrete implementation step>
|
|
61
|
-
- [ ] Step 3: <concrete implementation step>
|
|
63
|
+
D-06: "PAUSE — wait for user CONFIRM before saving"
|
|
62
64
|
|
|
63
|
-
|
|
65
|
+
Present:
|
|
66
|
+
```
|
|
67
|
+
Ready to save PLAN.md?
|
|
68
|
+
Type CONFIRM to save, or describe changes needed.
|
|
69
|
+
```
|
|
64
70
|
|
|
65
|
-
|
|
66
|
-
|
|
71
|
+
If user types CONFIRM, proceed to Step 7.
|
|
72
|
+
If user requests changes, return to Step 3 with feedback.
|
|
67
73
|
|
|
68
|
-
|
|
74
|
+
### Step 7: Save Plan
|
|
69
75
|
|
|
70
|
-
|
|
71
|
-
|
|
76
|
+
Save PLAN.md to `.planning/phases/phase-<N>/PLAN.md`.
|
|
77
|
+
Commit with message: `docs(phase-N): save confirmed plan`
|
|
78
|
+
|
|
79
|
+
### Step 8: Update State
|
|
80
|
+
|
|
81
|
+
Update STATE.md:
|
|
82
|
+
- Set plan_file to path of saved PLAN.md
|
|
83
|
+
- Set plan_confirmed: true
|
|
84
|
+
- Update last_action to "Plan confirmed"
|
|
85
|
+
|
|
86
|
+
## D-06 Compliance
|
|
87
|
+
|
|
88
|
+
- Requires confirmed DISCUSS.md before proceeding
|
|
89
|
+
- Aborts with clear error if DISCUSS.md not confirmed
|
|
90
|
+
- Creates PLAN.md tracing D-XX decisions
|
|
91
|
+
- Pauses for user CONFIRM before saving
|
|
92
|
+
|
|
93
|
+
## Error Handling
|
|
72
94
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
95
|
+
D-03: Fail fast with clear error
|
|
96
|
+
- If guard check fails: abort with clear error and remediation
|
|
97
|
+
- If plan validation fails: show what's missing
|
|
98
|
+
- No partial plan saved on error
|
|
77
99
|
|
|
78
100
|
## Completion
|
|
79
101
|
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Quick task execution — analyze, implement, review, or investigate a specific piece of work without the full discuss -> plan -> execute workflow
|
|
3
|
+
argument-hint: [task description]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Quick Task
|
|
7
|
+
|
|
8
|
+
Execute a focused task without the full workflow. Analyzes the request, selects the best specialist agent, and returns the result directly.
|
|
9
|
+
|
|
10
|
+
**Input:** $ARGUMENTS — what you need done
|
|
11
|
+
|
|
12
|
+
## Analysis
|
|
13
|
+
|
|
14
|
+
Parse `$ARGUMENTS` to determine:
|
|
15
|
+
|
|
16
|
+
1. **Type of task** — what kind of work is it?
|
|
17
|
+
2. **Scope** — single file, directory, or whole codebase?
|
|
18
|
+
3. **Required capability** — what must the agent be able to do?
|
|
19
|
+
|
|
20
|
+
## Agent Selection Matrix
|
|
21
|
+
|
|
22
|
+
| Task Type | Signal Keywords | Agent |
|
|
23
|
+
|-----------|-----------------|-------|
|
|
24
|
+
| Write or edit code | implement, add, create, fix, refactor, update | `@coder` |
|
|
25
|
+
| Explore and understand | trace, map, find, explore, understand, what does | `@code-explorer` |
|
|
26
|
+
| Review code quality | review, check, audit, analyze | `@reviewer` |
|
|
27
|
+
| Security review | security, auth, vulnerability, injection, OWASP | `@security-auditor` |
|
|
28
|
+
| Design or architecture | design, architect, schema, API, structure | `@architect` |
|
|
29
|
+
| Write tests | test, coverage, regression, TDD | `@tester` |
|
|
30
|
+
| Documentation | docs, README, document, write | `@writer` |
|
|
31
|
+
| Research | research, find, look up, how to use, compare | `@researcher` |
|
|
32
|
+
| Debug | debug, trace, root cause, why is, fix error | `@debug-specialist` |
|
|
33
|
+
| Performance | performance, slow, optimize, bottleneck | `@performance-optimizer` |
|
|
34
|
+
| Build error | build error, compile, types, missing import | `@build-error-resolver` |
|
|
35
|
+
| Refactoring | refactor, extract, rename, restructure | `@refactor-guide` |
|
|
36
|
+
| Write/update docs | document, write docs, update README | `@doc-updater` |
|
|
37
|
+
|
|
38
|
+
**Default:** If unclear or mixed, use `@orchestrator`.
|
|
39
|
+
|
|
40
|
+
## Execution
|
|
41
|
+
|
|
42
|
+
1. Select the best agent from the matrix above.
|
|
43
|
+
2. Construct a focused prompt with:
|
|
44
|
+
- The task from `$ARGUMENTS`
|
|
45
|
+
- Relevant context (file paths, architecture info, existing code)
|
|
46
|
+
- Clear success criteria
|
|
47
|
+
3. Execute directly — no intermediate steps.
|
|
48
|
+
|
|
49
|
+
## Output
|
|
50
|
+
|
|
51
|
+
Return the agent's output with:
|
|
52
|
+
- Which agent was used
|
|
53
|
+
- The result (be direct, no padding)
|
|
54
|
+
- If the task is partial or incomplete, note what still needs doing
|
|
55
|
+
|
|
56
|
+
## Guardrails
|
|
57
|
+
|
|
58
|
+
- **Small tasks only** — if the task would require more than ~15 minutes of work, suggest `/fd-new-feature` instead.
|
|
59
|
+
- **Single scope** — do not attempt multi-file refactors or cross-repo changes via this command.
|
|
60
|
+
- **No workflow overhead** — skip STATE.md updates, phase transitions, and plan markers.
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Post-session reflection — analyse artifacts
|
|
2
|
+
description: Post-session reflection and skill capture — analyse artifacts, propose improvements, capture session patterns
|
|
3
|
+
argument-hint: [--mode=reflect,learn]
|
|
3
4
|
---
|
|
4
5
|
|
|
5
|
-
# Reflect
|
|
6
|
+
# Reflect
|
|
6
7
|
|
|
7
8
|
Analyse session artifacts and propose concrete improvements to FlowDeck's knowledge base.
|
|
8
9
|
|
|
10
|
+
**Input:** $ARGUMENTS — optional `--mode=reflect` (default) or `--mode=learn`
|
|
11
|
+
|
|
12
|
+
## Modes
|
|
13
|
+
|
|
14
|
+
### Reflect (default)
|
|
15
|
+
Post-session self-improvement analysis. See Steps below.
|
|
16
|
+
|
|
17
|
+
### Learn (`--mode=learn`)
|
|
18
|
+
Capture a repeatable pattern from this session as a reusable FlowDeck skill.
|
|
19
|
+
|
|
9
20
|
## Steps
|
|
10
21
|
|
|
11
22
|
1. Call the `reflect` tool to gather session artifacts and generate the reflection context.
|
|
@@ -28,3 +39,31 @@ Analyse session artifacts and propose concrete improvements to FlowDeck's knowle
|
|
|
28
39
|
- What was captured (new skills created)
|
|
29
40
|
- What requires human review (policy proposals, workflow changes)
|
|
30
41
|
- 3–5 bullet summary of this session's most impactful learnings
|
|
42
|
+
|
|
43
|
+
## Learn Mode
|
|
44
|
+
|
|
45
|
+
When `--mode=learn`:
|
|
46
|
+
|
|
47
|
+
1. **Identify what is worth capturing.** Look for:
|
|
48
|
+
- A novel problem that required figuring out a non-obvious solution
|
|
49
|
+
- A pattern that required human guidance or clarification to resolve
|
|
50
|
+
- A workflow or sequence that would save significant time if remembered
|
|
51
|
+
- A pitfall that was hit and corrected
|
|
52
|
+
|
|
53
|
+
If nothing significant was discovered, reply: "No new patterns to capture from this session." and stop.
|
|
54
|
+
|
|
55
|
+
2. **Draft the skill.** Structure it as:
|
|
56
|
+
- `## When to Activate` — concrete triggers (e.g., "when X file pattern exists", "when the user asks about Y")
|
|
57
|
+
- `## Steps` — ordered, concrete steps to apply the skill
|
|
58
|
+
- `## Examples` — at least one short, concrete example
|
|
59
|
+
- `## Pitfalls` — common mistakes to avoid
|
|
60
|
+
|
|
61
|
+
3. **Choose the skill name.** Use `$ARGUMENTS` if provided as skill name, otherwise derive a kebab-case name from the pattern.
|
|
62
|
+
|
|
63
|
+
4. **Write the skill** using the `create-skill` tool with:
|
|
64
|
+
- `name`: kebab-case identifier
|
|
65
|
+
- `description`: one sentence summarising what the skill does
|
|
66
|
+
- `content`: the full Markdown body from step 2
|
|
67
|
+
- `tags`: 2–4 relevant tags
|
|
68
|
+
|
|
69
|
+
5. **Report** what was captured, why it is useful, and remind the user to restart OpenCode to activate it.
|