@dv.nghiem/flowdeck 0.2.4 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +24 -41
  2. package/dist/hooks/memory-hook.d.ts +21 -0
  3. package/dist/hooks/memory-hook.d.ts.map +1 -0
  4. package/dist/hooks/orchestrator-guard-hook.d.ts.map +1 -1
  5. package/dist/hooks/todo-hook.d.ts +1 -7
  6. package/dist/hooks/todo-hook.d.ts.map +1 -1
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +709 -420
  9. package/dist/services/memory-store.d.ts +40 -0
  10. package/dist/services/memory-store.d.ts.map +1 -0
  11. package/dist/tools/memory-search.d.ts +3 -0
  12. package/dist/tools/memory-search.d.ts.map +1 -0
  13. package/docs/commands/fd-doctor.md +21 -0
  14. package/docs/commands/fd-quick.md +33 -0
  15. package/docs/commands/fd-reflect.md +23 -0
  16. package/docs/commands/fd-status.md +31 -0
  17. package/docs/commands/fd-translate-intent.md +17 -0
  18. package/docs/commands.md +209 -271
  19. package/docs/configuration.md +1 -2
  20. package/docs/index.md +22 -28
  21. package/docs/memory.md +69 -0
  22. package/docs/quick-start.md +1 -1
  23. package/package.json +1 -1
  24. package/src/commands/fd-deploy-check.md +131 -11
  25. package/src/commands/fd-new-project.md +14 -1
  26. package/src/commands/fd-quick.md +60 -0
  27. package/src/commands/fd-reflect.md +41 -2
  28. package/src/commands/fd-status.md +84 -0
  29. package/src/rules/README.md +8 -7
  30. package/src/skills/agent-harness-construction/SKILL.md +227 -0
  31. package/src/skills/api-design/SKILL.md +5 -0
  32. package/src/skills/backend-patterns/SKILL.md +105 -0
  33. package/src/skills/clean-architecture/SKILL.md +85 -0
  34. package/src/skills/cqrs/SKILL.md +230 -0
  35. package/src/skills/ddd-architecture/SKILL.md +104 -0
  36. package/src/skills/django-patterns/SKILL.md +304 -0
  37. package/src/skills/django-tdd/SKILL.md +297 -0
  38. package/src/skills/event-driven-architecture/SKILL.md +152 -0
  39. package/src/skills/frontend-pattern/SKILL.md +159 -0
  40. package/src/skills/hexagonal-architecture/SKILL.md +80 -0
  41. package/src/skills/layered-architecture/SKILL.md +64 -0
  42. package/src/skills/postgres-patterns/SKILL.md +74 -0
  43. package/src/skills/python-patterns/SKILL.md +5 -0
  44. package/src/skills/saga-architecture/SKILL.md +113 -0
  45. package/dist/tools/run-parallel.d.ts +0 -4
  46. package/dist/tools/run-parallel.d.ts.map +0 -1
  47. package/docs/command-migration.md +0 -175
  48. package/docs/commands/fd-analyze-change.md +0 -107
  49. package/docs/commands/fd-dashboard.md +0 -11
  50. package/docs/commands/fd-evaluate-risk.md +0 -134
  51. package/docs/commands/fd-guarded-edit.md +0 -105
  52. package/docs/commands/fd-progress.md +0 -11
  53. package/docs/commands/fd-review-code.md +0 -29
  54. package/docs/commands/fd-roadmap.md +0 -10
  55. package/docs/commands/fd-settings.md +0 -10
  56. package/docs/parallel-execution.md +0 -255
  57. package/src/commands/fd-analyze-change.md +0 -57
  58. package/src/commands/fd-approve.md +0 -64
  59. package/src/commands/fd-blast-radius.md +0 -49
  60. package/src/commands/fd-dashboard.md +0 -57
  61. package/src/commands/fd-evaluate-risk.md +0 -62
  62. package/src/commands/fd-guarded-edit.md +0 -69
  63. package/src/commands/fd-impact-radar.md +0 -51
  64. package/src/commands/fd-learn.md +0 -36
  65. package/src/commands/fd-progress.md +0 -50
  66. package/src/commands/fd-regression-predict.md +0 -57
  67. package/src/commands/fd-review-code.md +0 -96
  68. package/src/commands/fd-review-route.md +0 -54
  69. package/src/commands/fd-roadmap.md +0 -46
  70. package/src/commands/fd-settings.md +0 -57
  71. package/src/commands/fd-test-gap.md +0 -54
  72. package/src/commands/fd-volatility-map.md +0 -64
  73. package/src/commands/fd-workspace-status.md +0 -34
  74. package/src/skills/parallel-execute/SKILL.md +0 -92
@@ -1,255 +0,0 @@
1
- # Parallel Execution
2
-
3
- FlowDeck can coordinate multiple agents working simultaneously on independent tasks. This is managed by the `@parallel-coordinator` agent using a wave-based execution model.
4
-
5
- ---
6
-
7
- ## When to Use Parallel Execution
8
-
9
- Parallel execution pays off when:
10
-
11
- - A feature decomposes into clearly independent tracks (research, implementation, documentation)
12
- - The codebase has well-separated modules with distinct file ownership
13
- - Review and security audit need to happen simultaneously (they always can)
14
- - Estimated total work exceeds 30 minutes
15
-
16
- ## When NOT to Use It
17
-
18
- Avoid parallel execution when:
19
-
20
- - Total estimated work is under 30 minutes — coordination overhead outweighs the gain
21
- - File ownership is unclear — parallel agents editing the same files produce merge conflicts
22
- - Task B depends directly on task A's output — sequential is correct here, not parallel
23
-
24
- ---
25
-
26
- ## The WAVE TABLE
27
-
28
- When `@parallel-coordinator` plans work, it produces a WAVE TABLE that maps each wave to its agents, and records any inter-wave dependencies:
29
-
30
- ```
31
- ╔══════════════════════════════════════════════════════════════╗
32
- ║ WAVE TABLE — [Feature Name] ║
33
- ╠══════════════════════════════════════════════════════════════╣
34
- ║ Wave 1 (parallel) │ @researcher + @code-explorer ║
35
- ║ Wave 2 (serial) │ @architect ║
36
- ║ Wave 3 (parallel) │ @coder + @tester ║
37
- ║ Wave 4 (parallel) │ @reviewer + @security-auditor ║
38
- ╠══════════════════════════════════════════════════════════════╣
39
- ║ Dependency lock: │ Wave 3 blocked on Wave 2 output ║
40
- ╚══════════════════════════════════════════════════════════════╝
41
- ```
42
-
43
- The dependency lock line explicitly documents which wave gates are in effect. `@parallel-coordinator` enforces these locks — Wave 3 will not begin until Wave 2 output is confirmed available.
44
-
45
- ---
46
-
47
- ## Standard 4-Wave Pattern
48
-
49
- ### Wave 1 — Research (always parallel)
50
-
51
- **Agents:** `@researcher` + `@code-explorer`
52
-
53
- These two agents run simultaneously because neither depends on the other's output.
54
-
55
- - **`@researcher`** — gathers external context: API documentation, library docs, relevant RFCs, prior art, and best practices for the problem domain
56
- - **`@code-explorer`** — maps the existing codebase: which patterns are in use, which modules will be affected, which conventions must be followed
57
-
58
- Both results feed into Wave 2 as inputs. `@architect` should not begin until both are complete.
59
-
60
- ---
61
-
62
- ### Wave 2 — Design (always serial)
63
-
64
- **Agent:** `@architect`
65
-
66
- Wave 2 is intentionally serial. Architecture decisions are the foundation everything else builds on — running `@coder` before `@architect` is done produces code that must be thrown away.
67
-
68
- `@architect` consumes Wave 1 outputs and produces:
69
-
70
- - **Interface contracts** — function signatures, type definitions, API shapes
71
- - **Data models** — schemas, entity relationships, persistence strategy
72
- - **ADRs (Architecture Decision Records)** — the key decisions made and the alternatives rejected, with rationale
73
-
74
- Wave 2 output is written to `.planning/phases/*/ARCH.md` and is the authoritative specification for Wave 3.
75
-
76
- ---
77
-
78
- ### Wave 3 — Execution (usually parallel)
79
-
80
- **Agents:** `@coder` + `@tester`
81
-
82
- `@coder` and `@tester` can run in parallel because both work from the same Wave 2 interface contracts — neither needs to see the other's actual implementation.
83
-
84
- - **`@coder`** — implements the interfaces and data models specified by `@architect`. Works top-down from contracts, not bottom-up from intuition.
85
- - **`@tester`** — writes tests against the same Wave 2 interface contracts. Because tests are written to the contract (not the implementation), they are valid before `@coder` finishes.
86
-
87
- When Wave 3 completes, tests should be passing against the new implementation. If they are not, `@coder` and `@tester` reconcile before Wave 4 begins.
88
-
89
- > **Note:** Wave 3 is marked "usually parallel" because some features have sequential implementation requirements — for example, a migration that must run before the new code can be tested. `@parallel-coordinator` identifies these cases from the Wave 2 output and adjusts accordingly.
90
-
91
- ---
92
-
93
- ### Wave 4 — Verification (always parallel)
94
-
95
- **Agents:** `@reviewer` + `@security-auditor`
96
-
97
- Both agents review the same codebase snapshot but look for different issues — they can always run in parallel.
98
-
99
- - **`@reviewer`** — checks code quality, logic correctness, error handling completeness, naming, and adherence to the project's coding standards
100
- - **`@security-auditor`** — runs through the OWASP checklist, checks authentication and authorization logic, scans for injection vulnerabilities, and verifies that no secrets are present in the diff
101
-
102
- Wave 4 produces a joint findings report. Findings are classified as:
103
-
104
- | Severity | Meaning |
105
- |----------|---------|
106
- | **Critical** | Must be resolved before the code is merged |
107
- | **Major** | Should be resolved; skipping requires explicit justification |
108
- | **Minor** | Suggestions; no blocking requirement |
109
-
110
- If Critical findings exist, the flow returns to Wave 3 (`@coder`) for remediation before re-entering Wave 4.
111
-
112
- ---
113
-
114
- ## Triggering Parallel Execution
115
-
116
- ### Automatic (via `/fd-new-feature`)
117
-
118
- ```
119
- /fd-new-feature "payment integration with Stripe"
120
- ```
121
-
122
- The `@orchestrator` estimates scope for every `/fd-new-feature` call. If the feature exceeds approximately 30 minutes of estimated work, `@orchestrator` automatically hands off to `@parallel-coordinator`, which builds the WAVE TABLE and begins Wave 1.
123
-
124
- You do not need to specify parallel execution — it is selected based on scope.
125
-
126
- ### Manual (direct invocation)
127
-
128
- For work that does not go through `/fd-new-feature`, invoke `@parallel-coordinator` directly:
129
-
130
- ```
131
- @parallel-coordinator I need to implement the notification system.
132
- Track 1: email notifications via SendGrid
133
- Track 2: push notifications via Firebase FCM
134
- Track 3: SMS notifications via Twilio
135
- ```
136
-
137
- `@parallel-coordinator` will:
138
- 1. Identify which tracks are fully independent
139
- 2. Build a WAVE TABLE appropriate for the work
140
- 3. Manage agent dispatch, output collection, and inter-wave handoffs
141
-
142
- ---
143
-
144
- ## Merge Protocol
145
-
146
- After parallel waves complete, `@parallel-coordinator` classifies the combined output by conflict type:
147
-
148
- - **Additive** — each agent touched different files and different modules. These are merged automatically with no manual review required.
149
- - **Structural** — agents touched the same module but made compatible changes (e.g., both added new functions to the same file). `@parallel-coordinator` merges and flags the overlapping area for `@reviewer`.
150
- - **Contradictory** — agents produced conflicting design decisions (e.g., `@coder` implemented a REST interface while `@tester` assumed a message queue). These are escalated to `@architect` for resolution before any merge occurs.
151
-
152
- The merge classification is written to `.planning/phases/*/MERGE.md` so the resolution is traceable.
153
-
154
- ---
155
-
156
- ## Using the `run-parallel` Tool
157
-
158
- The `run-parallel` plugin tool is available in all FlowDeck sessions. It provides lower-level control over parallel dispatch when you want to coordinate agents yourself without going through `@parallel-coordinator`:
159
-
160
- ```
161
- Use the run-parallel tool to execute @researcher and @code-explorer simultaneously
162
- on the topic of rate-limiting strategies for REST APIs.
163
- ```
164
-
165
- ```
166
- Use the run-parallel tool to run @reviewer on src/payments/ and
167
- @security-auditor on src/payments/ at the same time, then combine their findings.
168
- ```
169
-
170
- `run-parallel` is best used when:
171
- - You have exactly two independent tasks and do not need full WAVE TABLE management
172
- - You want to parallelize review and audit on a specific directory after manual edits
173
- - You are running a one-off investigation, not a full feature pipeline
174
-
175
- For full feature work, prefer `/fd-new-feature` or direct `@parallel-coordinator` invocation over the `run-parallel` tool.
176
-
177
- ---
178
-
179
- ## Using the `delegate` Tool
180
-
181
- The `delegate` tool runs a single agent in an isolated child session and returns its output. Use it when you need a focused sub-task completed by a specific agent without disrupting the current session context:
182
-
183
- ```
184
- Use the delegate tool to ask @security-auditor to review src/auth/login.ts
185
- and report back any vulnerabilities found.
186
- ```
187
-
188
- ```
189
- Use the delegate tool with context "existing schema: ..." to ask @architect to
190
- propose a migration plan.
191
- ```
192
-
193
- `delegate` supports an optional `context` field — any string prepended to the agent's prompt. This is useful for passing output from a prior step without polluting the current conversation.
194
-
195
- ---
196
-
197
- ## Using the `run-pipeline` Tool
198
-
199
- The `run-pipeline` tool chains agents sequentially: each step's output becomes part of the next step's input. This is the right tool when tasks must happen in order and each depends on the previous result:
200
-
201
- ```
202
- Use the run-pipeline tool with steps:
203
- 1. agent: planner, prompt: "Analyze the codebase and produce an implementation plan for the auth refactor"
204
- 2. agent: coder, prompt: "Implement the plan"
205
- 3. agent: reviewer, prompt: "Review the implementation for correctness and security"
206
- ```
207
-
208
- Key behaviors:
209
- - Each step gets its own fresh child session (no hidden state accumulates between steps)
210
- - The previous step's text output is automatically prepended to the next step's prompt
211
- - Set `abort_on_failure: false` to continue the pipeline even if a step fails
212
- - Provide `initial_context` to seed the first step with prior information
213
-
214
- ---
215
-
216
- ## Implementation Notes
217
-
218
- All three dispatch tools (`run-parallel`, `delegate`, `run-pipeline`) create real OpenCode child sessions via `client.session.create` and `client.session.prompt`. They:
219
-
220
- - Use `parentID` to link child sessions to the current session
221
- - Check both transport-level errors (`response.error`) and agent-level errors (`response.data.info.error`)
222
- - Register an abort listener on the parent context so child sessions are cancelled if the parent aborts
223
- - Return structured JSON with per-task/step results including `session_id`, `success`, and `duration_ms`
224
-
225
- ---
226
-
227
- ## Telemetry & Monitoring
228
-
229
- The `run-parallel` tool emits structured telemetry events for observability:
230
-
231
- | Event | When |
232
- |-------|------|
233
- | `agent.dispatch` | Child session created for a task |
234
- | `agent.complete` | Task finished (success or error) |
235
-
236
- Events are appended to `.codebase/TELEMETRY.jsonl` and include:
237
- - `session_id` / `run_id` — session tracking
238
- - `agent` — which agent ran
239
- - `duration_ms` — wall time
240
- - `status` — `ok` or `error`
241
- - `meta` — child session ID, task index, output length, error details
242
-
243
- Additionally, `run-parallel` writes `.codebase/parallel-progress.json` at completion with aggregate stats.
244
-
245
- **To enable telemetry**, set the environment variable:
246
-
247
- ```bash
248
- TELEMETRY_ENABLED=true
249
- ```
250
-
251
- When enabled, events are written to `.codebase/TELEMETRY.jsonl`. The progress file is always written regardless of this setting.
252
-
253
- ---
254
-
255
- ← [Back to Index](index.md)
@@ -1,57 +0,0 @@
1
- ---
2
- description: Pre-change analysis — runs impact radar, blast radius, regression prediction, test gaps, volatility, and reviewer routing in one report
3
- argument-hint: [change description]
4
- ---
5
-
6
- # Analyze Change
7
-
8
- Run a comprehensive pre-change analysis combining all intelligence tools into a single report.
9
-
10
- **Input:** $ARGUMENTS — description of the proposed change
11
-
12
- ## Steps
13
-
14
- Run all analyses in parallel:
15
-
16
- 1. **Impact Radar** — which files/APIs/tests are affected (see `/fd-impact-radar`)
17
- 2. **Blast Radius** — downstream consequences and hidden couplings (see `/fd-blast-radius`)
18
- 3. **Regression Predict** — most likely regression categories (see `/fd-regression-predict`)
19
- 4. **Test Gap** — coverage gaps to fill before implementing (see `/fd-test-gap`)
20
- 5. **Volatility** — check `.codebase/VOLATILITY.json` for hotspot scores on affected files
21
- 6. **Review Route** — who should review this change (see `/fd-review-route`)
22
-
23
- ## Consolidated Report
24
-
25
- ```
26
- ════════════════════════════════════════════════════
27
- PRE-CHANGE ANALYSIS: "$ARGUMENTS"
28
- ════════════════════════════════════════════════════
29
-
30
- IMPACT (<N> files affected)
31
- - <top 5 affected files with reason>
32
-
33
- BLAST RADIUS (risk: <low|medium|high>)
34
- - <key downstream risks>
35
-
36
- REGRESSIONS (top 3 risks)
37
- 🔴 <category> — <reason>
38
- 🟠 <category> — <reason>
39
-
40
- TEST GAPS (<N> gaps found)
41
- - CRITICAL: <gap>
42
- - HIGH: <gap>
43
-
44
- VOLATILITY
45
- Hot zones touched: <list or "none">
46
-
47
- REVIEW ROUTING
48
- → <reviewer type> (<reason>)
49
-
50
- ────────────────────────────────────────────────────
51
- RECOMMENDATION: <proceed | add tests first | redesign | review required>
52
-
53
- Next steps:
54
- 1. <most important action>
55
- 2. <second action>
56
- ════════════════════════════════════════════════════
57
- ```
@@ -1,64 +0,0 @@
1
- ---
2
- description: Manage approval requests — list pending approvals, approve or reject a request by ID
3
- argument-hint: [list | approve <id> | reject <id> [reason]]
4
- ---
5
-
6
- # Approve
7
-
8
- Manage approval requests for guarded changes.
9
-
10
- **Input:** $ARGUMENTS
11
-
12
- ## Behavior
13
-
14
- ### List Pending (`list` or no arguments)
15
-
16
- Read `.planning/approvals.json`. Display all pending approval requests:
17
-
18
- ```
19
- ════════════════════════════════════════
20
- PENDING APPROVALS
21
- ════════════════════════════════════════
22
- ID | Change | Risk | Requested
23
- ---------|---------------------------|-------|----------
24
- APR-001 | Edit auth middleware | HIGH | <time>
25
- APR-002 | Update DB migration | MED | <time>
26
- ════════════════════════════════════════
27
- Use: /fd-approve approve <ID> or /fd-approve reject <ID> [reason]
28
- ```
29
-
30
- If no pending approvals: "No pending approvals."
31
-
32
- ### Approve (`approve <ID>`)
33
-
34
- 1. Read `.planning/approvals.json`
35
- 2. Find approval with matching ID
36
- 3. Update status to `approved`, set `approved_at` timestamp
37
- 4. Write updated file
38
- 5. Report: "APR-XXX approved. Change may proceed."
39
-
40
- ### Reject (`reject <ID> [reason]`)
41
-
42
- 1. Find approval with matching ID
43
- 2. Update status to `rejected`, set `rejected_at` and `reason`
44
- 3. Report: "APR-XXX rejected. Reason: <reason>."
45
-
46
- ## Approval File Format
47
-
48
- `.planning/approvals.json`:
49
- ```json
50
- {
51
- "approvals": [
52
- {
53
- "id": "APR-001",
54
- "change": "<description>",
55
- "risk_score": 0.8,
56
- "requested_at": "<timestamp>",
57
- "status": "pending|approved|rejected",
58
- "approved_at": null,
59
- "rejected_at": null,
60
- "reason": null
61
- }
62
- ]
63
- }
64
- ```
@@ -1,49 +0,0 @@
1
- ---
2
- description: Blast Radius Preview — show downstream consequences of a proposed change including hidden dependencies and fragile integration points
3
- argument-hint: [change description] [--depth=N]
4
- ---
5
-
6
- # Blast Radius
7
-
8
- Map the full downstream blast radius of a proposed change.
9
-
10
- **Input:** $ARGUMENTS — description or file path of the proposed change. Optional `--depth=N` (default: 3).
11
-
12
- ## Steps
13
-
14
- Run two agents in parallel:
15
-
16
- - **@architect**: Trace dependency graph to depth `--depth` (default 3 levels); flag integration points, event listeners, shared state, and service-to-service calls that would be affected
17
-
18
- - **@researcher**: Identify hidden couplings — shared config values, environment variables, database tables, message queue topics, and implicit conventions that the changed code relies on
19
-
20
- ## Report
21
-
22
- ```
23
- ════════════════════════════════════════════
24
- BLAST RADIUS PREVIEW
25
- ════════════════════════════════════════════
26
- Change: <summary>
27
- Depth: <N> levels
28
-
29
- Direct Impact (depth 1):
30
- - <file/module> — <relationship>
31
-
32
- Indirect Impact (depth 2-3):
33
- - <file/module> — <chain>
34
-
35
- Hidden Couplings:
36
- - <coupling type>: <description>
37
-
38
- Fragile Integration Points:
39
- - <point> — <why fragile>
40
-
41
- Risk Assessment:
42
- Score: <0-10>
43
- Level: <low|medium|high|critical>
44
-
45
- <1-2 sentence summary of the biggest risks>
46
-
47
- Recommended: <proceed | add tests | get review | redesign>
48
- ════════════════════════════════════════════
49
- ```
@@ -1,57 +0,0 @@
1
- ---
2
- description: Open project dashboard in browser — displays phase progress, milestones, and blockers
3
- argument-hint: [--port=N]
4
- ---
5
-
6
- # Dashboard
7
-
8
- Open the FlowDeck project dashboard.
9
-
10
- **Input:** $ARGUMENTS — optional `--port=N` (default: 3847)
11
-
12
- ## Steps
13
-
14
- 1. Check `.planning/STATE.md` exists — if not, error: "No active project. Run /fd-new-project first."
15
-
16
- 2. Read project state from:
17
- - `.planning/STATE.md` — current phase, status, progress
18
- - `.planning/ROADMAP.md` — all phases and completion status
19
- - `.planning/phases/phase-*/PLAN.md` — step completion per phase
20
-
21
- 3. Try to start the dashboard server if not running:
22
- ```bash
23
- npx @dv.nghiem/flowdeck-dashboard --port <port> &
24
- ```
25
- Or if the package is installed, run:
26
- ```bash
27
- flowdeck-dashboard --port <port> &
28
- ```
29
-
30
- 4. If server cannot start, display a text-based dashboard instead:
31
-
32
- ```
33
- ════════════════════════════════════════════
34
- FLOWDECK DASHBOARD
35
- ════════════════════════════════════════════
36
- Project: <name from PROJECT.md>
37
- Updated: <last_updated>
38
-
39
- ROADMAP
40
- ✅ Phase 1: Setup — completed
41
- 🔄 Phase 2: Core Feature — in progress (3/7 steps)
42
- ⏳ Phase 3: Polish — planned
43
-
44
- CURRENT PHASE (2): Core Feature
45
- ✅ Step 1: Set up database schema
46
- ✅ Step 2: Create API endpoints
47
- ✅ Step 3: Add authentication
48
- ⬜ Step 4: Write tests
49
- ⬜ Step 5: Write documentation
50
-
51
- BLOCKERS
52
- - (none)
53
- ════════════════════════════════════════════
54
- Run /fd-progress for detailed state view.
55
- ```
56
-
57
- 5. If server starts: report the URL: "Dashboard running at http://localhost:<port>"
@@ -1,62 +0,0 @@
1
- ---
2
- description: Risk assessment — estimates change risk, confidence, likely regressions, and whether approval is needed before proceeding
3
- argument-hint: [change description]
4
- ---
5
-
6
- # Evaluate Risk
7
-
8
- Produce a risk assessment for a proposed change.
9
-
10
- **Input:** $ARGUMENTS — description of the proposed change
11
-
12
- ## Steps
13
-
14
- Run two agents in parallel:
15
-
16
- - **@researcher**: Map `$ARGUMENTS` to affected paths and modules; check `.codebase/VOLATILITY.json` for hotspot scores; check `.codebase/FAILURES.json` for prior failures; identify external dependencies touched
17
-
18
- - **@reviewer**: Validate the risk assessment — verify risk level is calibrated correctly given the scope; flag any under-estimated risks; check if approval is warranted by active policies in `.planning/config.json`
19
-
20
- ## Risk Dimensions
21
-
22
- | Dimension | Weight | Assessment |
23
- |-----------|--------|------------|
24
- | Volatility | 30% | hotspot score of affected files |
25
- | Blast radius | 25% | number of downstream dependents |
26
- | Prior failures | 25% | recurrences in FAILURES.json |
27
- | External deps | 20% | third-party APIs or services involved |
28
-
29
- ## Approval Logic
30
-
31
- Approval required if:
32
- - `approval_required: true` in config
33
- - Overall risk score ≥ `volatility_threshold` (default 0.7)
34
- - Any touched file has 3+ prior failures
35
-
36
- ## Report
37
-
38
- ```
39
- ════════════════════════════════════════════
40
- RISK ASSESSMENT
41
- ════════════════════════════════════════════
42
- Change: <summary>
43
-
44
- Risk Score: <0.0–1.0> (<low|medium|high|critical>)
45
- Confidence: <high|medium|low>
46
-
47
- Breakdown:
48
- Volatility: <score> (<rationale>)
49
- Blast radius: <score> (<N downstream>)
50
- Prior failures: <score> (<N failures>)
51
- External deps: <score> (<list or none>)
52
-
53
- Likely Regressions:
54
- - <category>: <reason>
55
-
56
- Approval Required: <yes|no>
57
- <if yes: reason and who should approve>
58
-
59
- Recommendation:
60
- <proceed | add tests | get review | redesign>
61
- ════════════════════════════════════════════
62
- ```
@@ -1,69 +0,0 @@
1
- ---
2
- description: Edit gate — decides auto-approve / require-confirmation / require-review / block based on policy, trust score, volatility, and arch constraints
3
- argument-hint: [change description or file path]
4
- ---
5
-
6
- # Guarded Edit
7
-
8
- Evaluate a proposed edit against all safety gates before allowing it to proceed.
9
-
10
- **Input:** $ARGUMENTS — description or file path of the proposed edit
11
-
12
- ## Gates (evaluated in order)
13
-
14
- ### Gate 1 — Policy Check
15
-
16
- Read `.planning/config.json` for active policies:
17
- - `approval_required`: if true, all edits need explicit approval
18
- - `volatility_threshold`: edits touching files above this score need confirmation
19
-
20
- ### Gate 2 — Volatility Check
21
-
22
- Check `.codebase/VOLATILITY.json` for the files in `$ARGUMENTS`.
23
- - Score ≥ 0.8 → REQUIRE REVIEW
24
- - Score ≥ 0.6 → REQUIRE CONFIRMATION
25
- - Score < 0.6 → proceed
26
-
27
- ### Gate 3 — Architecture Constraints
28
-
29
- Read `.codebase/ARCHITECTURE.md` and check if the edit:
30
- - Crosses defined service boundaries
31
- - Modifies public API contracts
32
- - Touches security-critical paths (auth, payments, PII)
33
-
34
- ### Gate 4 — Trust Score
35
-
36
- Check `.codebase/FAILURES.json` for prior failures in the same path.
37
- - 3+ prior failures in this area → REQUIRE REVIEW
38
- - 1-2 prior failures → REQUIRE CONFIRMATION
39
-
40
- ## Decision Matrix
41
-
42
- | Condition | Decision |
43
- |-----------|----------|
44
- | Any BLOCK signal | ❌ BLOCK |
45
- | REQUIRE REVIEW signal | 👁️ REQUIRE REVIEW |
46
- | REQUIRE CONFIRMATION signal | ⚠️ REQUIRE CONFIRMATION |
47
- | All gates pass | ✅ AUTO-APPROVE |
48
-
49
- ## Report
50
-
51
- ```
52
- ════════════════════════════════════
53
- GUARDED EDIT GATE
54
- ════════════════════════════════════
55
- Edit: <summary>
56
-
57
- Gate 1 — Policy: <pass|flag>
58
- Gate 2 — Volatility: <score> → <pass|confirm|review>
59
- Gate 3 — Arch: <pass|flag>
60
- Gate 4 — Trust: <failures count> → <pass|confirm|review>
61
-
62
- DECISION: AUTO-APPROVE / CONFIRM / REVIEW / BLOCK
63
-
64
- <if BLOCK or REVIEW: explain what needs to happen first>
65
- ════════════════════════════════════
66
- ```
67
-
68
- If BLOCK: do not proceed with the edit. Explain what must change first.
69
- If CONFIRM: present to user and wait for explicit "yes" before proceeding.
@@ -1,51 +0,0 @@
1
- ---
2
- description: Change Impact Radar — predict which files, modules, APIs, tests, and DB paths are affected before editing anything
3
- argument-hint: [change description]
4
- ---
5
-
6
- # Impact Radar
7
-
8
- Predict the blast area of a proposed change before any code is written.
9
-
10
- **Input:** $ARGUMENTS — description of the proposed change
11
-
12
- ## Steps
13
-
14
- Run three agents in parallel:
15
-
16
- - **@researcher**: Trace dependency graph from the paths mentioned in `$ARGUMENTS`; find all files that import or are imported by those modules; map 2 levels deep
17
-
18
- - **@architect**: Identify API contracts and service boundaries at risk; flag any public interfaces that would change; check for DB schema impacts
19
-
20
- - **@tester**: Find test files that cover the affected paths; identify which tests would need updating; spot gaps (changed files with no tests)
21
-
22
- ## Report
23
-
24
- ```
25
- ════════════════════════════════════════════
26
- CHANGE IMPACT RADAR
27
- ════════════════════════════════════════════
28
- Change: <summary of $ARGUMENTS>
29
- Risk score: <low|medium|high>
30
-
31
- Affected Files (<N>):
32
- - <file> (<reason>)
33
-
34
- API Contracts at Risk:
35
- - <interface/endpoint> — <risk>
36
-
37
- Tests to Update (<N>):
38
- - <test file>
39
-
40
- Test Gaps (<N> files with no tests):
41
- - <file>
42
-
43
- DB / Schema Impact:
44
- - <none | description>
45
-
46
- Recommendation:
47
- <proceed with caution | review required | block>
48
- ════════════════════════════════════════════
49
- ```
50
-
51
- If no impact found: "No significant impact detected. Proceed with standard review."