@dv.nghiem/flowdeck 0.2.3 → 0.2.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/dist/hooks/orchestrator-guard-hook.d.ts +2 -1
- package/dist/hooks/orchestrator-guard-hook.d.ts.map +1 -1
- package/dist/index.js +197 -147
- package/dist/services/telemetry.d.ts +1 -1
- package/dist/services/telemetry.d.ts.map +1 -1
- package/dist/tools/run-parallel.d.ts.map +1 -1
- package/docs/configuration.md +2 -0
- package/docs/parallel-execution.md +28 -0
- package/docs/workflows.md +72 -320
- package/package.json +1 -2
- package/src/commands/fd-deploy-check.md +67 -32
- 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-plan.md +66 -44
- package/src/commands/fd-review-code.md +69 -35
- package/src/commands/fd-write-docs.md +55 -23
- 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
|
@@ -18,7 +18,7 @@ export interface TelemetryEvent {
|
|
|
18
18
|
meta?: Record<string, unknown>;
|
|
19
19
|
}
|
|
20
20
|
export declare function telemetryPath(dir: string): string;
|
|
21
|
-
export declare function appendEvent(dir: string, partial: Omit<TelemetryEvent, "id" | "ts">): TelemetryEvent;
|
|
21
|
+
export declare function appendEvent(dir: string, partial: Omit<TelemetryEvent, "id" | "ts">): TelemetryEvent | null;
|
|
22
22
|
export declare function readEvents(dir: string, limit?: number): TelemetryEvent[];
|
|
23
23
|
export declare function getRunEvents(dir: string, run_id: string): TelemetryEvent[];
|
|
24
24
|
export interface CommandSummary {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/services/telemetry.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,kBAAkB,GAC1B,eAAe,GACf,aAAa,GACb,WAAW,GACX,eAAe,GACf,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,UAAU,GACV,kBAAkB,GAClB,cAAc,CAAA;AAElB,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,kBAAkB,CAAA;IACzB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,IAAI,GAAG,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAA;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC/B;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,GAAG,IAAI,CAAC,GAAG,cAAc,
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/services/telemetry.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,kBAAkB,GAC1B,eAAe,GACf,aAAa,GACb,WAAW,GACX,eAAe,GACf,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,UAAU,GACV,kBAAkB,GAClB,cAAc,CAAA;AAElB,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,kBAAkB,CAAA;IACzB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,IAAI,GAAG,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAA;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC/B;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,GAAG,IAAI,CAAC,GAAG,cAAc,GAAG,IAAI,CAa1G;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,SAAM,GAAG,cAAc,EAAE,CAUrE;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,cAAc,EAAE,CAE1E;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,SAAM,GAAG,cAAc,EAAE,CAuBxE;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,cAAc,EAAE,CAI/E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-parallel.d.ts","sourceRoot":"","sources":["../../src/tools/run-parallel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"run-parallel.d.ts","sourceRoot":"","sources":["../../src/tools/run-parallel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAsBtD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAiK5E"}
|
package/docs/configuration.md
CHANGED
|
@@ -268,6 +268,8 @@ These are enabled by default. If you have API keys (e.g., `CONTEXT7_API_KEY`, `E
|
|
|
268
268
|
| `XDG_CONFIG_HOME` | `~/.config` | Standard XDG base directory; used to resolve `OPENCODE_CONFIG_DIR` when not explicitly set |
|
|
269
269
|
| `FLOWDECK_CONTEXT_LIMIT` | `200000` | Token limit used by the Context Window Monitor to warn when context usage exceeds 70% |
|
|
270
270
|
| `FLOWDECK_DISABLE_MCP` | (empty) | Comma-separated list of remote MCPs to disable. Valid options: `context7`, `websearch`, `grep_app` |
|
|
271
|
+
| `FLOWDECK_ORCHESTRATOR_GUARD` | `off` | Enable the orchestrator guard hook. When `on`, the orchestrator session cannot use write/bash tools directly and must delegate all implementation work. |
|
|
272
|
+
| `TELEMETRY_ENABLED` | `false` | Enable telemetry events from `run-parallel` and hooks. When `true`, events are written to `.codebase/TELEMETRY.jsonl`. |
|
|
271
273
|
|
|
272
274
|
---
|
|
273
275
|
|
|
@@ -224,4 +224,32 @@ All three dispatch tools (`run-parallel`, `delegate`, `run-pipeline`) create rea
|
|
|
224
224
|
|
|
225
225
|
---
|
|
226
226
|
|
|
227
|
+
## Telemetry & Monitoring
|
|
228
|
+
|
|
229
|
+
The `run-parallel` tool emits structured telemetry events for observability:
|
|
230
|
+
|
|
231
|
+
| Event | When |
|
|
232
|
+
|-------|------|
|
|
233
|
+
| `agent.dispatch` | Child session created for a task |
|
|
234
|
+
| `agent.complete` | Task finished (success or error) |
|
|
235
|
+
|
|
236
|
+
Events are appended to `.codebase/TELEMETRY.jsonl` and include:
|
|
237
|
+
- `session_id` / `run_id` — session tracking
|
|
238
|
+
- `agent` — which agent ran
|
|
239
|
+
- `duration_ms` — wall time
|
|
240
|
+
- `status` — `ok` or `error`
|
|
241
|
+
- `meta` — child session ID, task index, output length, error details
|
|
242
|
+
|
|
243
|
+
Additionally, `run-parallel` writes `.codebase/parallel-progress.json` at completion with aggregate stats.
|
|
244
|
+
|
|
245
|
+
**To enable telemetry**, set the environment variable:
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
TELEMETRY_ENABLED=true
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
When enabled, events are written to `.codebase/TELEMETRY.jsonl`. The progress file is always written regardless of this setting.
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
227
255
|
← [Back to Index](index.md)
|
package/docs/workflows.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Command Architecture
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
FlowDeck commands are the single entry point for all operations. Each command embeds its workflow steps directly — no separate workflow files are needed.
|
|
4
4
|
|
|
5
|
-
## How
|
|
5
|
+
## How Commands Work
|
|
6
6
|
|
|
7
7
|
1. You run a command (e.g., `/fd-plan`)
|
|
8
|
-
2. The command
|
|
9
|
-
3. The AI
|
|
10
|
-
4. Each step
|
|
11
|
-
5. The
|
|
8
|
+
2. The command template is loaded with its embedded workflow steps
|
|
9
|
+
3. The AI follows the step-by-step process defined in the command
|
|
10
|
+
4. Each step may spawn agents or perform actions
|
|
11
|
+
5. The command may pause for user confirmation before irreversible actions
|
|
12
12
|
|
|
13
13
|
## The Core FlowDeck Cycle
|
|
14
14
|
|
|
@@ -32,345 +32,97 @@ Each step gates the next. `/fd-plan` will not proceed without a confirmed `DISCU
|
|
|
32
32
|
|
|
33
33
|
---
|
|
34
34
|
|
|
35
|
-
##
|
|
35
|
+
## Command Reference
|
|
36
36
|
|
|
37
|
-
|
|
|
38
|
-
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
|
|
|
52
|
-
|
|
|
37
|
+
| Command | Purpose | Key Agents |
|
|
38
|
+
|---------|---------|------------|
|
|
39
|
+
| `/fd-new-project` | Bootstrap a new project | @orchestrator |
|
|
40
|
+
| `/fd-map-codebase` | Analyse and index the codebase | @mapper (×6 parallel) |
|
|
41
|
+
| `/fd-settings` | Configure FlowDeck settings | @orchestrator |
|
|
42
|
+
| `/fd-discuss` | Pre-planning discussion | @discusser |
|
|
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
|
+
| `/fd-ask` | Smart agent dispatch | various |
|
|
47
|
+
| `/fd-new-feature` | Implement a new feature | @coder, @tester, @reviewer |
|
|
48
|
+
| `/fd-fix-bug` | Fix a bug with TDD | @debug-specialist, @tester, @coder |
|
|
49
|
+
| `/fd-review-code` | Code review | @reviewer, @researcher, @tester |
|
|
50
|
+
| `/fd-write-docs` | Generate documentation | @writer, @reviewer |
|
|
51
|
+
| `/fd-deploy-check` | Pre-deploy safety check | @tester, @security-auditor, @reviewer |
|
|
52
|
+
| `/fd-progress` | View project progress | — |
|
|
53
|
+
| `/fd-checkpoint` | Save a session checkpoint | — |
|
|
54
|
+
| `/fd-resume` | Resume from checkpoint | — |
|
|
55
|
+
| `/fd-multi-repo` | Multi-repo orchestration | @multi-repo-coordinator, @architect |
|
|
53
56
|
|
|
54
57
|
---
|
|
55
58
|
|
|
56
|
-
##
|
|
59
|
+
## Analysis Commands
|
|
57
60
|
|
|
58
|
-
|
|
61
|
+
These umbrella commands combine multiple analysis modules:
|
|
59
62
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
Before the file is marked confirmed, `@orchestrator` presents a summary of all decisions to the user and requires explicit confirmation. Nothing in DISCUSS.md is treated as locked until the user confirms.
|
|
67
|
-
|
|
68
|
-
**Steps:**
|
|
69
|
-
1. `@orchestrator` — Load `PROJECT.md` and `STATE.md`
|
|
70
|
-
2. `@orchestrator` — Extract current phase number
|
|
71
|
-
3. `@discusser` — Q&A loop, one question per turn
|
|
72
|
-
4. `@discusser` — Record decisions with D-XX numbering
|
|
73
|
-
5. `@discusser` — Save to `.planning/phases/phase-N/DISCUSS.md`
|
|
74
|
-
6. `@orchestrator` — Present summary; require user confirmation
|
|
75
|
-
|
|
76
|
-
**Workflow format:**
|
|
77
|
-
```yaml
|
|
78
|
-
---
|
|
79
|
-
name: discuss-flow
|
|
80
|
-
description: "Orchestrates discuss phase (context load → @discusser Q&A → pause → decisions → save)"
|
|
81
|
-
triggers:
|
|
82
|
-
- /fd-discuss
|
|
83
|
-
steps:
|
|
84
|
-
- name: load_context
|
|
85
|
-
agent: "@orchestrator"
|
|
86
|
-
priority: first
|
|
87
|
-
action: Load PROJECT.md and current phase STATE.md
|
|
88
|
-
- name: determine_phase
|
|
89
|
-
agent: "@orchestrator"
|
|
90
|
-
action: Extract current phase number from STATE.md
|
|
91
|
-
- name: invoke_discusser
|
|
92
|
-
agent: "@discusser"
|
|
93
|
-
action: Spawn @discusser agent with project context
|
|
94
|
-
- name: qa_loop
|
|
95
|
-
agent: "@discusser"
|
|
96
|
-
action: Discusser asks one question at a time; user responds; repeat until all topics covered
|
|
97
|
-
- name: save_decisions
|
|
98
|
-
agent: "@discusser"
|
|
99
|
-
action: Write all decisions to .planning/phases/phase-N/DISCUSS.md with D-XX numbering
|
|
100
|
-
- name: confirm_discuss
|
|
101
|
-
agent: "@orchestrator"
|
|
102
|
-
action: Present summary to user; require explicit confirmation before marking DISCUSS.md as confirmed
|
|
103
|
-
---
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
---
|
|
107
|
-
|
|
108
|
-
### plan-flow
|
|
109
|
-
|
|
110
|
-
**Triggered by:** `/fd-plan`
|
|
111
|
-
|
|
112
|
-
The plan flow creates an execution-ready `PLAN.md` from the decisions in a confirmed `DISCUSS.md`. It starts with a guard check — if `DISCUSS.md` does not exist or is not confirmed, execution stops and the user is directed to run `/fd-discuss` first.
|
|
113
|
-
|
|
114
|
-
After loading context (`PROJECT.md`, `STATE.md`, `DISCUSS.md`), `@planner` creates a wave-structured `PLAN.md` where every task traces back to a `D-XX` decision. The draft plan is then handed to `@plan-checker`, which scores it for completeness, feasibility, and testability.
|
|
115
|
-
|
|
116
|
-
A FAIL verdict from `@plan-checker` returns the plan to `@planner` for revision. A PASS (or PASS_WITH_NOTES) causes `@orchestrator` to present the plan to the user. Execution **pauses here** — the plan is not saved until the user explicitly confirms it. After confirmation, the plan is saved to `.planning/phases/phase-N/PLAN.md` and `STATE.md` is updated.
|
|
117
|
-
|
|
118
|
-
**Steps:**
|
|
119
|
-
1. `@orchestrator` — Guard check: verify `DISCUSS.md` exists and is confirmed
|
|
120
|
-
2. `@orchestrator` — Load `PROJECT.md`, `STATE.md`, `DISCUSS.md`
|
|
121
|
-
3. `@planner` — Create `PLAN.md` with tasks traced to D-XX decisions
|
|
122
|
-
4. `@plan-checker` — Verify completeness, feasibility, testability; return PASS or FAIL
|
|
123
|
-
5. `@orchestrator` — Present draft plan for user review
|
|
124
|
-
6. `@orchestrator` — **PAUSE** — wait for explicit user CONFIRM before saving
|
|
125
|
-
7. `@orchestrator` — Save confirmed `PLAN.md` to `.planning/phases/phase-N/`
|
|
126
|
-
8. `@orchestrator` — Update `STATE.md` with plan file path
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
### plan-phase
|
|
131
|
-
|
|
132
|
-
**Triggered by:** `/fd-plan-phase [N]`
|
|
133
|
-
|
|
134
|
-
A focused sub-flow for creating a plan for a specific numbered phase. Unlike `plan-flow`, which drives the full `/fd-plan` command, `plan-phase` is a targeted invocation that takes a phase number as an argument and operates only on that phase's scope.
|
|
135
|
-
|
|
136
|
-
`@planner` is spawned with the phase's `REQUIREMENTS.md` (or `DISCUSS.md`), `ROADMAP.md`, and `PROJECT.md`. It produces `.planning/phases/phase-N/PLAN.md`. `@plan-checker` then reviews the plan and returns PASS or FAIL with specific recommendations. Results are presented by `@orchestrator`.
|
|
137
|
-
|
|
138
|
-
**Steps:**
|
|
139
|
-
1. `@planner` — Create `PLAN.md` for the specified phase
|
|
140
|
-
2. `@plan-checker` — Score plan: completeness, feasibility, testability
|
|
141
|
-
3. `@orchestrator` — Present PASS/FAIL verdict and recommendations
|
|
63
|
+
| Command | Purpose | Flags |
|
|
64
|
+
|---------|---------|-------|
|
|
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
|
+
| `/fd-translate-intent` | Intent to concrete options | `assumptions`, `recommended_option` |
|
|
142
69
|
|
|
143
70
|
---
|
|
144
71
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
**Triggered by:** `/fd-new-feature`
|
|
148
|
-
|
|
149
|
-
The execute flow drives full feature delivery. A guard check verifies that `.planning/` and `.codebase/` exist and that `PLAN.md` is confirmed — if any check fails, execution stops with a specific message directing the user to the missing prerequisite.
|
|
72
|
+
## Command Structure
|
|
150
73
|
|
|
151
|
-
|
|
74
|
+
Each command file (`src/commands/fd-*.md`) contains:
|
|
152
75
|
|
|
153
|
-
**
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
6. `@orchestrator` — Loop until all steps complete; update phase to `review`
|
|
76
|
+
1. **Frontmatter** — description and argument hint
|
|
77
|
+
2. **Purpose** — what the command does
|
|
78
|
+
3. **Input** — how to invoke it
|
|
79
|
+
4. **Process** — step-by-step workflow embedded directly
|
|
80
|
+
5. **Guards** — transition rules and blocking conditions
|
|
81
|
+
6. **Error Handling** — fail-fast rules
|
|
160
82
|
|
|
83
|
+
Example structure:
|
|
84
|
+
```markdown
|
|
161
85
|
---
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
**Triggered by:** `/execute-phase [N]`
|
|
166
|
-
|
|
167
|
-
A targeted sub-flow for executing a single numbered phase plan. Before delegating, `@orchestrator` verifies that `.planning/`, `.codebase/`, and `.planning/phases/phase-N/PLAN.md` all exist and that the plan has the `confirmed` status flag.
|
|
168
|
-
|
|
169
|
-
`@orchestrator` is spawned with `STATE.md`, `PLAN.md`, and `PROJECT.md`. It executes tasks in wave order, committing each atomically. After each task it checkpoints state via the planning-state tool. Deviations from the plan are documented in a `## Deviations` section of `PLAN.md`. After all tasks complete, `@orchestrator` writes `SUMMARY.md` and `@orchestrator` marks the phase complete in `STATE.md` and `ROADMAP.md`.
|
|
170
|
-
|
|
171
|
-
**Steps:**
|
|
172
|
-
1. `@orchestrator` — Verify prerequisites: `.planning/`, `.codebase/`, `PLAN.md` confirmed
|
|
173
|
-
2. `@orchestrator` — Load `PLAN.md`, `STATE.md`, `PROJECT.md`
|
|
174
|
-
3. `@orchestrator` — Execute tasks in wave order; atomic commit per task
|
|
175
|
-
4. `@orchestrator` — Checkpoint state after each task
|
|
176
|
-
5. `@orchestrator` — Write `SUMMARY.md`
|
|
177
|
-
6. `@orchestrator` — Mark phase complete in `STATE.md` and `ROADMAP.md`
|
|
178
|
-
|
|
179
|
-
---
|
|
180
|
-
|
|
181
|
-
### fix-bug-flow
|
|
182
|
-
|
|
183
|
-
**Triggered by:** `/fd-fix-bug`
|
|
184
|
-
|
|
185
|
-
A systematic bug fix workflow that guarantees a regression test exists before any fix is applied. `@orchestrator` loads `STATE.md`, `ARCHITECTURE.md`, and `CONVENTIONS.md` to give all agents the project context they need.
|
|
186
|
-
|
|
187
|
-
`@debug-specialist` reproduces the bug with a minimal case, documenting expected vs actual behavior. `@researcher` assists with root cause investigation by tracing the stack and reading related code. `@tester` writes a failing regression test that reproduces the exact failure — this test must fail before any fix is written. `@coder` then fixes the root cause (not the symptom) with the minimum change that makes the regression test pass. `@reviewer` checks the fix for quality and security regressions. Finally, `@tester` runs the full test suite to confirm everything is green.
|
|
188
|
-
|
|
189
|
-
**Steps:**
|
|
190
|
-
1. `@orchestrator` — Load `STATE.md`, `ARCHITECTURE.md`, `CONVENTIONS.md`
|
|
191
|
-
2. `@debug-specialist` — Reproduce bug; document inputs and expected vs actual
|
|
192
|
-
3. `@researcher` — Trace stack; identify root cause candidates
|
|
193
|
-
4. `@tester` — Write failing regression test
|
|
194
|
-
5. `@coder` — Fix root cause; minimum change to make regression test pass
|
|
195
|
-
6. `@reviewer` — Review fix for quality and security regressions
|
|
196
|
-
7. `@tester` — Run full suite; confirm regression test and all others pass
|
|
197
|
-
8. `@orchestrator` — Update `STATE.md` with fix summary
|
|
198
|
-
|
|
86
|
+
description: Brief description
|
|
87
|
+
argument-hint: [args]
|
|
199
88
|
---
|
|
200
89
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
**Triggered by:** `/debug`
|
|
90
|
+
# Command Name
|
|
204
91
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
`@debug-specialist` establishes a minimal reproduction case, reads the full stack trace from top to bottom, and traces the execution path backward to identify root cause. `@tester` then writes a failing regression test for the exact failure — not a general test, but one that fails for the specific reason `@debug-specialist` identified. `@coder` applies the minimal fix, and `@tester` verifies by running the regression test plus the full suite.
|
|
208
|
-
|
|
209
|
-
The cardinal rule of this workflow: never suppress an error to make a test pass. Fix the root cause.
|
|
210
|
-
|
|
211
|
-
**Steps:**
|
|
212
|
-
1. `@debug-specialist` — Establish minimal reproduction case
|
|
213
|
-
2. `@debug-specialist` — Trace execution path; identify root cause
|
|
214
|
-
3. `@tester` — Write failing regression test for the specific failure
|
|
215
|
-
4. `@coder` — Fix root cause with minimal change
|
|
216
|
-
5. `@tester` — Run regression test + full suite to confirm
|
|
217
|
-
|
|
218
|
-
---
|
|
92
|
+
**Input:** $ARGUMENTS
|
|
219
93
|
|
|
220
|
-
|
|
94
|
+
## Process
|
|
221
95
|
|
|
222
|
-
|
|
96
|
+
### Step 1: Context Load
|
|
97
|
+
...
|
|
223
98
|
|
|
224
|
-
|
|
99
|
+
### Step 2: Execute
|
|
100
|
+
...
|
|
225
101
|
|
|
226
|
-
|
|
102
|
+
## Guards
|
|
227
103
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
- `@reviewer` — security vulnerabilities and code quality
|
|
232
|
-
- `@researcher` — best-practice context for flagged areas
|
|
233
|
-
- `@tester` — test coverage for changed code
|
|
234
|
-
3. `@orchestrator` — Aggregate all findings by severity into unified report
|
|
235
|
-
|
|
236
|
-
---
|
|
237
|
-
|
|
238
|
-
### deploy-check-flow
|
|
239
|
-
|
|
240
|
-
**Triggered by:** `/fd-deploy-check`
|
|
241
|
-
|
|
242
|
-
A comprehensive pre-deployment check suite that runs four independent checks simultaneously and produces a single GO/NO-GO decision. Any CRITICAL or HIGH finding from any check produces NO-GO.
|
|
243
|
-
|
|
244
|
-
`@parallel-coordinator` launches all four checks at once: the full test suite (all tests pass, no unexplained skips), a security scan via `@security-auditor` (OWASP Top 10 on changed files), a CVE audit on dependencies, and a clean build verification. `@orchestrator` waits for all four to complete, aggregates the results, and produces the final GO or NO-GO verdict. A NO-GO includes a specific list of required fixes before the deployment can be retried.
|
|
245
|
-
|
|
246
|
-
**Steps:**
|
|
247
|
-
1. `@parallel-coordinator` — Run simultaneously:
|
|
248
|
-
- Full test suite
|
|
249
|
-
- Security scan (`@security-auditor`)
|
|
250
|
-
- CVE dependency audit
|
|
251
|
-
- Build verification
|
|
252
|
-
2. `@orchestrator` — Aggregate all results
|
|
253
|
-
3. `@orchestrator` — Produce GO/NO-GO decision; list required fixes if NO-GO
|
|
254
|
-
|
|
255
|
-
---
|
|
256
|
-
|
|
257
|
-
### refactor-flow
|
|
258
|
-
|
|
259
|
-
**Triggered by:** `/refactor`
|
|
260
|
-
|
|
261
|
-
A disciplined safe-refactoring workflow where the test suite must be green before the first line of code changes, and must stay green after every single transformation. No feature additions are permitted during a refactoring session.
|
|
262
|
-
|
|
263
|
-
`@tester` runs the suite and confirms it is green. If it is not green, the workflow stops — tests must be fixed before refactoring begins. `@mapper` reads the codebase and identifies refactoring candidates (large files, duplication, high complexity). `@refactor-guide` produces a list of specific transforms ordered from lowest to highest risk. `@coder` applies one transform, then `@tester` verifies the suite is still green. `@orchestrator` commits each transform separately with a `refactor:` prefix message. The loop repeats until all planned transforms are complete.
|
|
264
|
-
|
|
265
|
-
**Steps:**
|
|
266
|
-
1. `@tester` — Run suite; confirm green before any changes
|
|
267
|
-
2. `@mapper` — Identify refactoring candidates
|
|
268
|
-
3. `@refactor-guide` — List transforms in low-to-high risk order
|
|
269
|
-
4. Loop:
|
|
270
|
-
- `@coder` — Apply one transform
|
|
271
|
-
- `@tester` — Verify suite still green; if broken, undo
|
|
272
|
-
- `@orchestrator` — Commit with `refactor:` message
|
|
273
|
-
|
|
274
|
-
---
|
|
275
|
-
|
|
276
|
-
### write-docs-flow
|
|
277
|
-
|
|
278
|
-
**Triggered by:** `/fd-write-docs`
|
|
279
|
-
|
|
280
|
-
A documentation workflow that prioritizes accuracy over speed — every piece of documentation is verified against the actual code before it is finalized. The flow starts with exploration rather than writing.
|
|
281
|
-
|
|
282
|
-
`@code-explorer` maps all exported functions, classes, and types in the target scope, identifying public API entry points and key workflows. `@writer` uses that structural map to draft documentation covering API reference, examples, and usage patterns — it reads every source file it documents. `@reviewer` then checks the draft for accuracy against actual code behavior (not plausible-sounding descriptions, actual behavior). `@writer` incorporates reviewer feedback, and `@doc-updater` writes the final output to the appropriate location and ensures no stale references remain.
|
|
283
|
-
|
|
284
|
-
**Steps:**
|
|
285
|
-
1. `@code-explorer` — Map exports, public APIs, and key workflows in scope
|
|
286
|
-
2. `@writer` — Draft documentation from code exploration output
|
|
287
|
-
3. `@reviewer` — Accuracy check against actual code behavior
|
|
288
|
-
4. `@writer` — Revise based on review feedback
|
|
289
|
-
5. `@doc-updater` — Write final docs to appropriate location; remove stale references
|
|
290
|
-
|
|
291
|
-
---
|
|
292
|
-
|
|
293
|
-
### map-codebase-flow
|
|
294
|
-
|
|
295
|
-
**Triggered by:** `/fd-map-codebase`
|
|
296
|
-
|
|
297
|
-
Produces the six `.codebase/` documentation files in parallel using six `@mapper` instances, each assigned to one output file. Before running, `@orchestrator` checks whether `.codebase/` already exists and requires user confirmation before overwriting.
|
|
298
|
-
|
|
299
|
-
`@orchestrator` creates individual worktrees for each mapper instance to prevent file conflicts, then spawns all six `@mapper` agents simultaneously. Each mapper reads source files directly and writes only its assigned file: `STACK.md`, `ARCHITECTURE.md`, `STRUCTURE.md`, `CONVENTIONS.md`, `TESTING.md`, or `CONCERNS.md`. `@orchestrator` waits for all six to complete, then verifies each file exists and contains non-empty content. Worktrees are cleaned up regardless of success or failure.
|
|
300
|
-
|
|
301
|
-
**Steps:**
|
|
302
|
-
1. `@orchestrator` — Check if `.codebase/` exists; warn and require confirmation if present
|
|
303
|
-
2. `@orchestrator` — Create worktrees for each mapper instance
|
|
304
|
-
3. `@mapper` ×6 — Run in parallel, each writing its assigned `.codebase/` file
|
|
305
|
-
4. `@orchestrator` — Wait for all mappers to complete
|
|
306
|
-
5. `@orchestrator` — Clean up worktrees
|
|
307
|
-
6. `@orchestrator` — Verify all six files exist with non-empty content
|
|
308
|
-
|
|
309
|
-
**Output files:**
|
|
310
|
-
|
|
311
|
-
| File | Contents |
|
|
312
|
-
|------|---------|
|
|
313
|
-
| `.codebase/STACK.md` | Tech stack with exact pinned versions |
|
|
314
|
-
| `.codebase/ARCHITECTURE.md` | Component diagram and data flow |
|
|
315
|
-
| `.codebase/STRUCTURE.md` | Directory layout with purpose of each directory |
|
|
316
|
-
| `.codebase/CONVENTIONS.md` | Naming and coding patterns with file:line examples |
|
|
317
|
-
| `.codebase/TESTING.md` | Test frameworks, patterns, and file organization |
|
|
318
|
-
| `.codebase/CONCERNS.md` | All TODO, FIXME, and HACK markers found by grep |
|
|
319
|
-
|
|
320
|
-
---
|
|
321
|
-
|
|
322
|
-
### parallel-execution-flow
|
|
323
|
-
|
|
324
|
-
**Triggered by:** `@parallel-coordinator` (invoked from execute-flow or directly)
|
|
325
|
-
|
|
326
|
-
The parallel execution flow maximizes agent throughput by running independent workstreams simultaneously in waves. It is not triggered by a user command directly — it is invoked when `@orchestrator` or `@execute-flow` determines that parallel execution is appropriate for a plan.
|
|
327
|
-
|
|
328
|
-
`@parallel-coordinator` reads the active `PLAN.md`, identifies all tasks, and classifies each as blocking (must complete before something else) or independent (can run simultaneously). It then groups tasks into waves and emits a WAVE TABLE before delegating any agents.
|
|
329
|
-
|
|
330
|
-
The standard wave structure: Wave 1 runs `@researcher` and `@code-explorer` simultaneously (discovery); Wave 2 runs `@architect` alone (design, serial, gates Wave 3); Wave 3 runs `@coder` and `@tester` simultaneously (implementation from `@architect`'s contracts); Wave 4 runs `@reviewer` and `@security-auditor` simultaneously (validation). When Wave 3 tracks converge, `@parallel-coordinator` runs a merge protocol to detect and resolve any overlapping file changes.
|
|
331
|
-
|
|
332
|
-
**Steps:**
|
|
333
|
-
1. `@parallel-coordinator` — Read `PLAN.md`; classify tasks as blocking or independent
|
|
334
|
-
2. `@parallel-coordinator` — Group into waves; emit WAVE TABLE
|
|
335
|
-
3. Wave 1 (parallel): `@researcher` + `@code-explorer`
|
|
336
|
-
4. Wave 2 (serial): `@architect` (design from Wave 1 output)
|
|
337
|
-
5. Wave 3 (parallel): `@coder` + `@tester` (from `@architect` contracts)
|
|
338
|
-
6. `@parallel-coordinator` — Merge Wave 3 outputs; resolve conflicts
|
|
339
|
-
7. Wave 4 (parallel): `@reviewer` + `@security-auditor`
|
|
340
|
-
|
|
341
|
-
**WAVE TABLE format:**
|
|
342
|
-
```
|
|
343
|
-
╔══════════════════════════════════════════════════════════════╗
|
|
344
|
-
║ WAVE TABLE — [Job Title] ║
|
|
345
|
-
╠══════════════════════════════════════════════════════════════╣
|
|
346
|
-
║ Wave 1 (parallel) │ @researcher + @code-explorer ║
|
|
347
|
-
║ Wave 2 (serial) │ @architect ║
|
|
348
|
-
║ Wave 3 (parallel) │ @coder + @tester ║
|
|
349
|
-
║ Wave 4 (parallel) │ @reviewer + @security-auditor ║
|
|
350
|
-
╠══════════════════════════════════════════════════════════════╣
|
|
351
|
-
║ Est. sequential: │ 8h ║
|
|
352
|
-
║ Est. parallel: │ 4.5h ║
|
|
353
|
-
║ Dependency locks: │ Wave 3 blocked on Wave 2 output ║
|
|
354
|
-
╚══════════════════════════════════════════════════════════════╝
|
|
104
|
+
| Transition | Guard | If Violated |
|
|
105
|
+
|-----------|-------|-------------|
|
|
106
|
+
| A → B | condition | block |
|
|
355
107
|
```
|
|
356
108
|
|
|
357
109
|
---
|
|
358
110
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
**Triggered by:** `/fd-multi-repo`
|
|
362
|
-
|
|
363
|
-
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.
|
|
364
|
-
|
|
365
|
-
`@multi-repo-coordinator` reads the sub-repo registry from `.planning/config.json`, verifies all repository paths exist, and loads each service's tech stack. It then builds a dependency graph — which services call which — and classifies the change as breaking or non-breaking. `@architect` writes the contract-first change specification and a per-repo CHANGE PLAN ordered by the dependency graph. `@coder` and `@tester` implement and test changes in each repo in the correct order (upstream before downstream). After all repos are implemented, `@tester` and `@reviewer` run cross-repo integration verification and sign off on each repo before any service is deployed.
|
|
111
|
+
## Agent Configuration
|
|
366
112
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
113
|
+
| Agent | Purpose |
|
|
114
|
+
|-------|---------|
|
|
115
|
+
| @orchestrator | Coordinates multi-step workflows |
|
|
116
|
+
| @planner | Creates implementation plans |
|
|
117
|
+
| @coder | Implements code changes |
|
|
118
|
+
| @tester | Writes and runs tests |
|
|
119
|
+
| @reviewer | Reviews code quality |
|
|
120
|
+
| @researcher | Investigates and provides context |
|
|
121
|
+
| @security-auditor | Security vulnerability scanning |
|
|
122
|
+
| @architect | System design and patterns |
|
|
123
|
+
| @writer | Documentation generation |
|
|
124
|
+
| @mapper | Codebase analysis |
|
|
373
125
|
|
|
374
126
|
---
|
|
375
127
|
|
|
376
|
-
← [Back to Index](index.md)
|
|
128
|
+
← [Back to Index](index.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dv.nghiem/flowdeck",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "FlowDeck — structured planning and execution workflows for OpenCode",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
"src/commands",
|
|
21
21
|
"src/rules",
|
|
22
22
|
"src/skills",
|
|
23
|
-
"src/workflows",
|
|
24
23
|
"docs",
|
|
25
24
|
"postinstall.mjs"
|
|
26
25
|
],
|
|
@@ -5,54 +5,89 @@ argument-hint: [--env=staging|production]
|
|
|
5
5
|
|
|
6
6
|
# Deploy Check
|
|
7
7
|
|
|
8
|
-
Run a comprehensive pre-
|
|
8
|
+
Run a comprehensive pre-deployment check suite before releasing to production.
|
|
9
9
|
|
|
10
10
|
**Input:** $ARGUMENTS — optional `--env=staging|production` (default: staging)
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Process
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
### Step 1: Parallel Checks
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
- Run full test suite
|
|
18
|
-
- Check TDD coverage meets threshold (default: 80%)
|
|
19
|
-
- Report: tests passed/failed, coverage %, any flaky tests
|
|
16
|
+
Launch four checks simultaneously:
|
|
20
17
|
|
|
21
|
-
|
|
18
|
+
**Check A: Test Suite (@tester)**
|
|
19
|
+
```bash
|
|
20
|
+
npm test
|
|
21
|
+
```
|
|
22
|
+
All tests must pass. No failures, no skips without justification.
|
|
23
|
+
|
|
24
|
+
**Check B: Security Scan**
|
|
25
|
+
|
|
26
|
+
Spawn `@security-auditor` to check:
|
|
27
|
+
- No hardcoded secrets in changed files
|
|
28
|
+
- Input validation at trust boundaries
|
|
29
|
+
- Auth/authz on all protected routes
|
|
30
|
+
- No CRITICAL or HIGH vulnerabilities
|
|
31
|
+
|
|
32
|
+
**Check C: Dependency CVE Audit**
|
|
33
|
+
```bash
|
|
34
|
+
npm audit --audit-level=high
|
|
35
|
+
```
|
|
36
|
+
No HIGH or CRITICAL CVEs unaddressed.
|
|
37
|
+
|
|
38
|
+
**Check D: Build Verification**
|
|
39
|
+
```bash
|
|
40
|
+
npm run build
|
|
41
|
+
```
|
|
42
|
+
Build must succeed with zero errors.
|
|
43
|
+
|
|
44
|
+
**Check E: Code Review (@reviewer)** — parallel with above
|
|
22
45
|
- Security review: secrets, injection vulnerabilities, auth gaps
|
|
23
46
|
- Quality review: critical bugs, missing error handling
|
|
24
47
|
- TDD discipline: verify new code has tests
|
|
25
48
|
- Report: CRITICAL/HIGH findings only (no nits for deploy check)
|
|
26
49
|
|
|
27
|
-
###
|
|
28
|
-
- Scan `package.json`, `go.mod`, `Cargo.toml`, `requirements.txt` for known CVEs
|
|
29
|
-
- Check for recently disclosed vulnerabilities in key dependencies
|
|
30
|
-
- Report: any HIGH or CRITICAL CVEs found
|
|
50
|
+
### Step 2: Aggregate Results
|
|
31
51
|
|
|
32
|
-
|
|
52
|
+
```
|
|
53
|
+
## Pre-Deployment Check
|
|
33
54
|
|
|
34
|
-
|
|
55
|
+
| Check | Status | Details |
|
|
56
|
+
|-------|--------|---------|
|
|
57
|
+
| Tests | ✅ PASS / ❌ FAIL | N/N passed |
|
|
58
|
+
| Security | ✅ PASS / ❌ FAIL | [findings] |
|
|
59
|
+
| CVE Audit | ✅ PASS / ❌ FAIL | [vulnerabilities] |
|
|
60
|
+
| Build | ✅ PASS / ❌ FAIL | [errors] |
|
|
61
|
+
```
|
|
35
62
|
|
|
36
|
-
|
|
37
|
-
|-----------|----------|
|
|
38
|
-
| All checks pass, zero CRITICAL/HIGH | ✅ GO |
|
|
39
|
-
| Test failures or coverage below threshold | ❌ NO-GO |
|
|
40
|
-
| CRITICAL security issues | ❌ NO-GO |
|
|
41
|
-
| HIGH issues or HIGH CVEs | ⚠️ CONDITIONAL (requires override) |
|
|
63
|
+
### Step 3: Go/No-Go Decision
|
|
42
64
|
|
|
43
|
-
|
|
65
|
+
**🚀 GO** — all checks pass, proceed with deployment.
|
|
44
66
|
|
|
67
|
+
**🛑 NO-GO** — one or more checks failed:
|
|
45
68
|
```
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
DECISION: GO / NO-GO / CONDITIONAL
|
|
54
|
-
════════════════════════════════════════════
|
|
69
|
+
Verdict: NO-GO
|
|
70
|
+
|
|
71
|
+
Required fixes before deploy:
|
|
72
|
+
- [ ] [fix 1]
|
|
73
|
+
- [ ] [fix 2]
|
|
74
|
+
|
|
75
|
+
Run /deploy-check again after fixing.
|
|
55
76
|
```
|
|
56
77
|
|
|
57
|
-
|
|
58
|
-
|
|
78
|
+
## No-go conditions (automatic)
|
|
79
|
+
|
|
80
|
+
Any of these → automatic NO-GO:
|
|
81
|
+
- Test failures
|
|
82
|
+
- CRITICAL security vulnerability
|
|
83
|
+
- HIGH/CRITICAL CVE unpatched
|
|
84
|
+
- Build error
|
|
85
|
+
|
|
86
|
+
## Agent Configuration
|
|
87
|
+
|
|
88
|
+
| Agent | Purpose |
|
|
89
|
+
|-------|---------|
|
|
90
|
+
| @tester | Run test suite |
|
|
91
|
+
| @security-auditor | Security vulnerability scan |
|
|
92
|
+
| @researcher | CVE research and context |
|
|
93
|
+
| @reviewer | Code quality review |
|