specialist-agent 2.11.4 → 2.13.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 (80) hide show
  1. package/.claude-plugin/marketplace.json +4 -4
  2. package/.claude-plugin/plugin.json +2 -2
  3. package/.codex/INSTALL.md +32 -9
  4. package/.cursor-plugin/marketplace.json +4 -4
  5. package/.cursor-plugin/plugin.json +2 -2
  6. package/.opencode/opencode.json +45 -0
  7. package/README.md +18 -2
  8. package/agents/analyst-lite.md +1 -1
  9. package/agents/analyst.md +5 -1
  10. package/agents/api.md +1 -0
  11. package/agents/architect-lite.md +1 -1
  12. package/agents/architect.md +10 -1
  13. package/agents/autopilot-lite.md +46 -0
  14. package/agents/autopilot.md +196 -0
  15. package/agents/cloud-lite.md +1 -1
  16. package/agents/cloud.md +2 -1
  17. package/agents/data.md +1 -0
  18. package/agents/debugger.md +3 -0
  19. package/agents/deps-lite.md +1 -1
  20. package/agents/deps.md +2 -1
  21. package/agents/designer.md +8 -0
  22. package/agents/devops-lite.md +1 -1
  23. package/agents/devops.md +2 -1
  24. package/agents/docs-lite.md +1 -1
  25. package/agents/docs.md +2 -1
  26. package/agents/executor-lite.md +1 -1
  27. package/agents/executor.md +58 -31
  28. package/agents/explorer-lite.md +1 -1
  29. package/agents/explorer.md +14 -1
  30. package/agents/finance.md +1 -0
  31. package/agents/i18n.md +1 -0
  32. package/agents/legal.md +1 -0
  33. package/agents/marketing.md +9 -0
  34. package/agents/memory.md +103 -178
  35. package/agents/orchestrator-lite.md +1 -1
  36. package/agents/orchestrator.md +62 -39
  37. package/agents/pair-lite.md +1 -1
  38. package/agents/pair.md +2 -1
  39. package/agents/perf.md +1 -0
  40. package/agents/planner-lite.md +1 -1
  41. package/agents/planner.md +17 -11
  42. package/agents/product.md +9 -0
  43. package/agents/refactor.md +1 -0
  44. package/agents/ripple-lite.md +1 -1
  45. package/agents/ripple.md +4 -1
  46. package/agents/scout-lite.md +1 -1
  47. package/agents/scout.md +2 -1
  48. package/agents/security-lite.md +1 -1
  49. package/agents/security.md +4 -1
  50. package/agents/sentry-triage-lite.md +1 -1
  51. package/agents/sentry-triage.md +4 -1
  52. package/agents/starter-lite.md +1 -1
  53. package/agents/starter.md +2 -1
  54. package/agents/support.md +1 -0
  55. package/agents/tdd.md +3 -0
  56. package/agents/tester.md +1 -0
  57. package/cli/index.mjs +1 -1
  58. package/hooks/hooks.json +11 -0
  59. package/hooks/lifecycle.json +10 -0
  60. package/hooks/native/auto-dispatch.mjs +7 -2
  61. package/hooks/native/session-end.mjs +42 -0
  62. package/package.json +1 -1
  63. package/skills/audit/SKILL.md +71 -9
  64. package/skills/autopilot/SKILL.md +286 -0
  65. package/skills/brainstorm/SKILL.md +60 -7
  66. package/skills/codereview/SKILL.md +16 -3
  67. package/skills/copywriting/SKILL.md +218 -0
  68. package/skills/cro/SKILL.md +234 -0
  69. package/skills/design-review/SKILL.md +217 -0
  70. package/skills/grill/SKILL.md +270 -0
  71. package/skills/improve-architecture/SKILL.md +205 -0
  72. package/skills/prd/SKILL.md +241 -0
  73. package/skills/recall/SKILL.md +36 -74
  74. package/skills/remember/SKILL.md +41 -91
  75. package/skills/seo-audit/SKILL.md +240 -0
  76. package/skills/tdd/SKILL.md +49 -4
  77. package/skills/write-skill/SKILL.md +18 -6
  78. package/templates/autopilot/PROMPT.md +39 -0
  79. package/templates/autopilot/README.md +122 -0
  80. package/templates/autopilot/devcontainer.json +21 -0
@@ -85,7 +85,54 @@ Check for performance issues:
85
85
  | Network | Missing caching, redundant API calls |
86
86
  | Assets | Unoptimized images, missing lazy loading |
87
87
 
88
- ### Step 5: Dependency Audit
88
+ ### Step 5: Observability Audit
89
+
90
+ Check for production readiness observability:
91
+
92
+ | Check | What to Look For |
93
+ |-------|------------------|
94
+ | Structured logging | JSON format, consistent fields (timestamp, level, service, traceId) |
95
+ | Error tracking | Errors captured with context (user, request, stack trace) |
96
+ | Health endpoints | `/health` or equivalent exposed by every service |
97
+ | Metrics | RED metrics (Rate, Errors, Duration) for critical operations |
98
+ | Correlation IDs | Trace/request IDs propagated across service boundaries |
99
+ | Sensitive data | NO passwords, tokens, PII, credit cards in logs |
100
+
101
+ ```bash
102
+ # Check for structured logging
103
+ grep -rn "console\.log\|console\.error\|console\.warn" $TARGET --include="*.ts" --include="*.tsx" 2>/dev/null | grep -v "node_modules\|test\|spec" | head -15
104
+
105
+ # Check for health endpoints
106
+ grep -rn "health\|healthcheck\|readiness\|liveness" $TARGET --include="*.ts" --include="*.tsx" 2>/dev/null | head -10
107
+
108
+ # Check for sensitive data in logs
109
+ grep -rn "console\.\|logger\.\|log\." $TARGET --include="*.ts" 2>/dev/null | grep -i "password\|token\|secret\|credit\|ssn" | head -10
110
+ ```
111
+
112
+ ### Step 6: Accessibility Audit (if frontend detected)
113
+
114
+ If the project contains frontend code (`.tsx`, `.vue`, `.svelte`, `.astro`), check:
115
+
116
+ | Check | Criteria |
117
+ |-------|----------|
118
+ | Alt text | All images have descriptive alt attributes |
119
+ | Form labels | All inputs have associated labels or aria-label |
120
+ | Heading hierarchy | Single H1, logical H2-H6, no skipped levels |
121
+ | Keyboard navigation | Interactive elements accessible via keyboard |
122
+ | Color contrast | Text meets WCAG AA 4.5:1 ratio |
123
+ | ARIA usage | Correct roles, states, properties |
124
+
125
+ ```bash
126
+ # Detect frontend code
127
+ FRONTEND_FILES=$(find $TARGET -name "*.tsx" -o -name "*.vue" -o -name "*.svelte" -o -name "*.astro" 2>/dev/null | grep -v node_modules | head -5)
128
+ if [ -n "$FRONTEND_FILES" ]; then
129
+ echo "Frontend detected - running accessibility checks"
130
+ grep -rn "<img" $TARGET --include="*.tsx" --include="*.vue" 2>/dev/null | grep -v "alt=" | head -10
131
+ grep -rn "<input\|<select" $TARGET --include="*.tsx" --include="*.vue" 2>/dev/null | grep -v "aria-label\|id=" | head -10
132
+ fi
133
+ ```
134
+
135
+ ### Step 7: Dependency Audit
89
136
 
90
137
  Check dependency health:
91
138
 
@@ -102,10 +149,21 @@ Run if available:
102
149
  npx depcheck --json 2>/dev/null || true
103
150
  ```
104
151
 
105
- ### Step 6: Report Generation
152
+ ### Step 8: Report Generation & Scoring
106
153
 
107
154
  Compile findings into a structured report with severity ratings.
108
155
 
156
+ **Scoring formula per domain (0-100):**
157
+ - Start at 100
158
+ - CRITICAL finding: -25 points
159
+ - HIGH finding: -15 points
160
+ - MEDIUM finding: -10 points
161
+ - LOW finding: -5 points
162
+ - INFO: -0 points
163
+ - Minimum: 0
164
+
165
+ **Overall score** = average of all domain scores (weighted: Security 30%, Architecture 25%, Performance 20%, Observability 15%, Dependencies 10%).
166
+
109
167
  ## Severity Levels
110
168
 
111
169
  | Level | Description | Action |
@@ -120,7 +178,7 @@ Compile findings into a structured report with severity ratings.
120
178
 
121
179
  **Before claiming audit is complete:**
122
180
 
123
- 1. All 4 audit domains were checked (security, architecture, performance, dependencies)
181
+ 1. All domains were checked (security, architecture, performance, observability, dependencies, and accessibility if frontend)
124
182
  2. Every finding has a severity level
125
183
  3. Every CRITICAL/HIGH finding has a specific remediation step
126
184
  4. Automated tools were run where available (npm audit, eslint, depcheck)
@@ -135,10 +193,12 @@ Compile findings into a structured report with severity ratings.
135
193
  | "Dependencies are up to date" | Did you run `npm audit`? Check for unused deps? |
136
194
  | "Performance seems okay" | Did you check for N+1 queries, memory leaks, bundle size? |
137
195
  | "The codebase is too large to audit fully" | Scope down to critical paths (auth, payments, data). Never skip security. |
196
+ | "Observability is a nice-to-have" | Production without observability is flying blind. You can't fix what you can't see. |
197
+ | "Accessibility doesn't apply to us" | Internal tools have users with disabilities too. And legal requirements don't have exemptions. |
138
198
 
139
199
  ## Rules
140
200
 
141
- 1. **Check all 4 domains** - Skipping one defeats the purpose
201
+ 1. **Check all domains** - Skipping one defeats the purpose (security, architecture, performance, observability, dependencies + accessibility if frontend)
142
202
  2. **Run automated tools** - Never skip `npm audit` or linting if available
143
203
  3. **Severity must be justified** - Every rating needs evidence
144
204
  4. **Remediation is required** - Findings without fix suggestions are useless
@@ -152,12 +212,14 @@ Compile findings into a structured report with severity ratings.
152
212
  Target: [path or module]
153
213
  Scope: [X files, Y lines]
154
214
 
155
- Security: [X critical, Y high, Z medium]
156
- Architecture: [X high, Y medium]
157
- Performance: [X high, Y medium]
158
- Dependencies: [X vulnerable, Y outdated, Z unused]
215
+ Security: [score]/100 - [X critical, Y high, Z medium]
216
+ Architecture: [score]/100 - [X high, Y medium]
217
+ Performance: [score]/100 - [X high, Y medium]
218
+ Observability: [score]/100 - [X high, Y medium]
219
+ Dependencies: [score]/100 - [X vulnerable, Y outdated, Z unused]
220
+ Accessibility: [score]/100 - [N findings] (if frontend)
159
221
 
160
- Overall Score: [0-100]
222
+ Overall Score: [0-100] (weighted average)
161
223
  Risk Level: [CRITICAL | HIGH | MEDIUM | LOW]
162
224
 
163
225
  Top Findings:
@@ -0,0 +1,286 @@
1
+ ---
2
+ name: autopilot
3
+ description: "Use when you want to iteratively build a feature using a PRD as source of truth, with progress tracking and fresh-context iterations - the Autopilot technique for autonomous development."
4
+ user-invocable: true
5
+ argument-hint: "[PRD path or description] [--max-iterations=N]"
6
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Agent, TodoWrite
7
+ ---
8
+
9
+ # /autopilot - Iterative Autonomous Development
10
+
11
+ Execute complex features autonomously using the Autopilot technique: PRD as source of truth, progress file for state persistence, and fresh-context iterations to avoid context rot.
12
+
13
+ **Target:** $ARGUMENTS
14
+
15
+ ## When to Use
16
+
17
+ - Features that require 5+ tasks to implement
18
+ - Overnight or unattended batch execution
19
+ - Migrations (database, framework, architecture)
20
+ - Building MVPs from a PRD
21
+ - Any task where context rot degrades quality over long sessions
22
+ - NOT for: single-file changes (use `@builder`)
23
+ - NOT for: subjective design decisions (need human feedback)
24
+ - NOT for: tasks without clear completion criteria
25
+
26
+ ## Workflow
27
+
28
+ ### Step 1: PRD Resolution
29
+
30
+ 1. **If argument is a file path** (ends in `.md`): Read it as the PRD
31
+ 2. **If argument is a description**: Delegate to `/prd` to generate `docs/PRD-[name].md`
32
+ 3. **If PRD already exists** at `.claude/autopilot/progress.md` with a PRD reference: Resume from where it left off
33
+
34
+ ```bash
35
+ # Check for existing progress
36
+ cat .claude/autopilot/progress.md 2>/dev/null
37
+ ```
38
+
39
+ **BLOCKED** until a PRD file exists and is readable.
40
+
41
+ ### Step 2: Task Extraction & Progress Initialization
42
+
43
+ 1. **Parse the PRD** for implementable tasks (look for issue breakdown, task lists, or feature sections)
44
+ 2. **Create progress file** at `.claude/autopilot/progress.md`:
45
+
46
+ ```markdown
47
+ # Autopilot Progress
48
+
49
+ ## Config
50
+ - PRD: [path/to/PRD.md]
51
+ - Max iterations: [N, default 10]
52
+ - Current iteration: 0
53
+ - Status: IN_PROGRESS
54
+ - Started: [timestamp]
55
+
56
+ ## Tasks
57
+ | # | Task | Status | Iteration | Notes |
58
+ |---|------|--------|-----------|-------|
59
+ | 1 | [task from PRD] | PENDING | - | - |
60
+ | 2 | [task from PRD] | PENDING | - | - |
61
+ | 3 | [task from PRD] | PENDING | - | - |
62
+
63
+ ## Iteration Log
64
+ ```
65
+
66
+ 3. **Create git restore point:**
67
+
68
+ ```bash
69
+ git add -A 2>/dev/null
70
+ git tag restore-point/ralf-$(date +%Y%m%d-%H%M%S) 2>/dev/null
71
+ ```
72
+
73
+ 4. **Initialize TodoWrite** with all tasks for live progress tracking.
74
+
75
+ ### Step 3: Iteration Loop
76
+
77
+ For each iteration until completion:
78
+
79
+ #### 3a. Read State
80
+ ```
81
+ 1. READ the PRD (source of truth - may have been updated)
82
+ 2. READ .claude/autopilot/progress.md
83
+ 3. IDENTIFY next task with Status = PENDING
84
+ 4. If no PENDING tasks remain → go to Step 4 (Completion)
85
+ ```
86
+
87
+ #### 3b. Execute Task via Fresh-Context Subagent
88
+
89
+ **Critical:** Delegate each task to a subagent using the `Agent` tool. This gives the task a fresh context window, preventing context rot.
90
+
91
+ ```
92
+ Agent(
93
+ description: "RALF iteration N - task description",
94
+ prompt: "
95
+ You are executing a Autopilot task.
96
+
97
+ ## PRD (Source of Truth)
98
+ [inline PRD content]
99
+
100
+ ## Current Progress
101
+ [inline progress.md content]
102
+
103
+ ## Your Task
104
+ Task #N: [task description]
105
+
106
+ ## Instructions
107
+ 1. Implement this task completely
108
+ 2. Follow existing codebase patterns
109
+ 3. Run tests if available
110
+ 4. Create a git commit: git add -A && git commit -m 'autopilot: task-N - [description]'
111
+ 5. Report what you did and what files changed
112
+ "
113
+ )
114
+ ```
115
+
116
+ #### 3c. Verify Result
117
+
118
+ After the subagent returns:
119
+
120
+ ```
121
+ 1. CHECK git log for the commit
122
+ 2. RUN tests (if test command exists in package.json)
123
+ 3. RUN type check (tsc --noEmit, if TypeScript project)
124
+ 4. If PASS → mark task DONE in progress.md
125
+ 5. If FAIL → retry (max 2 retries per task)
126
+ 6. If still FAIL after retries → mark task BLOCKED, add error notes
127
+ ```
128
+
129
+ #### 3d. Update Progress
130
+
131
+ ```markdown
132
+ ## Update in progress.md:
133
+ - Increment "Current iteration" counter
134
+ - Update task status (DONE / BLOCKED)
135
+ - Add iteration log entry:
136
+
137
+ ### Iteration [N]
138
+ - Task: #[X] [description]
139
+ - Result: DONE | BLOCKED
140
+ - Files changed: [list]
141
+ - Notes: [what happened]
142
+ ```
143
+
144
+ #### 3e. Create Checkpoint
145
+
146
+ ```bash
147
+ git tag checkpoint/ralf-task-[N] 2>/dev/null
148
+ ```
149
+
150
+ #### 3f. Check Completion
151
+
152
+ ```
153
+ - All tasks DONE or BLOCKED? → Exit loop
154
+ - Current iteration >= max iterations? → Exit loop
155
+ - Otherwise → Continue to next iteration (3a)
156
+ ```
157
+
158
+ ### Step 4: Completion
159
+
160
+ 1. **Update progress.md** status to `COMPLETE` or `MAX_ITERATIONS_REACHED`
161
+ 2. **Generate summary report**
162
+ 3. **Suggest next steps** (`/verify` for validation, `/finish` for branch finalization)
163
+
164
+ ## Progress File Format
165
+
166
+ The progress file at `.claude/autopilot/progress.md` is the **state persistence layer** between iterations. It MUST follow this exact format for reliable parsing:
167
+
168
+ ```markdown
169
+ # Autopilot Progress
170
+
171
+ ## Config
172
+ - PRD: docs/PRD-feature-name.md
173
+ - Max iterations: 10
174
+ - Current iteration: 3
175
+ - Status: IN_PROGRESS | COMPLETE | MAX_ITERATIONS_REACHED
176
+ - Started: 2026-03-16T14:30:00
177
+
178
+ ## Tasks
179
+ | # | Task | Status | Iteration | Notes |
180
+ |---|------|--------|-----------|-------|
181
+ | 1 | Create data models | DONE | 1 | Created User, Task models |
182
+ | 2 | Implement API endpoints | DONE | 2 | REST endpoints for CRUD |
183
+ | 3 | Build frontend components | IN_PROGRESS | 3 | Started TaskList component |
184
+ | 4 | Add authentication | PENDING | - | - |
185
+ | 5 | Write integration tests | PENDING | - | - |
186
+
187
+ ## Iteration Log
188
+
189
+ ### Iteration 1
190
+ - Task: #1 Create data models
191
+ - Result: DONE
192
+ - Files: src/models/user.ts, src/models/task.ts
193
+ - Notes: Followed existing Prisma schema patterns
194
+
195
+ ### Iteration 2
196
+ - Task: #2 Implement API endpoints
197
+ - Result: DONE
198
+ - Files: src/api/users.ts, src/api/tasks.ts
199
+ - Notes: RESTful CRUD with validation
200
+
201
+ ### Iteration 3
202
+ - Task: #3 Build frontend components
203
+ - Result: IN_PROGRESS
204
+ - Files: src/components/TaskList.tsx
205
+ - Notes: Component created, needs styling
206
+ ```
207
+
208
+ ## Execution Modes
209
+
210
+ ### Plugin Mode (Default)
211
+
212
+ Runs inside Claude Code using `Agent` tool for fresh-context subagents. Easier to use but doesn't fully reset the outer context window.
213
+
214
+ ```
215
+ /autopilot docs/PRD-my-feature.md --max-iterations=10
216
+ ```
217
+
218
+ ### Script Mode (Maximum Performance)
219
+
220
+ For the true Autopilot experience with full context reset between iterations, use the bash script:
221
+
222
+ ```bash
223
+ ./scripts/autopilot.sh docs/PRD-my-feature.md --max-iterations=10 --model=claude-opus-4-6
224
+ ```
225
+
226
+ The script kills and restarts Claude Code between iterations, giving each iteration a completely fresh context window. Best for:
227
+ - Long-running overnight builds
228
+ - Complex migrations where context rot is noticeable
229
+ - Running inside a DevContainer with `--dangerously-skip-permissions`
230
+
231
+ See `templates/autopilot/README.md` for DevContainer setup.
232
+
233
+ ## Integration with Specialist Agent
234
+
235
+ | Component | How Autopilot Uses It |
236
+ |-----------|----------------------|
237
+ | `/prd` | Generates the PRD if user provides a description instead of a file |
238
+ | `/checkpoint` | Creates restore points and per-task checkpoints |
239
+ | `@executor` | Pattern reference for self-healing (max 2 retries) |
240
+ | `@builder` | Subagent for implementation tasks |
241
+ | `after-task` hook | Fires after each iteration completes |
242
+ | TodoWrite | Live progress tracking during plugin mode |
243
+
244
+ ## Anti-Rationalization
245
+
246
+ | Excuse | Reality |
247
+ |--------|---------|
248
+ | "I'll just do it in one long session" | Context rot is real. After ~50K tokens, quality degrades measurably. Fresh iterations produce better code. |
249
+ | "The PRD is too detailed, I'll wing it" | Vague PRDs produce vague code. The PRD is the contract. If it's wrong, fix the PRD first. |
250
+ | "I don't need progress tracking" | You are a goldfish with a notepad. Without progress.md, you'll redo completed work or skip critical tasks. |
251
+ | "One more retry will fix it" | After 2 retries, the approach is wrong, not the execution. Mark BLOCKED and move on. A human needs to look at it. |
252
+ | "I can combine multiple tasks per iteration" | One task per iteration. Combining tasks creates entangled commits and makes rollback impossible. |
253
+ | "Script mode is overkill" | For 3 tasks, maybe. For 10+ tasks or overnight runs, script mode's clean context pays for itself in fewer total iterations. |
254
+
255
+ ## Rules
256
+
257
+ 1. **One task per iteration** - Never combine tasks. Each iteration handles exactly one task.
258
+ 2. **PRD is sacred** - Never modify the PRD during execution. If the PRD is wrong, stop and fix it first.
259
+ 3. **Progress file is the single source of state** - All iteration state lives in progress.md. No in-memory state.
260
+ 4. **Fresh context per task** - Always delegate to a subagent (plugin mode) or restart Claude (script mode).
261
+ 5. **Max 2 retries per task** - After 2 failures, mark BLOCKED and continue with the next task.
262
+ 6. **Always checkpoint** - Every successful task gets a git tag. No exceptions.
263
+ 7. **Verify before marking DONE** - Run tests/type-check. No "should work" claims.
264
+ 8. **Resume-safe** - If interrupted, running `/autopilot` again reads progress.md and continues from where it stopped.
265
+
266
+ ## Output
267
+
268
+ ```
269
+ ──── /autopilot ────
270
+ PRD: docs/PRD-[name].md
271
+ Mode: Plugin | Script
272
+ Max Iterations: N
273
+
274
+ [1/N] Task 1: [description]... DONE (iteration 1)
275
+ [2/N] Task 2: [description]... DONE (iteration 2)
276
+ [3/N] Task 3: [description]... BLOCKED (iteration 3-5, retried 2x)
277
+ [4/N] Task 4: [description]... DONE (iteration 6)
278
+ [5/N] Task 5: [description]... PENDING
279
+
280
+ Status: IN_PROGRESS | COMPLETE | MAX_ITERATIONS_REACHED
281
+ Iterations used: X/N
282
+ Tasks: Y DONE, Z BLOCKED, W PENDING
283
+ Progress: .claude/autopilot/progress.md
284
+
285
+ ──── Next: /verify or /finish ────
286
+ ```
@@ -106,11 +106,41 @@ Risky assumptions to address: [list]
106
106
 
107
107
  **BLOCKED** until at least 5 assumptions are identified and tested.
108
108
 
109
+ ### Step 3.5: Competitive Analysis (Optional)
110
+
111
+ Before generating alternatives, check how others solved similar problems:
112
+
113
+ 1. **Scan for existing solutions:**
114
+ - "How do popular open-source projects handle this?"
115
+ - "What patterns do competing products use?"
116
+ - "Are there established libraries that solve this out of the box?"
117
+ 2. **Document findings:**
118
+
119
+ ```markdown
120
+ ## Competitive Analysis
121
+
122
+ | Solution | Approach | Pros | Cons | Applicable? |
123
+ |----------|----------|------|------|------------|
124
+ | [lib/product 1] | [how they solved it] | [pros] | [cons] | [yes/partial/no] |
125
+ | [lib/product 2] | [how they solved it] | [pros] | [cons] | [yes/partial/no] |
126
+ ```
127
+
128
+ Skip this step if the problem is purely internal or domain-specific with no external parallels.
129
+
109
130
  ### Step 4: Alternative Generation - Explore Options
110
131
 
111
- Generate multiple approaches:
132
+ Generate multiple approaches using ideation frameworks:
112
133
 
113
- 1. **Produce at least 3 alternatives:**
134
+ **Choose a framework to stimulate thinking:**
135
+
136
+ | Framework | When to Use | How It Works |
137
+ |-----------|-------------|-------------|
138
+ | **First Principles** | Complex technical problems | Decompose to ground truths → rebuild from scratch. "What is fundamentally true here?" |
139
+ | **SCAMPER** | Improving existing solutions | **S**ubstitute, **C**ombine, **A**dapt, **M**odify, **P**ut to other use, **E**liminate, **R**everse |
140
+ | **How Might We** | Reframing constraints | Turn every constraint into an opportunity. "We can't do X" → "How might we achieve the goal without X?" |
141
+ | **Inversion** | When stuck | Ask "How would we guarantee failure?" then invert each answer |
142
+
143
+ 1. **Apply the chosen framework** to generate at least 3 alternatives:
114
144
  - **Approach A** - The obvious solution
115
145
  - **Approach B** - The simpler alternative
116
146
  - **Approach C** - The scalable/future-proof option
@@ -141,12 +171,28 @@ Recommendation: Approach [X] because [rationale]
141
171
 
142
172
  ### Step 5: Convergence - Synthesize and Validate
143
173
 
144
- Present the design for approval in digestible sections:
174
+ Present the design for approval using a **Decision Matrix** for objective comparison:
175
+
176
+ 1. **Build Decision Matrix** - Score each approach on weighted criteria:
177
+
178
+ ```markdown
179
+ ## Decision Matrix
180
+
181
+ | Criteria | Weight | Approach A | Approach B | Approach C |
182
+ |----------|--------|-----------|-----------|-----------|
183
+ | Effort | 25% | 7 | 9 | 4 |
184
+ | Risk | 20% | 6 | 8 | 5 |
185
+ | Impact | 30% | 8 | 6 | 9 |
186
+ | Alignment | 15% | 7 | 7 | 8 |
187
+ | Maintainability | 10% | 6 | 8 | 7 |
188
+ | **Weighted Score** | | **7.05** | **7.35** | **6.55** |
189
+
190
+ Winner: Approach [X] (score: [N])
191
+ ```
145
192
 
146
- 1. **Synthesize chosen approach** into a design summary
147
193
  2. **Present in sections** - Each section gets user approval:
148
194
  - Section 1: Problem & scope (approve?)
149
- - Section 2: Technical approach (approve?)
195
+ - Section 2: Technical approach with decision matrix rationale (approve?)
150
196
  - Section 3: Data model / API design (approve?)
151
197
  - Section 4: Key decisions & trade-offs (approve?)
152
198
  3. **Document final design** - Ready for `/plan` handoff
@@ -159,7 +205,7 @@ Present the design for approval in digestible sections:
159
205
  [approved summary]
160
206
 
161
207
  ### Section 2: Technical Approach ✓
162
- [approved summary]
208
+ [approved summary + decision matrix winner]
163
209
 
164
210
  ### Section 3: Data Model ✓
165
211
  [approved summary]
@@ -168,7 +214,7 @@ Present the design for approval in digestible sections:
168
214
  [approved summary]
169
215
  ```
170
216
 
171
- ## Integration with @planner
217
+ ## Integration with Other Skills
172
218
 
173
219
  ```
174
220
  IF @planner classifies task as COMPLEX:
@@ -180,6 +226,11 @@ IF user says "skip brainstorming" or "just plan":
180
226
 
181
227
  IF /brainstorm output exists:
182
228
  → @planner uses it as foundation (don't re-ask questions)
229
+
230
+ IF /discovery was already run:
231
+ → Import discovery output (problem statement, personas, constraints)
232
+ → Skip Step 1 (Discovery) - already done
233
+ → Start from Step 2 (Clarification)
183
234
  ```
184
235
 
185
236
  ## Verification Protocol
@@ -202,6 +253,8 @@ IF /brainstorm output exists:
202
253
  | "Too many options will paralyze" | 3 options with clear pros/cons ENABLE informed decisions. Analysis paralysis comes from unclear options, not from having them. |
203
254
  | "The user already decided" | Clarify what they DECIDED vs what they ASSUMED. Often they assumed more than they decided. |
204
255
  | "Questions will frustrate the user" | Users prefer upfront questions over rework later. Frustration comes from building the wrong thing. |
256
+ | "We don't have competitors to analyze" | Every problem has prior art. Open-source libraries, competing products, or academic papers. Search before inventing. |
257
+ | "Frameworks are overkill for brainstorming" | Frameworks prevent blank-page paralysis and ensure coverage. SCAMPER takes 5 minutes and reveals options you'd miss. |
205
258
 
206
259
  ## Rules
207
260
 
@@ -159,9 +159,20 @@ Merge findings from all 3 perspectives:
159
159
 
160
160
  1. **Deduplicate** - Remove findings flagged by multiple perspectives (keep highest severity)
161
161
  2. **Cross-reference** - A security finding that also lacks tests is escalated one severity level
162
- 3. **Assign severity** - Every finding gets a severity level (see table below)
163
- 4. **Sort** - CRITICAL first, then HIGH, MEDIUM, LOW
164
- 5. **Group** - By file, then by severity within each file
162
+ 3. **YAGNI Check** - For every new abstraction, interface, or utility introduced in the change:
163
+ - Is it used in more than one place RIGHT NOW? (not "will be useful later")
164
+ - Does it add configurability that isn't required by the current spec?
165
+ - Does it introduce a layer of indirection without clear benefit?
166
+ - Flag unnecessary abstractions as MEDIUM (over-engineering)
167
+ 4. **Observability Check** - For code touching critical paths (auth, payments, data, API):
168
+ - Structured logging present? (not just `console.log`)
169
+ - Error tracking with context? (user, request, stack trace)
170
+ - Health check endpoint if it's a new service?
171
+ - Correlation IDs propagated across boundaries?
172
+ - Flag missing observability as MEDIUM (or HIGH for auth/payments)
173
+ 5. **Assign severity** - Every finding gets a severity level (see table below)
174
+ 6. **Sort** - CRITICAL first, then HIGH, MEDIUM, LOW
175
+ 7. **Group** - By file, then by severity within each file
165
176
 
166
177
  ### Step 4: Verdict
167
178
 
@@ -189,6 +200,8 @@ Apply verdict rules based on the consolidated findings. The verdict is final and
189
200
  - A security finding without a corresponding test → severity +1 level
190
201
  - A finding that recurs from a previous review → severity +1 level
191
202
  - A finding in auth, payments, or PII handling → minimum severity HIGH
203
+ - A change touching observability/monitoring code without corresponding tests → severity +1 level
204
+ - A new abstraction used in only one place → flag as YAGNI (MEDIUM)
192
205
 
193
206
  ## Verification Protocol
194
207