@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,233 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: execute-flow
|
|
3
|
+
description: "TDD-enforced feature execution: behavior checklist → RED (failing tests) → GREEN (minimum impl) → REFACTOR → review"
|
|
4
|
+
triggers:
|
|
5
|
+
- /new-feature
|
|
6
|
+
steps:
|
|
7
|
+
- name: guard_check
|
|
8
|
+
agent: "@orchestrator"
|
|
9
|
+
priority: first
|
|
10
|
+
action: Verify .planning/ and .codebase/ exist, plan is confirmed; Initialize TDD state (stage=behavior)
|
|
11
|
+
- name: load_plan
|
|
12
|
+
agent: "@orchestrator"
|
|
13
|
+
action: Read active PLAN.md from current phase directory
|
|
14
|
+
- name: define_behaviors
|
|
15
|
+
agent: "@orchestrator"
|
|
16
|
+
action: "Generate behavior checklist from PLAN.md: list all acceptance cases, edge cases, and expected behaviors"
|
|
17
|
+
- name: identify_next_step
|
|
18
|
+
agent: "@orchestrator"
|
|
19
|
+
action: Find first incomplete step (not in steps_complete); Check TDD stage for that step
|
|
20
|
+
- name: write_behavior_tests
|
|
21
|
+
agent: "@tester"
|
|
22
|
+
action: "TDD RED: Write failing tests for the behavior. Tests MUST fail before implementation."
|
|
23
|
+
- name: confirm_red
|
|
24
|
+
agent: "@tester"
|
|
25
|
+
action: "Run failing tests — confirm they fail for expected reasons. Do NOT proceed until tests fail."
|
|
26
|
+
- name: implement_minimum
|
|
27
|
+
agent: "@coder"
|
|
28
|
+
action: "TDD GREEN: Implement minimum code to make failing tests pass. No speculative features."
|
|
29
|
+
- name: confirm_green
|
|
30
|
+
agent: "@tester"
|
|
31
|
+
action: "Run tests — confirm they pass. Do NOT proceed until tests pass."
|
|
32
|
+
- name: refactor_step
|
|
33
|
+
agent: "@coder"
|
|
34
|
+
action: "TDD REFACTOR: Clean up code for this step while preserving passing tests. Only if GREEN."
|
|
35
|
+
- name: verify_step
|
|
36
|
+
agent: "@tester"
|
|
37
|
+
action: "Run full test suite for this step. Confirm all pass after refactoring."
|
|
38
|
+
- name: review_step
|
|
39
|
+
agent: "@reviewer"
|
|
40
|
+
action: "Run @reviewer on completed step work; Check TDD discipline, test coverage, no test omissions"
|
|
41
|
+
- name: update_state
|
|
42
|
+
agent: "@orchestrator"
|
|
43
|
+
action: "Mark step complete via planning-state tool; Update TDD stage"
|
|
44
|
+
- name: loop_or_complete
|
|
45
|
+
agent: "@orchestrator"
|
|
46
|
+
action: "If more steps, return to identify_next_step; If all done, update phase status to complete"
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
# Execute Flow (TDD-Enforced)
|
|
50
|
+
|
|
51
|
+
## Purpose
|
|
52
|
+
|
|
53
|
+
Orchestrates execution of a confirmed PLAN.md following strict Red-Green-Refactor TDD cycle.
|
|
54
|
+
|
|
55
|
+
## Prerequisites
|
|
56
|
+
|
|
57
|
+
Before executing, verify:
|
|
58
|
+
1. `.planning/` exists (project initialized)
|
|
59
|
+
2. `.codebase/` exists (codebase mapped)
|
|
60
|
+
3. `PLAN.md` is confirmed (via /plan phase)
|
|
61
|
+
|
|
62
|
+
If any prerequisite fails, abort with clear error.
|
|
63
|
+
|
|
64
|
+
## TDD Cycle Per Step
|
|
65
|
+
|
|
66
|
+
Each plan step follows the TDD cycle:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
BEHAVIOR → RED → GREEN → REFACTOR → next step
|
|
70
|
+
↑_________| |
|
|
71
|
+
(loop if needed) Only if GREEN
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Step Definitions
|
|
75
|
+
|
|
76
|
+
### Step 1: Guard Check
|
|
77
|
+
|
|
78
|
+
Verify prerequisites:
|
|
79
|
+
- `.planning/` directory exists
|
|
80
|
+
- `.codebase/` directory exists
|
|
81
|
+
- `STATE.md` has `plan_confirmed: true`
|
|
82
|
+
- `PLAN.md` exists in current phase directory
|
|
83
|
+
|
|
84
|
+
Initialize TDD state:
|
|
85
|
+
```yaml
|
|
86
|
+
tdd:
|
|
87
|
+
stage: behavior
|
|
88
|
+
cycle: 1
|
|
89
|
+
behaviors: []
|
|
90
|
+
regression_test_links: []
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Step 2: Load Plan
|
|
94
|
+
|
|
95
|
+
Read the active PLAN.md from the current phase directory.
|
|
96
|
+
Parse the tasks list and identify which steps are complete.
|
|
97
|
+
|
|
98
|
+
### Step 3: Define Behaviors
|
|
99
|
+
|
|
100
|
+
Spawn `@orchestrator` to generate behavior checklist from PLAN.md:
|
|
101
|
+
- Acceptance cases for each step
|
|
102
|
+
- Edge cases to test
|
|
103
|
+
- Expected behaviors
|
|
104
|
+
|
|
105
|
+
Store in TDD state.
|
|
106
|
+
|
|
107
|
+
### Step 4: Identify Next Step
|
|
108
|
+
|
|
109
|
+
From PLAN.md, find the first step NOT in `steps_complete`.
|
|
110
|
+
Check TDD stage — only proceed if stage is appropriate for the step.
|
|
111
|
+
|
|
112
|
+
### Step 5: Write Failing Tests (RED)
|
|
113
|
+
|
|
114
|
+
Spawn `@tester` to write tests for the step's behavior:
|
|
115
|
+
- **Tests MUST fail** before implementation
|
|
116
|
+
- Cover acceptance cases and edge cases
|
|
117
|
+
- Use AAA pattern (Arrange-Act-Assert)
|
|
118
|
+
|
|
119
|
+
### Step 6: Confirm RED
|
|
120
|
+
|
|
121
|
+
Run failing tests:
|
|
122
|
+
- **GUARD: Do NOT proceed to Step 7 until tests fail**
|
|
123
|
+
- If tests pass unexpectedly, tests don't correctly describe behavior
|
|
124
|
+
|
|
125
|
+
### Step 7: Implement Minimum (GREEN)
|
|
126
|
+
|
|
127
|
+
Spawn `@coder` to implement:
|
|
128
|
+
- **Minimum code** to make failing tests pass
|
|
129
|
+
- No speculative features
|
|
130
|
+
- No over-engineering
|
|
131
|
+
|
|
132
|
+
### Step 8: Confirm GREEN
|
|
133
|
+
|
|
134
|
+
Run tests:
|
|
135
|
+
- **GUARD: Do NOT proceed to Step 9 until tests pass**
|
|
136
|
+
- If tests fail, return to Step 7
|
|
137
|
+
|
|
138
|
+
### Step 9: Refactor (REFACTOR)
|
|
139
|
+
|
|
140
|
+
Only if GREEN:
|
|
141
|
+
- Clean up code for this step
|
|
142
|
+
- Remove dead code
|
|
143
|
+
- Improve readability
|
|
144
|
+
- **GUARD: Do not refactor if not GREEN**
|
|
145
|
+
|
|
146
|
+
### Step 10: Verify
|
|
147
|
+
|
|
148
|
+
Run full test suite:
|
|
149
|
+
- All tests must pass
|
|
150
|
+
- If any fails, revert refactoring
|
|
151
|
+
|
|
152
|
+
### Step 11: Review Step
|
|
153
|
+
|
|
154
|
+
Spawn `@reviewer` to check:
|
|
155
|
+
- Code quality, security, conventions
|
|
156
|
+
- TDD discipline followed
|
|
157
|
+
- Test coverage >= 80%
|
|
158
|
+
- No missing or weak tests (flag as major finding)
|
|
159
|
+
|
|
160
|
+
### Step 12: Update State
|
|
161
|
+
|
|
162
|
+
Mark step complete via planning-state tool:
|
|
163
|
+
```yaml
|
|
164
|
+
steps_complete: [N, ...]
|
|
165
|
+
last_action: "Step N complete via TDD: [behavior]"
|
|
166
|
+
tdd:
|
|
167
|
+
stage: behavior # Ready for next step
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Step 13: Loop or Complete
|
|
171
|
+
|
|
172
|
+
If more steps pending:
|
|
173
|
+
- Return to Step 3 (define behaviors for next step)
|
|
174
|
+
|
|
175
|
+
If all steps complete:
|
|
176
|
+
- Update phase status to "complete"
|
|
177
|
+
- Update ROADMAP.md progress
|
|
178
|
+
- Present completion summary
|
|
179
|
+
|
|
180
|
+
## Wave-Based Execution
|
|
181
|
+
|
|
182
|
+
WF-03 respects wave structure from PLAN.md:
|
|
183
|
+
- Wave 1 steps execute first (with TDD cycle per step)
|
|
184
|
+
- Wave 2 steps execute after Wave 1 completes
|
|
185
|
+
- Wave 3 steps execute after Wave 2 completes
|
|
186
|
+
- No intra-wave dependencies (parallel execution)
|
|
187
|
+
|
|
188
|
+
## Guards Summary
|
|
189
|
+
|
|
190
|
+
| Transition | Guard | If Violated |
|
|
191
|
+
|-----------|-------|-------------|
|
|
192
|
+
| behavior → red | Test written and fails | Block until test fails |
|
|
193
|
+
| red → green | Test exists and fails | Block until test passes |
|
|
194
|
+
| green → refactor | Tests are green | Block until green |
|
|
195
|
+
| refactor → verify | All tests pass | Block until all pass |
|
|
196
|
+
|
|
197
|
+
## Override Mechanism
|
|
198
|
+
|
|
199
|
+
User can override with `/fd-new-feature --override`:
|
|
200
|
+
- Every override is logged in `override_log`
|
|
201
|
+
- Surface override in next review
|
|
202
|
+
- Flag in deploy check
|
|
203
|
+
|
|
204
|
+
## Error Handling
|
|
205
|
+
|
|
206
|
+
D-03: Fail fast with clear error
|
|
207
|
+
- If guard check fails: abort with clear error and remediation
|
|
208
|
+
- If @coder fails: report failure, offer retry or skip
|
|
209
|
+
- If @reviewer finds critical issues: return to Step 7 for fixes
|
|
210
|
+
- No partial state saved on error
|
|
211
|
+
|
|
212
|
+
## State Updates
|
|
213
|
+
|
|
214
|
+
STATE.md updates after each step:
|
|
215
|
+
```yaml
|
|
216
|
+
steps_complete: [1, 2] # Added after step 2
|
|
217
|
+
steps_pending: [3, 4, 5] # Removed step 2
|
|
218
|
+
last_action: "Step 2 TDD complete: [behavior] (RED→GREEN→REFACTOR)"
|
|
219
|
+
tdd:
|
|
220
|
+
stage: behavior
|
|
221
|
+
cycle: 2
|
|
222
|
+
behaviors_completed: 2
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Full phase completion:
|
|
226
|
+
```yaml
|
|
227
|
+
status: complete
|
|
228
|
+
last_action: "Phase N TDD complete — all steps finished"
|
|
229
|
+
tdd:
|
|
230
|
+
stage: complete
|
|
231
|
+
cycles_used: N
|
|
232
|
+
behaviors_completed: M
|
|
233
|
+
```
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: execute-phase
|
|
3
|
+
description: "Orchestrates /execute-phase [N] — delegates to flowdeck-executor with checkpoint protocol"
|
|
4
|
+
triggers:
|
|
5
|
+
- /execute-phase
|
|
6
|
+
steps:
|
|
7
|
+
- name: verify_prerequisites
|
|
8
|
+
agent: "@orchestrator"
|
|
9
|
+
action: Check .planning/, .codebase/, plan_confirmed flag
|
|
10
|
+
- name: load_context
|
|
11
|
+
agent: "@orchestrator"
|
|
12
|
+
action: Load PLAN.md, STATE.md, PROJECT.md
|
|
13
|
+
- name: delegate_to_executor
|
|
14
|
+
agent: "@flowdeck-executor"
|
|
15
|
+
action: Spawn flowdeck-executor agent to execute plan atomically
|
|
16
|
+
- name: checkpoint_protocol
|
|
17
|
+
agent: "@flowdeck-executor"
|
|
18
|
+
action: After each task, checkpoint state via planning-state tool
|
|
19
|
+
- name: present_results
|
|
20
|
+
agent: "@orchestrator"
|
|
21
|
+
action: Present execution summary
|
|
22
|
+
- name: update_state
|
|
23
|
+
agent: "@orchestrator"
|
|
24
|
+
action: Mark phase complete in STATE.md and ROADMAP.md
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# Execute Phase Workflow
|
|
28
|
+
|
|
29
|
+
## Purpose
|
|
30
|
+
|
|
31
|
+
Execute `/execute-phase [N]` to implement a phase plan using the flowdeck-executor agent.
|
|
32
|
+
|
|
33
|
+
## Prerequisites
|
|
34
|
+
|
|
35
|
+
Before executing, verify:
|
|
36
|
+
1. `.planning/` exists
|
|
37
|
+
2. `.codebase/` exists
|
|
38
|
+
3. `.planning/phases/phase-N/PLAN.md` exists and is confirmed
|
|
39
|
+
|
|
40
|
+
## Process
|
|
41
|
+
|
|
42
|
+
### Step 1: Verify Prerequisites
|
|
43
|
+
|
|
44
|
+
Guard check:
|
|
45
|
+
- `.planning/` directory must exist
|
|
46
|
+
- `.codebase/` directory must exist
|
|
47
|
+
- `STATE.md` has `plan_confirmed: true`
|
|
48
|
+
- `PLAN.md` exists in `.planning/phases/phase-N/`
|
|
49
|
+
|
|
50
|
+
If any check fails, abort with clear error and remediation steps.
|
|
51
|
+
|
|
52
|
+
### Step 2: Load Context
|
|
53
|
+
|
|
54
|
+
Read into execution context:
|
|
55
|
+
- `.planning/PROJECT.md` (project goals and tech stack)
|
|
56
|
+
- `.planning/STATE.md` (current phase and progress)
|
|
57
|
+
- `.planning/phases/phase-N/PLAN.md` (implementation plan)
|
|
58
|
+
- `.codebase/ARCHITECTURE.md` (if exists)
|
|
59
|
+
- `.codebase/CONVENTIONS.md` (if exists)
|
|
60
|
+
|
|
61
|
+
### Step 3: Delegate to flowdeck-executor
|
|
62
|
+
|
|
63
|
+
Spawn flowdeck-executor agent with full context.
|
|
64
|
+
|
|
65
|
+
Agent will:
|
|
66
|
+
1. Execute each task in the plan
|
|
67
|
+
2. Run verification tests for each task
|
|
68
|
+
3. Commit atomically with message: `feat(phase-N): task description`
|
|
69
|
+
4. Handle deviations (document, pause for approval if checkpoint)
|
|
70
|
+
5. Create SUMMARY.md after all tasks complete
|
|
71
|
+
|
|
72
|
+
### Step 4: Checkpoint Protocol
|
|
73
|
+
|
|
74
|
+
After each task:
|
|
75
|
+
- Call `planning-state.update_planning_state()` with current progress
|
|
76
|
+
- Update `steps_complete`, `last_action`, `next_action`
|
|
77
|
+
- Append to session history (never overwrite)
|
|
78
|
+
|
|
79
|
+
If session interrupted:
|
|
80
|
+
- User can resume with `/resume`
|
|
81
|
+
- Executor will pick up from last checkpoint
|
|
82
|
+
|
|
83
|
+
### Step 5: Present Results
|
|
84
|
+
|
|
85
|
+
On completion, present:
|
|
86
|
+
```
|
|
87
|
+
## Phase [N] Execution Complete
|
|
88
|
+
|
|
89
|
+
**Executed:** [date]
|
|
90
|
+
**Tasks:** [N] completed
|
|
91
|
+
**Duration:** [time]
|
|
92
|
+
|
|
93
|
+
### What Was Built
|
|
94
|
+
[Summary of deliverables]
|
|
95
|
+
|
|
96
|
+
### Key Decisions
|
|
97
|
+
- [D-XX]: [decision made during execution]
|
|
98
|
+
|
|
99
|
+
### Deviations
|
|
100
|
+
- [Any deviations from original plan]
|
|
101
|
+
|
|
102
|
+
### Verification
|
|
103
|
+
- [x] Criterion 1
|
|
104
|
+
- [x] Criterion 2
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Step 6: Update State
|
|
108
|
+
|
|
109
|
+
Update STATE.md:
|
|
110
|
+
- Set `status: complete` for current phase
|
|
111
|
+
- Update `last_action` to "Phase N complete"
|
|
112
|
+
- Append to session history
|
|
113
|
+
|
|
114
|
+
Update ROADMAP.md:
|
|
115
|
+
- Mark phase N as "complete"
|
|
116
|
+
|
|
117
|
+
## Agent Configuration
|
|
118
|
+
|
|
119
|
+
| Agent | Model | Purpose |
|
|
120
|
+
|-------|-------|---------|
|
|
121
|
+
| flowdeck-executor | Sonnet 4.6 | Executes plan with atomic commits |
|
|
122
|
+
|
|
123
|
+
## Output Files
|
|
124
|
+
|
|
125
|
+
- `.planning/phases/phase-N/SUMMARY.md` — execution summary
|
|
126
|
+
- `.planning/phases/phase-N/RESULT.md` — final outcome (legacy)
|
|
127
|
+
- STATE.md — updated with phase completion
|
|
128
|
+
|
|
129
|
+
## Deviation Handling
|
|
130
|
+
|
|
131
|
+
If implementation requires deviating from plan:
|
|
132
|
+
1. Document the deviation in SUMMARY.md
|
|
133
|
+
2. If at checkpoint: pause and get user approval
|
|
134
|
+
3. If minor: continue and document
|
|
135
|
+
4. Update PLAN.md with adjusted approach
|
|
136
|
+
|
|
137
|
+
## Error Handling
|
|
138
|
+
|
|
139
|
+
- If task fails: stop at checkpoint, preserve state
|
|
140
|
+
- User can run `/fix-bug` or manually fix
|
|
141
|
+
- Resume picks up from last successful checkpoint
|
|
142
|
+
- Never leave partial state on error
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fix-bug-flow
|
|
3
|
+
description: "TDD-enforced bug fix: reproduce → isolate → RED (failing regression test) → GREEN (minimum fix) → REFACTOR → verify"
|
|
4
|
+
triggers:
|
|
5
|
+
- /fix-bug
|
|
6
|
+
steps:
|
|
7
|
+
- name: load_context
|
|
8
|
+
agent: "@orchestrator"
|
|
9
|
+
action: Read STATE.md, ARCHITECTURE.md, CONVENTIONS.md; Initialize TDD state (stage=behavior)
|
|
10
|
+
- name: define_behaviors
|
|
11
|
+
agent: "@orchestrator"
|
|
12
|
+
action: "Generate behavior checklist: what behaviors does this bug break? List acceptance cases."
|
|
13
|
+
- name: reproduce
|
|
14
|
+
agent: "@debug-specialist"
|
|
15
|
+
action: Reproduce the bug with minimal case; document inputs and expected vs actual
|
|
16
|
+
- name: isolate
|
|
17
|
+
agent: "@researcher"
|
|
18
|
+
action: Researcher investigates root cause; traces stack, reads related code
|
|
19
|
+
- name: write_failing_test
|
|
20
|
+
agent: "@tester"
|
|
21
|
+
action: "TDD RED: Write a failing regression test that reproduces the bug. Test MUST fail before proceeding."
|
|
22
|
+
- name: confirm_red
|
|
23
|
+
agent: "@tester"
|
|
24
|
+
action: "Run failing test — confirm it fails for the expected reason. Record RED state. Do NOT proceed until test fails."
|
|
25
|
+
- name: implement_fix
|
|
26
|
+
agent: "@coder"
|
|
27
|
+
action: "TDD GREEN: Implement minimum code change to make the failing test pass. No over-engineering."
|
|
28
|
+
- name: confirm_green
|
|
29
|
+
agent: "@tester"
|
|
30
|
+
action: "Run regression test — confirm it passes. Record GREEN state. Do NOT proceed until test passes."
|
|
31
|
+
- name: refactor
|
|
32
|
+
agent: "@coder"
|
|
33
|
+
action: "TDD REFACTOR: Clean up implementation while preserving passing tests. Only if tests are GREEN."
|
|
34
|
+
- name: verify_refactor
|
|
35
|
+
agent: "@tester"
|
|
36
|
+
action: "Run full test suite — confirm all tests pass after refactoring."
|
|
37
|
+
- name: review
|
|
38
|
+
agent: "@reviewer"
|
|
39
|
+
action: "Reviewer checks: fix is correct, no regressions, TDD discipline followed, no missing tests."
|
|
40
|
+
- name: update_state
|
|
41
|
+
agent: "@orchestrator"
|
|
42
|
+
action: "Update STATE.md: record bug, fix, test name, TDD stage=complete, regression test link"
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
# Fix Bug Flow (TDD-Enforced)
|
|
46
|
+
|
|
47
|
+
## Purpose
|
|
48
|
+
|
|
49
|
+
Fix a reported bug following strict Red-Green-Refactor TDD cycle with mandatory regression test.
|
|
50
|
+
|
|
51
|
+
## Prerequisites
|
|
52
|
+
|
|
53
|
+
- `.planning/` initialized
|
|
54
|
+
- Bug description or reproduction steps available
|
|
55
|
+
|
|
56
|
+
## TDD Cycle
|
|
57
|
+
|
|
58
|
+
The workflow enforces the TDD cycle with guards at each transition:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
BEHAVIOR → RED → GREEN → REFACTOR → complete
|
|
62
|
+
↑______________| |
|
|
63
|
+
(loop if needed) |
|
|
64
|
+
Only if GREEN
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Step Definitions
|
|
68
|
+
|
|
69
|
+
### Step 1: Load Context
|
|
70
|
+
|
|
71
|
+
Read:
|
|
72
|
+
- `.planning/STATE.md` — current phase, TDD state
|
|
73
|
+
- `.codebase/ARCHITECTURE.md` — system structure
|
|
74
|
+
- `.codebase/CONVENTIONS.md` — coding standards
|
|
75
|
+
|
|
76
|
+
Initialize TDD state:
|
|
77
|
+
```yaml
|
|
78
|
+
tdd:
|
|
79
|
+
stage: behavior
|
|
80
|
+
cycle: 1
|
|
81
|
+
behaviors: []
|
|
82
|
+
regression_test_links: []
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Step 2: Define Behaviors
|
|
86
|
+
|
|
87
|
+
Spawn `@orchestrator` to generate a behavior checklist:
|
|
88
|
+
- What behaviors does this bug break?
|
|
89
|
+
- What are the acceptance cases for "fixed"?
|
|
90
|
+
- What edge cases should be tested?
|
|
91
|
+
|
|
92
|
+
Store behaviors in TDD state.
|
|
93
|
+
|
|
94
|
+
### Step 3: Reproduce
|
|
95
|
+
|
|
96
|
+
Identify minimal reproduction:
|
|
97
|
+
- What inputs trigger the bug?
|
|
98
|
+
- What is expected behavior?
|
|
99
|
+
- What is actual behavior?
|
|
100
|
+
|
|
101
|
+
Document in comment or issue before touching code.
|
|
102
|
+
|
|
103
|
+
### Step 4: Isolate Root Cause
|
|
104
|
+
|
|
105
|
+
Spawn `@researcher` to investigate:
|
|
106
|
+
- Trace the execution path
|
|
107
|
+
- Read stack trace completely
|
|
108
|
+
- Check recent changes: `git log --oneline -20 -- <file>`
|
|
109
|
+
- Identify root cause (not symptom)
|
|
110
|
+
|
|
111
|
+
### Step 5: Write Failing Test (RED)
|
|
112
|
+
|
|
113
|
+
Spawn `@tester` to write regression test:
|
|
114
|
+
- **Test MUST fail on current code** (this is the RED phase)
|
|
115
|
+
- Named: `test('should <expected> when <condition>')`
|
|
116
|
+
- Tests the bug scenario exactly
|
|
117
|
+
- Use AAA pattern (Arrange-Act-Assert)
|
|
118
|
+
|
|
119
|
+
### Step 6: Confirm RED
|
|
120
|
+
|
|
121
|
+
Run the failing test:
|
|
122
|
+
- Confirm it fails for the expected reason
|
|
123
|
+
- **GUARD: Do NOT proceed to Step 7 until test fails**
|
|
124
|
+
- If test passes unexpectedly, the test is not correctly reproducing the bug
|
|
125
|
+
|
|
126
|
+
### Step 7: Implement Fix (GREEN)
|
|
127
|
+
|
|
128
|
+
Spawn `@coder` to implement fix:
|
|
129
|
+
- Fix the root cause identified in Step 4
|
|
130
|
+
- **Minimum code change** that makes regression test pass
|
|
131
|
+
- Do NOT add unrelated functionality
|
|
132
|
+
- Do NOT over-engineer
|
|
133
|
+
|
|
134
|
+
### Step 8: Confirm GREEN
|
|
135
|
+
|
|
136
|
+
Run regression test:
|
|
137
|
+
- **GUARD: Do NOT proceed to Step 9 until test passes**
|
|
138
|
+
- If test fails, the fix is incomplete — return to Step 7
|
|
139
|
+
|
|
140
|
+
### Step 9: Refactor (REFACTOR)
|
|
141
|
+
|
|
142
|
+
Only if tests are GREEN:
|
|
143
|
+
- Clean up implementation
|
|
144
|
+
- Remove dead code introduced during green phase
|
|
145
|
+
- Improve readability without changing behavior
|
|
146
|
+
- **GUARD: Do not refactor if tests are not green**
|
|
147
|
+
|
|
148
|
+
### Step 10: Verify Refactor
|
|
149
|
+
|
|
150
|
+
Run full test suite:
|
|
151
|
+
- All tests must pass
|
|
152
|
+
- If any test fails, revert refactoring and return to Step 9
|
|
153
|
+
|
|
154
|
+
### Step 11: Review
|
|
155
|
+
|
|
156
|
+
Spawn `@reviewer` to check:
|
|
157
|
+
- Fix is correct and complete
|
|
158
|
+
- No regressions introduced
|
|
159
|
+
- TDD discipline followed (RED before GREEN, minimum impl)
|
|
160
|
+
- Missing tests are flagged as major findings
|
|
161
|
+
- No suspicious test omissions
|
|
162
|
+
|
|
163
|
+
### Step 12: Update State
|
|
164
|
+
|
|
165
|
+
Update STATE.md:
|
|
166
|
+
- Record bug description and root cause
|
|
167
|
+
- Record fix applied (file:line)
|
|
168
|
+
- Record regression test name and path
|
|
169
|
+
- Update TDD stage to "complete"
|
|
170
|
+
- Update `last_action` to "Bug fixed: [description]"
|
|
171
|
+
|
|
172
|
+
## Error Handling
|
|
173
|
+
|
|
174
|
+
- **GUARD VIOLATION**: If coder attempts to skip RED or GREEN phase, block and return to correct phase
|
|
175
|
+
- **Override mechanism**: User can override with `/fd-fix-bug --override` but every override is logged in `override_log`
|
|
176
|
+
- If root cause unclear: spawn `@debug-specialist` for deeper analysis
|
|
177
|
+
- If fix breaks tests: revert, reassess root cause, never suppress error
|
|
178
|
+
|
|
179
|
+
## Override Protocol
|
|
180
|
+
|
|
181
|
+
If user requests bypass of TDD stages:
|
|
182
|
+
1. Log the override: `logTDDOverride(dir, stage, reason, override_by="user")`
|
|
183
|
+
2. Surface override in next review check
|
|
184
|
+
3. Flag in deploy check as "TDD override used"
|
|
185
|
+
|
|
186
|
+
## Output
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
## Bug Fix Complete (TDD-Enforced)
|
|
190
|
+
|
|
191
|
+
**Bug:** [description]
|
|
192
|
+
**Root cause:** [what caused it]
|
|
193
|
+
**Behaviors tested:** [N behaviors]
|
|
194
|
+
**TDD Stage:** complete
|
|
195
|
+
**Cycle:** [N cycles used]
|
|
196
|
+
|
|
197
|
+
**Regression test:** [test name] @ [path]
|
|
198
|
+
**Test result:** ✅ PASS
|
|
199
|
+
|
|
200
|
+
**Override used:** [yes/no]
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Guards Summary
|
|
204
|
+
|
|
205
|
+
| Transition | Guard | If Violated |
|
|
206
|
+
|-----------|-------|-------------|
|
|
207
|
+
| behavior → red | Test written and fails | Block until test fails |
|
|
208
|
+
| red → green | Test exists and fails | Block until test passes |
|
|
209
|
+
| green → refactor | Tests are green | Block until green |
|
|
210
|
+
| refactor → complete | All tests pass | Block until all pass |
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: map-codebase-flow
|
|
3
|
+
description: "Orchestrates codebase mapping (parallel mappers → wait for all → synthesize → write .codebase/ docs)"
|
|
4
|
+
triggers:
|
|
5
|
+
- /map-codebase
|
|
6
|
+
steps:
|
|
7
|
+
- name: check_existing
|
|
8
|
+
agent: "@orchestrator"
|
|
9
|
+
priority: first
|
|
10
|
+
action: Check if .codebase/ already exists; warn and require confirmation if present
|
|
11
|
+
- name: initialize_worktrees
|
|
12
|
+
agent: "@orchestrator"
|
|
13
|
+
action: Create individual worktrees for each mapper agent (one per doc: STACK, ARCHITECTURE, STRUCTURE, CONVENTIONS, TESTING, CONCERNS)
|
|
14
|
+
- name: invoke_mappers
|
|
15
|
+
agent: "@mapper"
|
|
16
|
+
action: Spawn 6 @mapper agents in parallel, each writing to its assigned doc file
|
|
17
|
+
- name: wait_for_mappers
|
|
18
|
+
agent: "@orchestrator"
|
|
19
|
+
action: Wait for all mapper agents to complete
|
|
20
|
+
- name: cleanup_worktrees
|
|
21
|
+
agent: "@orchestrator"
|
|
22
|
+
action: Remove worktrees after all mappers complete (success or error)
|
|
23
|
+
- name: verify_output
|
|
24
|
+
agent: "@orchestrator"
|
|
25
|
+
action: Verify all 6 .codebase/ doc files exist and contain non-empty content
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
# Map Codebase Flow
|
|
29
|
+
|
|
30
|
+
## Purpose
|
|
31
|
+
|
|
32
|
+
Maps an existing codebase to documentation via parallel analysis. Produces STACK.md, ARCHITECTURE.md, STRUCTURE.md, CONVENTIONS.md, TESTING.md, CONCERNS.md in `.codebase/`.
|
|
33
|
+
|
|
34
|
+
## Process
|
|
35
|
+
|
|
36
|
+
### Step 1: Check Existing
|
|
37
|
+
|
|
38
|
+
If `.codebase/` directory already exists:
|
|
39
|
+
```
|
|
40
|
+
Warning: .codebase/ already exists. Running /map-codebase will overwrite existing docs.
|
|
41
|
+
Continue? (y/n)
|
|
42
|
+
```
|
|
43
|
+
If user declines, abort. If user confirms, proceed.
|
|
44
|
+
|
|
45
|
+
### Step 2: Initialize Worktrees
|
|
46
|
+
|
|
47
|
+
D-04: Each mapper runs in its own isolated worktree to prevent conflicts.
|
|
48
|
+
Create worktrees:
|
|
49
|
+
- `flowdeck-mapper-stack`
|
|
50
|
+
- `flowdeck-mapper-arch`
|
|
51
|
+
- `flowdeck-mapper-structure`
|
|
52
|
+
- `flowdeck-mapper-conventions`
|
|
53
|
+
- `flowdeck-mapper-testing`
|
|
54
|
+
- `flowdeck-mapper-concerns`
|
|
55
|
+
|
|
56
|
+
### Step 3: Invoke Mappers
|
|
57
|
+
|
|
58
|
+
Spawn 6 @mapper agents in parallel:
|
|
59
|
+
- @mapper → STACK.md (tech stack, dependencies, versions)
|
|
60
|
+
- @mapper → ARCHITECTURE.md (system design, components, data flow)
|
|
61
|
+
- @mapper → STRUCTURE.md (file organization, directory layout)
|
|
62
|
+
- @mapper → CONVENTIONS.md (coding standards, naming, patterns)
|
|
63
|
+
- @mapper → TESTING.md (test strategy, coverage, frameworks)
|
|
64
|
+
- @mapper → CONCERNS.md (known issues, technical debt, risks)
|
|
65
|
+
|
|
66
|
+
Each mapper:
|
|
67
|
+
- Reads source files directly (no guessing)
|
|
68
|
+
- Outputs factual analysis only
|
|
69
|
+
- Writes to assigned .codebase/ doc file
|
|
70
|
+
|
|
71
|
+
### Step 4: Wait for Completion
|
|
72
|
+
|
|
73
|
+
Wait for all 6 mapper agents to complete. If any fails:
|
|
74
|
+
- Log the failure
|
|
75
|
+
- Continue with remaining mappers
|
|
76
|
+
- Report which docs were not generated
|
|
77
|
+
|
|
78
|
+
### Step 5: Cleanup
|
|
79
|
+
|
|
80
|
+
Remove all worktrees regardless of outcome (D-04: cleanup happens after all agents complete).
|
|
81
|
+
|
|
82
|
+
### Step 6: Verify
|
|
83
|
+
|
|
84
|
+
Check that all 6 .codebase/ doc files exist and contain non-empty content.
|
|
85
|
+
If any are missing or empty, report which ones need regeneration.
|
|
86
|
+
|
|
87
|
+
## Error Handling
|
|
88
|
+
|
|
89
|
+
D-03: Fail fast with clear error
|
|
90
|
+
- If .codebase/ check fails: show clear error with remediation
|
|
91
|
+
- If worktree creation fails: report which worktree failed
|
|
92
|
+
- Do NOT save partial state on error
|