@dv.nghiem/flowdeck 0.1.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.
- package/LICENSE +21 -0
- package/README.md +136 -0
- package/bin/flowdeck.js +108 -0
- package/dist/agents/architect.d.ts +3 -0
- package/dist/agents/architect.d.ts.map +1 -0
- package/dist/agents/code-explorer.d.ts +3 -0
- package/dist/agents/code-explorer.d.ts.map +1 -0
- package/dist/agents/coder.d.ts +3 -0
- package/dist/agents/coder.d.ts.map +1 -0
- package/dist/agents/debug.d.ts +4 -0
- package/dist/agents/debug.d.ts.map +1 -0
- package/dist/agents/doc-updater.d.ts +3 -0
- package/dist/agents/doc-updater.d.ts.map +1 -0
- package/dist/agents/flowdeck.d.ts +5 -0
- package/dist/agents/flowdeck.d.ts.map +1 -0
- package/dist/agents/index.d.ts +38 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/mapper.d.ts +3 -0
- package/dist/agents/mapper.d.ts.map +1 -0
- package/dist/agents/orchestrator.d.ts +10 -0
- package/dist/agents/orchestrator.d.ts.map +1 -0
- package/dist/agents/performance.d.ts +4 -0
- package/dist/agents/performance.d.ts.map +1 -0
- package/dist/agents/planner.d.ts +3 -0
- package/dist/agents/planner.d.ts.map +1 -0
- package/dist/agents/policy-enforcer.d.ts +3 -0
- package/dist/agents/policy-enforcer.d.ts.map +1 -0
- package/dist/agents/researcher.d.ts +3 -0
- package/dist/agents/researcher.d.ts.map +1 -0
- package/dist/agents/reviewer.d.ts +3 -0
- package/dist/agents/reviewer.d.ts.map +1 -0
- package/dist/agents/risk-analyst.d.ts +3 -0
- package/dist/agents/risk-analyst.d.ts.map +1 -0
- package/dist/agents/security-auditor.d.ts +3 -0
- package/dist/agents/security-auditor.d.ts.map +1 -0
- package/dist/agents/specialist.d.ts +5 -0
- package/dist/agents/specialist.d.ts.map +1 -0
- package/dist/agents/tester.d.ts +3 -0
- package/dist/agents/tester.d.ts.map +1 -0
- package/dist/agents/types.d.ts +20 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/agents/writer.d.ts +3 -0
- package/dist/agents/writer.d.ts.map +1 -0
- package/dist/commands/analysis/analysis.test.d.ts +2 -0
- package/dist/commands/analysis/analysis.test.d.ts.map +1 -0
- package/dist/commands/analysis/analyze-change.d.ts +148 -0
- package/dist/commands/analysis/analyze-change.d.ts.map +1 -0
- package/dist/commands/analysis/evaluate-risk.d.ts +77 -0
- package/dist/commands/analysis/evaluate-risk.d.ts.map +1 -0
- package/dist/commands/analysis/guarded-edit.d.ts +72 -0
- package/dist/commands/analysis/guarded-edit.d.ts.map +1 -0
- package/dist/commands/execution/deploy-check.d.ts +91 -0
- package/dist/commands/execution/deploy-check.d.ts.map +1 -0
- package/dist/commands/execution/fix-bug.d.ts +187 -0
- package/dist/commands/execution/fix-bug.d.ts.map +1 -0
- package/dist/commands/execution/new-feature.d.ts +171 -0
- package/dist/commands/execution/new-feature.d.ts.map +1 -0
- package/dist/commands/execution/review-code.d.ts +130 -0
- package/dist/commands/execution/review-code.d.ts.map +1 -0
- package/dist/commands/execution/write-docs.d.ts +94 -0
- package/dist/commands/execution/write-docs.d.ts.map +1 -0
- package/dist/commands/governance/approve.d.ts +80 -0
- package/dist/commands/governance/approve.d.ts.map +1 -0
- package/dist/commands/intelligence/blast-radius.d.ts +67 -0
- package/dist/commands/intelligence/blast-radius.d.ts.map +1 -0
- package/dist/commands/intelligence/impact-radar.d.ts +71 -0
- package/dist/commands/intelligence/impact-radar.d.ts.map +1 -0
- package/dist/commands/intelligence/intelligence.test.d.ts +2 -0
- package/dist/commands/intelligence/intelligence.test.d.ts.map +1 -0
- package/dist/commands/intelligence/regression-predict.d.ts +75 -0
- package/dist/commands/intelligence/regression-predict.d.ts.map +1 -0
- package/dist/commands/intelligence/review-route.d.ts +65 -0
- package/dist/commands/intelligence/review-route.d.ts.map +1 -0
- package/dist/commands/intelligence/test-gap.d.ts +73 -0
- package/dist/commands/intelligence/test-gap.d.ts.map +1 -0
- package/dist/commands/intelligence/translate-intent.d.ts +87 -0
- package/dist/commands/intelligence/translate-intent.d.ts.map +1 -0
- package/dist/commands/intelligence/volatility-map-cmd.d.ts +68 -0
- package/dist/commands/intelligence/volatility-map-cmd.d.ts.map +1 -0
- package/dist/commands/planning/ask.d.ts +62 -0
- package/dist/commands/planning/ask.d.ts.map +1 -0
- package/dist/commands/planning/ask.test.d.ts +2 -0
- package/dist/commands/planning/ask.test.d.ts.map +1 -0
- package/dist/commands/planning/dashboard.d.ts +30 -0
- package/dist/commands/planning/dashboard.d.ts.map +1 -0
- package/dist/commands/planning/discuss.d.ts +39 -0
- package/dist/commands/planning/discuss.d.ts.map +1 -0
- package/dist/commands/planning/plan.d.ts +67 -0
- package/dist/commands/planning/plan.d.ts.map +1 -0
- package/dist/commands/planning/roadmap.d.ts +105 -0
- package/dist/commands/planning/roadmap.d.ts.map +1 -0
- package/dist/commands/setup/doctor.d.ts +10 -0
- package/dist/commands/setup/doctor.d.ts.map +1 -0
- package/dist/commands/setup/map-codebase.d.ts +62 -0
- package/dist/commands/setup/map-codebase.d.ts.map +1 -0
- package/dist/commands/setup/new-project.d.ts +19 -0
- package/dist/commands/setup/new-project.d.ts.map +1 -0
- package/dist/commands/setup/settings.d.ts +57 -0
- package/dist/commands/setup/settings.d.ts.map +1 -0
- package/dist/commands/state/checkpoint.d.ts +27 -0
- package/dist/commands/state/checkpoint.d.ts.map +1 -0
- package/dist/commands/state/multi-repo.d.ts +63 -0
- package/dist/commands/state/multi-repo.d.ts.map +1 -0
- package/dist/commands/state/progress.d.ts +57 -0
- package/dist/commands/state/progress.d.ts.map +1 -0
- package/dist/commands/state/resume.d.ts +11 -0
- package/dist/commands/state/resume.d.ts.map +1 -0
- package/dist/commands/state/workspace-commands.d.ts +207 -0
- package/dist/commands/state/workspace-commands.d.ts.map +1 -0
- package/dist/dashboard/lib/port-finder.d.ts +10 -0
- package/dist/dashboard/lib/port-finder.d.ts.map +1 -0
- package/dist/dashboard/lib/port-finder.test.d.ts +2 -0
- package/dist/dashboard/lib/port-finder.test.d.ts.map +1 -0
- package/dist/dashboard/lib/state-reader.d.ts +3 -0
- package/dist/dashboard/lib/state-reader.d.ts.map +1 -0
- package/dist/dashboard/server.d.ts +2 -0
- package/dist/dashboard/server.d.ts.map +1 -0
- package/dist/dashboard/server.mjs +13649 -0
- package/dist/dashboard/types.d.ts +72 -0
- package/dist/dashboard/types.d.ts.map +1 -0
- package/dist/dashboard/views/index.ejs +391 -0
- package/dist/dashboard/views/partials/blockers.ejs +10 -0
- package/dist/dashboard/views/partials/header.ejs +20 -0
- package/dist/dashboard/views/partials/phase-timeline.ejs +40 -0
- package/dist/dashboard/views/partials/progress.ejs +12 -0
- package/dist/hooks/approval-hook.d.ts +13 -0
- package/dist/hooks/approval-hook.d.ts.map +1 -0
- package/dist/hooks/compaction-hook.d.ts +23 -0
- package/dist/hooks/compaction-hook.d.ts.map +1 -0
- package/dist/hooks/context-window-monitor.d.ts +21 -0
- package/dist/hooks/context-window-monitor.d.ts.map +1 -0
- package/dist/hooks/decision-trace-hook.d.ts +13 -0
- package/dist/hooks/decision-trace-hook.d.ts.map +1 -0
- package/dist/hooks/file-tracker.d.ts +29 -0
- package/dist/hooks/file-tracker.d.ts.map +1 -0
- package/dist/hooks/guard-rails.d.ts +33 -0
- package/dist/hooks/guard-rails.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/notifications.d.ts +21 -0
- package/dist/hooks/notifications.d.ts.map +1 -0
- package/dist/hooks/patch-trust.d.ts +27 -0
- package/dist/hooks/patch-trust.d.ts.map +1 -0
- package/dist/hooks/patch-trust.test.d.ts +2 -0
- package/dist/hooks/patch-trust.test.d.ts.map +1 -0
- package/dist/hooks/session-events.d.ts +8 -0
- package/dist/hooks/session-events.d.ts.map +1 -0
- package/dist/hooks/session-idle-hook.d.ts +21 -0
- package/dist/hooks/session-idle-hook.d.ts.map +1 -0
- package/dist/hooks/session-start.d.ts +10 -0
- package/dist/hooks/session-start.d.ts.map +1 -0
- package/dist/hooks/shell-env-hook.d.ts +21 -0
- package/dist/hooks/shell-env-hook.d.ts.map +1 -0
- package/dist/hooks/telemetry-hook.d.ts +25 -0
- package/dist/hooks/telemetry-hook.d.ts.map +1 -0
- package/dist/hooks/todo-hook.d.ts +25 -0
- package/dist/hooks/todo-hook.d.ts.map +1 -0
- package/dist/hooks/tool-guard.d.ts +41 -0
- package/dist/hooks/tool-guard.d.ts.map +1 -0
- package/dist/hooks/tool-guard.test.d.ts +2 -0
- package/dist/hooks/tool-guard.test.d.ts.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6639 -0
- package/dist/lib/confirmation.d.ts +20 -0
- package/dist/lib/confirmation.d.ts.map +1 -0
- package/dist/lib/impact-radar.d.ts +35 -0
- package/dist/lib/impact-radar.d.ts.map +1 -0
- package/dist/lib/signatures.d.ts +12 -0
- package/dist/lib/signatures.d.ts.map +1 -0
- package/dist/lib/timestamps.d.ts +23 -0
- package/dist/lib/timestamps.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +20 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/services/agent-performance.d.ts +29 -0
- package/dist/services/agent-performance.d.ts.map +1 -0
- package/dist/services/approval-manager.d.ts +30 -0
- package/dist/services/approval-manager.d.ts.map +1 -0
- package/dist/services/index.d.ts +7 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/model-router.d.ts +35 -0
- package/dist/services/model-router.d.ts.map +1 -0
- package/dist/services/policy-compiler.d.ts +27 -0
- package/dist/services/policy-compiler.d.ts.map +1 -0
- package/dist/services/run-trace.d.ts +34 -0
- package/dist/services/run-trace.d.ts.map +1 -0
- package/dist/services/services.test.d.ts +2 -0
- package/dist/services/services.test.d.ts.map +1 -0
- package/dist/services/telemetry.d.ts +34 -0
- package/dist/services/telemetry.d.ts.map +1 -0
- package/dist/tools/agent-dispatch.test.d.ts +2 -0
- package/dist/tools/agent-dispatch.test.d.ts.map +1 -0
- package/dist/tools/codebase-state.d.ts +4 -0
- package/dist/tools/codebase-state.d.ts.map +1 -0
- package/dist/tools/context-generator.d.ts +3 -0
- package/dist/tools/context-generator.d.ts.map +1 -0
- package/dist/tools/council.d.ts +4 -0
- package/dist/tools/council.d.ts.map +1 -0
- package/dist/tools/decision-trace.d.ts +16 -0
- package/dist/tools/decision-trace.d.ts.map +1 -0
- package/dist/tools/delegate.d.ts +4 -0
- package/dist/tools/delegate.d.ts.map +1 -0
- package/dist/tools/failure-replay.d.ts +19 -0
- package/dist/tools/failure-replay.d.ts.map +1 -0
- package/dist/tools/failure-replay.test.d.ts +2 -0
- package/dist/tools/failure-replay.test.d.ts.map +1 -0
- package/dist/tools/hash-edit.d.ts +3 -0
- package/dist/tools/hash-edit.d.ts.map +1 -0
- package/dist/tools/planning-state-lib.d.ts +65 -0
- package/dist/tools/planning-state-lib.d.ts.map +1 -0
- package/dist/tools/planning-state.d.ts +3 -0
- package/dist/tools/planning-state.d.ts.map +1 -0
- package/dist/tools/policy-engine.d.ts +19 -0
- package/dist/tools/policy-engine.d.ts.map +1 -0
- package/dist/tools/repo-memory.d.ts +20 -0
- package/dist/tools/repo-memory.d.ts.map +1 -0
- package/dist/tools/repo-memory.test.d.ts +2 -0
- package/dist/tools/repo-memory.test.d.ts.map +1 -0
- package/dist/tools/run-parallel.d.ts +4 -0
- package/dist/tools/run-parallel.d.ts.map +1 -0
- package/dist/tools/run-pipeline.d.ts +4 -0
- package/dist/tools/run-pipeline.d.ts.map +1 -0
- package/dist/tools/volatility-map.d.ts +18 -0
- package/dist/tools/volatility-map.d.ts.map +1 -0
- package/dist/tools/volatility-map.test.d.ts +2 -0
- package/dist/tools/volatility-map.test.d.ts.map +1 -0
- package/dist/tools/workspace-state.d.ts +3 -0
- package/dist/tools/workspace-state.d.ts.map +1 -0
- package/docs/USER_GUIDE.md +20 -0
- package/docs/agents.md +562 -0
- package/docs/best-practices.md +47 -0
- package/docs/command-migration.md +175 -0
- package/docs/commands/fd-analyze-change.md +107 -0
- package/docs/commands/fd-ask.md +51 -0
- package/docs/commands/fd-checkpoint.md +10 -0
- package/docs/commands/fd-dashboard.md +11 -0
- package/docs/commands/fd-deploy-check.md +11 -0
- package/docs/commands/fd-discuss.md +28 -0
- package/docs/commands/fd-evaluate-risk.md +134 -0
- package/docs/commands/fd-fix-bug.md +24 -0
- package/docs/commands/fd-guarded-edit.md +105 -0
- package/docs/commands/fd-map-codebase.md +27 -0
- package/docs/commands/fd-multi-repo.md +63 -0
- package/docs/commands/fd-new-feature.md +25 -0
- package/docs/commands/fd-new-project.md +24 -0
- package/docs/commands/fd-plan.md +33 -0
- package/docs/commands/fd-progress.md +11 -0
- package/docs/commands/fd-resume.md +10 -0
- package/docs/commands/fd-review-code.md +29 -0
- package/docs/commands/fd-roadmap.md +10 -0
- package/docs/commands/fd-settings.md +10 -0
- package/docs/commands/fd-write-docs.md +10 -0
- package/docs/commands.md +476 -0
- package/docs/configuration.md +211 -0
- package/docs/feature-integration-architecture.md +255 -0
- package/docs/index.md +75 -0
- package/docs/installation.md +134 -0
- package/docs/intelligence.md +294 -0
- package/docs/multi-repo.md +201 -0
- package/docs/notifications.md +170 -0
- package/docs/parallel-execution.md +227 -0
- package/docs/quick-start.md +174 -0
- package/docs/rules.md +459 -0
- package/docs/skills.md +408 -0
- package/docs/workflows.md +376 -0
- package/package.json +58 -0
- package/postinstall.mjs +102 -0
- package/src/rules/README.md +37 -0
- package/src/rules/common/agent-orchestration.md +86 -0
- package/src/rules/common/coding-style.md +120 -0
- package/src/rules/common/git-workflow.md +77 -0
- package/src/rules/common/security.md +94 -0
- package/src/rules/common/testing.md +105 -0
- package/src/rules/golang/patterns.md +187 -0
- package/src/rules/java/patterns.md +204 -0
- package/src/rules/python/patterns.md +141 -0
- package/src/rules/rust/patterns.md +210 -0
- package/src/rules/typescript/patterns.md +168 -0
- package/src/skills/api-design/SKILL.md +143 -0
- package/src/skills/arch-constraint-guard/SKILL.md +61 -0
- package/src/skills/blast-radius-preview/SKILL.md +65 -0
- package/src/skills/change-impact-radar/SKILL.md +63 -0
- package/src/skills/code-review/SKILL.md +108 -0
- package/src/skills/code-tour/SKILL.md +101 -0
- package/src/skills/codebase-mapping/SKILL.md +87 -0
- package/src/skills/codebase-onboarding/SKILL.md +133 -0
- package/src/skills/confidence-aware-planning/SKILL.md +67 -0
- package/src/skills/context-load/SKILL.md +63 -0
- package/src/skills/debug-flow/SKILL.md +75 -0
- package/src/skills/decision-trace/SKILL.md +72 -0
- package/src/skills/dependency-audit/SKILL.md +126 -0
- package/src/skills/deploy-check/SKILL.md +87 -0
- package/src/skills/documentation-writer/SKILL.md +154 -0
- package/src/skills/failure-replay-engine/SKILL.md +59 -0
- package/src/skills/git-release/SKILL.md +94 -0
- package/src/skills/git-workflow/SKILL.md +177 -0
- package/src/skills/golang-patterns/SKILL.md +511 -0
- package/src/skills/human-review-routing/SKILL.md +65 -0
- package/src/skills/intent-translator/SKILL.md +57 -0
- package/src/skills/java-patterns/SKILL.md +479 -0
- package/src/skills/multi-repo/SKILL.md +187 -0
- package/src/skills/parallel-execute/SKILL.md +92 -0
- package/src/skills/patch-trust-score/SKILL.md +44 -0
- package/src/skills/performance-profiling/SKILL.md +153 -0
- package/src/skills/plan-task/SKILL.md +101 -0
- package/src/skills/python-patterns/SKILL.md +529 -0
- package/src/skills/refactor-guide/SKILL.md +117 -0
- package/src/skills/regression-prediction/SKILL.md +57 -0
- package/src/skills/repo-memory-graph/SKILL.md +49 -0
- package/src/skills/rust-patterns/SKILL.md +492 -0
- package/src/skills/security-scan/SKILL.md +91 -0
- package/src/skills/self-healing-policies/SKILL.md +76 -0
- package/src/skills/tdd-workflow/SKILL.md +126 -0
- package/src/skills/test-coverage/SKILL.md +94 -0
- package/src/skills/test-gap-detector/SKILL.md +58 -0
- package/src/skills/volatility-map/SKILL.md +52 -0
- package/src/workflows/debug-flow.md +119 -0
- package/src/workflows/deploy-check-flow.md +98 -0
- package/src/workflows/discuss-flow.md +97 -0
- package/src/workflows/execute-flow.md +233 -0
- package/src/workflows/execute-phase.md +142 -0
- package/src/workflows/fix-bug-flow.md +210 -0
- package/src/workflows/map-codebase-flow.md +92 -0
- package/src/workflows/multi-repo-flow.md +226 -0
- package/src/workflows/parallel-execution-flow.md +236 -0
- package/src/workflows/plan-flow.md +126 -0
- package/src/workflows/plan-phase.md +101 -0
- package/src/workflows/refactor-flow.md +122 -0
- package/src/workflows/review-code-flow.md +105 -0
- package/src/workflows/spec-driven-flow.md +43 -0
- package/src/workflows/write-docs-flow.md +95 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tdd-workflow
|
|
3
|
+
description: Enforces Test-Driven Development with Red-Green-Refactor cycle and 80%+ coverage. Activate when writing new features, fixing bugs, or refactoring.
|
|
4
|
+
origin: FlowDeck
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# TDD Workflow Skill
|
|
8
|
+
|
|
9
|
+
Tests before code. Always. Red-Green-Refactor is not a suggestion.
|
|
10
|
+
|
|
11
|
+
## When to Activate
|
|
12
|
+
|
|
13
|
+
Activate when:
|
|
14
|
+
- Implementing any new feature
|
|
15
|
+
- Fixing any bug
|
|
16
|
+
- Refactoring existing code
|
|
17
|
+
|
|
18
|
+
## Core Principles
|
|
19
|
+
|
|
20
|
+
- **Tests before code** — write the failing test first, then the implementation
|
|
21
|
+
- **Minimum implementation** — write the least code that makes the test pass
|
|
22
|
+
- **Refactor after green** — clean up only when tests are passing
|
|
23
|
+
- **80%+ coverage** — non-negotiable threshold
|
|
24
|
+
|
|
25
|
+
## Workflow
|
|
26
|
+
|
|
27
|
+
### Red — Write a Failing Test
|
|
28
|
+
|
|
29
|
+
Write a test that describes the behavior you want. It must fail before you write any implementation.
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
// AAA Pattern: Arrange, Act, Assert
|
|
33
|
+
describe('calculateDiscount', () => {
|
|
34
|
+
it('should apply 10% discount for premium users', () => {
|
|
35
|
+
// Arrange
|
|
36
|
+
const user = { tier: 'premium' };
|
|
37
|
+
const price = 100;
|
|
38
|
+
|
|
39
|
+
// Act
|
|
40
|
+
const result = calculateDiscount(price, user);
|
|
41
|
+
|
|
42
|
+
// Assert
|
|
43
|
+
expect(result).toBe(90);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('should return full price for standard users', () => {
|
|
47
|
+
// Arrange
|
|
48
|
+
const user = { tier: 'standard' };
|
|
49
|
+
const price = 100;
|
|
50
|
+
|
|
51
|
+
// Act
|
|
52
|
+
const result = calculateDiscount(price, user);
|
|
53
|
+
|
|
54
|
+
// Assert
|
|
55
|
+
expect(result).toBe(100);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Run it: `npm test` → must fail with "cannot find function" or similar.
|
|
61
|
+
|
|
62
|
+
### Green — Minimum Code to Pass
|
|
63
|
+
|
|
64
|
+
Write the minimum implementation:
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
function calculateDiscount(price: number, user: { tier: string }): number {
|
|
68
|
+
if (user.tier === 'premium') return price * 0.9;
|
|
69
|
+
return price;
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Run it: `npm test` → must pass.
|
|
74
|
+
|
|
75
|
+
### Refactor — Clean Up While Green
|
|
76
|
+
|
|
77
|
+
Now clean up the implementation:
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
const DISCOUNT_RATES: Record<string, number> = {
|
|
81
|
+
premium: 0.10,
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
function calculateDiscount(price: number, user: { tier: string }): number {
|
|
85
|
+
const discountRate = DISCOUNT_RATES[user.tier] ?? 0;
|
|
86
|
+
return price * (1 - discountRate);
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Run it: `npm test` → must still pass.
|
|
91
|
+
|
|
92
|
+
### Git Checkpoint
|
|
93
|
+
|
|
94
|
+
After each Red-Green-Refactor cycle:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
git add -A
|
|
98
|
+
git commit -m "test: add calculateDiscount + implementation"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Test Types
|
|
102
|
+
|
|
103
|
+
| Type | When | Tools |
|
|
104
|
+
|------|------|-------|
|
|
105
|
+
| Unit | Functions, services with mocked deps | vitest, jest |
|
|
106
|
+
| Integration | API endpoints, database queries | supertest, vitest |
|
|
107
|
+
| E2E | Critical user flows | playwright, cypress |
|
|
108
|
+
|
|
109
|
+
Write unit tests for every function. Integration tests for every API route. E2E only for critical paths.
|
|
110
|
+
|
|
111
|
+
## Coverage Check
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
npx vitest --coverage # vitest
|
|
115
|
+
npx jest --coverage # jest
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Threshold: 80% line coverage minimum. If below, write more tests before considering the work done.
|
|
119
|
+
|
|
120
|
+
## Common Mistakes
|
|
121
|
+
|
|
122
|
+
- Writing tests AFTER implementation — these are not TDD tests
|
|
123
|
+
- Writing tests that always pass (asserting something trivially true)
|
|
124
|
+
- Skipping the Refactor step — leaving messy green code is not TDD
|
|
125
|
+
- Testing implementation details instead of behavior
|
|
126
|
+
- Giant tests that test multiple behaviors at once
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-coverage
|
|
3
|
+
description: Enforce test-first development and measure coverage gaps. Use for new features, bug fixes, or when coverage drops below threshold. Drives the write-test → implement → verify cycle.
|
|
4
|
+
origin: FlowDeck
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Test Coverage Skill
|
|
8
|
+
|
|
9
|
+
Ensures code is tested before it is considered done. Coverage numbers are a by-product — the goal is meaningful tests that catch real bugs.
|
|
10
|
+
|
|
11
|
+
## When to Activate
|
|
12
|
+
|
|
13
|
+
Activate when:
|
|
14
|
+
- Implementing a new feature (TDD: tests first)
|
|
15
|
+
- Fixing a bug (write failing test before fix)
|
|
16
|
+
- Coverage drops below threshold
|
|
17
|
+
- Preparing code for review
|
|
18
|
+
|
|
19
|
+
## Core Principles
|
|
20
|
+
|
|
21
|
+
- 80% minimum line coverage — no exceptions
|
|
22
|
+
- Tests before code, not after
|
|
23
|
+
- Test behavior, not implementation
|
|
24
|
+
- Every bug fix gets a regression test
|
|
25
|
+
|
|
26
|
+
## Workflow
|
|
27
|
+
|
|
28
|
+
1. **Write failing test** (Red) — describe the behavior you're about to implement
|
|
29
|
+
2. **Implement minimum code** (Green) — make the test pass
|
|
30
|
+
3. **Refactor** — clean up while keeping tests green
|
|
31
|
+
4. **Run coverage** — verify 80%+ threshold
|
|
32
|
+
5. **Add edge case tests** — for empty inputs, invalid inputs, error paths
|
|
33
|
+
|
|
34
|
+
## Coverage Commands
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# vitest
|
|
38
|
+
npx vitest --coverage
|
|
39
|
+
npx vitest --coverage --reporter=verbose
|
|
40
|
+
|
|
41
|
+
# jest
|
|
42
|
+
npx jest --coverage
|
|
43
|
+
|
|
44
|
+
# view HTML report
|
|
45
|
+
open coverage/index.html
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Coverage Report Format
|
|
49
|
+
|
|
50
|
+
A passing coverage report looks like this:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
----------|---------|----------|---------|---------|
|
|
54
|
+
File | % Stmts | % Branch | % Funcs | % Lines |
|
|
55
|
+
----------|---------|----------|---------|---------|
|
|
56
|
+
All files | 87.3 | 82.1 | 91.4 | 87.3 |
|
|
57
|
+
auth.ts | 94.2 | 88.0 | 100.0 | 94.2 |
|
|
58
|
+
user.ts | 80.1 | 76.4 | 85.7 | 80.1 |
|
|
59
|
+
----------|---------|----------|---------|---------|
|
|
60
|
+
|
|
61
|
+
Coverage threshold met: 80% ✅
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
A failing report looks like:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
services/payment.ts | 41.2 | 30.0 | 50.0 | 41.2 |
|
|
68
|
+
|
|
69
|
+
Coverage threshold NOT met: 41.2% < 80% ❌
|
|
70
|
+
Uncovered lines: 45-67, 89-112
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## What to Test
|
|
74
|
+
|
|
75
|
+
| Category | Examples |
|
|
76
|
+
|---------|---------|
|
|
77
|
+
| Happy path | Normal inputs, expected outputs |
|
|
78
|
+
| Error conditions | Invalid inputs, missing fields, null |
|
|
79
|
+
| Edge cases | Empty arrays, zero values, max values |
|
|
80
|
+
| Auth | Unauthenticated, unauthorized, correct role |
|
|
81
|
+
|
|
82
|
+
## What NOT to Test
|
|
83
|
+
|
|
84
|
+
- Private methods (test via public interface)
|
|
85
|
+
- Third-party library behavior
|
|
86
|
+
- Simple property accessors with no logic
|
|
87
|
+
- Framework internals
|
|
88
|
+
|
|
89
|
+
## Troubleshooting Failures
|
|
90
|
+
|
|
91
|
+
- **Test failing after refactor**: undo the refactor, fix in smaller steps
|
|
92
|
+
- **Test failing after bug fix**: the test should have been failing before the fix
|
|
93
|
+
- **Low coverage on new code**: add edge case tests for all branches
|
|
94
|
+
- **Flaky tests**: find the shared state being mutated, isolate it
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-gap-detector
|
|
3
|
+
description: Identify which areas of a proposed change are weakly covered by tests and suggest the minimum high-value tests to add first.
|
|
4
|
+
origin: FlowDeck
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Test Gap Detector
|
|
8
|
+
|
|
9
|
+
Run `/test-gap` before implementing a feature or fix. Get back a ranked list of coverage gaps and the minimum viable tests to close them.
|
|
10
|
+
|
|
11
|
+
## Gap Categories
|
|
12
|
+
|
|
13
|
+
| Category | What It Means |
|
|
14
|
+
|----------|--------------|
|
|
15
|
+
| missing test file | Source file changed but no `*.test.*` counterpart exists |
|
|
16
|
+
| untested error path | A `catch`, `else`, or error branch has no test |
|
|
17
|
+
| untested branch | An `if/else` or `switch` arm has no test exercising it |
|
|
18
|
+
| no integration test | A service-to-service or API call has no integration test |
|
|
19
|
+
| no regression test | A previously-failed path has no regression test guarding it |
|
|
20
|
+
|
|
21
|
+
## Workflow
|
|
22
|
+
|
|
23
|
+
1. List all files to be changed
|
|
24
|
+
2. For each file, check if a test file exists (`*.test.ts`, `*.spec.ts`, `__tests__/`)
|
|
25
|
+
3. For files with tests, scan for untested branches:
|
|
26
|
+
- Count `if`, `else`, `catch`, `switch` statements
|
|
27
|
+
- Cross-reference with test file to see which paths are exercised
|
|
28
|
+
4. Check `.codebase/FAILURES.json` for prior failures on these paths — flag as regression gap if no regression test exists
|
|
29
|
+
5. For external calls (fetch, db.query, sendEmail), check for integration test coverage
|
|
30
|
+
6. Rank gaps by risk (auth > payment > data > logic > UI)
|
|
31
|
+
7. Produce minimum viable test set (top 3–5 tests)
|
|
32
|
+
|
|
33
|
+
## Output Format
|
|
34
|
+
|
|
35
|
+
```markdown
|
|
36
|
+
## Test Gap Report
|
|
37
|
+
|
|
38
|
+
### Gap Summary
|
|
39
|
+
| File | Gap Type | Risk | Suggested Test |
|
|
40
|
+
|------|----------|------|----------------|
|
|
41
|
+
|
|
42
|
+
### Minimum Viable Test Set (top 5)
|
|
43
|
+
1. **[test name]** — [file.test.ts]
|
|
44
|
+
Tests: [what it validates]
|
|
45
|
+
```typescript
|
|
46
|
+
it('[test name]', async () => {
|
|
47
|
+
// test skeleton
|
|
48
|
+
})
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Coverage Verdict: GOOD | GAPS FOUND | CRITICAL GAPS
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Guidance
|
|
55
|
+
|
|
56
|
+
- A test skeleton is always better than no test — write it even if incomplete
|
|
57
|
+
- Auth and payment paths with no regression test = CRITICAL GAP, block merge
|
|
58
|
+
- Do not add tests just to hit a coverage number — add tests for real risk paths
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: volatility-map
|
|
3
|
+
description: Highlight unstable zones of the repo based on commit churn, recent breakages, hotfix frequency, and unresolved TODO clusters.
|
|
4
|
+
origin: FlowDeck
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Codebase Volatility Map
|
|
8
|
+
|
|
9
|
+
Run `/volatility-map` to generate a heatmap of the most unstable parts of the codebase. Results are stored in `.codebase/VOLATILITY.json` for use by other FlowDeck features.
|
|
10
|
+
|
|
11
|
+
## Stability Levels
|
|
12
|
+
|
|
13
|
+
| Level | Score | Meaning |
|
|
14
|
+
|-------|-------|---------|
|
|
15
|
+
| stable | 0–19 | Low churn, no hotfixes, few TODOs |
|
|
16
|
+
| moderate | 20–49 | Some churn, occasional fixes |
|
|
17
|
+
| volatile | 50–79 | High churn or repeated hotfixes |
|
|
18
|
+
| critical | 80+ | Highest risk, most likely to break |
|
|
19
|
+
|
|
20
|
+
## Score Formula
|
|
21
|
+
|
|
22
|
+
`score = churn_commits + (hotfix_count × 10) + (todo_count × 2)`
|
|
23
|
+
|
|
24
|
+
## Data Collection Workflow
|
|
25
|
+
|
|
26
|
+
1. **Churn analysis** (git log, last 90 days):
|
|
27
|
+
```bash
|
|
28
|
+
git log --since="90 days ago" --name-only --pretty=format: | sort | uniq -c | sort -rn
|
|
29
|
+
```
|
|
30
|
+
2. **Hotfix detection** (commit messages):
|
|
31
|
+
```bash
|
|
32
|
+
git log --since="90 days ago" --pretty=format:"%s %H" | grep -i "hotfix\|revert\|urgent\|critical"
|
|
33
|
+
```
|
|
34
|
+
3. **TODO scan** (source files):
|
|
35
|
+
```bash
|
|
36
|
+
grep -rn "TODO\|FIXME\|HACK\|XXX" src/ --include="*.ts" | cut -d: -f1 | sort | uniq -c
|
|
37
|
+
```
|
|
38
|
+
4. Write results to VOLATILITY.json via `volatility-map` tool
|
|
39
|
+
|
|
40
|
+
## How Other Features Use This
|
|
41
|
+
|
|
42
|
+
- **Patch Trust Score**: deducts points for volatile/critical files
|
|
43
|
+
- **Change Impact Radar**: flags volatile files in impact reports
|
|
44
|
+
- **Safe Execution Modes**: switches to `guarded` for volatile, `review-only` for critical
|
|
45
|
+
- **Human Review Routing**: escalates changes to volatile files to senior reviewers
|
|
46
|
+
|
|
47
|
+
## Refresh Schedule
|
|
48
|
+
|
|
49
|
+
Refresh the volatility map:
|
|
50
|
+
- Before any significant feature work
|
|
51
|
+
- After a production incident
|
|
52
|
+
- Weekly in active development periods
|
|
@@ -0,0 +1,119 @@
|
|
|
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
|
+
```
|
|
@@ -0,0 +1,98 @@
|
|
|
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 |
|
|
@@ -0,0 +1,97 @@
|
|
|
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
|