@dv.nghiem/flowdeck 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +18 -13
  2. package/dist/hooks/orchestrator-guard-hook.d.ts +4 -1
  3. package/dist/hooks/orchestrator-guard-hook.d.ts.map +1 -1
  4. package/dist/hooks/session-idle-hook.d.ts.map +1 -1
  5. package/dist/hooks/telemetry-hook.d.ts +14 -1
  6. package/dist/hooks/telemetry-hook.d.ts.map +1 -1
  7. package/dist/hooks/telemetry-hook.test.d.ts +2 -0
  8. package/dist/hooks/telemetry-hook.test.d.ts.map +1 -0
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +583 -240
  11. package/dist/tools/council.d.ts.map +1 -1
  12. package/dist/tools/delegate.d.ts.map +1 -1
  13. package/dist/tools/dispatch-routing.d.ts +6 -0
  14. package/dist/tools/dispatch-routing.d.ts.map +1 -0
  15. package/dist/tools/memory-status.d.ts +3 -0
  16. package/dist/tools/memory-status.d.ts.map +1 -0
  17. package/dist/tools/run-pipeline.d.ts.map +1 -1
  18. package/docs/commands.md +102 -9
  19. package/docs/installation.md +6 -17
  20. package/docs/intelligence.md +18 -33
  21. package/docs/optimization-baseline.md +21 -0
  22. package/docs/quick-start.md +44 -23
  23. package/docs/rules.md +9 -36
  24. package/docs/workflows.md +18 -17
  25. package/package.json +4 -2
  26. package/src/commands/fd-execute.md +192 -0
  27. package/src/commands/fd-new-feature.md +44 -157
  28. package/src/commands/fd-new-project.md +1 -2
  29. package/src/commands/fd-plan.md +1 -1
  30. package/src/commands/fd-suggest.md +84 -0
  31. package/src/commands/fd-verify.md +126 -0
  32. package/src/rules/README.md +10 -0
  33. package/src/rules/common/agent-orchestration.md +5 -5
  34. package/src/rules/common/coding-style.md +17 -0
  35. package/src/rules/typescript/patterns.md +1 -1
  36. package/src/skills/backend-patterns/SKILL.md +6 -0
  37. package/src/skills/clean-architecture/SKILL.md +6 -0
  38. package/src/skills/cqrs/SKILL.md +6 -0
  39. package/src/skills/ddd-architecture/SKILL.md +6 -0
  40. package/src/skills/event-driven-architecture/SKILL.md +6 -0
  41. package/src/skills/hexagonal-architecture/SKILL.md +6 -0
  42. package/src/skills/layered-architecture/SKILL.md +6 -0
  43. package/src/skills/postgres-patterns/SKILL.md +6 -0
  44. package/src/skills/saga-architecture/SKILL.md +6 -0
@@ -1 +1 @@
1
- {"version":3,"file":"council.d.ts","sourceRoot":"","sources":["../../src/tools/council.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEtD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAmExE"}
1
+ {"version":3,"file":"council.d.ts","sourceRoot":"","sources":["../../src/tools/council.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAKtD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CA2ExE"}
@@ -1 +1 @@
1
- {"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../../src/tools/delegate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAStD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAiFzE"}
1
+ {"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../../src/tools/delegate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAYtD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CA+HzE"}
@@ -0,0 +1,6 @@
1
+ import type { TaskType } from "../services/model-router";
2
+ export declare function shouldRetry(promptRes: any): boolean;
3
+ export declare function isTransientError(text?: string): boolean;
4
+ export declare function normalizeTaskType(taskType: string | undefined, agent: string): TaskType;
5
+ export declare function isTaskType(value: string): value is TaskType;
6
+ //# sourceMappingURL=dispatch-routing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatch-routing.d.ts","sourceRoot":"","sources":["../../src/tools/dispatch-routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAExD,wBAAgB,WAAW,CAAC,SAAS,EAAE,GAAG,GAAG,OAAO,CAOnD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAUvD;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,QAAQ,CAcvF;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,QAAQ,CAY3D"}
@@ -0,0 +1,3 @@
1
+ import { type ToolDefinition } from "@opencode-ai/plugin";
2
+ export declare const memoryStatusTool: ToolDefinition;
3
+ //# sourceMappingURL=memory-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-status.d.ts","sourceRoot":"","sources":["../../src/tools/memory-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAQ/D,eAAO,MAAM,gBAAgB,EAAE,cAoE7B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"run-pipeline.d.ts","sourceRoot":"","sources":["../../src/tools/run-pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAuBtD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAyG5E"}
1
+ {"version":3,"file":"run-pipeline.d.ts","sourceRoot":"","sources":["../../src/tools/run-pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AA6BtD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAyH5E"}
package/docs/commands.md CHANGED
@@ -7,18 +7,20 @@ Commands are slash commands registered in OpenCode. Run them by typing `/command
7
7
  | Command | Arguments | Description |
8
8
  |---------|-----------|-------------|
9
9
  | `/fd-new-project` | `[project-name]` | Initialize project with planning structure and default config |
10
+ | `/fd-new-feature` | `[feature-description]` | Define a new feature and initialize feature context |
10
11
  | `/fd-discuss` | `[topic]` | Structured Q&A to capture decisions for a phase |
11
12
  | `/fd-plan` | `[--phase=N]` | Generate detailed implementation plan from decisions |
12
- | `/fd-new-feature` | `[feature-description]` | Full feature implementation with parallel agents |
13
+ | `/fd-execute` | `[--phase=N] [--override]` | Implement feature with TDD pipeline and parallel agents |
14
+ | `/fd-verify` | `[--phase=N] [--env=staging\|production]` | Verify feature completion: tests, review, security, deploy check |
13
15
  | `/fd-fix-bug` | `[bug-description]` | Debug, fix, and verify bug with regression test |
14
16
  | `/fd-deploy-check` | `[--check=deploy,review,analysis]` | Pre-deploy checks, code review, or pre-change analysis |
15
- | `/fd-status` | `[--roadmap | --workspace | --phase=N]` | Combined status, roadmap, and workspace view |
17
+ | `/fd-status` | `[--roadmap \| --workspace \| --phase=N]` | Combined status, roadmap, and workspace view |
16
18
  | `/fd-resume` | `[--yes]` | Reload STATE.md and PLAN.md to continue interrupted session |
17
19
  | `/fd-checkpoint` | — | Persist current state to STATE.md |
18
20
  | `/fd-reflect` | `[--mode=reflect,learn]` | Post-session reflection or capture skill from session |
19
21
  | `/fd-map-codebase` | `[--incremental]` | Map codebase into structured `.codebase/` files |
20
22
  | `/fd-write-docs` | `[--scope=path]` | Explore APIs and generate documentation |
21
- | `/fd-multi-repo` | `[list | add <path> [name] | remove <name> | status]` | Multi-repo orchestration |
23
+ | `/fd-multi-repo` | `[list \| add <path> [name] \| remove <name> \| status]` | Multi-repo orchestration |
22
24
  | `/fd-translate-intent` | `[vague intent]` | Convert vague request into ranked implementation options |
23
25
  | `/fd-ask` | `[question]` | Route question to specialist agent (architect, security, etc.) |
24
26
  | `/fd-quick` | `[task description]` | Quick focused task with automatic agent selection |
@@ -47,12 +49,38 @@ Commands are slash commands registered in OpenCode. Run them by typing `/command
47
49
  ```
48
50
 
49
51
  **What Next?**
50
- 1. Run `/fd-discuss` to begin structured discovery
52
+ 1. Run `/fd-new-feature` to define your first feature
51
53
  2. Run `/fd-map-codebase` if this is an existing codebase
52
54
  3. Edit `.planning/config.json` directly to change settings
53
55
 
54
56
  ---
55
57
 
58
+ ## /fd-new-feature
59
+
60
+ **Description:** Define a new feature and initialize feature context. This is the first step of the feature workflow after project setup.
61
+
62
+ **Arguments:**
63
+ - `[feature-description]` — name or short description of the feature
64
+
65
+ **What it does:**
66
+ 1. Reads `.planning/STATE.md` to determine current phase
67
+ 2. Creates `.planning/phases/phase-N/FEATURE.md` with feature context
68
+ 3. Updates STATE.md with feature definition
69
+ 4. Displays the workflow steps ahead: discuss → plan → execute → verify
70
+
71
+ **Example:**
72
+ ```
73
+ /fd-new-feature user authentication
74
+ ```
75
+
76
+ **What Next?**
77
+ 1. Run `/fd-discuss` to capture requirements
78
+ 2. Run `/fd-plan` to create implementation plan
79
+ 3. Run `/fd-execute` to implement with TDD
80
+ 4. Run `/fd-verify` to confirm all checks pass
81
+
82
+ ---
83
+
56
84
  ## /fd-discuss
57
85
 
58
86
  **Description:** Opens a structured Q&A session to capture decisions for a phase. Saves decisions to `.planning/phases/phase-N/DISCUSS.md` with D-XX numbering.
@@ -61,14 +89,14 @@ Commands are slash commands registered in OpenCode. Run them by typing `/command
61
89
  - `[topic]` — optional topic to focus the discussion
62
90
 
63
91
  **What it does:**
64
- 1. Loads `.planning/PROJECT.md` and `.planning/STATE.md` for project context
92
+ 1. Loads `.planning/FEATURE.md` and `.planning/STATE.md` for context
65
93
  2. Invokes `@discusser` agent which asks targeted questions one at a time
66
94
  3. Records decisions with D-XX numbering (D-01, D-02, …)
67
95
  4. Saves to `.planning/phases/phase-N/DISCUSS.md`
68
96
 
69
97
  **Example:**
70
98
  ```
71
- /fd-discuss user authentication
99
+ /fd-discuss
72
100
  ```
73
101
 
74
102
  **What Next?**
@@ -93,19 +121,84 @@ Commands are slash commands registered in OpenCode. Run them by typing `/command
93
121
 
94
122
  **Example:**
95
123
  ```
124
+ /fd-plan
96
125
  /fd-plan --phase=1
97
126
  ```
98
127
 
99
128
  **What Next?**
100
- 1. Run `/fd-new-feature` to implement
129
+ 1. Run `/fd-execute` to implement the plan
101
130
  2. Run `/fd-plan --phase=2` for next phase
102
131
 
103
132
  ---
104
133
 
105
- ## /fd-new-feature
134
+ ## /fd-execute
135
+
136
+ **Description:** Implement the current phase's plan using TDD discipline with parallel agents. This is the execution step after planning is confirmed.
137
+
138
+ **Arguments:**
139
+ - `[--phase=N]` — target specific phase
140
+ - `[--override]` — bypass guards and proceed anyway
141
+
142
+ **What it does:**
143
+ 1. Reads `.planning/phases/phase-N/PLAN.md` for implementation steps
144
+ 2. For each step, enforces TDD cycle: BEHAVIOR → RED → GREEN → REFACTOR
145
+ 3. `@tester` writes failing tests first
146
+ 4. `@coder` implements minimum to pass
147
+ 5. `@reviewer` confirms quality
148
+ 6. Updates `STATE.md` with completed steps
149
+ 7. Waves execute in order, with parallel tasks within each wave
150
+
151
+ **Example:**
152
+ ```
153
+ /fd-execute
154
+ /fd-execute --phase=1
155
+ ```
156
+
157
+ **What Next?**
158
+ 1. Run `/fd-verify` to confirm all checks pass
159
+ 2. Commit changes and create pull request
160
+ 3. Run `/fd-checkpoint` to save session state
161
+
162
+ ---
163
+
164
+ ## /fd-verify
165
+
166
+ **Description:** Verify feature completion with full test suite, code review, security scan, and deploy check.
167
+
168
+ **Arguments:**
169
+ - `[--phase=N]` — target specific phase
170
+ - `[--env=staging|production]` — environment for deploy check (default: staging)
171
+
172
+ **What it does:**
173
+ 1. Runs test suite — all tests must pass
174
+ 2. Runs code review — `@reviewer` checks quality, security, conventions
175
+ 3. Runs security scan — `@security-auditor` checks for vulnerabilities
176
+ 4. Runs deploy check — build verification, CVE audit, readiness
177
+ 5. Aggregates all findings into a verification report
178
+ 6. Updates STATE.md if all checks pass
179
+
180
+ **Example:**
181
+ ```
182
+ /fd-verify
183
+ /fd-verify --phase=1 --env=production
184
+ ```
185
+
186
+ **Verdict:**
187
+ - ✅ **VERIFIED** — all checks pass, feature is ready
188
+ - ❌ **NOT VERIFIED** — one or more checks failed; review report and fix issues
189
+
190
+ **What Next?**
191
+ 1. If VERIFIED: merge changes, deploy, or move to next phase
192
+ 2. If NOT VERIFIED: fix issues and run `/fd-verify` again
193
+
194
+ ---
195
+
196
+ ## /fd-new-feature (old — now use /fd-execute)
106
197
 
107
198
  **Description:** Implements a new feature end-to-end using TDD discipline with parallel agents. Reads active PLAN.md for context.
108
199
 
200
+ **DEPRECATED:** Use `/fd-execute` instead. The `/fd-new-feature` command is now the entry point for defining features (step 1 of 6).
201
+
109
202
  **Arguments:**
110
203
  - `[feature-description]` — plain-language description of the feature
111
204
 
@@ -118,7 +211,7 @@ Commands are slash commands registered in OpenCode. Run them by typing `/command
118
211
 
119
212
  **Example:**
120
213
  ```
121
- /fd-new-feature "user authentication with JWT"
214
+ /fd-execute "user authentication with JWT"
122
215
  ```
123
216
 
124
217
  ---
@@ -20,7 +20,7 @@ If OpenCode is not yet installed, follow the [OpenCode installation guide](https
20
20
 
21
21
  ## Method 1: curl (recommended)
22
22
 
23
- The install script downloads the latest release, copies all agents, skills, commands, and workflows to `~/.config/opencode/`, and registers `@dv.nghiem/flowdeck` as a plugin in `opencode.json`.
23
+ The install script registers `@dv.nghiem/flowdeck` as a plugin in `opencode.json` and sets `orchestrator` as default agent when missing.
24
24
 
25
25
  ```bash
26
26
  curl -fsSL https://raw.githubusercontent.com/DVNghiem/flowdeck/main/install.sh | bash
@@ -29,11 +29,9 @@ curl -fsSL https://raw.githubusercontent.com/DVNghiem/flowdeck/main/install.sh |
29
29
  What the script does:
30
30
 
31
31
  1. Detects your config directory (`$OPENCODE_CONFIG_DIR` or `~/.config/opencode`)
32
- 2. Copies `agents/*.md` → `~/.config/opencode/agent/` (markdown agents for OpenCode compatibility)
33
- 3. Compiles TypeScript agents from `src/agents/` `dist/agents/` (for plugin-based loading)
34
- 4. Copies `skills/*/` `~/.config/opencode/skills/`
35
- 5. Registers `@dv.nghiem/flowdeck` as a plugin in `opencode.json`
36
- 6. Sets `orchestrator` as the default agent
32
+ 2. Creates the config directory if needed
33
+ 3. Registers `@dv.nghiem/flowdeck` as a plugin in `opencode.json` if not present
34
+ 4. Sets `orchestrator` as the default agent if not already configured
37
35
 
38
36
  ---
39
37
 
@@ -59,18 +57,9 @@ Steps explained:
59
57
 
60
58
  ## Verification
61
59
 
62
- After any install method, run these commands to confirm everything landed correctly:
60
+ After any install method, run these commands to confirm registration:
63
61
 
64
62
  ```bash
65
- # Should print 23 or more
66
- ls ~/.config/opencode/agent/ | grep -c "\.md"
67
-
68
- # Should list 24 or more directories
69
- ls ~/.config/opencode/skills/
70
-
71
- # Should list 16 or more files
72
- ls ~/.config/opencode/command/
73
-
74
63
  # Should print @dv.nghiem/flowdeck
75
64
  cat ~/.config/opencode/opencode.json | grep flowdeck
76
65
  ```
@@ -81,7 +70,7 @@ Expected output for the last command:
81
70
  "@dv.nghiem/flowdeck"
82
71
  ```
83
72
 
84
- If any count is lower than expected, re-run the install command. If the `opencode.json` line is missing, the plugin will not load — add it manually (see [Configuration](configuration.md)).
73
+ If the `opencode.json` line is missing, the plugin will not load — add it manually (see [Configuration](configuration.md)).
85
74
 
86
75
  ---
87
76
 
@@ -8,19 +8,19 @@ FlowDeck's intelligence layer adds safety-first AI editing, persistent architect
8
8
 
9
9
  | Feature | Command / Hook | Storage |
10
10
  |---------|---------------|---------|
11
- | Change Impact Radar | `/fd-impact-radar` | VOLATILITY.json, MEMORY.json |
11
+ | Change Impact Radar | Integrated analysis workflow | VOLATILITY.json, MEMORY.json |
12
12
  | Patch Trust Score | Hook (automatic) | VOLATILITY.json, FAILURES.json |
13
- | Blast Radius Preview | `/fd-blast-radius` | MEMORY.json, FAILURES.json |
13
+ | Blast Radius Preview | Integrated analysis workflow | MEMORY.json, FAILURES.json |
14
14
  | Repo Memory Graph | `repo-memory` tool | `.codebase/MEMORY.json` |
15
15
  | Failure Replay Engine | `failure-replay` tool | `.codebase/FAILURES.json` |
16
16
  | Safe Execution Modes | Hook (automatic) | `.planning/config.json` |
17
- | Test Gap Detector | `/fd-test-gap` | VOLATILITY.json |
17
+ | Test Gap Detector | Integrated analysis workflow | VOLATILITY.json |
18
18
  | Architectural Constraint Guard | Hook (automatic) | `.codebase/CONSTRAINTS.md` |
19
19
  | Intent-to-Change Translator | `/fd-translate-intent` | — |
20
20
  | Confidence-Aware Planning | Skill | — |
21
- | Codebase Volatility Map | `/fd-volatility-map`, `volatility-map` tool | `.codebase/VOLATILITY.json` |
22
- | Human Review Routing | `/fd-review-route` | VOLATILITY.json, FAILURES.json |
23
- | Regression Prediction | `/fd-regression-predict` | — |
21
+ | Codebase Volatility Map | `volatility-map` tool | `.codebase/VOLATILITY.json` |
22
+ | Human Review Routing | Integrated analysis workflow | VOLATILITY.json, FAILURES.json |
23
+ | Regression Prediction | Integrated analysis workflow | — |
24
24
  | Decision Trace | `decision-trace` tool + hook | `.codebase/DECISIONS.jsonl` |
25
25
  | Self-Healing Policies | `policy-engine` tool | `.codebase/POLICIES.json` |
26
26
 
@@ -28,14 +28,11 @@ FlowDeck's intelligence layer adds safety-first AI editing, persistent architect
28
28
 
29
29
  ## Slash Commands
30
30
 
31
- ### `/fd-impact-radar`
31
+ ### Change Impact Radar
32
32
 
33
33
  Predicts which files, modules, APIs, tests, and database paths are likely to be affected before the AI edits anything.
34
34
 
35
- ```
36
- /fd-impact-radar --change "refactor auth token handling" --scope all
37
- /fd-impact-radar --change "drop users table" --json
38
- ```
35
+ Use `/fd-suggest` or `/fd-translate-intent` when you need pre-change analysis with impact context.
39
36
 
40
37
  **Arguments:**
41
38
  - `--change` — describe the proposed change (free text)
@@ -46,13 +43,11 @@ Predicts which files, modules, APIs, tests, and database paths are likely to be
46
43
 
47
44
  ---
48
45
 
49
- ### `/fd-blast-radius`
46
+ ### Blast Radius Preview
50
47
 
51
48
  Shows the likely downstream consequences of a proposed change — hidden dependencies, fragile integration points, and predicted test breakages.
52
49
 
53
- ```
54
- /fd-blast-radius --change "delete legacy session table" --depth 3
55
- ```
50
+ Use `/fd-suggest` for broad risk discovery and `/fd-deploy-check` before release changes.
56
51
 
57
52
  **Arguments:**
58
53
  - `--change` — describe the proposed change
@@ -78,14 +73,11 @@ Converts a vague request like "make checkout faster" into concrete, ranked imple
78
73
 
79
74
  ---
80
75
 
81
- ### `/fd-volatility-map`
76
+ ### Volatility Map
82
77
 
83
78
  Displays the Codebase Volatility Map — highlights unstable zones based on churn, hotfix frequency, and unresolved TODO clusters.
84
79
 
85
- ```
86
- /fd-volatility-map
87
- /fd-volatility-map --threshold volatile --limit 10
88
- ```
80
+ Use the `volatility-map` tool directly from delegated agents for incremental updates.
89
81
 
90
82
  **Arguments:**
91
83
  - `--threshold` — minimum stability level to show: `stable`, `moderate`, `volatile` (default), `critical`
@@ -96,13 +88,11 @@ Displays the Codebase Volatility Map — highlights unstable zones based on chur
96
88
 
97
89
  ---
98
90
 
99
- ### `/fd-regression-predict`
91
+ ### Regression Prediction
100
92
 
101
93
  Estimates the most likely regression categories for a change — performance, auth, schema, UI states, async flows, etc.
102
94
 
103
- ```
104
- /fd-regression-predict --change "add webhook retry logic" --categories all
105
- ```
95
+ FlowDeck derives regression risk from historical failures plus volatility data during analysis-oriented workflows.
106
96
 
107
97
  **Arguments:**
108
98
  - `--change` — describe the proposed change
@@ -111,14 +101,11 @@ Estimates the most likely regression categories for a change — performance, au
111
101
 
112
102
  ---
113
103
 
114
- ### `/fd-test-gap`
104
+ ### Test Gap Detector
115
105
 
116
106
  Identifies which areas of a proposed change are weakly covered by tests, and suggests the minimum high-value tests to add first.
117
107
 
118
- ```
119
- /fd-test-gap --change "add payment webhook handler"
120
- /fd-test-gap --change "update user schema" --scope unit
121
- ```
108
+ Use `/fd-verify` and `/fd-deploy-check` for current test-gap surfacing in production workflows.
122
109
 
123
110
  **Arguments:**
124
111
  - `--change` — describe the proposed change
@@ -127,13 +114,11 @@ Identifies which areas of a proposed change are weakly covered by tests, and sug
127
114
 
128
115
  ---
129
116
 
130
- ### `/fd-review-route`
117
+ ### Human Review Routing
131
118
 
132
119
  Routes risky patches to the right reviewer type — security, backend, infra, domain-owner, frontend, data, or devops — based on the file paths and change description.
133
120
 
134
- ```
135
- /fd-review-route --files "src/auth/token.ts,src/api/routes.ts" --change "new JWT rotation logic"
136
- ```
121
+ Routing to reviewer profiles is integrated into verification and deployment checks.
137
122
 
138
123
  **Arguments:**
139
124
  - `--files` — comma-separated file paths being changed
@@ -0,0 +1,21 @@
1
+ # FlowDeck Optimization Baseline
2
+
3
+ Captured on 2026-05-07 before deep optimization implementation.
4
+
5
+ ## Dispatch Baseline
6
+
7
+ - Command: `bun test src/tools/agent-dispatch.test.ts`
8
+ - Result: 8 passing, 0 failing
9
+ - Suite runtime (bun): 135ms
10
+ - Wall clock runtime: 0.17s
11
+
12
+ ## Observability Baseline
13
+
14
+ - `.codebase/` does not exist yet in a clean repo checkout.
15
+ - Telemetry hooks emitted `status: "ok"` for all tool completions and did not classify failures.
16
+ - Session/run IDs defaulted to `session-0` and `run-0` when runtime env variables were not set.
17
+
18
+ ## Routing and Cost Baseline
19
+
20
+ - Dispatch tools did not call model routing or agent performance tracking.
21
+ - `src/services/model-router.ts` and `src/services/agent-performance.ts` were present but not wired into `delegate`/`run-pipeline`.
@@ -71,12 +71,28 @@ All subsequent agents read these files for context. Skip this step for brand-new
71
71
 
72
72
  ---
73
73
 
74
- ## Step 4: Start a Discussion
74
+ ## Step 4: Define a New Feature
75
75
 
76
- Requirements gathering comes before planning. Run:
76
+ Before discussing requirements, initialize the feature:
77
77
 
78
78
  ```
79
- /fd-discuss 1
79
+ /fd-new-feature user authentication
80
+ ```
81
+
82
+ `@orchestrator` creates `.planning/phases/phase-1/FEATURE.md` and updates `STATE.md`. This establishes the feature context and shows you the next steps in the workflow:
83
+ 1. /fd-discuss
84
+ 2. /fd-plan
85
+ 3. /fd-execute
86
+ 4. /fd-verify
87
+
88
+ ---
89
+
90
+ ## Step 5: Start a Discussion
91
+
92
+ Requirements gathering comes next. Run:
93
+
94
+ ```
95
+ /fd-discuss
80
96
  ```
81
97
 
82
98
  `@discusser` asks structured questions about your goals, constraints, and success criteria — one question at a time. Each answer is numbered and tracked as a decision (`D-01`, `D-02`, …).
@@ -90,17 +106,17 @@ When you finish answering, the decisions are saved to `.planning/phases/phase-1/
90
106
 
91
107
  ---
92
108
 
93
- ## Step 5: Create an Implementation Plan
109
+ ## Step 6: Create an Implementation Plan
94
110
 
95
111
  With requirements captured, generate the plan:
96
112
 
97
113
  ```
98
- /fd-plan 1
114
+ /fd-plan
99
115
  ```
100
116
 
101
117
  `@planner` reads `DISCUSS.md` and produces a wave-structured `PLAN.md` in `.planning/phases/phase-1/`. Then `@plan-checker` reviews it for quality — checking that task sizes are reasonable, success criteria are specific, and wave dependencies are correct.
102
118
 
103
- You are shown the plan and prompted for confirmation. **Type `CONFIRMED` to allow execution to proceed.** Review carefully before confirming:
119
+ You are shown the plan and prompted for confirmation. **Type `CONFIRM` to allow execution to proceed.** Review carefully before confirming:
104
120
 
105
121
  - Are success criteria observable and specific?
106
122
  - Are individual tasks sized to 1–3 hours?
@@ -108,40 +124,45 @@ You are shown the plan and prompted for confirmation. **Type `CONFIRMED` to allo
108
124
 
109
125
  ---
110
126
 
111
- ## Step 6: Execute a Feature
127
+ ## Step 7: Execute the Feature
112
128
 
113
129
  Once the plan is confirmed, start implementation:
114
130
 
115
131
  ```
116
- /fd-new-feature "user authentication with JWT"
132
+ /fd-execute
117
133
  ```
118
134
 
119
- `@orchestrator` reads `STATE.md` and `PLAN.md`, then delegates work to specialist agents in wave order:
135
+ `@orchestrator` reads `STATE.md` and `PLAN.md`, then delegates work to specialist agents in wave order via a TDD cycle (RED → GREEN → REFACTOR):
120
136
 
121
- 1. **Wave 1** — `@architect` designs the component structure and API contracts
122
- 2. **Wave 2** — `@coder` and `@researcher` implement in parallel (independent tasks)
123
- 3. **Wave 3** — `@tester` writes and runs tests against the completed implementation
124
- 4. **Wave 4** — `@reviewer` reviews the full changeset
137
+ 1. **Behavior** — Define acceptance cases from PLAN.md
138
+ 2. **RED** — Write failing tests covering each behavior
139
+ 3. **GREEN** — Implement minimum code to pass tests
140
+ 4. **REFACTOR** — Clean up code while tests remain green
141
+ 5. **Review** — `@reviewer` checks code quality and TDD discipline
125
142
 
126
- You see progress updates as each wave completes. Independent tasks within a wave run simultaneously via OpenCode's multi-agent capabilities.
143
+ You see progress updates as each task completes. Independent tasks within a wave run simultaneously.
127
144
 
128
145
  ---
129
146
 
130
- ## Step 7: Review the Code
147
+ ## Step 8: Verify Feature Completion
131
148
 
132
- After implementation, run the review phase against staged changes:
149
+ After implementation, run the full verification pipeline:
133
150
 
134
151
  ```
135
- /fd-review-code staged
152
+ /fd-verify
136
153
  ```
137
154
 
138
- `@reviewer`, `@security-auditor`, and `@tester` run in parallel. Their findings are aggregated into a single report ranked by severity: Critical → High → Medium → Pass.
155
+ This runs four checks in parallel:
156
+ - **Tests** — Full test suite must pass
157
+ - **Code Review** — `@reviewer` checks quality, security, conventions
158
+ - **Security Scan** — `@security-auditor` checks for vulnerabilities
159
+ - **Deploy Check** — Build verification, CVE audit, readiness assessment
139
160
 
140
- Address any Critical or High findings before merging.
161
+ If all checks pass, the phase is marked **VERIFIED**. If any check fails, the report shows what needs fixing.
141
162
 
142
163
  ---
143
164
 
144
- ## Step 8: Save State
165
+ ## Step 9: Review the Results
145
166
 
146
167
  Before closing OpenCode, checkpoint your progress:
147
168
 
@@ -161,13 +182,13 @@ This writes the current execution state to `.planning/STATE.md`. To reload conte
161
182
 
162
183
  ## Tips
163
184
 
164
- > **Check status at any time** — `/fd-progress` prints the current state, active plan, and a summary of recent results without modifying anything.
185
+ > **Check status at any time** — `/fd-status` prints the current state, active plan, and a summary of recent results without modifying anything.
165
186
 
166
187
  > **Context after a restart** — always run `/fd-resume` at the start of a new OpenCode session on a project that was previously active. Agents have no memory between sessions without it.
167
188
 
168
- > **Follow the "What Next?" prompt** — after each FlowDeck command completes, the orchestrating agent presents a set of suggested next steps. Reading these keeps you on the intended workflow path.
189
+ > **Follow the workflow order** — the cycle `/fd-new-feature /fd-discuss /fd-plan /fd-execute /fd-verify` ensures requirements are captured before implementation and verification happens at the end.
169
190
 
170
- > **Skip steps for small tasks** — for a quick bug fix, you do not need to run `/fd-discuss` and `/fd-plan`. Use `/fd-fix-bug` directly and let `@debug-specialist` handle the full cycle.
191
+ > **Skip to execute for small tasks** — for a quick bug fix, you do not need to run `/fd-discuss` and `/fd-plan`. Use `/fd-fix-bug` directly and let `@debug-specialist` handle the full cycle.
171
192
 
172
193
  ---
173
194
 
package/docs/rules.md CHANGED
@@ -1,47 +1,20 @@
1
1
  # FlowDeck Rules
2
2
 
3
- Rules are coding standard documents that you load into OpenCode's context. They give the AI consistent style, testing, security, and language-specific guidelines to follow across all sessions.
3
+ Rules are coding standards used by FlowDeck agents for style, testing, security, and language-specific guidance.
4
4
 
5
- ## How to Use Rules
5
+ ## How Rules Load
6
6
 
7
- ### Method 1 Project-level (recommended)
7
+ FlowDeck loads all markdown files under `src/rules/` automatically through plugin startup. You do not need to manually copy or symlink rule files.
8
8
 
9
- Add the rules you want to your project's `opencode.json`. This ensures every OpenCode session in the project automatically picks them up:
9
+ ## Precedence
10
10
 
11
- ```json
12
- {
13
- "instructions": [
14
- ".flowdeck-rules/common/coding-style.md",
15
- ".flowdeck-rules/common/testing.md",
16
- ".flowdeck-rules/common/security.md",
17
- ".flowdeck-rules/typescript/patterns.md"
18
- ]
19
- }
20
- ```
21
-
22
- Where `.flowdeck-rules/` is a symlink or copy of the FlowDeck rules directory:
23
-
24
- ```bash
25
- ln -s ~/.config/opencode/node_modules/@dv.nghiem/flowdeck/rules .flowdeck-rules
26
- ```
27
-
28
- ### Method 2 — Per-session
29
-
30
- Reference a rule file directly in your prompt:
11
+ When guidance conflicts, precedence is:
31
12
 
32
- ```
33
- Follow the rules in ~/.config/opencode/node_modules/@dv.nghiem/flowdeck/rules/typescript/patterns.md
34
- ```
35
-
36
- ### Method 3 — Copy to project
37
-
38
- Copy the rules directory into your project for version-controlled standards:
39
-
40
- ```bash
41
- cp -r ~/.config/opencode/node_modules/@dv.nghiem/flowdeck/rules ./flowdeck-rules
42
- ```
13
+ 1. `AGENTS.md` and `CLAUDE.md` in the repository
14
+ 2. FlowDeck plugin rules in `src/rules/**`
15
+ 3. Runtime policy rules in `.codebase/POLICIES.json`
43
16
 
44
- Then commit `flowdeck-rules/` to your repository so the entire team uses the same standards.
17
+ This keeps repository-specific conventions authoritative and lets policy learning add guardrails without overriding project intent.
45
18
 
46
19
  ---
47
20