@dv.nghiem/flowdeck 0.3.9 → 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 (124) hide show
  1. package/README.md +13 -21
  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 +1 -2
  9. package/dist/hooks/compaction-hook.d.ts.map +1 -1
  10. package/dist/hooks/file-tracker.d.ts +6 -0
  11. package/dist/hooks/file-tracker.d.ts.map +1 -1
  12. package/dist/hooks/notifications.d.ts.map +1 -1
  13. package/dist/hooks/session-start.d.ts.map +1 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +742 -794
  16. package/dist/lib/completion-validator.d.ts +51 -0
  17. package/dist/lib/completion-validator.d.ts.map +1 -0
  18. package/dist/lib/recommended-question.d.ts +24 -0
  19. package/dist/lib/recommended-question.d.ts.map +1 -0
  20. package/dist/lib/research-gate.d.ts +97 -0
  21. package/dist/lib/research-gate.d.ts.map +1 -0
  22. package/dist/lib/research-gate.test.d.ts +2 -0
  23. package/dist/lib/research-gate.test.d.ts.map +1 -0
  24. package/dist/mcp/index.d.ts +12 -2
  25. package/dist/mcp/index.d.ts.map +1 -1
  26. package/dist/services/codegraph.d.ts +36 -0
  27. package/dist/services/codegraph.d.ts.map +1 -0
  28. package/dist/services/codegraph.test.d.ts +2 -0
  29. package/dist/services/codegraph.test.d.ts.map +1 -0
  30. package/dist/services/question-guard.d.ts +4 -0
  31. package/dist/services/question-guard.d.ts.map +1 -1
  32. package/dist/services/recommended-question.test.d.ts +2 -0
  33. package/dist/services/recommended-question.test.d.ts.map +1 -0
  34. package/dist/services/supervisor-binding.d.ts +3 -1
  35. package/dist/services/supervisor-binding.d.ts.map +1 -1
  36. package/dist/tools/codebase-index.d.ts +30 -0
  37. package/dist/tools/codebase-index.d.ts.map +1 -0
  38. package/dist/tools/codebase-index.test.d.ts +2 -0
  39. package/dist/tools/codebase-index.test.d.ts.map +1 -0
  40. package/dist/tools/codegraph-tool.d.ts +3 -0
  41. package/dist/tools/codegraph-tool.d.ts.map +1 -0
  42. package/dist/tools/planning-state-lib.d.ts +23 -0
  43. package/dist/tools/planning-state-lib.d.ts.map +1 -1
  44. package/docs/agents/index.md +154 -0
  45. package/docs/commands/fd-ask.md +71 -39
  46. package/docs/commands/fd-checkpoint.md +63 -8
  47. package/docs/commands/fd-deploy-check.md +166 -9
  48. package/docs/commands/fd-design.md +101 -0
  49. package/docs/commands/fd-discuss.md +87 -20
  50. package/docs/commands/fd-doctor.md +100 -13
  51. package/docs/commands/fd-done.md +215 -0
  52. package/docs/commands/fd-execute.md +104 -0
  53. package/docs/commands/fd-fix-bug.md +144 -24
  54. package/docs/commands/fd-map-codebase.md +85 -21
  55. package/docs/commands/fd-multi-repo.md +155 -40
  56. package/docs/commands/fd-new-feature.md +63 -19
  57. package/docs/commands/fd-plan.md +80 -27
  58. package/docs/commands/fd-quick.md +143 -29
  59. package/docs/commands/fd-reflect.md +81 -13
  60. package/docs/commands/fd-resume.md +65 -8
  61. package/docs/commands/fd-status.md +80 -12
  62. package/docs/commands/fd-suggest.md +114 -0
  63. package/docs/commands/fd-translate-intent.md +69 -9
  64. package/docs/commands/fd-verify.md +71 -14
  65. package/docs/commands/fd-write-docs.md +121 -8
  66. package/docs/concepts/architecture.md +163 -0
  67. package/docs/concepts/governance.md +242 -0
  68. package/docs/concepts/intelligence.md +145 -0
  69. package/docs/concepts/multi-repo.md +227 -0
  70. package/docs/concepts/workflows.md +205 -0
  71. package/docs/configuration/index.md +208 -0
  72. package/docs/configuration/opencode-settings.md +98 -0
  73. package/docs/getting-started/first-project.md +126 -0
  74. package/docs/getting-started/installation.md +73 -0
  75. package/docs/getting-started/quick-start.md +74 -0
  76. package/docs/index.md +36 -72
  77. package/docs/reference/hooks.md +176 -0
  78. package/docs/reference/rules.md +109 -0
  79. package/docs/skills/code-review.md +47 -0
  80. package/docs/skills/index.md +148 -0
  81. package/docs/skills/planning.md +39 -0
  82. package/package.json +1 -1
  83. package/src/commands/fd-discuss.md +74 -10
  84. package/src/commands/fd-done.md +196 -0
  85. package/src/commands/fd-execute.md +43 -6
  86. package/src/commands/fd-fix-bug.md +43 -6
  87. package/src/commands/fd-map-codebase.md +99 -19
  88. package/src/commands/fd-new-feature.md +14 -5
  89. package/src/commands/fd-plan.md +38 -1
  90. package/src/commands/fd-quick.md +1 -1
  91. package/src/commands/fd-resume.md +1 -1
  92. package/src/commands/fd-status.md +1 -1
  93. package/src/commands/fd-verify.md +16 -2
  94. package/src/commands/fd-write-docs.md +30 -5
  95. package/src/skills/context-load/SKILL.md +1 -1
  96. package/dist/hooks/memory-hook.d.ts +0 -28
  97. package/dist/hooks/memory-hook.d.ts.map +0 -1
  98. package/dist/services/memory-store.d.ts +0 -73
  99. package/dist/services/memory-store.d.ts.map +0 -1
  100. package/dist/services/memory-store.test.d.ts +0 -2
  101. package/dist/services/memory-store.test.d.ts.map +0 -1
  102. package/dist/tools/memory-search.d.ts +0 -3
  103. package/dist/tools/memory-search.d.ts.map +0 -1
  104. package/dist/tools/memory-status.d.ts +0 -3
  105. package/dist/tools/memory-status.d.ts.map +0 -1
  106. package/docs/USER_GUIDE.md +0 -20
  107. package/docs/agents.md +0 -544
  108. package/docs/best-practices.md +0 -47
  109. package/docs/commands/fd-new-project.md +0 -24
  110. package/docs/commands.md +0 -557
  111. package/docs/configuration.md +0 -325
  112. package/docs/design-first-workflow.md +0 -94
  113. package/docs/feature-integration-architecture.md +0 -227
  114. package/docs/installation.md +0 -123
  115. package/docs/intelligence.md +0 -370
  116. package/docs/memory.md +0 -69
  117. package/docs/multi-repo.md +0 -201
  118. package/docs/notifications.md +0 -170
  119. package/docs/optimization-baseline.md +0 -21
  120. package/docs/quick-start.md +0 -197
  121. package/docs/rules.md +0 -432
  122. package/docs/skills.md +0 -417
  123. package/docs/workflows.md +0 -134
  124. package/src/commands/fd-new-project.md +0 -114
@@ -1,51 +1,83 @@
1
- ---
2
- description: Smart dispatch — routes a free-form task to the appropriate specialized agent without requiring a workflow
3
- argument-hint: "--task '<description>'"
4
- ---
1
+ # /fd-ask
5
2
 
6
- Route a free-form task to the best specialized agent automatically.
3
+ **Purpose:** Smart agent dispatch — routes a focused question to the appropriate specialist.
7
4
 
8
- **What this does:**
9
- 1. Parses your task description using keyword scoring
10
- 2. Picks the best-fit agent from 12 specialists
11
- 3. Runs the Impact Radar if the task involves change analysis
12
- 4. Dispatches the task directly — no workflow, no STATE.md required
5
+ ## Usage
13
6
 
14
- **Routing table:**
7
+ /fd-ask [question]
15
8
 
16
- | Keywords | Agent |
17
- |---|---|
18
- | design, architecture, component | `@architect` |
19
- | impact, blast radius, affected | `@researcher` + radar |
20
- | security, vulnerability, CVE | `@security-auditor` |
21
- | performance, bottleneck, slow | `@performance-optimizer` |
22
- | debug, error, crash, exception | `@debug-specialist` |
23
- | test, coverage, spec, TDD | `@tester` |
24
- | refactor, cleanup, simplify | `@backend-coder` / `@frontend-coder` / `@devops` |
25
- | document, docs, README | `@writer` |
26
- | explain, query, find, explore | `@code-explorer` |
27
- | deploy, release, migration | `@devops` |
28
- | plan, roadmap, breakdown | `@planner` |
29
- | (anything else) | `@orchestrator` |
9
+ ## Arguments
30
10
 
31
- **Examples:**
11
+ - `question` — the question to route to a specialist agent
32
12
 
13
+ ## What Happens
14
+
15
+ Analyze the question to determine the best specialist from this routing table:
16
+
17
+ | Keywords / Topic | Agent |
18
+ |-----------------|-------|
19
+ | ui, ux, wireframe, landing page, dashboard, admin panel, app screen, design system | **@design** |
20
+ | design, architecture, structure, system, component, API | **@architect** |
21
+ | security, auth, vulnerability, token, permission, injection | **@security-auditor** |
22
+ | performance, speed, slow, optimize, latency, cache, memory | **@performance** |
23
+ | impact, change, affect, downstream, dependency, blast | **@researcher** (impact mode) |
24
+ | test, coverage, regression, tdd, gap | **@tester** |
25
+ | bug, error, crash, debug, trace | **@debug-specialist** |
26
+ | general / unclear | **@orchestrator** |
27
+
28
+ Once the specialist is identified:
29
+ 1. Delegate the question to that specialist with full context
30
+ 2. Include `.codebase/ARCHITECTURE.md` if available and relevant
31
+ 3. Include `.planning/STATE.md` phase context if relevant
32
+ 4. Return the specialist's answer directly
33
+
34
+ ## Output / State
35
+
36
+ Present the answer clearly with:
37
+ - Which specialist answered
38
+ - The answer (no padding, no ceremony)
39
+ - Any follow-up suggestions if the question opens further threads
40
+
41
+ ## Examples
42
+
43
+ **Ask an architecture question:**
44
+ ```
45
+ /fd-ask "What is the best way to structure a new API endpoint?"
46
+ ```
47
+ Routes to: @architect
48
+
49
+ **Ask a security question:**
33
50
  ```
34
- /fd-ask --task "system design for a real-time notification service"
35
- /fd-ask --task "explain how the payment flow works"
36
- /fd-ask --task "is there a security issue with the rate limiter"
37
- /fd-ask --task "why is the login endpoint slow"
38
- /fd-ask --task "what files are affected if I change the auth module"
39
- /fd-ask --task "write tests for the checkout service"
40
- /fd-ask --agent security-auditor --task "review the JWT implementation"
51
+ /fd-ask "How should we handle token expiration securely?"
41
52
  ```
53
+ Routes to: @security-auditor
42
54
 
43
- **Override routing:** Use `--agent` to force a specific agent.
55
+ **Ask about performance:**
56
+ ```
57
+ /fd-ask "Why is the login page slow on mobile?"
58
+ ```
59
+ Routes to: @performance
60
+
61
+ **Ask about a bug:**
62
+ ```
63
+ /fd-ask "Why does the session timeout error appear randomly?"
64
+ ```
65
+ Routes to: @debug-specialist
44
66
 
45
- ## What Next?
67
+ **Ask about test coverage:**
68
+ ```
69
+ /fd-ask "What parts of the auth module are not tested?"
70
+ ```
71
+ Routes to: @tester
72
+
73
+ **Ask about UI design:**
74
+ ```
75
+ /fd-ask "Should the dashboard use tabs or a sidebar for navigation?"
76
+ ```
77
+ Routes to: @design
46
78
 
47
- After `/fd-ask` completes, you can go deeper:
79
+ ## Related Commands
48
80
 
49
- 1. **Full workflow** → `/fd-fix-bug`, `/fd-new-feature`, `/fd-verify`
50
- 2. **Detailed planning** → `/fd-discuss`, `/fd-plan`
51
- 3. **Another question** → `/fd-ask --task '...'`
81
+ - `/fd-discuss` — structured exploration of a topic with multiple questions
82
+ - `/fd-suggest` — get feature recommendations
83
+ - `/fd-translate-intent` convert a vague request into concrete options
@@ -1,10 +1,65 @@
1
- ---
2
- description: Save current state to STATE.md — safe to close session after this
3
- ---
4
- Run the FlowDeck checkpoint command to save the current project state.
1
+ # /fd-checkpoint
5
2
 
6
- ## What Next?
3
+ **Purpose:** Force-save mid-session checkpoint to STATE.md and write a CHECKPOINT.md summary — safe to close the session and resume later with `/fd-resume`.
7
4
 
8
- 1. **Continue working** → `/fd-new-feature [description]`
9
- 2. **View progress** → `/fd-progress`
10
- 3. **Check dashboard** → `/fd-dashboard`
5
+ ## Usage
6
+
7
+ /fd-checkpoint
8
+
9
+ ## What Happens
10
+
11
+ 1. **Pre-flight check.**
12
+ - Verify `.planning/STATE.md` exists — error if not found ("No active project to checkpoint.")
13
+
14
+ 2. **Read current STATE.md.** Parse phase, status, steps_complete, and other tracked fields.
15
+
16
+ 3. **Update STATE.md.**
17
+ - Set `last_updated` to current timestamp
18
+ - Ensure `status` reflects current state accurately
19
+ - Scan `.planning/phases/phase-<N>/PLAN.md` for completed steps and update `steps_complete` if tracked
20
+
21
+ 4. **Write CHECKPOINT.md.** Creates `.planning/phases/phase-<N>/CHECKPOINT.md`:
22
+
23
+ ```markdown
24
+ # Checkpoint
25
+
26
+ **Saved:** <timestamp>
27
+ **Phase:** <N>
28
+ **Status:** <status>
29
+ **Plan confirmed:** <yes/no>
30
+
31
+ ## What was done
32
+
33
+ <brief summary of recent changes in this session>
34
+
35
+ ## What's next
36
+
37
+ <next uncompleted step from PLAN.md, or "No plan active">
38
+ ```
39
+
40
+ 5. **Report.** Present checkpoint summary including phase, status, file path, and the `/fd-resume` command.
41
+
42
+ ## Output / State
43
+
44
+ Files created:
45
+ - `.planning/phases/phase-<N>/CHECKPOINT.md`
46
+
47
+ STATE.md updates:
48
+ ```yaml
49
+ last_updated: "<timestamp>"
50
+ status: <current status>
51
+ steps_complete: [1, 2, ...] # if tracked in PLAN.md
52
+ ```
53
+
54
+ ## Examples
55
+
56
+ ```
57
+ /fd-checkpoint
58
+ ```
59
+
60
+ Save a checkpoint for the current session. Safe to close afterward.
61
+
62
+ ## Related Commands
63
+
64
+ - `/fd-resume` — reload the checkpointed state and continue
65
+ - `/fd-map-codebase` — map the codebase (required before starting a feature)
@@ -1,11 +1,168 @@
1
- ---
2
- description: Pre-deploy check — parallel tester + reviewer + CVE scan — orchestrator go/no-go decision
3
- ---
4
- Run the FlowDeck deploy-check workflow before deploying to production.
1
+ # /fd-deploy-check
5
2
 
6
- ## What Next?
3
+ **Purpose:** Pre-deploy safety check with test, security, and build verification.
7
4
 
8
- 1. **Fix blocking issues** → `/fd-fix-bug [issue]`
9
- 2. **Create deployment checkpoint** → `/fd-checkpoint`
10
- 3. **Review code again** → `/fd-verify`
11
- 4. **View project roadmap** → `/fd-roadmap`
5
+ ## Usage
6
+
7
+ /fd-deploy-check [--env=staging|production] [--check=deploy,review,analysis] [--scope=path]
8
+
9
+ ## Arguments
10
+
11
+ - `--env=staging|production` (optional) — target environment
12
+ - `--check=deploy|review|analysis` (optional) — type of check to run
13
+ - `deploy` (default): full pre-deployment suite
14
+ - `review`: parallel reviewer + researcher + tester on changed files
15
+ - `analysis`: comprehensive pre-change analysis
16
+ - `--scope=path` (optional) — limit scope to specific files or directories
17
+
18
+ ## What Happens
19
+
20
+ ### Deploy Check (`--check=deploy` or default)
21
+
22
+ **Step 1: Parallel Checks**
23
+
24
+ Launch four checks simultaneously:
25
+
26
+ - **Check A: Test Suite (@tester)** — runs `npm test`. All tests must pass.
27
+ - **Check B: Security Scan (@security-auditor)** — checks for hardcoded secrets, input validation at trust boundaries, auth/authz on protected routes, no CRITICAL/HIGH vulnerabilities.
28
+ - **Check C: Dependency CVE Audit** — runs `npm audit --audit-level=high`. No HIGH/CRITICAL CVEs unaddressed.
29
+ - **Check D: Build Verification** — runs `npm run build`. Build must succeed with zero errors.
30
+ - **Check E: Code Review (@reviewer)** (parallel) — security review, quality review, TDD discipline check.
31
+
32
+ **Step 2: Aggregate Results**
33
+
34
+ ```
35
+ ## Pre-Deployment Check
36
+
37
+ | Check | Status | Details |
38
+ |-------|--------|---------|
39
+ | Tests | ✅ PASS / ❌ FAIL | N/N passed |
40
+ | Security | ✅ PASS / ❌ FAIL | [findings] |
41
+ | CVE Audit | ✅ PASS / ❌ FAIL | [vulnerabilities] |
42
+ | Build | ✅ PASS / ❌ FAIL | [errors] |
43
+ ```
44
+
45
+ **Step 3: Go/No-Go Decision**
46
+
47
+ - **🚀 GO** — all checks pass, proceed with deployment.
48
+ - **🛑 NO-GO** — one or more checks failed. Report required fixes.
49
+
50
+ ### Code Review (`--check=review`)
51
+
52
+ **Step 4-5: Scope and Parallel Review**
53
+
54
+ Determine scope (files changed since last commit or provided scope). Spawn three agents in parallel:
55
+ - **@reviewer** — security, quality, conventions review
56
+ - **@researcher** — best practices lookup, vulnerability context
57
+ - **@tester** — coverage check, untested paths, run existing tests
58
+
59
+ **Step 6: Aggregate Review Results**
60
+
61
+ ```
62
+ ## Code Review: <scope>
63
+
64
+ ### 🔴 CRITICAL (block merge)
65
+ - [finding with file:line and fix]
66
+
67
+ ### 🟠 HIGH (strongly recommend fix)
68
+ - [finding]
69
+
70
+ ### 🟡 MEDIUM (consider fixing)
71
+ - [finding]
72
+
73
+ ### 🟢 LOW (optional)
74
+ - [finding]
75
+
76
+ ### Coverage
77
+ - Changed files: N%
78
+ - Untested paths: [list]
79
+
80
+ ### Verdict: PASS | FAIL | PASS_WITH_NOTES
81
+ ```
82
+
83
+ ### Pre-Change Analysis (`--check=analysis`)
84
+
85
+ **Step 7: Run All Analyses in Parallel**
86
+
87
+ 1. **Impact Radar** — which files/APIs/tests are affected
88
+ 2. **Blast Radius** — downstream consequences and hidden couplings
89
+ 3. **Regression Predict** — most likely regression categories
90
+ 4. **Test Gap** — coverage gaps to fill before implementing
91
+ 5. **Volatility** — check hotspot scores on affected files
92
+ 6. **Review Route** — who should review this change
93
+
94
+ ```
95
+ ════════════════════════════════════════════════════
96
+ PRE-CHANGE ANALYSIS: "$ARGUMENTS"
97
+ ════════════════════════════════════════════════════
98
+
99
+ IMPACT (<N> files affected)
100
+ - <top 5 affected files with reason>
101
+
102
+ BLAST RADIUS (risk: <low|medium|high>)
103
+ - <key downstream risks>
104
+
105
+ REGRESSIONS (top 3 risks)
106
+ 🔴 <category> — <reason>
107
+ 🟠 <category> — <reason>
108
+
109
+ TEST GAPS (<N> gaps found)
110
+ - CRITICAL: <gap>
111
+ - HIGH: <gap>
112
+
113
+ VOLATILITY
114
+ Hot zones touched: <list or "none">
115
+
116
+ REVIEW ROUTING
117
+ → <reviewer type> (<reason>)
118
+
119
+ ────────────────────────────────────────────────────
120
+ RECOMMENDATION: <proceed | add tests first | redesign | review required>
121
+
122
+ Next steps:
123
+ 1. <most important action>
124
+ 2. <second action>
125
+ ════════════════════════════════════════════════════
126
+ ```
127
+
128
+ ## No-Go Conditions
129
+
130
+ Automatic NO-GO if any of:
131
+ - Test failures
132
+ - CRITICAL security vulnerability
133
+ - HIGH/CRITICAL CVE unpatched
134
+ - Build error
135
+
136
+ ## Output / State
137
+
138
+ For deploy: aggregated check results with GO/NO-GO verdict.
139
+ For review: findings by severity with verdict.
140
+ For analysis: consolidated analysis report with recommendations.
141
+
142
+ ## Examples
143
+
144
+ **Full pre-deployment check:**
145
+ ```
146
+ /fd-deploy-check
147
+ ```
148
+
149
+ **Code review on specific scope:**
150
+ ```
151
+ /fd-deploy-check --check=review --scope=src/auth
152
+ ```
153
+
154
+ **Pre-change analysis:**
155
+ ```
156
+ /fd-deploy-check --check=analysis --scope=src/api
157
+ ```
158
+
159
+ **Target staging environment:**
160
+ ```
161
+ /fd-deploy-check --env=staging
162
+ ```
163
+
164
+ ## Related Commands
165
+
166
+ - `/fd-verify` — full verification suite
167
+ - `/fd-fix-bug` — fix issues found during check
168
+ - `/fd-status` — review current project state
@@ -0,0 +1,101 @@
1
+ # /fd-design
2
+
3
+ **Purpose:** Design-first workflow for UI-heavy features, including draft, review, and design system modes.
4
+
5
+ ## Usage
6
+
7
+ /fd-design [--mode=draft|review|system] [task-description] [--override]
8
+
9
+ ## Arguments
10
+
11
+ - `--mode=draft|review|system` (optional) — workflow mode, default: `draft`
12
+ - `task-description` — description of the design task
13
+ - `--override` (optional) — bypass design approval requirement (logged explicitly)
14
+
15
+ ## What Happens
16
+
17
+ ### Mode: draft
18
+
19
+ Use when creating or updating UI before implementation.
20
+
21
+ **Required Stages:**
22
+ 1. discovery
23
+ 2. UX planning
24
+ 3. wireframe/layout planning
25
+ 4. visual system definition
26
+ 5. design approval
27
+ 6. implementation handoff
28
+
29
+ **Process:**
30
+ 1. Classify task as UI-heavy (landing page, dashboard, admin panel, app screen, website/app UX)
31
+ 2. Delegate to `@design` agent for structured artifacts
32
+ 3. Persist outputs in planning state under `design_artifact`
33
+ 4. Mark:
34
+ - `requires_design_first: true`
35
+ - `design_stage: handoff_complete`
36
+ - `design_approved: true` only when approval criteria are met
37
+ 5. Record any bypass with explicit `design_override_reason`
38
+
39
+ ### Mode: review
40
+
41
+ Use to review implemented UI against approved design artifact.
42
+
43
+ **Process:**
44
+ 1. Load approved design artifact and changed UI files
45
+ 2. Delegate to `@design` with `design-audit` + `responsive-review`
46
+ 3. Report:
47
+ - design mismatches
48
+ - hierarchy/spacing issues
49
+ - CTA flow weaknesses
50
+ - responsive/accessibility concerns
51
+ - missing empty/error/loading/success states
52
+
53
+ ### Mode: system
54
+
55
+ Use to generate or update design tokens and component behavior rules.
56
+
57
+ **Process:**
58
+ 1. Delegate to `@design` with `design-system-definition`
59
+ 2. Generate/update token guidance and component rules
60
+ 3. Save summary in planning state `design_artifact.design_tokens_guidance`
61
+
62
+ ## Enforcement Notes
63
+
64
+ - UI-heavy tasks must complete design approval before `/fd-execute`, unless `--override` is explicitly provided and logged
65
+ - Backend-only/infrastructure-only tasks skip this command
66
+
67
+ ## Output / State
68
+
69
+ - `design_artifact` persisted in planning state
70
+ - `requires_design_first: true` set in STATE.md
71
+ - `design_stage: handoff_complete` when draft complete
72
+ - `design_approved: true` when approval criteria met
73
+
74
+ ## Examples
75
+
76
+ **Draft a new UI:**
77
+ ```
78
+ /fd-design "Create a user profile page with avatar upload and bio editing"
79
+ ```
80
+
81
+ **Review implemented UI against design:**
82
+ ```
83
+ /fd-design --mode=review
84
+ ```
85
+
86
+ **Generate design system tokens:**
87
+ ```
88
+ /fd-design --mode=system
89
+ ```
90
+
91
+ **Bypass design (with explicit logging):**
92
+ ```
93
+ /fd-design "Quick UI change" --override
94
+ ```
95
+
96
+ ## Related Commands
97
+
98
+ - `/fd-execute` — implementation (must wait for design approval for UI-heavy tasks)
99
+ - `/fd-discuss` — explore design requirements before starting
100
+ - `/fd-plan` — plan the implementation after design is approved
101
+ - `/fd-quick` — run full workflow including design for UI-heavy tasks
@@ -1,28 +1,95 @@
1
- ---
2
- description: Start a structured requirements discussion using FlowDeck. Extracts decisions and saves to .planning/phases/phase-N/DISCUSS.md
3
- argument-hint: "[phase-number]"
4
- ---
1
+ # /fd-discuss
5
2
 
6
- Load the FlowDeck discuss workflow for the current (or specified) phase.
3
+ **Purpose:** Structured pre-planning Q&A to capture decisions about scope, constraints, acceptance criteria, risks, and UI classification — saves decisions to DISCUSS.md with D-XX numbering.
7
4
 
8
- **What this does:**
9
- 1. Reads `.planning/STATE.md` to determine the current phase
10
- 2. Scouts the codebase for relevant context (existing patterns, affected files)
11
- 3. Surfaces key decisions that need to be made for this phase
12
- 4. Guides you through answering them via conversation
13
- 5. Saves decisions to `.planning/phases/phase-N/DISCUSS.md`
5
+ ## Usage
14
6
 
15
- **Output:** A DISCUSS.md file with locked decisions that guide the planner and coder.
7
+ /fd-discuss [topic]
16
8
 
17
- **Next step after this:** Run `/fd-plan` to create the implementation plan.
9
+ ## What Happens
18
10
 
19
- ## What Next?
11
+ 1. **Pre-flight checks.**
12
+ - Verify `.planning/STATE.md` exists (error: "No active feature. Run `/fd-map-codebase` then `/fd-new-feature` to start a feature.")
13
+ - Read current phase N from STATE.md
14
+ - Create `.planning/phases/phase-<N>/` directory if needed
20
15
 
21
- After discussion completes, choose your next step:
16
+ 2. **CodeGraph intelligence check.**
17
+ - Run `codegraph action=check`
18
+ - If indexed and fresh: use `codegraph_context`, `codegraph_search`, `codegraph_explore` for preflight exploration
19
+ - If stale or unavailable: fall back to `@code-explorer` for codebase exploration
20
+ - Log which mode is active
22
21
 
23
- 1. **Create implementation plan** `/fd-plan [phase-number]`
24
- 2. **Continue discussion** `/fd-discuss [phase-number]`
25
- 3. **Review existing work** `/fd-verify`
26
- 4. **Check project dashboard** `/fd-dashboard`
22
+ 3. **Autonomous codebase exploration (before any questions).**
23
+ - Inspect PROJECT.md, STATE.md, prior DISCUSS.md files, tech stack manifests, src/ structure, and AGENTS.md/rules
24
+ - Skip questions whose answers are already determinable from the codebase
25
+ - Apply question guard: suppress any question answered by existing evidence
27
26
 
28
- Type the number or the command to proceed.
27
+ 4. **Invoke @discusser agent.**
28
+ - Agent receives project context, current phase, and full preflight exploration findings
29
+ - Asks one question per turn using the RecommendedQuestion format
30
+ - Each question is validated with `parseQuestionBlocks()` and `validateRecommendedQuestion()` before presentation
31
+
32
+ 5. **Q&A loop.**
33
+ - Questions presented one at a time covering: Scope, Constraints, Acceptance Criteria, Risks, UI Classification
34
+ - Each answer is assigned a D-XX decision number and recorded with topic, choice, and rationale
35
+ - Conflicts with prior decisions are flagged
36
+ - Loop continues until all topics covered or user says to stop early
37
+
38
+ 6. **Write DISCUSS.md.**
39
+ - Saves to `.planning/phases/phase-<N>/DISCUSS.md`
40
+ - Includes D-XX numbered decisions, suppressed questions (with evidence source), open questions, and next steps
41
+ - If UI-heavy, suggests `/fd-design --mode=draft` before `/fd-execute`
42
+
43
+ ## Output / State
44
+
45
+ File created:
46
+ - `.planning/phases/phase-<N>/DISCUSS.md`
47
+
48
+ DISCUSS.md structure:
49
+ ```markdown
50
+ # Discussion: <topic>
51
+
52
+ **Phase:** <N>
53
+ **Date:** <timestamp>
54
+ **Topic:** <topic>
55
+
56
+ ## Preflight Evidence Used
57
+ - Tech stack: <detected>
58
+ - Questions suppressed by evidence: <N>
59
+
60
+ ## Decisions
61
+ D-01: [Topic] — [Decision] ([Rationale])
62
+ ...
63
+
64
+ ## Answered Recommendations
65
+ RQ-01: [question] | User choice: [answer] | Rationale: [why]
66
+
67
+ ## Suppressed Questions
68
+ "<question>" → answered by: <evidence source>
69
+
70
+ ## Open Questions
71
+ - <unresolved items>
72
+
73
+ ## Next Steps
74
+ - Run /fd-plan to create implementation plan
75
+ ```
76
+
77
+ ## Examples
78
+
79
+ ```
80
+ /fd-discuss user authentication
81
+ ```
82
+
83
+ Runs a structured discussion on "user authentication", exploring scope, constraints, acceptance criteria, risks, and UI classification.
84
+
85
+ ```
86
+ /fd-discuss
87
+ ```
88
+
89
+ Runs a discussion with no pre-selected topic.
90
+
91
+ ## Related Commands
92
+
93
+ - `/fd-new-feature` — define the feature before discussing
94
+ - `/fd-plan` — create implementation plan from DISCUSS.md decisions
95
+ - `/fd-design` — draft UI designs if the feature is UI-heavy