@dv.nghiem/flowdeck 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/hooks/orchestrator-guard-hook.d.ts +2 -1
  2. package/dist/hooks/orchestrator-guard-hook.d.ts.map +1 -1
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +209 -146
  5. package/dist/services/telemetry.d.ts +1 -1
  6. package/dist/services/telemetry.d.ts.map +1 -1
  7. package/dist/tools/run-parallel.d.ts.map +1 -1
  8. package/docs/configuration.md +2 -0
  9. package/docs/parallel-execution.md +28 -0
  10. package/docs/workflows.md +72 -320
  11. package/package.json +1 -2
  12. package/src/commands/fd-deploy-check.md +67 -32
  13. package/src/commands/fd-discuss.md +44 -6
  14. package/src/commands/fd-fix-bug.md +47 -20
  15. package/src/commands/fd-map-codebase.md +66 -18
  16. package/src/commands/fd-multi-repo.md +130 -6
  17. package/src/commands/fd-new-feature.md +164 -21
  18. package/src/commands/fd-plan.md +66 -44
  19. package/src/commands/fd-review-code.md +69 -35
  20. package/src/commands/fd-write-docs.md +55 -23
  21. package/src/workflows/debug-flow.md +0 -119
  22. package/src/workflows/deploy-check-flow.md +0 -98
  23. package/src/workflows/discuss-flow.md +0 -97
  24. package/src/workflows/execute-flow.md +0 -233
  25. package/src/workflows/execute-phase.md +0 -145
  26. package/src/workflows/fix-bug-flow.md +0 -210
  27. package/src/workflows/map-codebase-flow.md +0 -92
  28. package/src/workflows/multi-repo-flow.md +0 -226
  29. package/src/workflows/parallel-execution-flow.md +0 -236
  30. package/src/workflows/plan-flow.md +0 -126
  31. package/src/workflows/plan-phase.md +0 -101
  32. package/src/workflows/refactor-flow.md +0 -122
  33. package/src/workflows/review-code-flow.md +0 -105
  34. package/src/workflows/spec-driven-flow.md +0 -43
  35. package/src/workflows/write-docs-flow.md +0 -95
@@ -5,75 +5,97 @@ argument-hint: [--phase=N] [--yes]
5
5
 
6
6
  # Plan
7
7
 
8
- Create a detailed implementation plan from confirmed discussion decisions.
8
+ Create a detailed implementation plan from confirmed DISCUSS.md decisions.
9
9
 
10
10
  **Input:** $ARGUMENTS (optional `--phase=N` to target a specific phase, `--yes` to skip confirmation)
11
11
 
12
- ## Pre-flight
12
+ ## Process
13
13
 
14
- 1. Check `.planning/STATE.md` exists — if not, return error: "Run /fd-new-project first."
15
- 2. Determine phase: use `--phase=N` from arguments, or read current phase from STATE.md.
16
- 3. Check `.planning/phases/phase-<N>/DISCUSS.md` exists — if not, return error: "Run /fd-discuss first."
14
+ ### Step 1: Guard Check
17
15
 
18
- ## Confirmation Gate
16
+ D-06: Verify DISCUSS.md exists and is confirmed.
19
17
 
20
- Unless `--yes` is passed or STATE.md already has `plan_confirmed: true`:
21
-
22
- Show a preview of the DISCUSS.md decisions found and ask:
18
+ If no DISCUSS.md found:
19
+ ```
20
+ Error: DISCUSS.md not found. Run /discuss [topic] first.
21
+ ```
23
22
 
23
+ If DISCUSS.md exists but not confirmed:
24
+ ```
25
+ Error: DISCUSS.md not yet confirmed. Complete the discuss phase first.
24
26
  ```
25
- ═══════════════════════════════════════════
26
- PLAN PHASE <N> — AWAITING CONFIRMATION
27
- ═══════════════════════════════════════════
28
27
 
29
- Found <X> decisions in DISCUSS.md:
30
- <preview of D-XX lines>
28
+ Abort with clear error message in both cases.
31
29
 
32
- Type CONFIRM to save PLAN.md and enable execution.
33
- ═══════════════════════════════════════════
34
- ```
30
+ ### Step 2: Load Context
35
31
 
36
- **PAUSE** — wait for user to type CONFIRM before proceeding.
32
+ Read:
33
+ - `.codebase/PROJECT.md` (project context)
34
+ - `.planning/STATE.md` (current phase and position)
35
+ - `.planning/phases/phase-<N>/DISCUSS.md` (D-XX decisions to trace in plan)
37
36
 
38
- ## Plan Generation
37
+ ### Step 3: Draft Plan
39
38
 
40
- After confirmation:
39
+ Create PLAN.md with:
40
+ - Tasks that trace to D-XX decisions from DISCUSS.md
41
+ - Each task includes `<action>` referencing relevant D-XX decisions
42
+ - Wave assignments for parallel execution
43
+ - File dependencies between tasks
41
44
 
42
- 1. Read all `D-XX: <decision>` lines from DISCUSS.md.
43
- 2. Generate `.planning/phases/phase-<N>/PLAN.md`:
45
+ ### Step 4: Validate Plan
44
46
 
45
- ```markdown
46
- # Implementation Plan
47
+ Verify:
48
+ - All requirements from ROADMAP.md for current phase are addressed
49
+ - All D-XX decisions from DISCUSS.md are traced in plan tasks
50
+ - No tasks that contradict prior decisions
47
51
 
48
- **Phase:** <N>
49
- **Created:** <timestamp>
50
- **Source:** DISCUSS.md (<X> decisions)
52
+ If validation fails, return to Step 3 to revise.
51
53
 
52
- ## Decisions
54
+ ### Step 5: Review Plan
53
55
 
54
- - D-01: <decision>
55
- - D-02: <decision>
56
+ Present draft plan to user:
57
+ - Show all tasks and their D-XX decision traces
58
+ - Show wave structure
59
+ - Show file dependencies
56
60
 
57
- ## Steps
61
+ ### Step 6: PAUSE CONFIRM
58
62
 
59
- - [ ] Step 1: <concrete implementation step traced to decision>
60
- - [ ] Step 2: <concrete implementation step>
61
- - [ ] Step 3: <concrete implementation step>
63
+ D-06: "PAUSE wait for user CONFIRM before saving"
62
64
 
63
- ## Acceptance Criteria
65
+ Present:
66
+ ```
67
+ Ready to save PLAN.md?
68
+ Type CONFIRM to save, or describe changes needed.
69
+ ```
64
70
 
65
- - [ ] <criterion from DISCUSS.md>
66
- - [ ] <criterion from DISCUSS.md>
71
+ If user types CONFIRM, proceed to Step 7.
72
+ If user requests changes, return to Step 3 with feedback.
67
73
 
68
- ## Status
74
+ ### Step 7: Save Plan
69
75
 
70
- CONFIRMED
71
- ```
76
+ Save PLAN.md to `.planning/phases/phase-<N>/PLAN.md`.
77
+ Commit with message: `docs(phase-N): save confirmed plan`
78
+
79
+ ### Step 8: Update State
80
+
81
+ Update STATE.md:
82
+ - Set plan_file to path of saved PLAN.md
83
+ - Set plan_confirmed: true
84
+ - Update last_action to "Plan confirmed"
85
+
86
+ ## D-06 Compliance
87
+
88
+ - Requires confirmed DISCUSS.md before proceeding
89
+ - Aborts with clear error if DISCUSS.md not confirmed
90
+ - Creates PLAN.md tracing D-XX decisions
91
+ - Pauses for user CONFIRM before saving
92
+
93
+ ## Error Handling
72
94
 
73
- 3. Update `.planning/STATE.md`:
74
- - Set `plan_confirmed: true`
75
- - Set `confirmed_at: <timestamp>`
76
- - Set `status: in_progress`
95
+ D-03: Fail fast with clear error
96
+ - If guard check fails: abort with clear error and remediation
97
+ - If plan validation fails: show what's missing
98
+ - No partial plan saved on error
77
99
 
78
100
  ## Completion
79
101
 
@@ -5,58 +5,92 @@ argument-hint: [--scope=path | --focus=security,quality,tdd]
5
5
 
6
6
  # Review Code
7
7
 
8
- Run a comprehensive parallel code review.
8
+ Run a comprehensive parallel code review before merging or deploying.
9
9
 
10
10
  **Input:** $ARGUMENTS — optional `--scope=<path>` and `--focus=<areas>`
11
11
 
12
- ## Steps
12
+ ## Process
13
13
 
14
- 1. Determine scope: use `--scope` if provided, else review uncommitted changes (`git diff --name-only HEAD`).
15
- 2. If no changes found, report: "Nothing to review."
14
+ ### Step 1: Identify Scope
16
15
 
17
- ## Parallel Review
16
+ If `/review-code [scope]` provided: review files matching scope.
17
+ If no scope: review all files changed since last commit.
18
18
 
19
- Run three reviewers in parallel:
19
+ ```bash
20
+ git diff --name-only HEAD~1
21
+ ```
22
+
23
+ If no changes found, report: "Nothing to review."
24
+
25
+ ### Step 2: Parallel Review
20
26
 
21
- - **@reviewer**: Quality, security, convention compliance, TDD discipline
22
- - CRITICAL: hardcoded secrets, SQL injection, XSS, auth gaps
23
- - HIGH: logic errors, missing error handling, unsafe casts
24
- - MEDIUM: functions >50 lines, nesting >4 deep, missing tests
25
- - LOW: naming nits, missing comments on public APIs
27
+ Spawn three agents simultaneously:
26
28
 
27
- - **@researcher**: API contracts, edge cases, hidden dependencies, integration risks
29
+ **@reviewer**
30
+ - Security: secrets, injection, auth, XSS
31
+ - Quality: function size, nesting, error handling
32
+ - Conventions: naming, import style, patterns
28
33
 
29
- - **@tester**: Test coverage, missing test cases, test quality, regression risks
34
+ **@researcher**
35
+ - Look up best practices for flagged patterns
36
+ - Check if flagged patterns are known vulnerabilities
37
+ - Provide context for MEDIUM findings
30
38
 
31
- ## Report
39
+ **@tester**
40
+ - Check coverage for changed files
41
+ - Identify untested paths
42
+ - Run existing tests
32
43
 
33
- Aggregate findings into:
44
+ ### Step 3: Aggregate Results
45
+
46
+ Merge all findings by severity:
34
47
 
35
48
  ```
36
- ════════════════════════════════════════════
37
- CODE REVIEW REPORT
38
- ════════════════════════════════════════════
39
- Files reviewed: <N>
49
+ ## Code Review: <scope>
50
+
51
+ ### 🔴 CRITICAL (block merge)
52
+ - [finding with file:line and fix]
40
53
 
41
- CRITICAL (<count>)
42
- - <file>:<line> — <issue>
54
+ ### 🟠 HIGH (strongly recommend fix)
55
+ - [finding]
43
56
 
44
- HIGH (<count>)
45
- - <file>:<line> — <issue>
57
+ ### 🟡 MEDIUM (consider fixing)
58
+ - [finding]
46
59
 
47
- MEDIUM (<count>)
48
- - <file>:<line> — <issue>
60
+ ### 🟢 LOW (optional)
61
+ - [finding]
49
62
 
50
- LOW (<count>)
51
- - <file>:<line> <issue>
63
+ ### Coverage
64
+ - Changed files: N%
65
+ - Untested paths: [list]
52
66
 
53
- Test Coverage: <findings>
54
- ────────────────────────────────────────────
55
- Verdict: PASS / NEEDS CHANGES / BLOCK
56
- ════════════════════════════════════════════
67
+ ### Verdict: PASS | FAIL | PASS_WITH_NOTES
57
68
  ```
58
69
 
59
- **Verdict rules:**
60
- - CRITICAL issues → BLOCK
61
- - HIGH issuesNEEDS CHANGES
62
- - Only MEDIUM/LOWPASS with comments
70
+ ### Step 4: Decision
71
+
72
+ - **CRITICAL found**Block. Fix before merge.
73
+ - **HIGH found**Strongly recommend fix. Document if proceeding anyway.
74
+ - **MEDIUM/LOW** → Document. Proceed.
75
+ - **PASS** → Ready to merge.
76
+
77
+ ## Agent Configuration
78
+
79
+ | Agent | Model | Purpose |
80
+ |-------|-------|---------|
81
+ | @reviewer | google/gemini-2.5-flash | Security and quality |
82
+ | @researcher | anthropic/claude-sonnet-4-5 | Context and best practices |
83
+ | @tester | anthropic/claude-sonnet-4-5 | Coverage analysis |
84
+
85
+ ## Severity Classification
86
+
87
+ | Severity | Meaning | Action |
88
+ |----------|---------|--------|
89
+ | CRITICAL | Security vulnerability or data loss risk | **BLOCK** - Must fix before merge |
90
+ | HIGH | Bug or significant quality issue | **WARN** - Should fix before merge |
91
+ | MEDIUM | Maintainability concern | **INFO** - Consider fixing |
92
+ | LOW | Style or minor suggestion | **NOTE** - Optional |
93
+
94
+ ## Output
95
+
96
+ Report: files reviewed, findings by severity, coverage, verdict.
@@ -5,46 +5,78 @@ argument-hint: [--scope=path | --format=api,guide,readme]
5
5
 
6
6
  # Write Docs
7
7
 
8
- Generate documentation for the codebase or a specific scope.
8
+ Generate accurate, up-to-date documentation from the codebase.
9
9
 
10
10
  **Input:** $ARGUMENTS — optional `--scope=<path>` and `--format=<type>`
11
11
 
12
12
  Supported formats: `api` (API reference), `guide` (usage guide), `readme` (README)
13
13
  Default: all formats
14
14
 
15
- ## Pipeline
15
+ ## Process
16
16
 
17
- ### Phase 1 Explore
17
+ ### Step 1: Explore APIs
18
18
 
19
- - **@researcher**: Find all public APIs, exported functions, classes, types, and their signatures
20
- - **@code-explorer**: Identify existing documentation, JSDoc comments, README sections
19
+ Spawn `@mapper` to:
20
+ - Find all exported functions, classes, and types
21
+ - Identify public API entry points
22
+ - Map key workflows and integration points
21
23
 
22
- ### Phase 2 — Draft
24
+ ```bash
25
+ # Find exports
26
+ grep -rn "export " src/ --include="*.ts"
27
+ # Find public interfaces
28
+ grep -rn "export interface\|export type\|export class" src/ --include="*.ts"
29
+ ```
23
30
 
24
- - **@writer**: Draft documentation based on the exploration findings
25
- - API docs: function signatures, parameters, return types, examples
26
- - Guides: usage examples, step-by-step instructions
27
- - README: project overview, install, quickstart, API summary
31
+ ### Step 2: Draft Documentation
28
32
 
29
- ### Phase 3 — Review
33
+ Spawn `@writer` to produce:
30
34
 
31
- - **@reviewer**: Check accuracy — verify all documented APIs exist and signatures are correct
32
- - Flag any documentation that contradicts the implementation
33
- - Flag missing documentation for public APIs
35
+ **API Reference**
36
+ ```markdown
37
+ ## functionName(param: Type): ReturnType
34
38
 
35
- ### Phase 4 Finalize
39
+ Description of what the function does.
36
40
 
37
- - **@writer**: Apply reviewer corrections, finalize and write documentation files
41
+ **Parameters:**
42
+ - `param` (Type) — description
38
43
 
39
- ## Output Files
44
+ **Returns:** description
40
45
 
41
- Based on `--format`:
42
- - `api` → writes or updates `docs/API.md`
43
- - `guide` writes or updates `docs/GUIDE.md`
44
- - `readme` → updates `README.md`
46
+ **Example:**
47
+ \`\`\`typescript
48
+ const result = functionName(value);
49
+ \`\`\`
50
+ ```
45
51
 
46
- If `--scope` is set, documentation applies only to files within that path.
52
+ **Usage Guide**
53
+ - Step-by-step workflow with examples
54
+ - Common patterns and best practices
55
+ - Configuration options
47
56
 
48
- ## Completion
57
+ **Troubleshooting**
58
+ - Common errors and their solutions
59
+
60
+ ### Step 3: Review for Accuracy
61
+
62
+ Spawn `@reviewer` to verify:
63
+ - Every documented function/method actually exists
64
+ - Parameter types match the actual signatures
65
+ - Examples are syntactically correct
66
+ - No outdated API references
67
+
68
+ ### Step 4: Finalize
69
+
70
+ Writer incorporates feedback and writes final docs to:
71
+ - `README.md` — project overview and quick start
72
+ - `docs/API.md` — complete API reference
73
+ - `docs/USER_GUIDE.md` — detailed usage guide
74
+
75
+ ## Output
76
+
77
+ Updated documentation files with:
78
+ - Accurate function signatures
79
+ - Working code examples
80
+ - Clear explanations of behavior
49
81
 
50
82
  Report: files written/updated, public APIs documented, any gaps found.
@@ -1,119 +0,0 @@
1
- ---
2
- name: debug-flow
3
- description: "Systematic debugging: reproduce → trace → write failing test → fix root cause → verify. Never suppress errors."
4
- triggers:
5
- - /debug
6
- steps:
7
- - name: reproduce
8
- agent: "@debug-specialist"
9
- action: Establish minimal reproduction case with expected vs actual behavior
10
- - name: trace
11
- agent: "@debug-specialist"
12
- action: Debug-specialist traces execution path and identifies root cause
13
- - name: write_test
14
- agent: "@tester"
15
- action: Tester writes failing regression test for the exact failure
16
- - name: fix
17
- agent: "@coder"
18
- action: Coder fixes root cause with minimal change
19
- - name: verify
20
- agent: "@tester"
21
- action: Run regression test + full suite to confirm fix
22
- ---
23
-
24
- # Debug Flow
25
-
26
- ## Purpose
27
-
28
- Diagnose and fix unexpected behavior systematically. Prevents symptom-fixing and ensures reproducibility.
29
-
30
- ## Rules
31
-
32
- - Never suppress an error to make a test pass
33
- - Fix the root cause, not the symptom
34
- - Always write a regression test before fixing
35
- - Read stack traces completely — never half-read
36
-
37
- ## Process
38
-
39
- ### Step 1: Reproduce
40
-
41
- Document the bug precisely:
42
- ```
43
- Bug: [one-line description]
44
- Steps to reproduce:
45
- 1. ...
46
- 2. ...
47
- Expected: [what should happen]
48
- Actual: [what does happen]
49
- Stack trace: [if available]
50
- ```
51
-
52
- Confirm you can reproduce it consistently before proceeding.
53
-
54
- ### Step 2: Trace
55
-
56
- Spawn `@debug-specialist` to:
57
-
58
- 1. Read the complete stack trace
59
- 2. Identify the failing function and line
60
- 3. Trace inputs backward to find where bad data enters
61
- 4. Check recent changes: `git log --oneline -10 -- <file>`
62
- 5. Identify root cause (not symptom)
63
-
64
- Common root causes:
65
- | Symptom | Look for |
66
- |---------|---------|
67
- | null/undefined error | Missing boundary check |
68
- | Wrong value | Type coercion, missing validation |
69
- | Race condition | Missing await, shared mutable state |
70
- | Auth failure | Missing middleware, wrong scope check |
71
- | Infinite loop | Missing base case, wrong termination |
72
-
73
- ### Step 3: Write Failing Test
74
-
75
- Spawn `@tester` to write a regression test:
76
- - Must FAIL on current code (RED)
77
- - Tests the exact scenario from Step 1
78
- - Isolated from other tests
79
-
80
- ```typescript
81
- test('should [expected] when [condition from bug report]', () => {
82
- // Arrange: set up the exact failing scenario
83
- // Act: call the failing code
84
- // Assert: verify expected behavior
85
- });
86
- ```
87
-
88
- ### Step 4: Fix
89
-
90
- Spawn `@coder` to:
91
- - Fix the root cause identified in Step 2
92
- - Minimum change to make the regression test pass
93
- - Do NOT touch unrelated code
94
-
95
- If the fix requires more than 20 lines: STOP, reassess scope.
96
-
97
- ### Step 5: Verify
98
-
99
- ```bash
100
- # Regression test must pass
101
- npm test -- --grep "regression test name"
102
-
103
- # Full suite must still pass
104
- npm test
105
- ```
106
-
107
- If any unrelated test breaks: the fix has unintended side effects. Investigate before proceeding.
108
-
109
- ## Output
110
-
111
- ```
112
- ## Debug Complete
113
-
114
- Bug: [description]
115
- Root cause: [specific cause]
116
- Fix: [what changed, file:line]
117
- Regression test: [test name] ✅ PASS
118
- Suite: ✅ N/N tests passing
119
- ```
@@ -1,98 +0,0 @@
1
- ---
2
- name: deploy-check-flow
3
- description: "Pre-deployment checks: parallel tests + security scan + CVE audit + build verification → go/no-go decision"
4
- triggers:
5
- - /deploy-check
6
- steps:
7
- - name: parallel_checks
8
- agent: "@parallel-coordinator"
9
- action: Run tests, security scan, CVE audit, and build in parallel
10
- - name: aggregate
11
- agent: "@orchestrator"
12
- action: Aggregate all results into a unified report
13
- - name: decision
14
- agent: "@orchestrator"
15
- action: Produce explicit go/no-go decision with required fixes if no-go
16
- ---
17
-
18
- # Deploy Check Flow
19
-
20
- ## Purpose
21
-
22
- Run a comprehensive pre-deployment check suite before releasing to production.
23
-
24
- ## Process
25
-
26
- ### Step 1: Parallel Checks
27
-
28
- Launch four checks simultaneously:
29
-
30
- **Check A: Test Suite**
31
- ```bash
32
- npm test
33
- ```
34
- All tests must pass. No failures, no skips without justification.
35
-
36
- **Check B: Security Scan**
37
-
38
- Spawn `@security-auditor` to check:
39
- - No hardcoded secrets in changed files
40
- - Input validation at trust boundaries
41
- - Auth/authz on all protected routes
42
- - No CRITICAL or HIGH vulnerabilities
43
-
44
- **Check C: Dependency CVE Audit**
45
- ```bash
46
- npm audit --audit-level=high
47
- ```
48
- No HIGH or CRITICAL CVEs unaddressed.
49
-
50
- **Check D: Build Verification**
51
- ```bash
52
- npm run build
53
- ```
54
- Build must succeed with zero errors.
55
-
56
- ### Step 2: Aggregate Results
57
-
58
- ```
59
- ## Pre-Deployment Check
60
-
61
- | Check | Status | Details |
62
- |-------|--------|---------|
63
- | Tests | ✅ PASS / ❌ FAIL | N/N passed |
64
- | Security | ✅ PASS / ❌ FAIL | [findings] |
65
- | CVE Audit | ✅ PASS / ❌ FAIL | [vulnerabilities] |
66
- | Build | ✅ PASS / ❌ FAIL | [errors] |
67
- ```
68
-
69
- ### Step 3: Decision
70
-
71
- **🚀 GO** — all checks pass, proceed with deployment.
72
-
73
- **🛑 NO-GO** — one or more checks failed:
74
- ```
75
- Verdict: NO-GO
76
-
77
- Required fixes before deploy:
78
- - [ ] [fix 1]
79
- - [ ] [fix 2]
80
-
81
- Run /deploy-check again after fixing.
82
- ```
83
-
84
- ## No-go conditions (automatic)
85
-
86
- Any of these → automatic NO-GO:
87
- - Test failures
88
- - CRITICAL security vulnerability
89
- - HIGH/CRITICAL CVE unpatched
90
- - Build error
91
-
92
- ## Agent configuration
93
-
94
- | Agent | Purpose |
95
- |-------|---------|
96
- | @tester | Run test suite |
97
- | @security-auditor | Security vulnerability scan |
98
- | @researcher | CVE research and context |
@@ -1,97 +0,0 @@
1
- ---
2
- name: discuss-flow
3
- description: "Orchestrates discuss phase (context load → @discusser Q&A → pause → decisions → save)"
4
- triggers:
5
- - /discuss
6
- steps:
7
- - name: load_context
8
- agent: "@orchestrator"
9
- priority: first
10
- action: Load PROJECT.md and current phase STATE.md
11
- - name: determine_phase
12
- agent: "@orchestrator"
13
- action: Extract current phase number from STATE.md
14
- - name: invoke_discusser
15
- agent: "@discusser"
16
- action: Spawn @discusser agent with project context
17
- - name: qa_loop
18
- agent: "@discusser"
19
- action: Discusser asks one question at a time; user responds; repeat until all topics covered
20
- - name: save_decisions
21
- agent: "@discusser"
22
- action: Write all decisions to .planning/phases/phase-N/DISCUSS.md with D-XX numbering
23
- - name: confirm_discuss
24
- agent: "@orchestrator"
25
- action: Present summary to user; require explicit confirmation before marking DISCUSS.md as confirmed
26
- ---
27
-
28
- # Discuss Flow
29
-
30
- ## Purpose
31
-
32
- Extract project requirements and decisions via structured Q&A with the @discusser agent.
33
-
34
- ## Process
35
-
36
- ### Step 1: Load Context
37
-
38
- Read `.planning/PROJECT.md` to understand the project vision and goals.
39
- Read `.planning/STATE.md` to determine the current phase and context.
40
-
41
- ### Step 2: Determine Phase
42
-
43
- Extract the current phase number from STATE.md.
44
- Decisions will be saved to `.planning/phases/phase-{N}/DISCUSS.md`.
45
-
46
- ### Step 3: Invoke Discusser
47
-
48
- Spawn @discusser agent with:
49
- - Project context (from PROJECT.md)
50
- - Current phase number
51
- - Instructions to ask ONE question per turn
52
-
53
- ### Step 4: Q&A Loop
54
-
55
- The @discusser agent asks one question at a time.
56
- After each user response:
57
- - Assign D-XX number to any new decision
58
- - Record: topic, choice, rationale
59
- - If response conflicts with previous decision, flag the conflict
60
-
61
- Continue until all required topics are covered or user says to stop early.
62
-
63
- ### Step 5: Save Decisions
64
-
65
- Save all decisions to `.planning/phases/phase-N/DISCUSS.md`:
66
- ```
67
- D-01: [Topic] — [Decision] ([Rationale])
68
- D-02: [Topic] — [Decision] ([Rationale])
69
- ...
70
- ```
71
-
72
- ### Step 6: Confirm Discuss
73
-
74
- Present summary of decisions to user.
75
- Ask for explicit confirmation: "CONFIRMED" to proceed or "REVISION NEEDED" to revisit.
76
-
77
- If user confirms:
78
- - Update STATE.md to mark DISCUSS.md as confirmed
79
- - Proceed to plan phase
80
-
81
- If user requests revision:
82
- - Return to Step 4 (Q&A loop) for the specified topics
83
-
84
- ## D-05 Compliance
85
-
86
- - Loads PROJECT.md + current phase STATE.md
87
- - Invokes @discusser agent
88
- - Saves decisions with D-XX numbering to DISCUSS.md
89
- - One question at a time (no compound questions)
90
-
91
- ## Error Handling
92
-
93
- D-03: Fail fast with clear error
94
- - If PROJECT.md not found: error with "Run /new-project first"
95
- - If STATE.md not found: error with "Project not initialized"
96
- - If @discusser fails: error with "Discusser agent unavailable"
97
- - No partial state saved on error