@dv.nghiem/flowdeck 0.3.8 → 0.4.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.
Files changed (136) hide show
  1. package/README.md +13 -122
  2. package/dist/agents/code-explorer.d.ts.map +1 -1
  3. package/dist/agents/mapper.d.ts.map +1 -1
  4. package/dist/agents/orchestrator.d.ts.map +1 -1
  5. package/dist/agents/planner.d.ts.map +1 -1
  6. package/dist/agents/specialist.d.ts.map +1 -1
  7. package/dist/dashboard/server.mjs +12 -2
  8. package/dist/hooks/compaction-hook.d.ts.map +1 -1
  9. package/dist/hooks/file-tracker.d.ts +6 -0
  10. package/dist/hooks/file-tracker.d.ts.map +1 -1
  11. package/dist/hooks/notifications.d.ts.map +1 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +752 -785
  14. package/dist/lib/completion-validator.d.ts +51 -0
  15. package/dist/lib/completion-validator.d.ts.map +1 -0
  16. package/dist/lib/recommended-question.d.ts +24 -0
  17. package/dist/lib/recommended-question.d.ts.map +1 -0
  18. package/dist/lib/research-gate.d.ts +97 -0
  19. package/dist/lib/research-gate.d.ts.map +1 -0
  20. package/dist/lib/research-gate.test.d.ts +2 -0
  21. package/dist/lib/research-gate.test.d.ts.map +1 -0
  22. package/dist/mcp/index.d.ts +14 -3
  23. package/dist/mcp/index.d.ts.map +1 -1
  24. package/dist/services/codegraph.d.ts +36 -0
  25. package/dist/services/codegraph.d.ts.map +1 -0
  26. package/dist/services/codegraph.test.d.ts +2 -0
  27. package/dist/services/codegraph.test.d.ts.map +1 -0
  28. package/dist/services/command-validator.d.ts +11 -0
  29. package/dist/services/command-validator.d.ts.map +1 -1
  30. package/dist/services/preflight-explorer.d.ts +130 -0
  31. package/dist/services/preflight-explorer.d.ts.map +1 -0
  32. package/dist/services/preflight-explorer.test.d.ts +25 -0
  33. package/dist/services/preflight-explorer.test.d.ts.map +1 -0
  34. package/dist/services/question-guard.d.ts +96 -0
  35. package/dist/services/question-guard.d.ts.map +1 -0
  36. package/dist/services/quick-router.d.ts +40 -1
  37. package/dist/services/quick-router.d.ts.map +1 -1
  38. package/dist/services/recommended-question.test.d.ts +2 -0
  39. package/dist/services/recommended-question.test.d.ts.map +1 -0
  40. package/dist/services/supervisor-binding.d.ts +3 -1
  41. package/dist/services/supervisor-binding.d.ts.map +1 -1
  42. package/dist/tools/codebase-index.d.ts +30 -0
  43. package/dist/tools/codebase-index.d.ts.map +1 -0
  44. package/dist/tools/codebase-index.test.d.ts +2 -0
  45. package/dist/tools/codebase-index.test.d.ts.map +1 -0
  46. package/dist/tools/codegraph-tool.d.ts +3 -0
  47. package/dist/tools/codegraph-tool.d.ts.map +1 -0
  48. package/dist/tools/planning-state-lib.d.ts +23 -0
  49. package/dist/tools/planning-state-lib.d.ts.map +1 -1
  50. package/docs/agents/index.md +154 -0
  51. package/docs/commands/fd-ask.md +71 -39
  52. package/docs/commands/fd-checkpoint.md +63 -8
  53. package/docs/commands/fd-deploy-check.md +166 -9
  54. package/docs/commands/fd-design.md +101 -0
  55. package/docs/commands/fd-discuss.md +87 -20
  56. package/docs/commands/fd-doctor.md +100 -13
  57. package/docs/commands/fd-done.md +215 -0
  58. package/docs/commands/fd-execute.md +104 -0
  59. package/docs/commands/fd-fix-bug.md +144 -24
  60. package/docs/commands/fd-map-codebase.md +85 -21
  61. package/docs/commands/fd-multi-repo.md +155 -40
  62. package/docs/commands/fd-new-feature.md +63 -19
  63. package/docs/commands/fd-plan.md +80 -27
  64. package/docs/commands/fd-quick.md +143 -29
  65. package/docs/commands/fd-reflect.md +81 -13
  66. package/docs/commands/fd-resume.md +65 -8
  67. package/docs/commands/fd-status.md +80 -12
  68. package/docs/commands/fd-suggest.md +114 -0
  69. package/docs/commands/fd-translate-intent.md +69 -9
  70. package/docs/commands/fd-verify.md +71 -14
  71. package/docs/commands/fd-write-docs.md +121 -8
  72. package/docs/concepts/architecture.md +163 -0
  73. package/docs/concepts/governance.md +242 -0
  74. package/docs/concepts/intelligence.md +145 -0
  75. package/docs/concepts/multi-repo.md +227 -0
  76. package/docs/concepts/workflows.md +205 -0
  77. package/docs/configuration/index.md +208 -0
  78. package/docs/configuration/opencode-settings.md +98 -0
  79. package/docs/getting-started/first-project.md +126 -0
  80. package/docs/getting-started/installation.md +73 -0
  81. package/docs/getting-started/quick-start.md +74 -0
  82. package/docs/index.md +36 -72
  83. package/docs/reference/hooks.md +176 -0
  84. package/docs/reference/rules.md +109 -0
  85. package/docs/skills/code-review.md +47 -0
  86. package/docs/skills/index.md +148 -0
  87. package/docs/skills/planning.md +39 -0
  88. package/package.json +1 -1
  89. package/src/commands/fd-deploy-check.md +2 -2
  90. package/src/commands/fd-discuss.md +128 -7
  91. package/src/commands/fd-done.md +196 -0
  92. package/src/commands/fd-execute.md +43 -6
  93. package/src/commands/fd-fix-bug.md +43 -6
  94. package/src/commands/fd-map-codebase.md +100 -20
  95. package/src/commands/fd-multi-repo.md +1 -1
  96. package/src/commands/fd-new-feature.md +14 -5
  97. package/src/commands/fd-plan.md +38 -1
  98. package/src/commands/fd-quick.md +77 -14
  99. package/src/commands/fd-resume.md +1 -1
  100. package/src/commands/fd-status.md +1 -1
  101. package/src/commands/fd-verify.md +16 -2
  102. package/src/commands/fd-write-docs.md +30 -5
  103. package/src/rules/common/behavioral.md +63 -0
  104. package/src/skills/codebase-mapping/SKILL.md +1 -1
  105. package/src/skills/context-load/SKILL.md +1 -1
  106. package/src/skills/multi-repo/SKILL.md +1 -1
  107. package/src/skills/repo-memory-graph/SKILL.md +1 -1
  108. package/dist/hooks/memory-hook.d.ts +0 -28
  109. package/dist/hooks/memory-hook.d.ts.map +0 -1
  110. package/dist/services/memory-store.d.ts +0 -73
  111. package/dist/services/memory-store.d.ts.map +0 -1
  112. package/dist/services/memory-store.test.d.ts +0 -2
  113. package/dist/services/memory-store.test.d.ts.map +0 -1
  114. package/dist/tools/memory-search.d.ts +0 -3
  115. package/dist/tools/memory-search.d.ts.map +0 -1
  116. package/dist/tools/memory-status.d.ts +0 -3
  117. package/dist/tools/memory-status.d.ts.map +0 -1
  118. package/docs/USER_GUIDE.md +0 -20
  119. package/docs/agents.md +0 -544
  120. package/docs/best-practices.md +0 -47
  121. package/docs/commands/fd-new-project.md +0 -24
  122. package/docs/commands.md +0 -557
  123. package/docs/configuration.md +0 -325
  124. package/docs/design-first-workflow.md +0 -94
  125. package/docs/feature-integration-architecture.md +0 -227
  126. package/docs/installation.md +0 -123
  127. package/docs/intelligence.md +0 -370
  128. package/docs/memory.md +0 -69
  129. package/docs/multi-repo.md +0 -201
  130. package/docs/notifications.md +0 -170
  131. package/docs/optimization-baseline.md +0 -21
  132. package/docs/quick-start.md +0 -197
  133. package/docs/rules.md +0 -432
  134. package/docs/skills.md +0 -417
  135. package/docs/workflows.md +0 -134
  136. package/src/commands/fd-new-project.md +0 -114
package/docs/agents.md DELETED
@@ -1,544 +0,0 @@
1
- # FlowDeck Agents
2
-
3
- Agents are specialized AI personas installed into OpenCode. Each agent has a focused role and system prompt. Invoke them in any OpenCode prompt with `@agent-name`.
4
-
5
- ## How to Use Agents
6
-
7
- ```
8
- @architect Design the database schema for a multi-tenant SaaS app
9
- @backend-coder Implement the UserRepository class following the interface in src/interfaces/
10
- @reviewer Review src/auth/jwt.ts for security issues
11
- ```
12
-
13
- Agents are installed to `~/.config/opencode/agent/`. OpenCode loads them automatically — no additional configuration needed.
14
-
15
- ---
16
-
17
- ## Agent Quick Reference
18
-
19
- | Agent | Role | Best for |
20
- |-------|------|----------|
21
- | [@architect](#architect) | Designs system architecture, creates ADRs, defines interface contracts | New modules, API design, schema changes, cross-cutting concerns |
22
- | [@build-error-resolver](#build-error-resolver) | Diagnoses and fixes build failures, type errors, and dependency issues | Broken builds, type mismatches, missing modules |
23
- | [@code-explorer](#code-explorer) | Reads and maps unfamiliar codebases systematically | Understanding unknown code before modifying it |
24
- | [@backend-coder](#backend-coder) | Implements backend features and fixes following confirmed plans | API, service, data-layer implementation |
25
- | [@frontend-coder](#frontend-coder) | Implements frontend features and fixes following confirmed plans | UI components, client state, interaction behavior |
26
- | [@devops](#devops) | Implements infrastructure and delivery changes following confirmed plans | CI/CD, deployment, infra and operations |
27
- | [@debug-specialist](#debug-specialist) | Root cause analysis via hypothesis-driven investigation | Deep bugs that require systematic tracing |
28
- | [@design](#design) | Runs design-first UI workflow with structured handoff artifacts | Landing pages, dashboards, admin panels, app screens, UX-heavy features |
29
- | [@discusser](#discusser) | Structured requirements Q&A, one question at a time | Starting new projects, defining feature scope |
30
- | [@doc-updater](#doc-updater) | Keeps documentation in sync with code changes | Post-implementation doc maintenance |
31
- | [@plan-checker](#plan-checker) | Validates plans before execution for completeness and feasibility | Quality gate before running a plan |
32
- | [@planner](#planner) | Creates detailed, wave-structured implementation plans | Creating execution-ready PLAN.md files |
33
- | [@mapper](#mapper) | Maps codebase to `.codebase/` structured documentation | Producing STACK.md, ARCHITECTURE.md, CONVENTIONS.md, and more |
34
- | [@multi-repo-coordinator](#multi-repo-coordinator) | Cross-repo dependency graphs, change propagation, ordered CHANGE PLANs | Features spanning multiple microservices |
35
- | [@orchestrator](#orchestrator) | Coordinates multi-agent workflows, phase gating, go/no-go decisions | End-to-end feature delivery |
36
- | [@performance-optimizer](#performance-optimizer) | Profiling-first bottleneck identification and targeted fixes | Slow endpoints, N+1 queries, bundle bloat |
37
- | [@planner](#planner) | Implementation planning with explicit user confirmation before execution | Planning any multi-file feature |
38
- | [@refactor-guide](#refactor-guide) | Safe refactoring with test-first guarantees, preserves external behavior | Cleanup, extraction, debt reduction |
39
- | [@researcher](#researcher) | API documentation research, library comparison, cited sources | Understanding unfamiliar APIs before implementation |
40
- | [@reviewer](#reviewer) | Code review covering security, logic, and quality — 80% confidence threshold | Pre-merge and pre-deploy code checks |
41
- | [@security-auditor](#security-auditor) | OWASP-based scanning, PASS/FAIL report, severity classification | Security-sensitive changes, pre-release audits |
42
- | [@task-splitter](#task-splitter) | Dependency graph decomposition, wave-based work breakdown | Decomposing large tasks into parallel workstreams |
43
- | [@tester](#tester) | TDD (Red-Green-Refactor), AAA pattern, unit/integration/e2e tests | Writing tests for features and bug regressions |
44
- | [@writer](#writer) | Technical documentation, ADRs, READMEs, changelog entries | Any documentation creation or update task |
45
-
46
- ---
47
-
48
- ### @design
49
-
50
- The design agent is a dedicated UI/UX specialist that runs before implementation on UI-heavy tasks. It outputs structured design artifacts covering discovery, UX flow, wireframe layout, visual system direction, and frontend handoff checklist. For existing implementations, it performs design fidelity review and reports hierarchy, spacing, responsiveness, accessibility, and state-coverage gaps.
51
-
52
- **Best for:**
53
- - Classifying user-facing task types (landing page, dashboard, admin panel, app screen)
54
- - Producing implementation-ready UI handoff before coding starts
55
- - Reviewing UI output against approved design artifacts during verification
56
- - Defining reusable token/component guidance for consistency
57
-
58
- **Example usage:**
59
- ```
60
- @design Run design-first workflow for: redesign onboarding dashboard.
61
- Output structured handoff artifact with approval checklist.
62
- ```
63
-
64
- **Works with:** `@backend-coder` (consumes handoff artifact), `@reviewer` (code-quality + design-fidelity checks), `@orchestrator` (enforces design gate before implementation)
65
-
66
- ---
67
-
68
- ## Detailed Agent Profiles
69
-
70
- ### @architect
71
-
72
- The architect designs systems before anyone writes code. It reads existing architecture documents and conventions first, then proposes decisions in writing — as ADRs and TypeScript interface contracts — before any implementation begins. It applies principles like "no speculative abstraction" (only abstract when there are 3+ concrete use cases) and surfaces conflicts with existing decisions rather than resolving them silently.
73
-
74
- **Model:** *(uses your active OpenCode model — override in `flowdeck.json`)*
75
-
76
- **Best for:**
77
- - Designing database schemas, API boundaries, and service interfaces for new features
78
- - Writing Architecture Decision Records (ADRs) for non-obvious technical choices
79
- - Defining TypeScript interface contracts before implementation starts
80
- - Identifying cross-cutting concerns such as authentication, logging, and rate limiting
81
-
82
- **Example usage:**
83
- ```
84
- @architect We need to add subscription billing. Design the data model and service interfaces.
85
- Read .codebase/ARCHITECTURE.md first. Save the ADR to .planning/adr/.
86
- ```
87
-
88
- **Works with:** `@backend-coder` (consumes interface contracts), `@planner` (uses ADRs as planning input), `@multi-repo-coordinator` (defines contract-first change specs)
89
-
90
- ---
91
-
92
- ### @build-error-resolver
93
-
94
- The build error resolver collects all build errors before touching a single file. It runs the full diagnostic suite (`tsc --noEmit`, build, lint, tests) and reads the complete output — never skims — because the first error is almost always the root cause and later errors are cascades. It applies the minimum fix to resolve the root cause, then re-runs to confirm no cascades remain.
95
-
96
- **Model:** *(uses your active OpenCode model — override in `flowdeck.json`)*
97
-
98
- **Best for:**
99
- - Diagnosing TypeScript type errors, missing modules, and circular imports
100
- - Resolving broken builds after dependency updates or refactors
101
- - Fixing compilation failures in a cascading error scenario
102
- - Identifying the root error versus cascade errors in a long error log
103
-
104
- **Example usage:**
105
- ```
106
- @build-error-resolver The CI build is failing after the auth refactor. Run the diagnostics
107
- and fix the root cause with minimal changes.
108
- ```
109
-
110
- **Works with:** `@backend-coder` (applies fixes identified by the resolver), `@orchestrator` (escalates build failures during plan execution), `@reviewer` (verifies fix quality)
111
-
112
- ---
113
-
114
- ### @code-explorer
115
-
116
- The code explorer maps unfamiliar code before anyone modifies it. It is read-only by design — it reports what it finds, not what it expects. Starting from the top-level directory, it traces entry points and call paths, identifies key abstractions and data models, and documents conventions in use. Its output gives other agents the context they need to make surgical changes.
117
-
118
- **Model:** *(uses your active OpenCode model — override in `flowdeck.json`)*
119
-
120
- **Best for:**
121
- - Understanding a new module or service before making changes to it
122
- - Tracing a specific flow end-to-end (e.g., HTTP request to database to response)
123
- - Identifying where in the codebase a task-relevant piece of logic lives
124
- - Feeding structural context to `@architect` or `@backend-coder` before implementation
125
-
126
- **Example usage:**
127
- ```
128
- @code-explorer Map the authentication flow in src/auth/. Trace a login request from the
129
- route handler to the database query. Identify the session management approach.
130
- ```
131
-
132
- **Works with:** `@architect` (provides structural context for design decisions), `@backend-coder` (surfaces conventions to match), `@mapper` (complements deeper .codebase/ documentation)
133
-
134
- ---
135
-
136
- ### @backend-coder
137
-
138
- The backend-coder implements features and fixes following a confirmed plan. It reads conventions and architecture docs before touching any source file, matches existing patterns precisely, and makes only the changes the task requires — no drive-by refactors. Functions stay under 50 lines. Every external input is validated at the boundary. If the plan is unclear or technically infeasible, it stops and asks rather than guessing.
139
-
140
- **Model:** *(uses your active OpenCode model — override in `flowdeck.json`)*
141
-
142
- **Best for:**
143
- - Implementing API handlers, services, repositories, and data-model changes
144
- - Applying backend fixes identified by `@debug-specialist` and `@build-error-resolver`
145
- - Delivering plan-scoped server-side functionality with minimal diffs
146
-
147
- **Example usage:**
148
- ```
149
- @backend-coder Implement the UserRepository class defined in contracts/user-repository.ts.
150
- Follow patterns in src/repositories/order-repository.ts. No new dependencies.
151
- ```
152
-
153
- **Works with:** `@tester` (verifies implementation), `@reviewer` (reviews the diff), `@architect` (provides interface contracts)
154
-
155
- ---
156
-
157
- ### @frontend-coder
158
-
159
- The frontend-coder implements frontend features and fixes following a confirmed plan. It focuses on user-facing behavior, component architecture, state transitions, accessibility, and visual consistency with existing patterns.
160
-
161
- **Model:** *(uses your active OpenCode model — override in `flowdeck.json`)*
162
-
163
- ---
164
-
165
- ### @devops
166
-
167
- The devops agent implements infrastructure and operational changes from confirmed plans. It focuses on CI/CD workflows, build and deploy automation, runtime configuration, and safe rollout practices.
168
-
169
- **Model:** *(uses your active OpenCode model — override in `flowdeck.json`)*
170
-
171
- **Best for:**
172
- - Implementing CI/CD workflow changes, deployment config updates, and environment setup
173
- - Applying infra and runtime remediations identified by `@debug-specialist` or `@build-error-resolver`
174
- - Automating release pipelines and operational scripts with minimal blast radius
175
- - Managing build/deploy reliability improvements and rollback-safe changes
176
-
177
- **Example usage:**
178
- ```
179
- @devops Update the deployment workflow to add smoke tests before production release.
180
- Keep rollback steps explicit and preserve existing release gates.
181
- ```
182
-
183
- **Works with:** `@tester` (verifies implementation), `@reviewer` (reviews the diff), `@architect` (consumes interface contracts)
184
-
185
- ---
186
-
187
- ### @debug-specialist
188
-
189
- The debug specialist finds root causes through systematic investigation — never by guessing. It reads the full stack trace from top to bottom, traces execution backward from the point of failure, and identifies the earliest point in the call chain where invariants are violated. For regressions, it uses `git bisect` to identify the culprit commit. It produces a structured debug report before any fix is proposed.
190
-
191
- **Model:** *(uses your active OpenCode model — override in `flowdeck.json`)*
192
-
193
- **Best for:**
194
- - Diagnosing intermittent failures, race conditions, and memory leaks
195
- - Tracing the cause of a `Cannot read property of undefined` or similar runtime error
196
- - Using `git bisect` to find which commit introduced a regression
197
- - Writing a hypothesis and validating it before touching any code
198
-
199
- **Example usage:**
200
- ```
201
- @debug-specialist The order total is calculated incorrectly when a discount code is applied
202
- alongside a loyalty credit. Trace the calculation path and identify the root cause.
203
- ```
204
-
205
- **Works with:** `@tester` (writes the regression test once root cause is confirmed), `@backend-coder` (applies the minimal fix), `@build-error-resolver` (handles compile-time failures the debug specialist doesn't cover)
206
-
207
- ---
208
-
209
- ### @discusser
210
-
211
- The discusser extracts clear requirements through focused, one-at-a-time questioning. It never asks two questions in a single turn. Every decision is numbered (D-01, D-02, ...) and recorded with its rationale. If a new answer conflicts with a previous decision, it flags the conflict immediately and presents options. All decisions are saved to `.planning/phases/phase-N/DISCUSS.md` in a format that `@planner` can trace back to individual tasks.
212
-
213
- **Model:** *(uses your active OpenCode model — override in `flowdeck.json`)*
214
-
215
- **Best for:**
216
- - Defining the scope of a new project or feature phase before planning begins
217
- - Surfacing implicit assumptions and resolving ambiguity through structured Q&A
218
- - Producing a numbered decision log that links requirements to implementation tasks
219
- - Detecting and resolving conflicts between requirements early
220
-
221
- **Example usage:**
222
- ```
223
- @discusser We want to add multi-factor authentication. Ask me the questions you need
224
- to nail down the requirements. One question at a time.
225
- ```
226
-
227
- **Works with:** `@planner` (uses DISCUSS.md as plan input), `@orchestrator` (manages the discuss phase), `@planner` (alternative for lighter planning workflows)
228
-
229
- ---
230
-
231
- ### @doc-updater
232
-
233
- The doc updater synchronizes documentation with the current implementation after code changes. It targets README installation instructions, API reference function signatures, inline comments on complex algorithms, and changelog entries under `## Unreleased`. It verifies that every example it writes actually compiles and runs. Dead links and dead examples are removed, not left behind.
234
-
235
- **Model:** *(uses your active OpenCode model — override in `flowdeck.json`)*
236
-
237
- **Best for:**
238
- - Updating API reference docs after function signatures change
239
- - Syncing README quick-start examples after CLI or config changes
240
- - Adding changelog entries in Keep a Changelog format after a feature lands
241
- - Removing stale documentation references after code is deleted
242
-
243
- **Example usage:**
244
- ```
245
- @doc-updater The auth module was refactored in this PR. Update docs/api/auth.md to match
246
- the new function signatures and verify the examples still compile.
247
- ```
248
-
249
- **Works with:** `@writer` (writer drafts new docs; doc-updater keeps them current), `@reviewer` (flags doc accuracy issues during review), `@code-explorer` (reads current implementation to verify accuracy)
250
-
251
- ---
252
-
253
- ### @plan-checker
254
-
255
- The plan checker reviews a PLAN.md before execution and returns a scored PASS or FAIL verdict. It checks three dimensions: completeness (all requirements from DISCUSS.md are covered, every task has a defined scope and success criteria), feasibility (no task exceeds 3 hours, no circular dependencies, no assumed capabilities that don't exist), and testability (each success criterion is observable, edge cases are addressed, verification commands are specified). A score of 8–10 earns PASS, 6–7 earns PASS_WITH_NOTES, and 0–5 earns FAIL.
256
-
257
- **Model:** *(uses your active OpenCode model — override in `flowdeck.json`)*
258
-
259
- **Best for:**
260
- - Catching vague success criteria before they cause ambiguous execution
261
- - Identifying tasks with missing file paths or verification steps
262
- - Ensuring every requirement from DISCUSS.md is mapped to at least one task
263
- - Flagging infeasible tasks that assume capabilities not yet in the codebase
264
-
265
- **Example usage:**
266
- ```
267
- @plan-checker Review .planning/phases/phase-1/PLAN.md. Score it and return
268
- PASS or FAIL with specific recommendations for any failures.
269
- ```
270
-
271
- **Works with:** `@planner` (generates the plan this agent reviews), `@orchestrator` (receives the verdict and decides whether to proceed)
272
-
273
- ### @mapper
274
-
275
- The mapper produces factual codebase documentation for the `.codebase/` directory. In a parallel run of 6 instances, each mapper is assigned one output file: `STACK.md`, `ARCHITECTURE.md`, `STRUCTURE.md`, `CONVENTIONS.md`, `TESTING.md`, or `CONCERNS.md`. It reads source files directly and reports only what it can verify — any gap is marked `UNKNOWN — needs verification` rather than filled with assumptions. Every claim is traceable to a specific file path.
276
-
277
- **Model:** *(uses your active OpenCode model — override in `flowdeck.json`)*
278
-
279
- **Best for:**
280
- - Generating `.codebase/CONVENTIONS.md` with real naming patterns backed by file:line examples
281
- - Producing `STACK.md` with exact pinned versions from manifest files
282
- - Populating `CONCERNS.md` by grepping for `TODO`, `FIXME`, and `HACK` markers
283
- - Running in parallel with 5 other mapper instances via `@orchestrator`
284
-
285
- **Example usage:**
286
- ```
287
- @mapper Write .codebase/CONVENTIONS.md. Read actual source files to identify naming
288
- patterns, import style, error handling, and async patterns. Include file:line examples.
289
- ```
290
-
291
- **Works with:** `@orchestrator` (coordinates parallel mapper runs), `@code-explorer` (complementary — explorer traces flows, mapper documents structure), `@writer` (writer may document narrative; mapper documents facts)
292
-
293
- ---
294
-
295
- ### @multi-repo-coordinator
296
-
297
- The multi-repo coordinator manages change propagation across a microservice architecture. It reads the sub-repo registry from `.planning/config.json`, builds a dependency graph (upstream-api → downstream-consumer → gateway order), detects conflicts between concurrent service changes, and produces a per-repo CHANGE PLAN ordered by that graph. API contracts are defined first; implementation follows in dependency order so upstream services always deploy before their consumers.
298
-
299
- **Model:** *(uses your active OpenCode model — override in `flowdeck.json`)*
300
-
301
- **Best for:**
302
- - Coordinating a feature that requires changes across two or more services
303
- - Ordering deployments when an upstream API contract is changing
304
- - Detecting which downstream consumers will break when a shared library bumps a major version
305
- - Producing a CHANGE PLAN document that teams can use to coordinate their work
306
-
307
- **Example usage:**
308
- ```
309
- @multi-repo-coordinator The user-service is adding a `preferences` field to GET /users/:id.
310
- Map which downstream consumers call this endpoint and produce
311
- an ordered CHANGE PLAN.
312
- ```
313
-
314
- **Works with:** `@architect` (defines contract-first change specs), `@backend-coder` (implements changes per repo), `@tester` (verifies cross-repo integration)
315
-
316
- ---
317
-
318
- ### @orchestrator
319
-
320
- The orchestrator coordinates multi-agent execution for feature delivery. At startup it reads STATE.md and the active PLAN.md, identifies the first incomplete step, delegates it to the appropriate specialist, waits for completion, marks progress, and advances to the next step. It enforces phase gating — execution only proceeds when DISCUSS.md and PLAN.md are confirmed. If a delegated agent fails after one retry, it escalates to the user with specific options rather than continuing silently.
321
-
322
- **Model:** *(uses your active OpenCode model — override in `flowdeck.json`)*
323
-
324
- **Best for:**
325
- - Running `/fd-new-feature` to drive an end-to-end feature delivery cycle
326
- - Enforcing the discuss → plan → execute → review phase state machine
327
- - Coordinating error recovery when a specialist agent fails mid-execution
328
- - Tracking plan progress and updating STATE.md after each step
329
-
330
- **Example usage:**
331
- ```
332
- @orchestrator Resume execution of the active plan. Read STATE.md to find the current
333
- phase. Delegate incomplete steps in order and mark each complete.
334
- ```
335
-
336
- **Works with:** `@plan-checker` (validates plans before execution), `@task-splitter` (decomposes work into safe parallel waves), `@backend-coder`/`@frontend-coder`/`@devops` (executes routed implementation tasks)
337
-
338
- ---
339
-
340
-
341
- ### @performance-optimizer
342
-
343
- The performance optimizer identifies and fixes performance bottlenecks using data, never intuition. It always measures before optimizing: Node.js profiler, `webpack-bundle-analyzer`, `EXPLAIN ANALYZE`, or Lighthouse depending on the target. It reports findings as before/after numbers. It never proposes a speculative optimization — only improvements justified by profiling output. It targets Core Web Vitals thresholds (LCP < 2.5s, FID < 100ms) and common patterns like N+1 queries and O(n²) algorithms.
344
-
345
- **Model:** *(uses your active OpenCode model — override in `flowdeck.json`)*
346
-
347
- **Best for:**
348
- - Diagnosing slow API endpoints using `EXPLAIN ANALYZE` on the database queries
349
- - Reducing JavaScript bundle size with `webpack-bundle-analyzer` or `source-map-explorer`
350
- - Eliminating N+1 query patterns by building an index before loops
351
- - Optimizing React render performance with `useMemo` and `React.memo`
352
-
353
- **Example usage:**
354
- ```
355
- @performance-optimizer The /api/orders endpoint is taking 2-3 seconds. Profile the database
356
- queries and identify the bottleneck. Show before/after numbers.
357
- ```
358
-
359
- **Works with:** `@backend-coder` (implements optimizations once bottleneck is confirmed), `@tester` (writes benchmarks to verify improvement), `@reviewer` (checks that optimizations don't introduce bugs)
360
-
361
- ---
362
-
363
- ### @planner
364
-
365
- The planner creates detailed, file-level implementation plans with an explicit user confirmation gate before any code is written. It reads ARCHITECTURE.md and existing conventions first, extracts both explicit and implicit requirements, orders steps by dependency (data models → schema → repository → service → API → tests → UI → docs), and flags risks. After presenting the plan it pauses and waits for the user to confirm before execution begins.
366
-
367
- **Model:** *(uses your active OpenCode model — override in `flowdeck.json`)*
368
-
369
- **Best for:**
370
- - Planning any feature that spans more than two files before writing code
371
- - Identifying architecture conflicts and unknowns that would block implementation
372
- - Ordering implementation steps so foundation code is in place before dependent code
373
- - Generating a plan that feeds directly into `@backend-coder`'s execution
374
-
375
- **Example usage:**
376
- ```
377
- @planner Plan the implementation of JWT refresh tokens. Read .codebase/ARCHITECTURE.md.
378
- List every file that needs to change and the order to change them.
379
- Pause for my confirmation before we proceed.
380
- ```
381
-
382
- **Works with:** `@architect` (provides interface contracts and ADRs that feed the plan), `@backend-coder` (executes the confirmed plan), `@planner` (alternative for structured FlowDeck plan format)
383
-
384
- ---
385
-
386
- ### @refactor-guide
387
-
388
- The refactor guide changes code structure without changing observable behavior. It requires a green test suite before starting and verifies the suite stays green after every single transformation. Each transformation is committed independently with a `refactor:` prefix — never batched. It stops immediately if a test breaks and looks for a smaller step. It covers extract-function, rename, move-module, inline-variable, and similar low-risk catalog transforms, ordered from lowest to highest risk.
389
-
390
- **Model:** *(uses your active OpenCode model — override in `flowdeck.json`)*
391
-
392
- **Best for:**
393
- - Extracting functions from files over 50 lines or 800 lines
394
- - Eliminating code duplication by identifying and extracting shared logic
395
- - Renaming variables and functions that no longer reflect their purpose
396
- - Preparing a module for a new feature by reducing its complexity first
397
-
398
- **Example usage:**
399
- ```
400
- @refactor-guide Refactor src/services/order-service.ts. It's 600 lines with several
401
- large functions. Extract into smaller functions. Keep all tests green.
402
- One commit per transformation.
403
- ```
404
-
405
- **Works with:** `@tester` (confirms suite is green before and after each step), `@backend-coder` (applies transformations), `@mapper` (identifies refactoring candidates across the codebase)
406
-
407
- ---
408
-
409
- ### @researcher
410
-
411
- The researcher finds accurate, cited information before anyone writes code. It searches Context7 first for up-to-date library documentation, then vendor docs, then package registries. Every fact is paired with its source URL. It never cites StackOverflow as a primary source and never fabricates API documentation — if it cannot find an authoritative source, it says so explicitly. Output follows a structured format covering "what it is", "how to use it", and "gotchas".
412
-
413
- **Model:** *(uses your active OpenCode model — override in `flowdeck.json`)*
414
-
415
- **Best for:**
416
- - Documenting an unfamiliar library's API before `@backend-coder` uses it
417
- - Comparing two libraries (e.g., `zod` vs `joi`) with concrete tradeoffs cited from official sources
418
- - Finding the correct pagination API, error response format, or auth flow for an external service
419
- - Identifying breaking changes between library versions that affect the implementation plan
420
-
421
- **Example usage:**
422
- ```
423
- @researcher Document the Stripe Checkout API for subscription billing. Cover: session creation,
424
- webhook event types, and how to handle failed payments. Cite official Stripe docs.
425
- ```
426
-
427
- **Works with:** `@backend-coder` (receives research output before implementation), `@architect` (uses library capability research to inform interface design), `@orchestrator` (runs in parallel with `@code-explorer` in Wave 1)
428
-
429
- ---
430
-
431
- ### @reviewer
432
-
433
- The reviewer checks code for correctness, security, and adherence to project conventions. It reads full files — not just the diff — to understand call context. It applies an 80% confidence threshold before flagging an issue: speculation is not a finding. Findings are classified as CRITICAL, HIGH, MEDIUM, or PASS. It checks for hardcoded credentials, SQL injection, XSS, missing auth middleware, improper error handling, and convention violations.
434
-
435
- **Model:** *(uses your active OpenCode model — override in `flowdeck.json`)*
436
-
437
- **Best for:**
438
- - Reviewing a pull request before it is merged
439
- - Checking a feature for security issues before it reaches staging
440
- - Verifying that implementation matches the original plan and interface contracts
441
- - Running in parallel with `@security-auditor` for a comprehensive pre-deploy check
442
-
443
- **Example usage:**
444
- ```
445
- @reviewer Review the diff in src/routes/payments.ts. Check for injection vulnerabilities,
446
- missing auth middleware, and convention adherence. Report by severity.
447
- ```
448
-
449
- **Works with:** `@security-auditor` (runs in parallel for deeper security coverage), `@orchestrator` (receives review verdict and decides whether to advance phase), `@backend-coder` (receives actionable findings and applies fixes)
450
-
451
- ---
452
-
453
- ### @security-auditor
454
-
455
- The security auditor performs deep security audits against the OWASP Top 10. It checks for injection vulnerabilities (SQL, NoSQL, command, LDAP, template), broken access control (missing ownership checks, role bypasses), cryptographic failures (MD5/SHA1 for passwords, plaintext secrets), and dependency risks (known CVEs). It produces a PASS/FAIL report with severity classification and specific remediation steps. It does not apply fixes — that is `@backend-coder`'s responsibility.
456
-
457
- **Model:** *(uses your active OpenCode model — override in `flowdeck.json`)*
458
-
459
- **Best for:**
460
- - Auditing authentication and authorization code before merging security-sensitive PRs
461
- - Scanning for hardcoded secrets and exposed API keys across changed files
462
- - Checking dependency manifests for packages with known CVEs
463
- - Producing a formal security report for compliance or handoff purposes
464
-
465
- **Example usage:**
466
- ```
467
- @security-auditor Audit src/auth/ for OWASP Top 10 vulnerabilities. Focus on A01 (access control)
468
- and A02 (cryptographic failures). Return PASS or FAIL with severity classification.
469
- ```
470
-
471
- **Works with:** `@reviewer` (parallel review partner), `@backend-coder` (applies remediations after audit findings), `@orchestrator` (aggregates audit result into go/no-go decision)
472
-
473
- ---
474
-
475
- ### @task-splitter
476
-
477
- The task splitter decomposes complex tasks into independent parallel workstreams. It reads a feature description or PLAN.md, builds a dependency graph, groups tasks into waves where each wave's work is provably independent, and emits a structured parallel execution plan that `@orchestrator` can execute directly. Each track includes: assigned agent, target files, specific task, and a verifiable completion criterion.
478
-
479
- **Model:** *(uses your active OpenCode model — override in `flowdeck.json`)*
480
-
481
- **Best for:**
482
- - Breaking a large feature into parallel workstreams before handing off to `@orchestrator`
483
- - Identifying which tasks must be serial (dependency gates) versus truly independent
484
- - Sizing and scoping tasks so each fits within a single agent session
485
- - Producing a wave plan when `@planner` is unavailable or overkill
486
-
487
- **Example usage:**
488
- ```
489
- @task-splitter Decompose the payment integration feature into parallel workstreams.
490
- Identify which parts can run simultaneously and which have dependencies.
491
- Produce a WAVE TABLE with agent assignments.
492
- ```
493
-
494
- **Works with:** `@orchestrator` (executes the wave plan produced by this agent), `@orchestrator` (uses task breakdown to coordinate execution), `@planner` (complementary — planner creates PLAN.md format, splitter focuses on parallelization)
495
-
496
- ---
497
-
498
- ### @tester
499
-
500
- The tester writes tests that drive implementation using strict Red-Green-Refactor TDD. Tests are written before the code that makes them pass. Every test follows the Arrange-Act-Assert (AAA) pattern. It covers unit tests for isolated logic, integration tests for database and service interactions, and end-to-end tests for user-facing flows. For bug fixes, it writes a failing regression test before any fix is applied so the bug cannot silently recur.
501
-
502
- **Model:** *(uses your active OpenCode model — override in `flowdeck.json`)*
503
-
504
- **Best for:**
505
- - Writing a failing regression test to capture a reported bug before `@backend-coder` fixes it
506
- - Implementing the test suite for a new feature in parallel with `@backend-coder` from interface contracts
507
- - Running the full test suite as a verification step after `@refactor-guide` transforms
508
- - Identifying coverage gaps and writing tests for uncovered paths
509
-
510
- **Example usage:**
511
- ```
512
- @tester Write failing tests for the UserService.create() method. Cover: happy path,
513
- duplicate email (conflict), and missing required fields (validation error).
514
- Use the AAA pattern with vitest.
515
- ```
516
-
517
- **Works with:** `@backend-coder` (implements code to make tests pass), `@debug-specialist` (writes regression test after root cause is identified), `@refactor-guide` (verifies green suite before and after each transformation)
518
-
519
- ---
520
-
521
- ### @writer
522
-
523
- The writer drafts technical documentation that developers will actually read. It reads every source file it documents — never documents from memory. It favors accuracy over comprehensiveness, examples over prose, and active voice throughout. Documentation types covered: README.md (with standard section order), API reference (per-function with parameters, return types, and usage examples), changelogs (Keep a Changelog format), and ADRs. It marks anything it cannot verify as `UNKNOWN` rather than guessing.
524
-
525
- **Model:** *(uses your active OpenCode model — override in `flowdeck.json`)*
526
-
527
- **Best for:**
528
- - Writing a README.md from scratch for a new project or module
529
- - Drafting API reference documentation for newly implemented public functions
530
- - Creating a changelog entry after a release
531
- - Writing a code tour or architectural overview document
532
-
533
- **Example usage:**
534
- ```
535
- @writer Write a README.md for the payments module in src/payments/.
536
- Read the source files first. Include: purpose, quick start, API reference,
537
- and configuration options. Verify all examples compile.
538
- ```
539
-
540
- **Works with:** `@doc-updater` (writer creates docs; doc-updater keeps them current), `@reviewer` (checks accuracy of written docs against implementation), `@code-explorer` (maps the codebase so writer has a structural overview before writing)
541
-
542
- ---
543
-
544
- ← [Back to Index](index.md)
@@ -1,47 +0,0 @@
1
- # FlowDeck Best Practices
2
-
3
- Maximize the efficiency and safety of your AI-driven development by following these best practices.
4
-
5
- ---
6
-
7
- ## 1. Spec-Driven Discipline
8
-
9
- **Don't skip the planning phase.** FlowDeck strictly enforces phase gating to prevent agents from writing code before requirements are finalized.
10
- - Use `/fd-discuss` to capture edge cases and constraints early.
11
- - Use `/fd-plan` to break complex features into manageable waves.
12
- - **Tip**: If you must make an emergency edit, run `/fd-settings` to temporarily advance the phase to `execute`, but remember to return to `plan` if you are still designing.
13
-
14
- ## 2. The Power of the Council
15
-
16
- When faced with ambiguity, don't rely on a single agent.
17
- - Use `/fd-council` for high-level design choices.
18
- - The synthesis provided by the council often catches security or performance risks that a role-based implementation agents might miss.
19
-
20
- ## 3. Grounding with Hierarchical Context
21
-
22
- AI agents perform better when they have clear, localized context.
23
- - Keep an `AGENTS.md` file in each major directory.
24
- - Use `context-generator` to keep these files up to date with your current `ROADMAP.md` and `STATE.md`.
25
- - Include "Forbidden Paths" and "Tech Stack" details to prevent agents from using incompatible libraries.
26
-
27
- ## 4. Reliable Edits
28
-
29
- In multi-agent sessions, files can change rapidly.
30
- - Encourage your agents to use `fd-hash-edit`.
31
- - By anchoring edits to specific content hashes, you eliminate the "stale line" problem where an agent overwrites a change made by another agent seconds earlier.
32
-
33
- ## 5. Failure Replay as a Learning Loop
34
-
35
- When a bug is fixed, use the failure replay engine.
36
- - FlowDeck records failure patterns to suggest new policies.
37
- - **Tip**: Regularly review `/fd-dashboard` to see recurring failure zones and add them to `.codebase/CONSTRAINTS.md` to prevent future regressions.
38
-
39
- ## 6. Infrastructure & Environment Health
40
-
41
- Before running a heavy implementation wave (e.g., `/fd-new-feature`):
42
- - Run `/fd-doctor` to ensure all plugins and MCPs are active.
43
- - Check the **Context Window Monitor** in your session logs. If you are above 80% usage, run a checkpoint and start a fresh session to avoid context truncation.
44
-
45
- ---
46
-
47
- ← [Back to Index](index.md)
@@ -1,24 +0,0 @@
1
- ---
2
- description: Initialize a new FlowDeck project — creates .planning/ directory structure
3
- argument-hint: "[project-name]"
4
- ---
5
-
6
- Initialize FlowDeck in the current project directory.
7
-
8
- **What this does:**
9
- 1. Creates `.planning/` directory structure:
10
- - `STATE.md` — current phase and status
11
- - `PROJECT.md` — project overview (you fill this in)
12
- - `phases/` — one subdirectory per roadmap phase
13
- 2. Optionally runs `/fd-map-codebase` to analyze existing code
14
- 3. Guides you to set the initial phase
15
-
16
- **Use this when:** Starting a new feature sprint, onboarding to an existing project, or setting up FlowDeck for the first time.
17
-
18
- **Next step:** Run `/fd-map-codebase` to document the codebase, then `/fd-discuss` to start planning.
19
-
20
- ## What Next?
21
-
22
- 1. **Map codebase** → `/fd-map-codebase`
23
- 2. **Start discussion** → `/fd-discuss`
24
- 3. **View dashboard** → `/fd-dashboard`