@rune-kit/rune 2.2.6 → 2.3.1
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/README.md +395 -389
- package/compiler/__tests__/tier-override.test.js +158 -0
- package/compiler/adapters/antigravity.js +3 -8
- package/compiler/adapters/codex.js +3 -8
- package/compiler/adapters/cursor.js +3 -8
- package/compiler/adapters/generic.js +3 -8
- package/compiler/adapters/openclaw.js +4 -9
- package/compiler/adapters/opencode.js +3 -8
- package/compiler/adapters/windsurf.js +3 -8
- package/compiler/bin/rune.js +34 -1
- package/compiler/emitter.js +94 -5
- package/compiler/transforms/branding.js +10 -3
- package/docs/ARCHITECTURE.md +3 -3
- package/docs/SKILL-TEMPLATE.md +15 -0
- package/docs/VISION.md +3 -3
- package/docs/guides/index.html +14 -14
- package/docs/index.html +82 -13
- package/docs/script.js +33 -6
- package/docs/skills/index.html +832 -832
- package/docs/style.css +62 -0
- package/extensions/ai-ml/PACK.md +7 -0
- package/extensions/content/PACK.md +7 -0
- package/extensions/mobile/PACK.md +9 -9
- package/extensions/zalo/PACK.md +9 -0
- package/package.json +8 -6
- package/skills/adversary/SKILL.md +12 -0
- package/skills/audit/SKILL.md +526 -467
- package/skills/autopsy/SKILL.md +12 -0
- package/skills/ba/SKILL.md +349 -342
- package/skills/brainstorm/SKILL.md +11 -0
- package/skills/completion-gate/SKILL.md +260 -249
- package/skills/context-engine/SKILL.md +77 -1
- package/skills/context-pack/SKILL.md +160 -0
- package/skills/cook/SKILL.md +648 -958
- package/skills/cook/references/deviation-rules.md +19 -0
- package/skills/cook/references/error-recovery.md +37 -0
- package/skills/cook/references/exit-conditions.md +31 -0
- package/skills/cook/references/loop-detection.md +39 -0
- package/skills/cook/references/mid-run-signals.md +31 -0
- package/skills/cook/references/output-format.md +40 -0
- package/skills/cook/references/pack-detection.md +82 -0
- package/skills/cook/references/pause-resume-template.md +38 -0
- package/skills/cook/references/rfc-template.md +52 -0
- package/skills/cook/references/sharp-edges.md +24 -0
- package/skills/cook/references/subagent-status.md +38 -0
- package/skills/db/SKILL.md +12 -0
- package/skills/debug/SKILL.md +392 -362
- package/skills/deploy/SKILL.md +10 -0
- package/skills/deploy/references/post-deploy-integration.md +192 -0
- package/skills/design/SKILL.md +9 -0
- package/skills/docs/SKILL.md +12 -0
- package/skills/docs-seeker/SKILL.md +11 -0
- package/skills/fix/SKILL.md +281 -249
- package/skills/incident/SKILL.md +10 -0
- package/skills/launch/SKILL.md +12 -0
- package/skills/logic-guardian/SKILL.md +11 -0
- package/skills/marketing/SKILL.md +13 -0
- package/skills/mcp-builder/SKILL.md +13 -0
- package/skills/onboard/SKILL.md +50 -2
- package/skills/perf/SKILL.md +11 -0
- package/skills/plan/SKILL.md +342 -688
- package/skills/plan/references/completeness-scoring.md +36 -0
- package/skills/plan/references/outcome-block.md +40 -0
- package/skills/plan/references/plan-templates.md +193 -0
- package/skills/plan/references/wave-planning.md +44 -0
- package/skills/plan/references/workflow-registry.md +52 -0
- package/skills/preflight/SKILL.md +360 -280
- package/skills/rescue/SKILL.md +11 -0
- package/skills/research/SKILL.md +149 -150
- package/skills/retro/SKILL.md +11 -0
- package/skills/review/SKILL.md +489 -396
- package/skills/review-intake/SKILL.md +11 -0
- package/skills/safeguard/SKILL.md +12 -0
- package/skills/scaffold/SKILL.md +10 -0
- package/skills/scope-guard/SKILL.md +11 -0
- package/skills/scout/SKILL.md +9 -0
- package/skills/sentinel/SKILL.md +296 -425
- package/skills/sentinel/references/config-protection.md +52 -0
- package/skills/sentinel/references/destructive-commands.md +39 -0
- package/skills/sentinel/references/domain-hooks.md +73 -0
- package/skills/sentinel/references/framework-patterns.md +46 -0
- package/skills/sentinel/references/owasp-patterns.md +69 -0
- package/skills/sentinel/references/secret-patterns.md +40 -0
- package/skills/sentinel/references/skill-content-guard.md +54 -0
- package/skills/session-bridge/SKILL.md +56 -2
- package/skills/skill-forge/SKILL.md +47 -2
- package/skills/skill-router/{SKILL.md → skill.md} +446 -365
- package/skills/surgeon/SKILL.md +12 -0
- package/skills/team/SKILL.md +34 -1
- package/skills/test/SKILL.md +585 -427
- package/skills/watchdog/references/webhook-health-checks.md +243 -0
package/skills/plan/SKILL.md
CHANGED
|
@@ -1,688 +1,342 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: plan
|
|
3
|
-
description: Create structured implementation plans from requirements. Produces master plan + phase files for enterprise-scale project management. Master plan = overview (<80 lines). Phase files = execution detail (<150 lines each). Each session handles 1 phase. Uses opus for deep reasoning.
|
|
4
|
-
metadata:
|
|
5
|
-
author: runedev
|
|
6
|
-
version: "
|
|
7
|
-
layer: L2
|
|
8
|
-
model: opus
|
|
9
|
-
group: creation
|
|
10
|
-
tools: "Read, Write, Edit, Glob, Grep"
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
# plan
|
|
14
|
-
|
|
15
|
-
## Purpose
|
|
16
|
-
|
|
17
|
-
Strategic planning engine for the Rune ecosystem. Produces a **master plan + phase files** architecture — NOT a single monolithic plan. The master plan is a concise overview (<80 lines) that references separate phase files, each containing enough detail (<150 lines) that ANY model can execute with high accuracy.
|
|
18
|
-
|
|
19
|
-
**Design principle: Plan for the weakest coder.** Phase files are designed so that even an Amateur-level model (Haiku) can execute them with minimal errors. When the plan satisfies the Amateur's needs, every model benefits — Junior (Sonnet) executes near-perfectly, Senior (Opus) executes flawlessly.
|
|
20
|
-
|
|
21
|
-
This is enterprise-grade project management: BA produces WHAT → Plan produces HOW (structured into phases) → ANY coder executes each phase with full context.
|
|
22
|
-
|
|
23
|
-
<HARD-GATE>
|
|
24
|
-
NEVER produce a single monolithic plan file for non-trivial tasks.
|
|
25
|
-
Non-trivial = 3+ phases OR 5+ files OR estimated > 100 LOC total change.
|
|
26
|
-
For non-trivial tasks: MUST produce master plan + separate phase files.
|
|
27
|
-
For trivial tasks (1-2 phases, < 5 files): inline plan is acceptable.
|
|
28
|
-
</HARD-GATE>
|
|
29
|
-
|
|
30
|
-
## Architecture: Master Plan + Phase Files
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
.rune/
|
|
34
|
-
plan-<feature>.md ← Master plan: phases overview, goals, status tracker (<80 lines)
|
|
35
|
-
plan-<feature>-phase1.md ← Phase 1 detail: tasks, acceptance criteria, files to touch (<150 lines)
|
|
36
|
-
plan-<feature>-phase2.md ← Phase 2 detail
|
|
37
|
-
...
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### Why This Architecture
|
|
41
|
-
|
|
42
|
-
- **Big context = even Opus misses details and makes mistakes**
|
|
43
|
-
- **Small context = Sonnet handles correctly, Opus has zero mistakes**
|
|
44
|
-
- Phase isolation prevents cross-contamination of concerns
|
|
45
|
-
- Each session starts clean with only the relevant phase loaded
|
|
46
|
-
- Coder (Sonnet/Haiku) can execute a phase file without needing the full plan
|
|
47
|
-
|
|
48
|
-
### Size Constraints
|
|
49
|
-
|
|
50
|
-
| File | Max Lines | Content |
|
|
51
|
-
|------|-----------|---------|
|
|
52
|
-
| Master plan | 80 lines | Overview, phase table, key decisions, status |
|
|
53
|
-
| Phase file | 200 lines | Amateur-proof template: data flow, contracts, tasks, failures, NFRs, rejections, cross-phase |
|
|
54
|
-
| Total phases | Max 8 | If > 8 phases, split into sub-projects |
|
|
55
|
-
|
|
56
|
-
## Modes
|
|
57
|
-
|
|
58
|
-
### Implementation Mode (default)
|
|
59
|
-
Standard implementation planning — decompose task into phased steps with code details.
|
|
60
|
-
|
|
61
|
-
### Feature Spec Mode
|
|
62
|
-
Product-oriented planning — write a feature specification before implementation.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
-
|
|
73
|
-
- `/rune plan
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
- `
|
|
90
|
-
-
|
|
91
|
-
- `
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
- `
|
|
96
|
-
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
- `
|
|
110
|
-
- `
|
|
111
|
-
- `
|
|
112
|
-
|
|
113
|
-
###
|
|
114
|
-
|
|
115
|
-
- `
|
|
116
|
-
- `
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
### Step
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
-
|
|
153
|
-
-
|
|
154
|
-
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
##
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
**
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
**
|
|
253
|
-
|
|
254
|
-
**
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
- Commit: `feat(trading): add calculateProfit with fee calculation`
|
|
344
|
-
- Logic: sum entries by side, apply fees (0.1% per trade), return net P&L
|
|
345
|
-
- Edge: empty array → return { netPnL: 0, totalFees: 0, winRate: 0 }
|
|
346
|
-
- [ ] Task 2 — Add input validation
|
|
347
|
-
- Req: REQ-002 (input validation)
|
|
348
|
-
- File: `src/foo/baz.ts` (modify)
|
|
349
|
-
- Test: `tests/foo/baz.test.ts` (new)
|
|
350
|
-
- Verify: `npm test -- --grep "validateInput"`
|
|
351
|
-
- Commit: `feat(trading): add input validation for trade entries`
|
|
352
|
-
- Logic: check side is 'long'|'short', prices > 0, quantity > 0
|
|
353
|
-
- [ ] Task 3 — Write integration tests
|
|
354
|
-
- Req: REQ-001, REQ-002 (integration coverage)
|
|
355
|
-
- File: `tests/foo/bar.test.ts` (modify)
|
|
356
|
-
- Test: N/A — this IS the test task
|
|
357
|
-
- Verify: `npm test -- --grep "trading" && npx tsc --noEmit`
|
|
358
|
-
- Commit: `test(trading): add integration tests for edge cases`
|
|
359
|
-
- Cases: happy path, empty input, negative values, overflow
|
|
360
|
-
|
|
361
|
-
## Failure Scenarios
|
|
362
|
-
<What should happen when things go wrong — coder MUST implement these>
|
|
363
|
-
|
|
364
|
-
| When | Then | Error Type |
|
|
365
|
-
|------|------|-----------|
|
|
366
|
-
| entries is empty array | return zero-value ProfitResult | No error (valid edge case) |
|
|
367
|
-
| entry has negative price | throw ValidationError("price must be positive") | ValidationError |
|
|
368
|
-
| entry has quantity = 0 | throw ValidationError("quantity must be > 0") | ValidationError |
|
|
369
|
-
| calculation overflows Number.MAX_SAFE_INTEGER | use BigInt or throw OverflowError | OverflowError |
|
|
370
|
-
|
|
371
|
-
## Performance Constraints
|
|
372
|
-
<Non-functional requirements — skip if not applicable>
|
|
373
|
-
|
|
374
|
-
| Metric | Requirement | Why |
|
|
375
|
-
|--------|-------------|-----|
|
|
376
|
-
| Input size | Must handle 10,000 entries | Production data volume |
|
|
377
|
-
| Response time | < 100ms for 10K entries | Real-time dashboard |
|
|
378
|
-
| Memory | < 50MB for 10K entries | Container memory limit |
|
|
379
|
-
|
|
380
|
-
## Rejection Criteria (DO NOT)
|
|
381
|
-
<Anti-patterns the coder MUST avoid — things that seem right but are wrong>
|
|
382
|
-
|
|
383
|
-
- ❌ DO NOT use `toFixed()` for financial calculations — use Decimal.js or integer cents
|
|
384
|
-
- ❌ DO NOT mutate the input array — create new objects (immutability rule)
|
|
385
|
-
- ❌ DO NOT use `any` type — full TypeScript strict
|
|
386
|
-
- ❌ DO NOT import from Phase 2+ files — this phase is self-contained
|
|
387
|
-
|
|
388
|
-
## Cross-Phase Context
|
|
389
|
-
<What this phase assumes from previous phases / what future phases expect from this one>
|
|
390
|
-
|
|
391
|
-
- **Assumes**: Phase 1 created `src/shared/types.ts` with base types
|
|
392
|
-
- **Exports for Phase 3**: `calculateProfit()` will be imported by `src/dashboard/PnLCard.tsx`
|
|
393
|
-
- **Interface contract**: ProfitResult shape MUST NOT change — Phase 3 depends on it
|
|
394
|
-
|
|
395
|
-
## Acceptance Criteria
|
|
396
|
-
- [ ] All tasks marked done
|
|
397
|
-
- [ ] Tests pass with 80%+ coverage on new code
|
|
398
|
-
- [ ] No TypeScript errors (`tsc --noEmit` passes)
|
|
399
|
-
- [ ] Failure scenarios all handled (table above)
|
|
400
|
-
- [ ] Performance: calculateProfit(10K entries) < 100ms
|
|
401
|
-
- [ ] No `any` types, no mutation, no `toFixed()` for money
|
|
402
|
-
|
|
403
|
-
## Traceability Matrix
|
|
404
|
-
| Req ID | Requirement | Task(s) | Test(s) | Status |
|
|
405
|
-
|--------|-------------|---------|---------|--------|
|
|
406
|
-
| REQ-001 | P&L calculation with fees | Task 1 | `tests/foo/bar.test.ts` | ⬚ |
|
|
407
|
-
| REQ-002 | Input validation | Task 2 | `tests/foo/baz.test.ts` | ⬚ |
|
|
408
|
-
|
|
409
|
-
Every requirement from BA's Requirements Document MUST appear in this matrix. Missing requirement = incomplete phase. `completion-gate` checks this matrix during verification.
|
|
410
|
-
|
|
411
|
-
## Files Touched
|
|
412
|
-
- `src/foo/bar.ts` — new
|
|
413
|
-
- `src/foo/baz.ts` — modify
|
|
414
|
-
- `tests/foo/bar.test.ts` — new
|
|
415
|
-
```
|
|
416
|
-
|
|
417
|
-
**Max 200 lines per phase file.** Must be self-contained — coder should NOT need to read master plan or other phases to execute.
|
|
418
|
-
|
|
419
|
-
<HARD-GATE>
|
|
420
|
-
Every phase file MUST include ALL of these sections (Amateur-Proof Checklist):
|
|
421
|
-
1. ✅ Data Flow — ASCII diagram of how data moves
|
|
422
|
-
2. ✅ Code Contracts — function signatures, interfaces, types
|
|
423
|
-
3. ✅ Tasks — with file paths, logic description, edge cases
|
|
424
|
-
4. ✅ Failure Scenarios — table of when/then/error for each error case
|
|
425
|
-
5. ✅ Rejection Criteria — explicit "DO NOT" anti-patterns
|
|
426
|
-
6. ✅ Cross-Phase Context — what's assumed from prior phases, what's exported for future phases
|
|
427
|
-
7. ✅ Acceptance Criteria — testable, includes performance if applicable
|
|
428
|
-
8. ✅ Test tasks — every code task has corresponding tests
|
|
429
|
-
9. ✅ Traceability Matrix — every BA requirement mapped to tasks and tests (skip if no BA requirements exist)
|
|
430
|
-
|
|
431
|
-
A phase missing ANY of sections 1-7 is INCOMPLETE — the weakest coder will guess wrong.
|
|
432
|
-
Performance Constraints section is optional (only when NFRs apply).
|
|
433
|
-
</HARD-GATE>
|
|
434
|
-
|
|
435
|
-
### Step 5.5 — Completeness Scoring (Alternatives)
|
|
436
|
-
|
|
437
|
-
When presenting alternative approaches (from brainstorm or Step 3 decisions), rate each with **Completeness X/10**:
|
|
438
|
-
|
|
439
|
-
| Score | Meaning |
|
|
440
|
-
|-------|---------|
|
|
441
|
-
| 9-10 | Complete — all edge cases, full coverage, production-ready |
|
|
442
|
-
| 7-8 | Happy path covered, some edges skipped |
|
|
443
|
-
| 4-6 | Shortcut — defers significant work |
|
|
444
|
-
| 1-3 | Minimal viable, debt guaranteed |
|
|
445
|
-
|
|
446
|
-
**Always recommend higher-completeness option.** With AI-assisted coding, the marginal cost of completeness is near-zero. Show dual effort estimates for each approach: `(human: ~X / AI: ~Y)`.
|
|
447
|
-
|
|
448
|
-
**Anti-pattern**: "Option B saves 70 LOC" → 70 LOC delta is meaningless with AI. Choose complete. The last 10% of coverage is where production bugs hide.
|
|
449
|
-
|
|
450
|
-
> Source: garrytan/gstack v0.9.0 — "Boil the Lake" principle.
|
|
451
|
-
|
|
452
|
-
### Step 6 — Present and Get Approval
|
|
453
|
-
|
|
454
|
-
Present the **master plan** to user (NOT all phase files). User reviews:
|
|
455
|
-
- Phase breakdown
|
|
456
|
-
- Key decisions
|
|
457
|
-
- Risks
|
|
458
|
-
- Completeness scores for chosen approach (from Step 5.5)
|
|
459
|
-
|
|
460
|
-
Wait for explicit approval ("go", "proceed", "yes") before writing phase files.
|
|
461
|
-
|
|
462
|
-
If user requests changes → revise and re-present.
|
|
463
|
-
|
|
464
|
-
### Step 7 — Execution Handoff
|
|
465
|
-
|
|
466
|
-
After approval, the execution flow is:
|
|
467
|
-
|
|
468
|
-
```
|
|
469
|
-
1. Cook loads master plan → identifies current phase (first ⬚ Pending)
|
|
470
|
-
2. Cook loads ONLY that phase's file
|
|
471
|
-
3. Coder executes tasks in the phase file
|
|
472
|
-
4. Mark tasks done in phase file as completed
|
|
473
|
-
5. When phase complete → update master plan status: ⬚ → ✅
|
|
474
|
-
6. Next session: load master plan → find next ⬚ phase → load phase file → execute
|
|
475
|
-
```
|
|
476
|
-
|
|
477
|
-
**Model selection for execution:**
|
|
478
|
-
- Opus plans phases (this skill)
|
|
479
|
-
- Sonnet/Haiku executes them (cook → fix)
|
|
480
|
-
- If Sonnet makes small errors → fix lightly (cheaper than using Opus for execution)
|
|
481
|
-
|
|
482
|
-
## Inline Plan (Trivial Tasks)
|
|
483
|
-
|
|
484
|
-
For trivial tasks (1-2 phases, < 5 files, < 100 LOC):
|
|
485
|
-
|
|
486
|
-
Skip master plan + phase files. Produce inline plan directly:
|
|
487
|
-
|
|
488
|
-
```
|
|
489
|
-
## Plan: [Task Name]
|
|
490
|
-
|
|
491
|
-
### Changes
|
|
492
|
-
1. [file]: [what to change] — [function signature]
|
|
493
|
-
2. [file]: [what to change]
|
|
494
|
-
|
|
495
|
-
### Tests
|
|
496
|
-
- [test file]: [test cases]
|
|
497
|
-
|
|
498
|
-
### Risks
|
|
499
|
-
- [risk]: [mitigation]
|
|
500
|
-
|
|
501
|
-
Awaiting approval.
|
|
502
|
-
```
|
|
503
|
-
|
|
504
|
-
## Re-Planning (Dynamic Adaptation)
|
|
505
|
-
|
|
506
|
-
When cook encounters unexpected conditions during execution:
|
|
507
|
-
|
|
508
|
-
### Trigger Conditions
|
|
509
|
-
- Phase execution hits max debug-fix loops (3)
|
|
510
|
-
- New files discovered outside the plan scope
|
|
511
|
-
- Dependency change alters the approach
|
|
512
|
-
- User requests scope change
|
|
513
|
-
|
|
514
|
-
### Re-Plan Protocol
|
|
515
|
-
|
|
516
|
-
1. **Read the master plan** + **current phase file**
|
|
517
|
-
2. **Read delta context**: what changed, what failed
|
|
518
|
-
3. **Assess impact**: which remaining phases are affected?
|
|
519
|
-
4. **Revise**:
|
|
520
|
-
- Mark completed phases as ✅ in master plan
|
|
521
|
-
- Modify affected phase files
|
|
522
|
-
- Add new phases if scope expanded
|
|
523
|
-
- **Do NOT rewrite completed phases**
|
|
524
|
-
5. **Present revised master plan** with diff summary
|
|
525
|
-
6. **Get approval** before resuming
|
|
526
|
-
|
|
527
|
-
## Feature Spec Mode
|
|
528
|
-
|
|
529
|
-
When invoked in Feature Spec Mode, produce a structured specification.
|
|
530
|
-
|
|
531
|
-
### Steps
|
|
532
|
-
|
|
533
|
-
**Step 1 — Problem Statement**
|
|
534
|
-
- What problem? Who has it? Current workaround?
|
|
535
|
-
|
|
536
|
-
**Step 2 — User Stories**
|
|
537
|
-
- Primary story, 2-3 secondary, edge cases
|
|
538
|
-
- Format: `As a [persona], I want to [action] so that [benefit]`
|
|
539
|
-
|
|
540
|
-
**Step 3 — Acceptance Criteria**
|
|
541
|
-
- `GIVEN [context] WHEN [action] THEN [result]`
|
|
542
|
-
- Happy path + error cases + performance criteria
|
|
543
|
-
|
|
544
|
-
**Step 4 — Scope Definition**
|
|
545
|
-
- In scope / Out of scope / Dependencies / Open questions
|
|
546
|
-
|
|
547
|
-
**Step 5 — Write Spec File**
|
|
548
|
-
Save to `.rune/features/<feature-name>/spec.md`
|
|
549
|
-
|
|
550
|
-
After spec approved → transition to Implementation Mode.
|
|
551
|
-
|
|
552
|
-
## Roadmap Mode
|
|
553
|
-
|
|
554
|
-
When invoked in Roadmap Mode, produce a prioritized feature roadmap.
|
|
555
|
-
|
|
556
|
-
### Steps
|
|
557
|
-
|
|
558
|
-
**Step 1 — Inventory**
|
|
559
|
-
Scan project for: open issues, TODO/FIXME comments, planned features.
|
|
560
|
-
|
|
561
|
-
**Step 2 — Prioritize (ICE Scoring)**
|
|
562
|
-
Impact × Confidence × Ease (each 1-10). Sort descending.
|
|
563
|
-
|
|
564
|
-
**Step 3 — Group into Milestones**
|
|
565
|
-
- Milestone 1: top 3-5 features by ICE
|
|
566
|
-
- Milestone 2: next 3-5
|
|
567
|
-
- Backlog: remaining
|
|
568
|
-
|
|
569
|
-
**Step 4 — Write Roadmap**
|
|
570
|
-
Save to `.rune/roadmap.md`
|
|
571
|
-
|
|
572
|
-
## Output Format
|
|
573
|
-
|
|
574
|
-
### Master Plan (`.rune/plan-<feature>.md`)
|
|
575
|
-
```markdown
|
|
576
|
-
# Feature: <name>
|
|
577
|
-
|
|
578
|
-
## Overview
|
|
579
|
-
<1-3 sentences: what and why>
|
|
580
|
-
|
|
581
|
-
## Phases
|
|
582
|
-
| # | Name | Status | Plan File | Summary |
|
|
583
|
-
|---|------|--------|-----------|---------|
|
|
584
|
-
| 1 | [name] | ⬚ Pending | plan-X-phase1.md | [1-line summary] |
|
|
585
|
-
|
|
586
|
-
## Key Decisions
|
|
587
|
-
- [decision — chosen approach and why]
|
|
588
|
-
|
|
589
|
-
## Architecture
|
|
590
|
-
<brief system diagram — NOT implementation detail>
|
|
591
|
-
|
|
592
|
-
## Dependencies / Risks
|
|
593
|
-
- [dep/risk]: [status/mitigation]
|
|
594
|
-
```
|
|
595
|
-
Max 80 lines. No implementation details.
|
|
596
|
-
|
|
597
|
-
### Phase File (`.rune/plan-<feature>-phase<N>.md`)
|
|
598
|
-
7 mandatory sections (Amateur-Proof Template):
|
|
599
|
-
1. **Goal** — 1-2 sentences
|
|
600
|
-
2. **Data Flow** — 5-line ASCII diagram
|
|
601
|
-
3. **Code Contracts** — function signatures, interfaces
|
|
602
|
-
4. **Tasks** — file paths, logic, edge cases, tests
|
|
603
|
-
5. **Failure Scenarios** — when/then/error table
|
|
604
|
-
6. **Rejection Criteria** — explicit DO NOTs
|
|
605
|
-
7. **Cross-Phase Context** — assumes from prior, exports for future
|
|
606
|
-
8. **Acceptance Criteria** — testable conditions
|
|
607
|
-
|
|
608
|
-
Max 200 lines. Self-contained — coder needs ONLY this file.
|
|
609
|
-
|
|
610
|
-
### Inline Plan (trivial tasks)
|
|
611
|
-
```
|
|
612
|
-
## Plan: [Task Name]
|
|
613
|
-
### Changes
|
|
614
|
-
1. [file]: [what] — [signature]
|
|
615
|
-
### Tests
|
|
616
|
-
- [test file]: [cases]
|
|
617
|
-
### Risks
|
|
618
|
-
- [risk]: [mitigation]
|
|
619
|
-
```
|
|
620
|
-
|
|
621
|
-
## Constraints
|
|
622
|
-
|
|
623
|
-
1. MUST produce master plan + phase files for non-trivial tasks (3+ phases OR 5+ files OR 100+ LOC)
|
|
624
|
-
2. MUST keep master plan under 80 lines — overview only, no implementation details
|
|
625
|
-
3. MUST keep each phase file under 200 lines — self-contained, Amateur-proof
|
|
626
|
-
4. MUST include exact file paths for every task — no vague "set up the database"
|
|
627
|
-
5. MUST include test tasks for every phase that produces code
|
|
628
|
-
6. MUST include ALL Amateur-Proof sections: data flow, code contracts, tasks, failure scenarios, rejection criteria, cross-phase context, acceptance criteria
|
|
629
|
-
7. MUST order phases by dependency — don't plan phase 3 before phase 1's output exists
|
|
630
|
-
8. MUST get user approval before writing phase files
|
|
631
|
-
9. Phase files MUST be self-contained — coder should NOT need master plan to execute
|
|
632
|
-
10. Max 8 phases per master plan — if more, split into sub-projects
|
|
633
|
-
11. MUST include failure scenarios table — what happens when things go wrong
|
|
634
|
-
12. MUST include rejection criteria — explicit "DO NOT" anti-patterns to prevent common mistakes
|
|
635
|
-
13. MUST include cross-phase context — what's assumed from prior phases, what's exported for future
|
|
636
|
-
|
|
637
|
-
## Sharp Edges
|
|
638
|
-
|
|
639
|
-
| Failure Mode | Severity | Mitigation |
|
|
640
|
-
|---|---|---|
|
|
641
|
-
| Monolithic plan file that overflows context | CRITICAL | HARD-GATE: non-trivial tasks MUST use master + phase files |
|
|
642
|
-
| Phase file too vague for Amateur to execute | CRITICAL | Amateur-Proof template: ALL 7 mandatory sections required |
|
|
643
|
-
| Coder uses wrong approach (toFixed for money, mutation) | CRITICAL | Rejection Criteria section: explicit "DO NOT" list prevents common traps |
|
|
644
|
-
| Coder doesn't handle errors properly | HIGH | Failure Scenarios table: when/then/error for EVERY error case |
|
|
645
|
-
| Coder doesn't know what other phases expect | HIGH | Cross-Phase Context: explicit imports/exports between phases |
|
|
646
|
-
| Coder over-engineers or under-engineers perf | HIGH | Performance Constraints: specific metrics with thresholds |
|
|
647
|
-
| Master plan contains implementation detail | HIGH | Max 80 lines, overview only — detail goes in phase files |
|
|
648
|
-
| Phase file references other phase files | HIGH | Phase files are self-contained — cross-phase section handles this |
|
|
649
|
-
| Plan without scout context — invented file paths | CRITICAL | Step 1: scout first, always |
|
|
650
|
-
| Phase with zero test tasks | CRITICAL | HARD-GATE rejects it |
|
|
651
|
-
| 10+ phases overwhelming the master plan | MEDIUM | Max 8 phases — split into sub-projects if more |
|
|
652
|
-
| Task without File path or Verify command | HIGH | Every task MUST have File + Test + Verify + Commit fields — no vague "implement the feature" tasks |
|
|
653
|
-
| Horizontal layer planning (all models → all APIs → all UI) | HIGH | Vertical slices parallelize better. Use wave-based grouping: independent tasks in same wave, dependent tasks in later waves |
|
|
654
|
-
| Tasks without `depends_on` in Wave 2+ | MEDIUM | Implicit dependencies break parallel dispatch. Every Wave 2+ task MUST declare `depends_on` |
|
|
655
|
-
| Plan ignores locked Decisions from BA | CRITICAL | Decision Compliance section cross-checks requirements.md — locked decisions are non-negotiable |
|
|
656
|
-
| Complex feature missing Workflow Registry — components planned but never wired | HIGH | Step 4.5: 4-view registry catches orphaned components, unphased workflows, and missing state transitions before phase files are written |
|
|
657
|
-
| Recommending shortcut approach without Completeness Score | MEDIUM | Step 5.5: every alternative needs X/10 Completeness score + dual effort estimate (human vs AI). "Saves 70 LOC" is not a reason when AI makes the delta cost minutes |
|
|
658
|
-
|
|
659
|
-
## Self-Validation
|
|
660
|
-
|
|
661
|
-
```
|
|
662
|
-
SELF-VALIDATION (run before presenting plan to user):
|
|
663
|
-
- [ ] Every task has a clear file path — no "update relevant files" vagueness
|
|
664
|
-
- [ ] Wave dependencies are acyclic — no task depends on a task in the same or later wave
|
|
665
|
-
- [ ] Every code-producing phase has at least one test task
|
|
666
|
-
- [ ] Phase files have ALL Amateur-Proof sections (data flow, code contracts, failure scenarios, rejection criteria)
|
|
667
|
-
- [ ] Locked decisions from BA are reflected in plan — none contradicted or ignored
|
|
668
|
-
- [ ] Every BA requirement has a corresponding Req ID in at least one phase's Traceability Matrix
|
|
669
|
-
```
|
|
670
|
-
|
|
671
|
-
## Done When
|
|
672
|
-
|
|
673
|
-
- Complexity classified (inline vs master + phase files)
|
|
674
|
-
- Scout output read and conventions/patterns identified
|
|
675
|
-
- BA requirements consumed (if available)
|
|
676
|
-
- Master plan written (< 80 lines) with phase table and key decisions
|
|
677
|
-
- Phase files written (< 200 lines each) with ALL Amateur-Proof sections:
|
|
678
|
-
- Data flow diagram, code contracts, tasks with edge cases
|
|
679
|
-
- Failure scenarios table, rejection criteria (DO NOTs)
|
|
680
|
-
- Cross-phase context (assumes/exports), acceptance criteria
|
|
681
|
-
- Every code-producing phase has test tasks
|
|
682
|
-
- Master plan presented to user with "Awaiting Approval"
|
|
683
|
-
- User has explicitly approved
|
|
684
|
-
- Self-Validation: all checks passed
|
|
685
|
-
|
|
686
|
-
## Cost Profile
|
|
687
|
-
|
|
688
|
-
~3000-8000 tokens input, ~2000-5000 tokens output (master + all phase files). Opus for architectural reasoning. Most expensive L2 skill but runs infrequently. Phase files are written once, executed by cheaper models (Sonnet/Haiku).
|
|
1
|
+
---
|
|
2
|
+
name: plan
|
|
3
|
+
description: Create structured implementation plans from requirements. Produces master plan + phase files for enterprise-scale project management. Master plan = overview (<80 lines). Phase files = execution detail (<150 lines each). Each session handles 1 phase. Uses opus for deep reasoning.
|
|
4
|
+
metadata:
|
|
5
|
+
author: runedev
|
|
6
|
+
version: "1.1.0"
|
|
7
|
+
layer: L2
|
|
8
|
+
model: opus
|
|
9
|
+
group: creation
|
|
10
|
+
tools: "Read, Write, Edit, Glob, Grep"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# plan
|
|
14
|
+
|
|
15
|
+
## Purpose
|
|
16
|
+
|
|
17
|
+
Strategic planning engine for the Rune ecosystem. Produces a **master plan + phase files** architecture — NOT a single monolithic plan. The master plan is a concise overview (<80 lines) that references separate phase files, each containing enough detail (<150 lines) that ANY model can execute with high accuracy.
|
|
18
|
+
|
|
19
|
+
**Design principle: Plan for the weakest coder.** Phase files are designed so that even an Amateur-level model (Haiku) can execute them with minimal errors. When the plan satisfies the Amateur's needs, every model benefits — Junior (Sonnet) executes near-perfectly, Senior (Opus) executes flawlessly.
|
|
20
|
+
|
|
21
|
+
This is enterprise-grade project management: BA produces WHAT → Plan produces HOW (structured into phases) → ANY coder executes each phase with full context.
|
|
22
|
+
|
|
23
|
+
<HARD-GATE>
|
|
24
|
+
NEVER produce a single monolithic plan file for non-trivial tasks.
|
|
25
|
+
Non-trivial = 3+ phases OR 5+ files OR estimated > 100 LOC total change.
|
|
26
|
+
For non-trivial tasks: MUST produce master plan + separate phase files.
|
|
27
|
+
For trivial tasks (1-2 phases, < 5 files): inline plan is acceptable.
|
|
28
|
+
</HARD-GATE>
|
|
29
|
+
|
|
30
|
+
## Architecture: Master Plan + Phase Files
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
.rune/
|
|
34
|
+
plan-<feature>.md ← Master plan: phases overview, goals, status tracker (<80 lines)
|
|
35
|
+
plan-<feature>-phase1.md ← Phase 1 detail: tasks, acceptance criteria, files to touch (<150 lines)
|
|
36
|
+
plan-<feature>-phase2.md ← Phase 2 detail
|
|
37
|
+
...
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Why This Architecture
|
|
41
|
+
|
|
42
|
+
- **Big context = even Opus misses details and makes mistakes**
|
|
43
|
+
- **Small context = Sonnet handles correctly, Opus has zero mistakes**
|
|
44
|
+
- Phase isolation prevents cross-contamination of concerns
|
|
45
|
+
- Each session starts clean with only the relevant phase loaded
|
|
46
|
+
- Coder (Sonnet/Haiku) can execute a phase file without needing the full plan
|
|
47
|
+
|
|
48
|
+
### Size Constraints
|
|
49
|
+
|
|
50
|
+
| File | Max Lines | Content |
|
|
51
|
+
|------|-----------|---------|
|
|
52
|
+
| Master plan | 80 lines | Overview, phase table, key decisions, status |
|
|
53
|
+
| Phase file | 200 lines | Amateur-proof template: data flow, contracts, tasks, failures, NFRs, rejections, cross-phase |
|
|
54
|
+
| Total phases | Max 8 | If > 8 phases, split into sub-projects |
|
|
55
|
+
|
|
56
|
+
## Modes
|
|
57
|
+
|
|
58
|
+
### Implementation Mode (default)
|
|
59
|
+
Standard implementation planning — decompose task into phased steps with code details.
|
|
60
|
+
|
|
61
|
+
### Feature Spec Mode
|
|
62
|
+
Product-oriented planning — write a feature specification before implementation.
|
|
63
|
+
**Triggers:** user says "spec", "feature spec", "write spec", "PRD" — or `/rune plan spec <feature>`
|
|
64
|
+
|
|
65
|
+
### Roadmap Mode
|
|
66
|
+
High-level multi-feature planning — organize features into milestones.
|
|
67
|
+
**Triggers:** user says "roadmap", "milestone", "release plan", "what to build next" — or `/rune plan roadmap`
|
|
68
|
+
|
|
69
|
+
## Triggers
|
|
70
|
+
|
|
71
|
+
- Called by `cook` when task scope > 1 file (Implementation Mode)
|
|
72
|
+
- Called by `team` for high-level task decomposition
|
|
73
|
+
- `/rune plan <task>` — manual planning
|
|
74
|
+
- `/rune plan spec <feature>` — feature specification
|
|
75
|
+
- `/rune plan roadmap` — roadmap planning
|
|
76
|
+
- Auto-trigger: when user says "implement", "build", "create" with complex scope
|
|
77
|
+
|
|
78
|
+
## Calls (outbound)
|
|
79
|
+
|
|
80
|
+
- `scout` (L2): scan codebase for existing patterns, conventions, and structure
|
|
81
|
+
- `brainstorm` (L2): when multiple valid approaches exist
|
|
82
|
+
- `research` (L3): external knowledge lookup
|
|
83
|
+
- `sequential-thinking` (L3): complex architecture with many trade-offs
|
|
84
|
+
- L4 extension packs: domain-specific architecture patterns
|
|
85
|
+
- `neural-memory` | Before architecture decisions | Recall past decisions on similar problems
|
|
86
|
+
|
|
87
|
+
## Called By (inbound)
|
|
88
|
+
|
|
89
|
+
- `cook` (L1): Phase 2 PLAN
|
|
90
|
+
- `team` (L1): task decomposition into parallel workstreams
|
|
91
|
+
- `brainstorm` (L2): when idea needs structuring
|
|
92
|
+
- `rescue` (L1): plan refactoring strategy
|
|
93
|
+
- `ba` (L2): hand-off after requirements complete
|
|
94
|
+
- `scaffold` (L1): Phase 3 architecture planning
|
|
95
|
+
- `skill-forge` (L2): plan structure for new skill
|
|
96
|
+
- User: `/rune plan` direct invocation
|
|
97
|
+
|
|
98
|
+
## Data Flow
|
|
99
|
+
|
|
100
|
+
### Feeds Into →
|
|
101
|
+
|
|
102
|
+
- `cook` (L1): master plan + phase files → cook's Phase 2-4 execution roadmap
|
|
103
|
+
- `team` (L1): task decomposition + wave grouping → team's parallel workstream dispatch
|
|
104
|
+
- `fix` (L2): phase file tasks → fix's implementation targets
|
|
105
|
+
- `test` (L2): phase file test tasks → test's RED phase targets
|
|
106
|
+
|
|
107
|
+
### Fed By ←
|
|
108
|
+
|
|
109
|
+
- `ba` (L2): Requirements Document → plan's primary input (locked decisions, user stories)
|
|
110
|
+
- `scout` (L2): codebase analysis → plan's convention/pattern awareness
|
|
111
|
+
- `neural-memory` (external): past architectural decisions → plan's precedent context
|
|
112
|
+
|
|
113
|
+
### Feedback Loops ↻
|
|
114
|
+
|
|
115
|
+
- `plan` ↔ `brainstorm`: plan requests options when multiple approaches exist → brainstorm generates options → plan selects and structures the chosen approach
|
|
116
|
+
- `plan` ↔ `cook`: cook discovers plan gaps during implementation → plan updates phase files → cook resumes with corrected tasks
|
|
117
|
+
|
|
118
|
+
## Executable Steps (Implementation Mode)
|
|
119
|
+
|
|
120
|
+
### Step 1 — Gather Context
|
|
121
|
+
|
|
122
|
+
Check for `.rune/features/*/requirements.md` via `Glob`. If a Requirements Document exists (from `rune:ba`), read it — it contains user stories, acceptance criteria, scope, constraints. Do NOT re-gather what BA already elicited.
|
|
123
|
+
|
|
124
|
+
Invoke `rune:scout` if not already done — plans without context produce wrong file paths. Call `neural-memory` (Recall Mode) to surface past architecture decisions before making new ones.
|
|
125
|
+
|
|
126
|
+
### Step 2 — Classify Complexity
|
|
127
|
+
|
|
128
|
+
Determine inline plan vs master + phase files:
|
|
129
|
+
|
|
130
|
+
| Criteria | Inline Plan | Master + Phase Files |
|
|
131
|
+
|----------|-------------|---------------------|
|
|
132
|
+
| Phases | 1-2 | 3+ |
|
|
133
|
+
| Files touched | < 5 | 5+ |
|
|
134
|
+
| Estimated LOC | < 100 | 100+ |
|
|
135
|
+
| Cross-module | No | Yes |
|
|
136
|
+
| Session span | Single session | Multi-session |
|
|
137
|
+
|
|
138
|
+
If ANY "Master + Phase Files" criterion is true → produce master plan + phase files.
|
|
139
|
+
|
|
140
|
+
### Step 3 — Decompose into Phases
|
|
141
|
+
<MUST-READ path="references/wave-planning.md" trigger="when writing wave-structured task lists inside any phase"/>
|
|
142
|
+
|
|
143
|
+
Group work into phases. Each phase: completable in one session, clear "done when", produces testable output, independent enough to run without other phases loaded.
|
|
144
|
+
|
|
145
|
+
<HARD-GATE>
|
|
146
|
+
Each phase MUST be completable by ANY coder model (including Haiku) with ONLY the phase file loaded.
|
|
147
|
+
If the coder would need to read the master plan or other phase files to execute → the phase file is missing detail.
|
|
148
|
+
Phase files are SELF-CONTAINED execution instructions — designed for the weakest model to succeed.
|
|
149
|
+
</HARD-GATE>
|
|
150
|
+
|
|
151
|
+
Phase decomposition rules:
|
|
152
|
+
- **Foundation first**: types, schemas, core engine
|
|
153
|
+
- **Dependencies before consumers**: create what's imported before the importer
|
|
154
|
+
- **Test alongside**: each phase includes its own test tasks
|
|
155
|
+
- **Max 5-7 tasks per phase**: if more, split the phase
|
|
156
|
+
- **Vertical slices over horizontal layers**: prefer "auth end-to-end" over "all models → all APIs → all UI"
|
|
157
|
+
|
|
158
|
+
Tasks within each phase MUST be organized into waves (parallel-safe groupings). See `references/wave-planning.md`.
|
|
159
|
+
|
|
160
|
+
### Step 4 — Write Master Plan File
|
|
161
|
+
<MUST-READ path="references/plan-templates.md" trigger="when writing the master plan file"/>
|
|
162
|
+
|
|
163
|
+
Save to `.rune/plan-<feature>.md`. Use the Master Plan Template in `references/plan-templates.md`. Max 80 lines — no implementation details.
|
|
164
|
+
|
|
165
|
+
### Step 4.5 — Workflow Registry (Complex Features Only)
|
|
166
|
+
<MUST-READ path="references/workflow-registry.md" trigger="when feature has 4+ phases OR 3+ user-facing workflows"/>
|
|
167
|
+
|
|
168
|
+
For complex features (4+ phases OR 3+ user-facing workflows): build a 4-view Workflow Registry before writing phase files. Catches orphaned components, unphased workflows, and missing state transitions at plan time.
|
|
169
|
+
|
|
170
|
+
**Skip** for: trivial tasks, inline plans, single-workflow features.
|
|
171
|
+
|
|
172
|
+
### Step 5 — Write Phase Files
|
|
173
|
+
<MUST-READ path="references/plan-templates.md" trigger="when writing any phase file"/>
|
|
174
|
+
|
|
175
|
+
For each phase, save to `.rune/plan-<feature>-phase<N>.md`. Use the Amateur-Proof Template in `references/plan-templates.md`.
|
|
176
|
+
|
|
177
|
+
<HARD-GATE>
|
|
178
|
+
Every phase file MUST include ALL of these sections (Amateur-Proof Checklist):
|
|
179
|
+
1. ✅ Data Flow — ASCII diagram of how data moves
|
|
180
|
+
2. ✅ Code Contracts — function signatures, interfaces, types
|
|
181
|
+
3. ✅ Tasks — with file paths, logic description, edge cases
|
|
182
|
+
4. ✅ Failure Scenarios — table of when/then/error for each error case
|
|
183
|
+
5. ✅ Rejection Criteria — explicit "DO NOT" anti-patterns
|
|
184
|
+
6. ✅ Cross-Phase Context — what's assumed from prior phases, what's exported for future phases
|
|
185
|
+
7. ✅ Acceptance Criteria — testable, includes performance if applicable
|
|
186
|
+
8. ✅ Test tasks — every code task has corresponding tests
|
|
187
|
+
9. ✅ Traceability Matrix — every BA requirement mapped to tasks and tests (skip if no BA requirements exist)
|
|
188
|
+
|
|
189
|
+
A phase missing ANY of sections 1-7 is INCOMPLETE — the weakest coder will guess wrong.
|
|
190
|
+
Performance Constraints section is optional (only when NFRs apply).
|
|
191
|
+
</HARD-GATE>
|
|
192
|
+
|
|
193
|
+
### Step 5.5 — Completeness Scoring (Alternatives)
|
|
194
|
+
<MUST-READ path="references/completeness-scoring.md" trigger="when presenting alternative approaches"/>
|
|
195
|
+
|
|
196
|
+
When presenting alternatives (from brainstorm or Step 3), rate each **Completeness X/10**. Always recommend the higher-completeness option — with AI, the marginal cost of completeness is near-zero.
|
|
197
|
+
|
|
198
|
+
### Step 6 — Present and Get Approval
|
|
199
|
+
|
|
200
|
+
Present the **master plan** to user (NOT all phase files). User reviews: phase breakdown, key decisions, risks, completeness scores. Wait for explicit approval ("go", "proceed", "yes") before writing phase files.
|
|
201
|
+
|
|
202
|
+
### Step 7 — Execution Handoff
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
1. Cook loads master plan → identifies current phase (first ⬚ Pending)
|
|
206
|
+
2. Cook loads ONLY that phase's file
|
|
207
|
+
3. Coder executes tasks in the phase file
|
|
208
|
+
4. Mark tasks done in phase file as completed
|
|
209
|
+
5. When phase complete → update master plan status: ⬚ → ✅
|
|
210
|
+
6. Next session: load master plan → find next ⬚ phase → load phase file → execute
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Model selection: Opus plans phases (this skill). Sonnet/Haiku executes them (cook → fix).
|
|
214
|
+
|
|
215
|
+
## Inline Plan (Trivial Tasks)
|
|
216
|
+
|
|
217
|
+
For trivial tasks (1-2 phases, < 5 files, < 100 LOC) — skip master + phase files. See inline plan template in `references/plan-templates.md`.
|
|
218
|
+
|
|
219
|
+
## Re-Planning (Dynamic Adaptation)
|
|
220
|
+
|
|
221
|
+
When cook encounters unexpected conditions during execution:
|
|
222
|
+
|
|
223
|
+
**Trigger Conditions:** Phase hits max debug-fix loops (3) | new files outside plan scope | dependency change | user requests scope change.
|
|
224
|
+
|
|
225
|
+
**Re-Plan Protocol:**
|
|
226
|
+
1. Read master plan + current phase file + delta context (what changed, what failed)
|
|
227
|
+
2. Assess impact: which remaining phases are affected?
|
|
228
|
+
3. Revise: mark ✅ completed phases, modify affected phase files, add new phases if scope expanded. Do NOT rewrite completed phases.
|
|
229
|
+
4. Present revised master plan with diff summary — get approval before resuming.
|
|
230
|
+
|
|
231
|
+
## Feature Spec Mode
|
|
232
|
+
|
|
233
|
+
**Step 1** — Problem Statement: what problem, who has it, current workaround?
|
|
234
|
+
**Step 2** — User Stories: primary + 2-3 secondary + edge cases. Format: `As a [persona], I want to [action] so that [benefit]`
|
|
235
|
+
**Step 3** — Acceptance Criteria: `GIVEN [context] WHEN [action] THEN [result]` — happy path + errors + performance
|
|
236
|
+
**Step 4** — Scope Definition: In scope / Out of scope / Dependencies / Open questions
|
|
237
|
+
**Step 5** — Write Spec File: save to `.rune/features/<feature-name>/spec.md`
|
|
238
|
+
|
|
239
|
+
After spec approved → transition to Implementation Mode.
|
|
240
|
+
|
|
241
|
+
## Roadmap Mode
|
|
242
|
+
|
|
243
|
+
**Step 1** — Inventory: scan for open issues, TODO/FIXME, planned features.
|
|
244
|
+
**Step 2** — Prioritize (ICE Scoring): Impact × Confidence × Ease (each 1-10), sort descending.
|
|
245
|
+
**Step 3** — Group into Milestones: M1 = top 3-5 by ICE, M2 = next 3-5, Backlog = remaining.
|
|
246
|
+
**Step 4** — Write to `.rune/roadmap.md`.
|
|
247
|
+
|
|
248
|
+
## Output Format
|
|
249
|
+
|
|
250
|
+
**Master Plan** (`.rune/plan-<feature>.md`): Overview, Phases table, Key Decisions, Decision Compliance, Architecture, Dependencies/Risks. Max 80 lines. See `references/plan-templates.md`.
|
|
251
|
+
|
|
252
|
+
**Phase File** (`.rune/plan-<feature>-phase<N>.md`): 7 mandatory sections (Amateur-Proof Template). Max 200 lines. Self-contained. See `references/plan-templates.md`.
|
|
253
|
+
|
|
254
|
+
**Inline Plan** (trivial tasks): Changes, Tests, Risks. See `references/plan-templates.md`.
|
|
255
|
+
|
|
256
|
+
## Outcome Block (Mandatory)
|
|
257
|
+
<MUST-READ path="references/outcome-block.md" trigger="when writing the final section of any plan output"/>
|
|
258
|
+
|
|
259
|
+
Every plan output — master plan, phase file, or inline plan — MUST end with an **Outcome Block** containing: What Was Planned + Immediate Next Action (single action, imperative) + How to Measure table (at least one shell command).
|
|
260
|
+
|
|
261
|
+
## Constraints
|
|
262
|
+
|
|
263
|
+
1. MUST produce master plan + phase files for non-trivial tasks (3+ phases OR 5+ files OR 100+ LOC)
|
|
264
|
+
2. MUST keep master plan under 80 lines — overview only, no implementation details
|
|
265
|
+
3. MUST keep each phase file under 200 lines — self-contained, Amateur-proof
|
|
266
|
+
4. MUST include exact file paths for every task — no vague "set up the database"
|
|
267
|
+
5. MUST include test tasks for every phase that produces code
|
|
268
|
+
6. MUST include ALL Amateur-Proof sections: data flow, code contracts, tasks, failure scenarios, rejection criteria, cross-phase context, acceptance criteria
|
|
269
|
+
7. MUST order phases by dependency — don't plan phase 3 before phase 1's output exists
|
|
270
|
+
8. MUST get user approval before writing phase files
|
|
271
|
+
9. Phase files MUST be self-contained — coder should NOT need master plan to execute
|
|
272
|
+
10. Max 8 phases per master plan — if more, split into sub-projects
|
|
273
|
+
11. MUST include failure scenarios table — what happens when things go wrong
|
|
274
|
+
12. MUST include rejection criteria — explicit "DO NOT" anti-patterns to prevent common mistakes
|
|
275
|
+
13. MUST include cross-phase context — what's assumed from prior phases, what's exported for future
|
|
276
|
+
|
|
277
|
+
## Returns
|
|
278
|
+
|
|
279
|
+
| Artifact | Format | Location |
|
|
280
|
+
|----------|--------|----------|
|
|
281
|
+
| Master plan | Markdown | `.rune/plan-<feature>.md` |
|
|
282
|
+
| Phase files | Markdown | `.rune/plan-<feature>-phase<N>.md` (one per phase) |
|
|
283
|
+
| Feature spec | Markdown | `.rune/features/<name>/spec.md` (Feature Spec Mode only) |
|
|
284
|
+
| Roadmap | Markdown | `.rune/roadmap.md` (Roadmap Mode only) |
|
|
285
|
+
| Inline plan | Markdown (inline) | Emitted directly for trivial tasks |
|
|
286
|
+
|
|
287
|
+
## Sharp Edges
|
|
288
|
+
|
|
289
|
+
| Failure Mode | Severity | Mitigation |
|
|
290
|
+
|---|---|---|
|
|
291
|
+
| Monolithic plan file that overflows context | CRITICAL | HARD-GATE: non-trivial tasks MUST use master + phase files |
|
|
292
|
+
| Phase file too vague for Amateur to execute | CRITICAL | Amateur-Proof template: ALL 7 mandatory sections required |
|
|
293
|
+
| Coder uses wrong approach (toFixed for money, mutation) | CRITICAL | Rejection Criteria section: explicit "DO NOT" list prevents common traps |
|
|
294
|
+
| Coder doesn't handle errors properly | HIGH | Failure Scenarios table: when/then/error for EVERY error case |
|
|
295
|
+
| Coder doesn't know what other phases expect | HIGH | Cross-Phase Context: explicit imports/exports between phases |
|
|
296
|
+
| Coder over-engineers or under-engineers perf | HIGH | Performance Constraints: specific metrics with thresholds |
|
|
297
|
+
| Master plan contains implementation detail | HIGH | Max 80 lines, overview only — detail goes in phase files |
|
|
298
|
+
| Phase file references other phase files | HIGH | Phase files are self-contained — cross-phase section handles this |
|
|
299
|
+
| Plan without scout context — invented file paths | CRITICAL | Step 1: scout first, always |
|
|
300
|
+
| Phase with zero test tasks | CRITICAL | HARD-GATE rejects it |
|
|
301
|
+
| 10+ phases overwhelming the master plan | MEDIUM | Max 8 phases — split into sub-projects if more |
|
|
302
|
+
| Task without File path or Verify command | HIGH | Every task MUST have File + Test + Verify + Commit fields — no vague "implement the feature" tasks |
|
|
303
|
+
| Horizontal layer planning (all models → all APIs → all UI) | HIGH | Vertical slices parallelize better. Use wave-based grouping: independent tasks in same wave, dependent tasks in later waves |
|
|
304
|
+
| Tasks without `depends_on` in Wave 2+ | MEDIUM | Implicit dependencies break parallel dispatch. Every Wave 2+ task MUST declare `depends_on` |
|
|
305
|
+
| Plan ignores locked Decisions from BA | CRITICAL | Decision Compliance section cross-checks requirements.md — locked decisions are non-negotiable |
|
|
306
|
+
| Complex feature missing Workflow Registry — components planned but never wired | HIGH | Step 4.5: 4-view registry catches orphaned components, unphased workflows, and missing state transitions before phase files are written |
|
|
307
|
+
| Recommending shortcut approach without Completeness Score | MEDIUM | Step 5.5: every alternative needs X/10 Completeness score + dual effort estimate (human vs AI). "Saves 70 LOC" is not a reason when AI makes the delta cost minutes |
|
|
308
|
+
| Plan output missing Outcome Block | MEDIUM | Every plan output MUST end with Outcome Block (What Was Planned + Immediate Next Action + How to Measure) — executor drift when omitted |
|
|
309
|
+
| Outcome Block "Next Action" is a list, not one action | LOW | One action only — ambiguity about where to start causes re-analysis and lost context |
|
|
310
|
+
|
|
311
|
+
## Self-Validation
|
|
312
|
+
|
|
313
|
+
```
|
|
314
|
+
SELF-VALIDATION (run before presenting plan to user):
|
|
315
|
+
- [ ] Every task has a clear file path — no "update relevant files" vagueness
|
|
316
|
+
- [ ] Wave dependencies are acyclic — no task depends on a task in the same or later wave
|
|
317
|
+
- [ ] Every code-producing phase has at least one test task
|
|
318
|
+
- [ ] Phase files have ALL Amateur-Proof sections (data flow, code contracts, failure scenarios, rejection criteria)
|
|
319
|
+
- [ ] Locked decisions from BA are reflected in plan — none contradicted or ignored
|
|
320
|
+
- [ ] Every BA requirement has a corresponding Req ID in at least one phase's Traceability Matrix
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
## Done When
|
|
324
|
+
|
|
325
|
+
- Complexity classified (inline vs master + phase files)
|
|
326
|
+
- Scout output read and conventions/patterns identified
|
|
327
|
+
- BA requirements consumed (if available)
|
|
328
|
+
- Master plan written (< 80 lines) with phase table and key decisions
|
|
329
|
+
- Phase files written (< 200 lines each) with ALL Amateur-Proof sections:
|
|
330
|
+
- Data flow diagram, code contracts, tasks with edge cases
|
|
331
|
+
- Failure scenarios table, rejection criteria (DO NOTs)
|
|
332
|
+
- Cross-phase context (assumes/exports), acceptance criteria
|
|
333
|
+
- Every code-producing phase has test tasks
|
|
334
|
+
- Master plan presented to user with "Awaiting Approval"
|
|
335
|
+
- User has explicitly approved
|
|
336
|
+
- Self-Validation: all checks passed
|
|
337
|
+
- Outcome Block present in every plan output (master plan, phase files, inline plan)
|
|
338
|
+
- Outcome Block contains: What Was Planned + Immediate Next Action (single action) + How to Measure table
|
|
339
|
+
|
|
340
|
+
## Cost Profile
|
|
341
|
+
|
|
342
|
+
~3000-8000 tokens input, ~2000-5000 tokens output (master + all phase files). Opus for architectural reasoning. Most expensive L2 skill but runs infrequently. Phase files are written once, executed by cheaper models (Sonnet/Haiku).
|