@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
@@ -0,0 +1,227 @@
1
+ # Multi-Repo
2
+
3
+ FlowDeck can coordinate changes across multiple repositories in a single session. Each repository is registered with the session, assigned a role, and managed through the `/fd-multi-repo` command. Coordination state is persisted in `.planning/multi-repo/` so sessions can be resumed.
4
+
5
+ ---
6
+
7
+ ## /fd-multi-repo Command
8
+
9
+ The `fd-multi-repo` command is the entry point for all multi-repo operations. It supports four subcommands:
10
+
11
+ | Subcommand | Description |
12
+ |------------|-------------|
13
+ | `fd-multi-repo add <path> [role]` | Register a repository at `<path>` with an optional role |
14
+ | `fd-multi-repo remove <path>` | Unregister a repository |
15
+ | `fd-multi-repo list` | Print all registered repositories and their roles |
16
+ | `fd-multi-repo status` | Show sync state, pending changes, and divergence status |
17
+
18
+ **Roles** classify the repository's purpose in the session:
19
+
20
+ | Role | Meaning |
21
+ |------|---------|
22
+ | `primary` | The main development repository (default for the first added) |
23
+ | `library` | An internal library or shared module |
24
+ | `service` | A microservice or backend API |
25
+ | `frontend` | A frontend application |
26
+ | `config` | A configuration or infrastructure repository |
27
+
28
+ The role determines how FlowDeck routes planning and which agents are responsible for changes to that repo.
29
+
30
+ ### Adding a Repository
31
+
32
+ ```bash
33
+ fd-multi-repo add /home/user/project-lib library
34
+ ```
35
+
36
+ This:
37
+
38
+ 1. Verifies the path exists and is a git repository
39
+ 2. Reads the `flowdeck.json` config if present in that repo
40
+ 3. Records the repo in `.planning/multi-repo/REPOSITORIES.json`
41
+ 4. Runs `/fd-map-codebase` on the new repository to index it into `.codebase/<repo-name>/`
42
+
43
+ ### Removing a Repository
44
+
45
+ ```bash
46
+ fd-multi-repo remove /home/user/project-lib
47
+ ```
48
+
49
+ This removes the repository from `REPOSITORIES.json` and deletes its `.codebase/<repo-name>/` index. It does not delete any files.
50
+
51
+ ---
52
+
53
+ ## Coordination State
54
+
55
+ All multi-repo state lives under `.planning/multi-repo/`:
56
+
57
+ ```
58
+ .planning/multi-repo/
59
+ REPOSITORIES.json — registered repos, roles, paths
60
+ CHANGES.json — pending cross-repo changes
61
+ DEPENDENCIES.json — dependency graph between repos
62
+ SYNC.json — sync status and divergence flags
63
+ ```
64
+
65
+ ### REPOSITORIES.json
66
+
67
+ ```json
68
+ {
69
+ "repositories": [
70
+ {
71
+ "name": "flowdeck",
72
+ "path": "/home/user/flowdeck",
73
+ "role": "primary",
74
+ "addedAt": "2026-05-26T08:00:00Z",
75
+ "lastSynced": "2026-05-26T10:00:00Z"
76
+ },
77
+ {
78
+ "name": "flowdeck-lib",
79
+ "path": "/home/user/flowdeck-lib",
80
+ "role": "library",
81
+ "addedAt": "2026-05-26T08:05:00Z",
82
+ "lastSynced": "2026-05-26T09:55:00Z"
83
+ }
84
+ ]
85
+ }
86
+ ```
87
+
88
+ ### CHANGES.json
89
+
90
+ Tracks planned or in-progress changes that span multiple repositories:
91
+
92
+ ```json
93
+ {
94
+ "changes": [
95
+ {
96
+ "id": "ch-001",
97
+ "description": "Add telemetry API to flowdeck-lib",
98
+ "status": "planned",
99
+ "affectedRepos": ["flowdeck-lib", "flowdeck"],
100
+ "planRef": ".planning/PLAN.md#ch-001"
101
+ }
102
+ ]
103
+ }
104
+ ```
105
+
106
+ ### DEPENDENCIES.json
107
+
108
+ Records declared dependencies between repositories (e.g., `flowdeck` imports `flowdeck-lib`):
109
+
110
+ ```json
111
+ {
112
+ "dependencies": [
113
+ {
114
+ "from": "flowdeck",
115
+ "to": "flowdeck-lib",
116
+ "type": "import",
117
+ "files": ["src/lib/telemetry.ts"]
118
+ }
119
+ ]
120
+ }
121
+ ```
122
+
123
+ Dependencies are inferred from import analysis during `/fd-map-codebase` but can be manually overridden in `flowdeck.json`.
124
+
125
+ ---
126
+
127
+ ## Cross-Repo Planning
128
+
129
+ When `/fd-plan` runs in a multi-repo session:
130
+
131
+ 1. The `@planner` agent reads `DISCUSS.md` and `FEATURE.md` as usual
132
+ 2. For each planned task, it checks `DEPENDENCIES.json` to determine which repository the task belongs to
133
+ 3. Tasks are organized by repository, then by wave within each repository
134
+ 4. Tasks that span multiple repositories (e.g., adding an API to a library and updating callers in the primary) are marked as **cross-repo tasks** and placed in a shared wave
135
+
136
+ **Cross-repo wave execution:**
137
+
138
+ ```
139
+ Wave 1 (parallel across repos)
140
+ ├── [flowdeck-lib] Task 1a: Add telemetry API → @coder (flowdeck-lib)
141
+ └── [flowdeck] Task 1b: Update telemetry callers → @coder (flowdeck)
142
+
143
+ Wave 2 (sequential, primary waits for library)
144
+ └── [flowdeck] Task 2a: Run integration tests → @tester
145
+ ```
146
+
147
+ The orchestrator enforces that all tasks in Wave 1 complete before Wave 2 begins, even across repositories.
148
+
149
+ ---
150
+
151
+ ## Cross-Repo Execution
152
+
153
+ During `/fd-execute`, the orchestrator:
154
+
155
+ 1. Iterates through waves
156
+ 2. For each wave, dispatches tasks to their target repositories in parallel
157
+ 3. Each agent operates in its assigned repository's working directory
158
+ 4. The `DEADLOCK_SIGNALS.jsonl` from each repository is aggregated into the primary repo's `.codebase/`
159
+ 5. If a task in one repository depends on output from another, the orchestrator waits for the source task to complete first
160
+
161
+ ### File Coordination
162
+
163
+ When a change in one repository depends on a change in another:
164
+
165
+ - The dependency is declared in `DEPENDENCIES.json`
166
+ - The planner ensures the source task runs before the dependent task
167
+ - If both repos are on the same filesystem, FlowDeck uses absolute paths
168
+ - If repos are on different machines, FlowDeck uses git worktree references or suggests a shared git remote
169
+
170
+ ---
171
+
172
+ ## Multi-Repo State Sync
173
+
174
+ Use `fd-multi-repo status` to see the current state:
175
+
176
+ ```
177
+ fd-multi-repo status
178
+
179
+ Repository: flowdeck (primary)
180
+ Path: /home/user/flowdeck
181
+ Role: primary
182
+ Last synced: 2026-05-26 10:00:00
183
+ Status: clean ✓
184
+
185
+ Repository: flowdeck-lib (library)
186
+ Path: /home/user/flowdeck-lib
187
+ Role: library
188
+ Last synced: 2026-05-26 09:55:00
189
+ Status: 2 commits ahead of remote
190
+ Pending:
191
+ - ch-001: Add telemetry API
192
+
193
+ Cross-repo changes:
194
+ ch-001: Add telemetry API to flowdeck-lib
195
+ Status: planned
196
+ Affects: flowdeck-lib, flowdeck
197
+ Blocker: none
198
+ ```
199
+
200
+ ---
201
+
202
+ ## Configuration
203
+
204
+ Declare multi-repo dependencies explicitly in `flowdeck.json` to override inferred dependencies:
205
+
206
+ ```json
207
+ {
208
+ "multiRepo": {
209
+ "repositories": [
210
+ {
211
+ "name": "flowdeck-lib",
212
+ "path": "/home/user/flowdeck-lib",
213
+ "role": "library"
214
+ }
215
+ ],
216
+ "dependencies": [
217
+ {
218
+ "from": "flowdeck",
219
+ "to": "flowdeck-lib",
220
+ "type": "import"
221
+ }
222
+ ]
223
+ }
224
+ }
225
+ ```
226
+
227
+ This is useful when FlowDeck cannot infer dependencies from imports (e.g., binary dependencies, API contracts, or generated files).
@@ -0,0 +1,205 @@
1
+ # Workflows
2
+
3
+ FlowDeck structures every feature through a six-step command cycle. Each step has a clear purpose, produces specific artifacts, and transitions the project state forward.
4
+
5
+ ## The Six-Step Cycle
6
+
7
+ ```
8
+ /fd-map-codebase
9
+
10
+
11
+ /fd-new-feature ─────────────────────────────────────────┐
12
+ │ │
13
+ ▼ │
14
+ /fd-discuss ─────────────────────────────────────────┐ │
15
+ │ │ │
16
+ ▼ │ │
17
+ /fd-plan ─────────────────────────────────────────┐ │ │
18
+ │ │ │ │
19
+ ▼ │ │ │
20
+ /fd-execute ──────────────────────────────────┐ │ │ │
21
+ │ │ │ │ │
22
+ ▼ │ │ │ │
23
+ /fd-verify ───────────────────────────────────┘ │ │ │
24
+ │ │ │
25
+ (loop back to /fd-new-feature) ◄───┘ └───┘
26
+ ```
27
+
28
+ Each command reads the current `STATE.md` and writes updated state when it completes. Use `/fd-checkpoint` at any time to save a mid-session snapshot and `/fd-resume` to restore it in a new session.
29
+
30
+ ---
31
+
32
+ ## /fd-map-codebase
33
+
34
+ **Purpose:** Analyse and index the codebase into structured `.codebase/` files — required before starting any feature.
35
+
36
+ **Files created:**
37
+ - `.codebase/CODEGRAPH.json`
38
+ - `.codebase/CONVENTIONS.md`
39
+ - `.codebase/CODEBASE_INDEX.md`
40
+
41
+ **Step-by-step:**
42
+
43
+ 1. Scan the project files and detect languages, frameworks, and patterns.
44
+ 2. Build a structured dependency graph and write it to `.codebase/CODEGRAPH.json`.
45
+ 3. Extract conventions and write them to `.codebase/CONVENTIONS.md`.
46
+ 4. Write a high-level index to `.codebase/CODEBASE_INDEX.md`.
47
+
48
+ ---
49
+
50
+ ## /fd-new-feature
51
+
52
+ **Purpose:** Define a new feature and initialize its context. Requires codebase mapping (`.codebase/`) to exist.
53
+
54
+ **Files created/modified:**
55
+ - `.planning/FEATURE.md` (created)
56
+ - `.planning/STATE.md` (created if missing, phase updated)
57
+ - `.planning/ROADMAP.md` (feature entry added)
58
+
59
+ **Step-by-step:**
60
+
61
+ 1. Verify `.codebase/` exists — error if not (codebase mapping is required first).
62
+ 2. Initialize `.planning/` and `STATE.md` lazily if they do not exist.
63
+ 3. Parse the feature description from the command argument.
64
+ 4. Create `FEATURE.md` with: feature name, summary, acceptance criteria, estimated complexity, related files.
65
+ 5. Append the feature to `ROADMAP.md` with status `pending`.
66
+ 6. Update `STATE.md` — set `phase: define`, `feature: <name>`, `status: in_progress`.
67
+
68
+ ---
69
+
70
+ ## /fd-discuss
71
+
72
+ **Purpose:** Pre-planning structured Q&A to capture design decisions before a plan is written.
73
+
74
+ **Files created/modified:**
75
+ - `.planning/DISCUSS.md` (created)
76
+ - `.planning/STATE.md` (phase updated)
77
+
78
+ **Step-by-step:**
79
+
80
+ 1. The `@discusser` agent asks a series of targeted questions covering: scope boundaries, edge cases, dependencies, non-functional requirements, and known risks.
81
+ 2. Each answer is recorded in `DISCUSS.md` under a corresponding heading.
82
+ 3. The `@risk-analyst` agent reviews the Q&A log and adds a risk summary section.
83
+ 4. `STATE.md` is updated — set `phase: discuss`, `status: ready_to_plan`.
84
+
85
+ The output of `/fd-discuss` is a signed decision log that the planner treats as authoritative input.
86
+
87
+ ---
88
+
89
+ ## /fd-plan
90
+
91
+ **Purpose:** Build a wave-structured execution plan from the discuss decisions.
92
+
93
+ **Files created/modified:**
94
+ - `.planning/PLAN.md` (created)
95
+ - `.planning/STATE.md` (phase updated)
96
+
97
+ **Step-by-step:**
98
+
99
+ 1. The `@planner` agent reads `DISCUSS.md`, `FEATURE.md`, and `PROJECT.md`.
100
+ 2. It breaks the feature into **waves** — groups of tasks that can run in parallel within a wave, with waves ordered sequentially.
101
+ 3. Each task records: description, responsible agent, files affected, rollback plan, and dependencies.
102
+ 4. The plan is written to `PLAN.md`.
103
+ 5. The user reviews the plan. Typing `CONFIRM` (case-insensitive) proceeds to execution; anything else aborts.
104
+ 6. `STATE.md` is updated — set `phase: plan_confirmed`, `status: ready_to_execute`.
105
+
106
+ Wave-structured planning prevents agents from blocking on tasks that could run in parallel. Wave 1 tasks that are independent run simultaneously. Wave 2 does not start until all Wave 1 tasks are complete.
107
+
108
+ ---
109
+
110
+ ## /fd-execute
111
+
112
+ **Purpose:** Implement the feature following TDD discipline, with parallel agent delegation.
113
+
114
+ **Files created/modified:**
115
+ - Implementation files (modified)
116
+ - `.planning/STATE.md` (phase updated)
117
+ - `.planning/PLAN.md` (tasks marked complete)
118
+
119
+ **Step-by-step:**
120
+
121
+ 1. The `@orchestrator` reads `PLAN.md` and iterates through waves.
122
+ 2. For each wave, it calls `run-pipeline` or `delegate` to invoke specialist agents in parallel:
123
+ - `@architect` — validates structural decisions before coding
124
+ - `@coder` — writes implementation following TDD (red/green/refactor)
125
+ - `@tester` — writes and runs tests alongside each implementation task
126
+ - `@reviewer` — reviews each completed task
127
+ 3. Each agent writes its output to the implementation files and updates `PLAN.md`.
128
+ 4. Governance hooks run after every tool execution — patch trust scoring, budget tracking, and deadlock detection.
129
+ 5. `STATE.md` is updated — set `phase: execute`, `status: in_progress`. On full completion, set `status: complete`.
130
+
131
+ If the deadlock detector triggers, execution pauses and the user is notified with the bounce signal.
132
+
133
+ ---
134
+
135
+ ## /fd-verify
136
+
137
+ **Purpose:** Full verification pipeline — tests, code review, security scan, and deploy check.
138
+
139
+ **Files created/modified:**
140
+ - Verification reports (printed to console)
141
+ - `.planning/STATE.md` (phase updated)
142
+ - `.codebase/SCORECARDS.jsonl` (new scorecard entry)
143
+
144
+ **Step-by-step:**
145
+
146
+ 1. Run the full test suite — `@tester` executes all test commands.
147
+ 2. Run `@reviewer` on every changed file since the last phase.
148
+ 3. Run `@policy-enforcer` to validate architectural constraint compliance.
149
+ 4. Run security scan (if configured) and deploy check (if configured).
150
+ 5. Compute and print the Workflow Scorecard (10 dimensions).
151
+ 6. Write a scorecard entry to `.codebase/SCORECARDS.jsonl`.
152
+ 7. Update `STATE.md` — set `phase: verify`, `status: verified` or `status: issues_found`.
153
+ 8. If issues are found, the user decides whether to loop back to `/fd-execute` or fix manually.
154
+
155
+ ---
156
+
157
+ ## State Transition Table
158
+
159
+ The following table shows how the key fields in `STATE.md` change at each phase:
160
+
161
+ | Field | `/fd-map-codebase` | `/fd-new-feature` | `/fd-discuss` | `/fd-plan` | `/fd-execute` | `/fd-verify` |
162
+ |-------|--------------------|-------------------|---------------|------------|---------------|--------------|
163
+ | `phase` | — | `define` | `discuss` | `plan_confirmed` | `execute` | `verify` |
164
+ | `status` | — | `in_progress` | `ready_to_plan` | `ready_to_execute` | `in_progress` → `complete` | `verified` |
165
+ | `feature` | — | set | — | — | — | — |
166
+ | `planConfirmed` | — | — | — | `true` | — | — |
167
+ | `checkpoint` | — | — | — | — | on `/fd-checkpoint` | — |
168
+
169
+ ---
170
+
171
+ ## Wave-Structured Execution
172
+
173
+ Wave structure is the mechanism that makes parallel execution safe.
174
+
175
+ ```
176
+ Wave 1 (parallel)
177
+ ├── Task 1a: Write user model → @coder
178
+ ├── Task 1b: Write auth service → @coder
179
+ └── Task 1c: Write user tests → @tester
180
+
181
+ Wave 2 (parallel, starts after all Wave 1 tasks complete)
182
+ ├── Task 2a: Integrate auth → @coder
183
+ └── Task 2b: Write integration → @tester
184
+ tests
185
+
186
+ Wave 3 (sequential)
187
+ └── Task 3a: Deploy configuration → @architect
188
+ ```
189
+
190
+ Dependencies between waves are explicit. Tasks within a wave are independent — no task in Wave 1 depends on another task in Wave 1. This maximizes parallelism while preserving ordering guarantees.
191
+
192
+ The orchestrator enforces wave ordering. It will not dispatch Wave 2 tasks until all Wave 1 tasks report completion. If a Wave 1 task fails, the orchestrator reports the failure and stops — Wave 2 is not entered.
193
+
194
+ ---
195
+
196
+ ## Mid-Session Checkpointing
197
+
198
+ Any step can be paused and resumed:
199
+
200
+ ```bash
201
+ /fd-checkpoint # Save current STATE.md snapshot
202
+ /fd-resume # Reload latest checkpoint and continue
203
+ ```
204
+
205
+ Checkpoints are written to `.planning/STATE.md`. The `/fd-resume` command reloads `STATE.md` and `PLAN.md` (if present) and reinitializes the context for the next phase step.
@@ -0,0 +1,208 @@
1
+ # Configuration
2
+
3
+ FlowDeck is configured via the OpenCode configuration file at `~/.config/opencode/opencode.json` (or `$OPENCODE_CONFIG_DIR/opencode.json`). This file is managed by FlowDeck's `postinstall` script — the plugin is registered automatically when you install FlowDeck.
4
+
5
+ > **Note:** FlowDeck uses `opencode.json` (OpenCode's global config), not `flowdeck.json`. This page documents the schema understood by FlowDeck's plugin layer.
6
+
7
+ ---
8
+
9
+ ## Top-Level Schema
10
+
11
+ ```json
12
+ {
13
+ "agents": { ... },
14
+ "governance": { ... },
15
+ "model_profile": "balanced",
16
+ "tdd_enforced": false,
17
+ "approval_required": false,
18
+ "volatility_threshold": 0.5,
19
+ "default_agent": "orchestrator"
20
+ }
21
+ ```
22
+
23
+ All keys are optional unless noted.
24
+
25
+ ---
26
+
27
+ ## `agents` — Per-Agent Model Override
28
+
29
+ > **Default:** every agent inherits the active OpenCode model.
30
+
31
+ Override the model for specific agents when you want a cheaper or more capable model for particular roles (e.g., a fast model for summarization, Opus for complex planning).
32
+
33
+ ```json
34
+ {
35
+ "agents": {
36
+ "planner": { "model": "anthropic/claude-opus-4" },
37
+ "architect": { "model": "anthropic/claude-opus-4" },
38
+ "reviewer": { "model": "openai/gpt-4o-mini" },
39
+ "tester": { "model": "anthropic/claude-sonnet-4" },
40
+ "debugger": { "model": "openai/gpt-4o-mini" }
41
+ }
42
+ }
43
+ ```
44
+
45
+ | Field | Type | Description |
46
+ |-------|------|-------------|
47
+ | `model` | string | Full model spec in `provider/model` format. Examples: `anthropic/claude-opus-4`, `openai/gpt-4o-mini`, `google/gemini-2.5-pro` |
48
+
49
+ ---
50
+
51
+ ## `governance` — Runtime Safety Services
52
+
53
+ FlowDeck's governance layer validates multi-agent execution. Each service can be toggled independently.
54
+
55
+ ```json
56
+ {
57
+ "governance": {
58
+ "validator": {
59
+ "mode": "advisory"
60
+ },
61
+ "delegationBudget": {
62
+ "maxToolCalls": 200,
63
+ "maxDepth": 8,
64
+ "maxSameStepRetries": 3
65
+ },
66
+ "deadlockDetection": {
67
+ "enabled": true,
68
+ "bounceThreshold": 3,
69
+ "autoStop": false
70
+ },
71
+ "scorecard": {
72
+ "enabled": true
73
+ },
74
+ "agentContractRegistry": {
75
+ "contracts": {}
76
+ }
77
+ }
78
+ }
79
+ ```
80
+
81
+ ### `validator` — Agent Validation Mode
82
+
83
+ | Mode | Description |
84
+ |------|-------------|
85
+ | `off` | No validation performed |
86
+ | `advisory` | Logs violations; does not block execution |
87
+ | `strict` | Blocks agent actions that violate their capability contract |
88
+
89
+ In `advisory` mode, a violation produces a warning in the session log:
90
+ ```
91
+ [flowdeck/validator] Agent 'coder' called forbidden tool 'deleteFile'
92
+ ```
93
+
94
+ ### `delegationBudget` — Per-Run Resource Limits
95
+
96
+ | Field | Type | Description |
97
+ |-------|------|-------------|
98
+ | `maxToolCalls` | number | Maximum tool calls per agent invocation |
99
+ | `maxDepth` | number | Maximum delegation chain depth (e.g., orchestrator → architect → coder is depth 2) |
100
+ | `maxSameStepRetries` | number | Maximum retries when an agent is stuck on the same step |
101
+
102
+ ### `deadlockDetection` — Loop and Stall Detection
103
+
104
+ | Field | Type | Description |
105
+ |-------|------|-------------|
106
+ | `enabled` | boolean | Enable deadlock/loop detection |
107
+ | `bounceThreshold` | number | Number of same-task bounces before flagging as a potential loop |
108
+ | `autoStop` | boolean | If `true`, stops execution when a deadlock is detected |
109
+
110
+ Deadlock signals are written to `.codebase/DEADLOCK_SIGNALS.jsonl`.
111
+
112
+ ### `scorecard` — Workflow Quality Recording
113
+
114
+ | Field | Type | Description |
115
+ |-------|------|-------------|
116
+ | `enabled` | boolean | Enable 10-dimension workflow quality scorecard |
117
+
118
+ Scorecards are written to `.codebase/SCORECARDS.jsonl` after each run. Dimensions include TDD adherence, design-first completion, approval rate, and budget efficiency.
119
+
120
+ ### `agentContractRegistry` — Agent Capability Contracts
121
+
122
+ Defines per-agent allowed/forbidden tools, required inputs, and success criteria.
123
+
124
+ ```json
125
+ {
126
+ "governance": {
127
+ "agentContractRegistry": {
128
+ "contracts": {
129
+ "coder": {
130
+ "allowedTools": ["Read", "Edit", "Bash", "WebSearch"],
131
+ "forbiddenTools": ["Write"],
132
+ "requires": ["task_description"],
133
+ "successCriteria": ["compiles", "tests_pass"]
134
+ }
135
+ }
136
+ }
137
+ }
138
+ }
139
+ ```
140
+
141
+ ---
142
+
143
+ ## `model_profile` — Context Window Balance
144
+
145
+ Controls how FlowDeck balances token usage vs. thoroughness.
146
+
147
+ | Value | Description |
148
+ |-------|-------------|
149
+ | `balanced` | Default. Moderate context usage. Good for most workflows. |
150
+ | `fast` | Prioritizes low token usage. Use for simple, well-understood tasks. |
151
+ | `thorough` | Maximizes context usage. Use for complex multi-file refactors or unfamiliar codebases. |
152
+
153
+ ---
154
+
155
+ ## `tdd_enforced` — Test-Driven Development Enforcement
156
+
157
+ > **Default:** `false`
158
+
159
+ When `true`, FlowDeck agents will enforce TDD discipline: failing tests must be written before any implementation code is added. The `reviewer` agent will flag any implementation that is not preceded by a failing test.
160
+
161
+ ---
162
+
163
+ ## `approval_required` — Phase Approval Gates
164
+
165
+ > **Default:** `false`
166
+
167
+ When `true`, FlowDeck will pause at each phase boundary and require explicit user approval before proceeding. Useful for high-stakes changes where you want to review plan output before execution begins.
168
+
169
+ ---
170
+
171
+ ## `volatility_threshold` — Risk Scoring Cutoff
172
+
173
+ > **Default:** `0.5` | **Range:** `0.0` – `1.0`
174
+
175
+ Used by FlowDeck's AI safety layer to determine when a change is considered "volatile" (high risk of regression). Changes with a volatility score above this threshold are flagged or blocked depending on governance mode.
176
+
177
+ - `0.0` — everything is flagged as volatile
178
+ - `1.0` — nothing is flagged (effectively disabled)
179
+ - `0.3` — conservative; flags many changes
180
+ - `0.7` — permissive; only flags obviously risky changes
181
+
182
+ ---
183
+
184
+ ## `default_agent` — Default Dispatch Target
185
+
186
+ > **Default:** `orchestrator`
187
+
188
+ Sets the agent that receives commands when no explicit agent is specified. The `orchestrator` coordinates sub-agents and is the appropriate default for most workflows.
189
+
190
+ ```json
191
+ {
192
+ "default_agent": "orchestrator"
193
+ }
194
+ ```
195
+
196
+ Other valid targets include `planner`, `architect`, `coder`, `reviewer`, `tester`, `debugger`, `risk-analyst`, and `policy-enforcer`.
197
+
198
+ ---
199
+
200
+ ## Environment Variables
201
+
202
+ FlowDeck reads the following environment variables:
203
+
204
+ | Variable | Default | Description |
205
+ |----------|---------|-------------|
206
+ | `OPENCODE_CONFIG_DIR` | `~/.config/opencode` | OpenCode configuration directory |
207
+ | `XDG_CONFIG_HOME` | `~/.config` | XDG Base Directory, used to derive `OPENCODE_CONFIG_DIR` |
208
+ | `FLOWDECK_CONTEXT_LIMIT` | `200000` | Context window token limit for context monitor warnings |