@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,226 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: multi-repo-flow
|
|
3
|
-
description: "Cross-repo change orchestration — analyze-repos → identify-dependencies → plan-changes → execute-per-repo → verify-integration"
|
|
4
|
-
steps:
|
|
5
|
-
- name: analyze_repos
|
|
6
|
-
agent: "@multi-repo-coordinator"
|
|
7
|
-
action: Read .planning/config.json sub_repos, verify all paths exist, load tech stacks
|
|
8
|
-
- name: identify_dependencies
|
|
9
|
-
agent: "@multi-repo-coordinator + @architect"
|
|
10
|
-
action: Build dependency graph from service roles and API references; classify change as breaking or non-breaking
|
|
11
|
-
- name: plan_changes
|
|
12
|
-
agent: "@architect"
|
|
13
|
-
action: Write contract-first change spec and per-repo CHANGE PLAN ordered by dependency graph
|
|
14
|
-
- name: execute_per_repo
|
|
15
|
-
agent: "@coder + @tester"
|
|
16
|
-
action: Implement changes in each repo in dependency order; upstream before downstream
|
|
17
|
-
- name: verify_integration
|
|
18
|
-
agent: "@tester + @reviewer"
|
|
19
|
-
action: Run cross-repo integration tests; verify no consumer broke; reviewer signs off on each repo
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
# Multi-Repo Flow
|
|
23
|
-
|
|
24
|
-
## Purpose
|
|
25
|
-
|
|
26
|
-
Orchestrates a feature or fix that spans multiple repositories in a microservice architecture. Ensures changes propagate in the correct dependency order, API contracts are agreed before implementation, and integration is verified end-to-end before any service ships to production.
|
|
27
|
-
|
|
28
|
-
## When to Use
|
|
29
|
-
|
|
30
|
-
- A feature requires changes in two or more services
|
|
31
|
-
- An API contract is changing in an upstream service with downstream consumers
|
|
32
|
-
- A shared library is being upgraded with a breaking change
|
|
33
|
-
- You need a coordinated rollout across services (canary → stage → prod in dependency order)
|
|
34
|
-
|
|
35
|
-
Do not use for single-repo work. Use `/new-feature` instead.
|
|
36
|
-
|
|
37
|
-
## Prerequisites
|
|
38
|
-
|
|
39
|
-
Before running this flow:
|
|
40
|
-
1. `.planning/config.json` has a `sub_repos` array with the relevant repos registered
|
|
41
|
-
2. All `path` values in the registry resolve to actual directories on disk
|
|
42
|
-
3. A description of the intended change is available (from `/discuss` or passed directly)
|
|
43
|
-
|
|
44
|
-
If the registry is empty or not set up, run `/multi-repo --add` first.
|
|
45
|
-
|
|
46
|
-
## Step-by-Step Execution
|
|
47
|
-
|
|
48
|
-
### Step 1: Analyze Repos
|
|
49
|
-
|
|
50
|
-
`@multi-repo-coordinator` reads `.planning/config.json` and produces a registry summary:
|
|
51
|
-
|
|
52
|
-
```
|
|
53
|
-
Registry Summary
|
|
54
|
-
user-service ../user-service upstream-api node+typescript
|
|
55
|
-
order-service ../order-service downstream-consumer node+typescript
|
|
56
|
-
shared-types ../shared-types shared-lib node+typescript
|
|
57
|
-
api-gateway ../api-gateway gateway nginx+lua
|
|
58
|
-
|
|
59
|
-
Path check: all 4 repos resolved ✅
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
If any path fails to resolve, the flow stops here with a clear error. The registry must be clean before proceeding.
|
|
63
|
-
|
|
64
|
-
### Step 2: Identify Dependencies
|
|
65
|
-
|
|
66
|
-
`@multi-repo-coordinator` and `@architect` work together to:
|
|
67
|
-
|
|
68
|
-
1. Build the dependency graph from service roles and actual API references (scan client code, package.json, service mesh config)
|
|
69
|
-
2. Classify the requested change as breaking or non-breaking for each affected service
|
|
70
|
-
3. Produce the ordered change list
|
|
71
|
-
|
|
72
|
-
```
|
|
73
|
-
Dependency Graph
|
|
74
|
-
shared-types (shared-lib)
|
|
75
|
-
└── user-service
|
|
76
|
-
└── order-service
|
|
77
|
-
user-service (upstream-api)
|
|
78
|
-
└── order-service ← calls GET /users/:id
|
|
79
|
-
api-gateway (gateway)
|
|
80
|
-
└── user-service
|
|
81
|
-
└── order-service
|
|
82
|
-
|
|
83
|
-
Change classification:
|
|
84
|
-
shared-types: additive (non-breaking)
|
|
85
|
-
user-service: new endpoint (non-breaking)
|
|
86
|
-
order-service: client update required (triggered by user-service change)
|
|
87
|
-
api-gateway: new route entry (non-breaking)
|
|
88
|
-
```
|
|
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
|
-
Contract format (example):
|
|
101
|
-
```typescript
|
|
102
|
-
// shared-types: new interface
|
|
103
|
-
interface UserPreferences {
|
|
104
|
-
userId: string;
|
|
105
|
-
notificationsEnabled: boolean;
|
|
106
|
-
timezone: string; // new field
|
|
107
|
-
}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
Per-repo CHANGE PLAN format:
|
|
111
|
-
```
|
|
112
|
-
Repo 1: shared-types (deploy first)
|
|
113
|
-
Task: Add `timezone: string` to UserPreferences
|
|
114
|
-
File: src/types/user.ts
|
|
115
|
-
Breaking: No
|
|
116
|
-
|
|
117
|
-
Repo 2: user-service (deploy after shared-types)
|
|
118
|
-
Task: Expose PATCH /users/:id/preferences including timezone
|
|
119
|
-
Files: src/routes/preferences.ts, src/handlers/preferences.ts
|
|
120
|
-
Breaking: No (new endpoint)
|
|
121
|
-
Contract: shared-types UserPreferences v1.1
|
|
122
|
-
|
|
123
|
-
Repo 3: order-service (deploy after user-service)
|
|
124
|
-
Task: Read timezone from user preferences when scheduling order notifications
|
|
125
|
-
Files: src/services/notification.ts
|
|
126
|
-
Breaking: No
|
|
127
|
-
Depends on: user-service PATCH /users/:id/preferences live
|
|
128
|
-
|
|
129
|
-
Repo 4: api-gateway (deploy last)
|
|
130
|
-
Task: Route PATCH /users/:id/preferences to user-service
|
|
131
|
-
Files: config/routes.yaml
|
|
132
|
-
Breaking: No
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
### Step 4: Execute Per Repo
|
|
136
|
-
|
|
137
|
-
Changes execute in dependency order. For each repo:
|
|
138
|
-
|
|
139
|
-
1. `@coder` implements the changes in that repo
|
|
140
|
-
2. `@tester` writes and runs tests for that repo's changes
|
|
141
|
-
3. No downstream repo starts until the upstream repo's changes pass tests
|
|
142
|
-
|
|
143
|
-
For non-breaking changes, `@coder` and `@tester` for a given repo run in parallel (Wave 3 pattern from parallel-execution-flow). For breaking changes, `@tester` must verify the upstream before `@coder` starts on any downstream.
|
|
144
|
-
|
|
145
|
-
**Upstream repo execution:**
|
|
146
|
-
```
|
|
147
|
-
@coder (user-service): implement PATCH /users/:id/preferences
|
|
148
|
-
@tester (user-service): write integration tests for new endpoint
|
|
149
|
-
→ both run in parallel within this repo
|
|
150
|
-
→ all tests must pass before order-service changes begin
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
**Downstream repo execution (after upstream confirmed):**
|
|
154
|
-
```
|
|
155
|
-
@coder (order-service): update notification service to read timezone
|
|
156
|
-
@tester (order-service): verify notification scheduling with timezone
|
|
157
|
-
→ both run in parallel within this repo
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
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.
|
|
161
|
-
|
|
162
|
-
### Step 5: Verify Integration
|
|
163
|
-
|
|
164
|
-
After all per-repo changes are complete, `@tester` and `@reviewer` run cross-repo verification:
|
|
165
|
-
|
|
166
|
-
**@tester (integration):**
|
|
167
|
-
```
|
|
168
|
-
Task: Run end-to-end integration tests covering the full change path
|
|
169
|
-
Scope: user-service → order-service interaction via the new preferences endpoint
|
|
170
|
-
Test environment: staging (all services deployed to stage)
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
**@reviewer (cross-repo review):**
|
|
174
|
-
```
|
|
175
|
-
Task: Review all changed files across all repos
|
|
176
|
-
Check: contract adherence, no breaking changes introduced unintentionally,
|
|
177
|
-
consistent error handling patterns across services
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
Both run in parallel. Integration tests failing in stage block the production rollout for the entire change set.
|
|
181
|
-
|
|
182
|
-
## Rollout After Integration Pass
|
|
183
|
-
|
|
184
|
-
Once integration is verified in staging, deploy in dependency order:
|
|
185
|
-
|
|
186
|
-
```
|
|
187
|
-
1. shared-types → publish to package registry (semver minor)
|
|
188
|
-
2. user-service → canary (5% traffic, 15 min) → stage ✅ → prod
|
|
189
|
-
3. order-service → canary (after user-service prod) → stage ✅ → prod
|
|
190
|
-
4. api-gateway → canary (after order-service prod) → stage ✅ → prod
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
No downstream service enters its canary phase until the upstream service is confirmed stable in production.
|
|
194
|
-
|
|
195
|
-
## Conflict Handling
|
|
196
|
-
|
|
197
|
-
If `@multi-repo-coordinator` detects a conflict during Step 2 or Step 3 (two concurrent changes that are incompatible), the flow pauses:
|
|
198
|
-
|
|
199
|
-
```
|
|
200
|
-
FLOW PAUSED — Conflict Requires Resolution
|
|
201
|
-
|
|
202
|
-
Service A (user-service): removing `legacyUserId` from response
|
|
203
|
-
Service B (order-service PR #47): new consumer of `legacyUserId`
|
|
204
|
-
Classification: Breaking API collision
|
|
205
|
-
|
|
206
|
-
Resolution options:
|
|
207
|
-
A. Versioned endpoint: keep /v1/users (with legacyUserId) + add /v2/users (without)
|
|
208
|
-
B. Coordinate: block order-service PR #47 until user-service migration is complete
|
|
209
|
-
C. Reverse: defer the user-service removal until order-service removes its dependency
|
|
210
|
-
|
|
211
|
-
Owner teams: platform (user-service), commerce (order-service)
|
|
212
|
-
Decision required before this flow can continue.
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
The flow does not auto-resolve conflicts. It surfaces them clearly, names the options, and waits for human direction.
|
|
216
|
-
|
|
217
|
-
## Error Conditions
|
|
218
|
-
|
|
219
|
-
| Condition | Action |
|
|
220
|
-
|-----------|--------|
|
|
221
|
-
| Registry path not found on disk | Stop at Step 1; report which path failed |
|
|
222
|
-
| Circular dependency in graph | Stop at Step 2; show the cycle |
|
|
223
|
-
| Contract review rejected | Stop at Step 3; rework contract before proceeding |
|
|
224
|
-
| Repo's tests fail | Pause that repo and all dependents; upstream remains deployed |
|
|
225
|
-
| Integration test fails | Block production rollout; report which test failed and why |
|
|
226
|
-
| Conflict detected | Pause flow; surface options; wait for human decision |
|
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: parallel-execution-flow
|
|
3
|
-
description: "Wave-based parallel agent execution — analyze → assign waves → execute wave 1 → execute wave 2 → merge → review"
|
|
4
|
-
steps:
|
|
5
|
-
- name: analyze
|
|
6
|
-
agent: "@parallel-coordinator"
|
|
7
|
-
action: Read PLAN.md, identify all tasks, classify each as blocking or independent
|
|
8
|
-
- name: assign_waves
|
|
9
|
-
agent: "@parallel-coordinator"
|
|
10
|
-
action: Group tasks into waves based on dependency graph, emit WAVE TABLE
|
|
11
|
-
- name: execute_wave_1
|
|
12
|
-
agent: "@researcher + @code-explorer"
|
|
13
|
-
action: Run discovery tracks simultaneously — research external APIs, map unfamiliar code
|
|
14
|
-
- name: execute_wave_2
|
|
15
|
-
agent: "@architect"
|
|
16
|
-
action: Design interfaces and produce ADR using Wave 1 findings — serial, gates Wave 3
|
|
17
|
-
- name: execute_wave_3
|
|
18
|
-
agent: "@coder + @tester"
|
|
19
|
-
action: Implement code and write tests in parallel from @architect contracts
|
|
20
|
-
- name: merge
|
|
21
|
-
agent: "@parallel-coordinator"
|
|
22
|
-
action: Compare file sets from Wave 3 tracks, detect overlaps, run conflict resolution if needed
|
|
23
|
-
- name: review
|
|
24
|
-
agent: "@reviewer + @security-auditor"
|
|
25
|
-
action: Validate code quality and security simultaneously, log non-blocking issues
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
# Parallel Execution Flow
|
|
29
|
-
|
|
30
|
-
## Purpose
|
|
31
|
-
|
|
32
|
-
Executes a PLAN.md using the wave-based parallel model. Maximizes agent throughput by running independent tracks simultaneously while respecting dependency gates between waves.
|
|
33
|
-
|
|
34
|
-
## When to Use
|
|
35
|
-
|
|
36
|
-
- A PLAN.md has tasks that can be classified as independent of each other
|
|
37
|
-
- Estimated sequential time exceeds 30 minutes
|
|
38
|
-
- Tasks span research, design, implementation, and testing — roles that don't share files
|
|
39
|
-
|
|
40
|
-
## Wave Architecture
|
|
41
|
-
|
|
42
|
-
The flow organizes work into four standard waves. Not every job needs all four — omit waves with no work.
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
Wave 1: Discovery
|
|
46
|
-
@researcher ──────────────────────┐
|
|
47
|
-
@code-explorer ───────────────────┤ (parallel)
|
|
48
|
-
▼
|
|
49
|
-
Wave 2: Architecture [gate: wait]
|
|
50
|
-
@architect ───────────────────────┐ (serial)
|
|
51
|
-
▼
|
|
52
|
-
Wave 3: Implementation [gate: wait]
|
|
53
|
-
@coder ───────────────────────────┤
|
|
54
|
-
@tester ──────────────────────────┤ (parallel)
|
|
55
|
-
▼
|
|
56
|
-
Wave 4: Validation [gate: wait]
|
|
57
|
-
@reviewer ────────────────────────┤
|
|
58
|
-
@security-auditor ────────────────┘ (parallel)
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Each wave gate waits for all **blocking** slots in the wave to complete before the next wave starts. Independent failures in a wave are retried asynchronously without blocking the gate.
|
|
62
|
-
|
|
63
|
-
## Step-by-Step Execution
|
|
64
|
-
|
|
65
|
-
### Step 1: Analyze
|
|
66
|
-
|
|
67
|
-
`@parallel-coordinator` reads PLAN.md and produces:
|
|
68
|
-
- A task list with estimated duration per task
|
|
69
|
-
- Dependency classification: which tasks block others
|
|
70
|
-
- Slot assignment: which agent handles each task
|
|
71
|
-
|
|
72
|
-
If PLAN.md is missing or unconfirmed, abort:
|
|
73
|
-
```
|
|
74
|
-
Error: No confirmed PLAN.md found.
|
|
75
|
-
Run /plan to produce a plan, then re-run this flow.
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### Step 2: Assign Waves
|
|
79
|
-
|
|
80
|
-
`@parallel-coordinator` groups tasks into waves and emits the WAVE TABLE:
|
|
81
|
-
|
|
82
|
-
```
|
|
83
|
-
╔══════════════════════════════════════════════════════════════╗
|
|
84
|
-
║ WAVE TABLE — [Feature Name] ║
|
|
85
|
-
╠══════════════════════════════════════════════════════════════╣
|
|
86
|
-
║ Wave 1 (parallel) │ @researcher + @code-explorer ║
|
|
87
|
-
║ Wave 2 (serial) │ @architect ║
|
|
88
|
-
║ Wave 3 (parallel) │ @coder + @tester ║
|
|
89
|
-
║ Wave 4 (parallel) │ @reviewer + @security-auditor ║
|
|
90
|
-
╠══════════════════════════════════════════════════════════════╣
|
|
91
|
-
║ Blocking locks: │ W3 blocked on W2; W4 blocked on W3 ║
|
|
92
|
-
╚══════════════════════════════════════════════════════════════╝
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
Print this before spawning any agents. It is the execution contract for the job.
|
|
96
|
-
|
|
97
|
-
### Step 3: Execute Wave 1
|
|
98
|
-
|
|
99
|
-
Delegate to `@researcher` and `@code-explorer` simultaneously:
|
|
100
|
-
|
|
101
|
-
**@researcher brief:**
|
|
102
|
-
```
|
|
103
|
-
Task: [specific research objective]
|
|
104
|
-
Deliverable: .planning/research/[topic].md
|
|
105
|
-
Sources to check: [list]
|
|
106
|
-
Do NOT touch any source files.
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
**@code-explorer brief:**
|
|
110
|
-
```
|
|
111
|
-
Task: Map [module/directory] — produce a file inventory with function signatures
|
|
112
|
-
Deliverable: .codebase/[module]-map.md
|
|
113
|
-
Do NOT touch any source files.
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
Both briefs are sent at the same time. `@parallel-coordinator` waits for both to complete before Wave 2.
|
|
117
|
-
|
|
118
|
-
### Step 4: Execute Wave 2
|
|
119
|
-
|
|
120
|
-
Delegate to `@architect` with Wave 1 outputs attached:
|
|
121
|
-
|
|
122
|
-
**@architect brief:**
|
|
123
|
-
```
|
|
124
|
-
Task: [design objective]
|
|
125
|
-
Inputs:
|
|
126
|
-
- Wave 1 research: .planning/research/[topic].md
|
|
127
|
-
- Wave 1 code map: .codebase/[module]-map.md
|
|
128
|
-
Deliverables:
|
|
129
|
-
- .planning/adr/[name].md
|
|
130
|
-
- Interface contracts (TypeScript interfaces or equivalent)
|
|
131
|
-
Do NOT touch source files — contracts only.
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
`@parallel-coordinator` waits for `@architect` to complete before Wave 3.
|
|
135
|
-
|
|
136
|
-
### Step 5: Execute Wave 3
|
|
137
|
-
|
|
138
|
-
Delegate to `@coder` and `@tester` simultaneously using `@architect` output as the shared source of truth:
|
|
139
|
-
|
|
140
|
-
**@coder brief:**
|
|
141
|
-
```
|
|
142
|
-
Task: Implement [feature] per the interface contracts
|
|
143
|
-
Inputs:
|
|
144
|
-
- Contracts: .planning/adr/[name].md
|
|
145
|
-
- Research: .planning/research/[topic].md
|
|
146
|
-
Files to create/modify: [list]
|
|
147
|
-
Do NOT modify the contract file.
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
**@tester brief:**
|
|
151
|
-
```
|
|
152
|
-
Task: Write tests for [feature] per the interface contracts
|
|
153
|
-
Inputs:
|
|
154
|
-
- Contracts: .planning/adr/[name].md ← use this, not @coder output
|
|
155
|
-
Test file: [path]
|
|
156
|
-
Coverage target: all public interface methods + error paths
|
|
157
|
-
Do NOT read or depend on @coder's implementation files.
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
Both are sent at the same time. `@tester` works from contracts, not from `@coder`'s code, so they are truly parallel.
|
|
161
|
-
|
|
162
|
-
### Step 6: Merge
|
|
163
|
-
|
|
164
|
-
`@parallel-coordinator` compares Wave 3 outputs:
|
|
165
|
-
|
|
166
|
-
1. Collect file lists from `@coder` and `@tester`
|
|
167
|
-
2. Check for overlapping files
|
|
168
|
-
3. If no overlap: apply both, proceed to Wave 4
|
|
169
|
-
4. If overlap detected: classify (additive vs structural vs contradictory) and resolve per the conflict resolution protocol
|
|
170
|
-
|
|
171
|
-
Merge report format:
|
|
172
|
-
```
|
|
173
|
-
Wave 3 Merge Check
|
|
174
|
-
@coder touched: src/auth/service.ts, src/auth/session.ts
|
|
175
|
-
@tester touched: src/auth/service.test.ts
|
|
176
|
-
Overlap: none ✅
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
If conflict:
|
|
180
|
-
```
|
|
181
|
-
Wave 3 Merge Check
|
|
182
|
-
Overlap: src/types/user.ts
|
|
183
|
-
Classification: Structural — incompatible interface definitions
|
|
184
|
-
Resolution: delegating to @coder for sequential reconciliation
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
### Step 7: Review
|
|
188
|
-
|
|
189
|
-
Delegate to `@reviewer` and `@security-auditor` simultaneously:
|
|
190
|
-
|
|
191
|
-
**@reviewer brief:**
|
|
192
|
-
```
|
|
193
|
-
Review all files changed in Wave 3: [list]
|
|
194
|
-
Flag: logic errors, code style violations, missing error handling
|
|
195
|
-
Do NOT refactor — flag issues only.
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
**@security-auditor brief:**
|
|
199
|
-
```
|
|
200
|
-
Audit entry points and data flows in: [list]
|
|
201
|
-
Focus: injection surfaces, auth bypass paths, unvalidated inputs
|
|
202
|
-
Report all findings, severity-tagged.
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
Both are sent at the same time. Either may fail independently without blocking the other.
|
|
206
|
-
|
|
207
|
-
## Failure Recovery
|
|
208
|
-
|
|
209
|
-
| Failure Type | Action |
|
|
210
|
-
|-------------|--------|
|
|
211
|
-
| Blocking slot fails | Pause dependent downstream slots; retry with fallback brief |
|
|
212
|
-
| Independent slot fails | Log and continue; retry async after wave closes |
|
|
213
|
-
| Merge conflict detected | Invoke conflict resolution; re-run affected downstream slots |
|
|
214
|
-
| All slots in a wave fail | Abort job; report which wave failed and why |
|
|
215
|
-
|
|
216
|
-
## Output: Execution Summary
|
|
217
|
-
|
|
218
|
-
After all waves complete, `@parallel-coordinator` produces:
|
|
219
|
-
|
|
220
|
-
```markdown
|
|
221
|
-
## Parallel Execution Summary
|
|
222
|
-
|
|
223
|
-
Feature: [name]
|
|
224
|
-
Total elapsed: [time] (vs [sequential estimate] sequential)
|
|
225
|
-
|
|
226
|
-
| Wave | Agents | Status | Key Outputs |
|
|
227
|
-
|------|--------|--------|-------------|
|
|
228
|
-
| 1 | @researcher, @code-explorer | ✅ | research doc, code map |
|
|
229
|
-
| 2 | @architect | ✅ | ADR, contracts |
|
|
230
|
-
| 3 | @coder, @tester | ✅ | implementation, 14 tests |
|
|
231
|
-
| 4 | @reviewer, @security-auditor | ⚠️ | 2 issues filed; audit retry pending |
|
|
232
|
-
|
|
233
|
-
Conflicts resolved: 0
|
|
234
|
-
Files changed: [N]
|
|
235
|
-
Tests: [N passing]
|
|
236
|
-
```
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: plan-flow
|
|
3
|
-
description: "Orchestrates plan phase (guard check → context load → draft plan → validate → review → PAUSE CONFIRM → save)"
|
|
4
|
-
triggers:
|
|
5
|
-
- /plan
|
|
6
|
-
steps:
|
|
7
|
-
- name: guard_check
|
|
8
|
-
agent: "@orchestrator"
|
|
9
|
-
priority: first
|
|
10
|
-
action: Verify DISCUSS.md exists and is confirmed; abort if not
|
|
11
|
-
- name: load_context
|
|
12
|
-
agent: "@orchestrator"
|
|
13
|
-
action: Load PROJECT.md, STATE.md, DISCUSS.md with D-XX decisions
|
|
14
|
-
- name: draft_plan
|
|
15
|
-
agent: "@planner"
|
|
16
|
-
action: Create PLAN.md with tasks traced to D-XX decisions from DISCUSS.md
|
|
17
|
-
- name: validate_plan
|
|
18
|
-
agent: "@plan-checker"
|
|
19
|
-
action: Verify all requirements covered, all D-XX decisions addressed
|
|
20
|
-
- name: review_plan
|
|
21
|
-
agent: "@orchestrator"
|
|
22
|
-
action: Present draft plan for user review
|
|
23
|
-
- name: pause_confirm
|
|
24
|
-
agent: "@orchestrator"
|
|
25
|
-
action: "PAUSE — wait for user CONFIRM before saving"
|
|
26
|
-
- name: save_plan
|
|
27
|
-
agent: "@orchestrator"
|
|
28
|
-
action: Save confirmed PLAN.md to .planning/phases/phase-N/
|
|
29
|
-
- name: update_state
|
|
30
|
-
agent: "@orchestrator"
|
|
31
|
-
action: Update STATE.md with plan file path
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
# Plan Flow
|
|
35
|
-
|
|
36
|
-
## Purpose
|
|
37
|
-
|
|
38
|
-
Create a detailed implementation plan from confirmed DISCUSS.md decisions.
|
|
39
|
-
|
|
40
|
-
## Process
|
|
41
|
-
|
|
42
|
-
### Step 1: Guard Check
|
|
43
|
-
|
|
44
|
-
D-06: Verify DISCUSS.md exists and is confirmed.
|
|
45
|
-
|
|
46
|
-
If no DISCUSS.md found:
|
|
47
|
-
```
|
|
48
|
-
Error: DISCUSS.md not found. Run /discuss [topic] first.
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
If DISCUSS.md exists but not confirmed:
|
|
52
|
-
```
|
|
53
|
-
Error: DISCUSS.md not yet confirmed. Complete the discuss phase first.
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
Abort with clear error message in both cases.
|
|
57
|
-
|
|
58
|
-
### Step 2: Load Context
|
|
59
|
-
|
|
60
|
-
Read:
|
|
61
|
-
- PROJECT.md (project context)
|
|
62
|
-
- STATE.md (current phase and position)
|
|
63
|
-
- DISCUSS.md (D-XX decisions to trace in plan)
|
|
64
|
-
|
|
65
|
-
### Step 3: Draft Plan
|
|
66
|
-
|
|
67
|
-
Create PLAN.md with:
|
|
68
|
-
- Tasks that trace to D-XX decisions from DISCUSS.md
|
|
69
|
-
- Each task includes `<action>` referencing relevant D-XX decisions
|
|
70
|
-
- Wave assignments for parallel execution
|
|
71
|
-
- File dependencies between tasks
|
|
72
|
-
|
|
73
|
-
### Step 4: Validate Plan
|
|
74
|
-
|
|
75
|
-
Verify:
|
|
76
|
-
- All requirements from ROADMAP.md for current phase are addressed
|
|
77
|
-
- All D-XX decisions from DISCUSS.md are traced in plan tasks
|
|
78
|
-
- No tasks that contradict prior decisions
|
|
79
|
-
|
|
80
|
-
If validation fails, return to Step 3 to revise.
|
|
81
|
-
|
|
82
|
-
### Step 5: Review Plan
|
|
83
|
-
|
|
84
|
-
Present draft plan to user:
|
|
85
|
-
- Show all tasks and their D-XX decision traces
|
|
86
|
-
- Show wave structure
|
|
87
|
-
- Show file dependencies
|
|
88
|
-
|
|
89
|
-
### Step 6: PAUSE CONFIRM
|
|
90
|
-
|
|
91
|
-
D-06: "PAUSE — wait for user CONFIRM before saving"
|
|
92
|
-
|
|
93
|
-
Present:
|
|
94
|
-
```
|
|
95
|
-
Ready to save PLAN.md?
|
|
96
|
-
Type CONFIRM to save, or describe changes needed.
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
If user types CONFIRM, proceed to Step 7.
|
|
100
|
-
If user requests changes, return to Step 3 with feedback.
|
|
101
|
-
|
|
102
|
-
### Step 7: Save Plan
|
|
103
|
-
|
|
104
|
-
Save PLAN.md to `.planning/phases/phase-N/PLAN.md`.
|
|
105
|
-
Commit with message: `docs(phase-N): save confirmed plan`
|
|
106
|
-
|
|
107
|
-
### Step 8: Update State
|
|
108
|
-
|
|
109
|
-
Update STATE.md:
|
|
110
|
-
- Set plan_file to path of saved PLAN.md
|
|
111
|
-
- Set plan_confirmed: true
|
|
112
|
-
- Update last_action to "Plan confirmed"
|
|
113
|
-
|
|
114
|
-
## D-06 Compliance
|
|
115
|
-
|
|
116
|
-
- Requires confirmed DISCUSS.md before proceeding
|
|
117
|
-
- Aborts with clear error if DISCUSS.md not confirmed
|
|
118
|
-
- Creates PLAN.md tracing D-XX decisions
|
|
119
|
-
- Pauses for user CONFIRM before saving
|
|
120
|
-
|
|
121
|
-
## Error Handling
|
|
122
|
-
|
|
123
|
-
D-03: Fail fast with clear error
|
|
124
|
-
- If guard check fails: abort with clear error and remediation
|
|
125
|
-
- If plan validation fails: show what's missing
|
|
126
|
-
- No partial plan saved on error
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: plan-phase
|
|
3
|
-
description: "Orchestrates /plan-phase — delegates to planner then plan-checker"
|
|
4
|
-
triggers:
|
|
5
|
-
- /plan-phase
|
|
6
|
-
steps:
|
|
7
|
-
- name: delegate_to_planner
|
|
8
|
-
agent: "@planner"
|
|
9
|
-
action: Spawn planner agent to create PLAN.md
|
|
10
|
-
- name: verify_plan_quality
|
|
11
|
-
agent: "@plan-checker"
|
|
12
|
-
action: Spawn plan-checker agent to verify plan completeness, feasibility, testability
|
|
13
|
-
- name: present_results
|
|
14
|
-
agent: "@orchestrator"
|
|
15
|
-
action: Present results to user — PASS or FAIL with recommendations
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
# Plan Phase Workflow
|
|
19
|
-
|
|
20
|
-
## Purpose
|
|
21
|
-
|
|
22
|
-
Execute `/plan-phase [N]` to create a structured implementation plan using FlowDeck agents.
|
|
23
|
-
|
|
24
|
-
## Process
|
|
25
|
-
|
|
26
|
-
### Step 1: Delegate to planner
|
|
27
|
-
|
|
28
|
-
Spawn planner agent with:
|
|
29
|
-
- ROADMAP.md (phase structure)
|
|
30
|
-
- REQUIREMENTS.md (requirements for this phase)
|
|
31
|
-
- PROJECT.md (project context)
|
|
32
|
-
- Phase number N
|
|
33
|
-
|
|
34
|
-
Agent will produce `.planning/phases/phase-N/PLAN.md`.
|
|
35
|
-
|
|
36
|
-
### Step 2: Verify Plan Quality
|
|
37
|
-
|
|
38
|
-
Spawn plan-checker agent to review PLAN.md:
|
|
39
|
-
|
|
40
|
-
**Completeness checklist:**
|
|
41
|
-
- [ ] All requirements mapped to tasks?
|
|
42
|
-
- [ ] Each task has clear scope?
|
|
43
|
-
- [ ] Dependencies clearly marked?
|
|
44
|
-
|
|
45
|
-
**Feasibility checklist:**
|
|
46
|
-
- [ ] Each task completable in one session?
|
|
47
|
-
- [ ] No circular dependencies?
|
|
48
|
-
- [ ] Tools/resources available?
|
|
49
|
-
|
|
50
|
-
**Testability checklist:**
|
|
51
|
-
- [ ] Success criteria observable?
|
|
52
|
-
- [ ] Can verify without running full system?
|
|
53
|
-
- [ ] Edge cases addressed?
|
|
54
|
-
|
|
55
|
-
### Step 3: Present Results
|
|
56
|
-
|
|
57
|
-
Return structured output:
|
|
58
|
-
```
|
|
59
|
-
## Plan Phase [N] Results
|
|
60
|
-
|
|
61
|
-
**Plan:** [plan name]
|
|
62
|
-
**Tasks:** [N] tasks in [waves] waves
|
|
63
|
-
|
|
64
|
-
### Verification
|
|
65
|
-
- [ ] PASS — Plan ready for execution
|
|
66
|
-
- [ ] FAIL — Issues found:
|
|
67
|
-
|
|
68
|
-
### Recommendations
|
|
69
|
-
- [issue and fix recommendation]
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### Step 4: On PASS
|
|
73
|
-
|
|
74
|
-
Update STATE.md:
|
|
75
|
-
- Set plan_file to `.planning/phases/phase-N/PLAN.md`
|
|
76
|
-
- Set plan_confirmed: true
|
|
77
|
-
- confirmed_at: [timestamp]
|
|
78
|
-
|
|
79
|
-
Output: "Plan ready. Run /execute-phase [N] to implement."
|
|
80
|
-
|
|
81
|
-
### Step 5: On FAIL
|
|
82
|
-
|
|
83
|
-
Return to user for decisions:
|
|
84
|
-
```
|
|
85
|
-
Plan not yet ready. Review findings above and:
|
|
86
|
-
- Type CONFIRM to proceed anyway (accept gaps)
|
|
87
|
-
- Type FIX to have planner revise the plan
|
|
88
|
-
- Describe specific changes needed
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## Agent Configuration
|
|
92
|
-
|
|
93
|
-
| Agent | Model | Purpose |
|
|
94
|
-
|-------|-------|---------|
|
|
95
|
-
| planner | Sonnet 4.6 | Creates executable PLAN.md with task breakdown |
|
|
96
|
-
| plan-checker | Haiku 4.5 | Reviews plan quality before execution |
|
|
97
|
-
|
|
98
|
-
## Output Files
|
|
99
|
-
|
|
100
|
-
- `.planning/phases/phase-N/PLAN.md` — implementation plan
|
|
101
|
-
- `.planning/phases/phase-N/VERIFICATION.md` — checker output (if FAIL)
|