@rune-kit/rune 2.7.0 → 2.10.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 (123) hide show
  1. package/README.md +78 -41
  2. package/agents/adversary.md +27 -0
  3. package/agents/architect.md +19 -29
  4. package/agents/asset-creator.md +18 -4
  5. package/agents/audit.md +25 -4
  6. package/agents/autopsy.md +19 -4
  7. package/agents/ba.md +35 -0
  8. package/agents/brainstorm.md +31 -4
  9. package/agents/browser-pilot.md +21 -4
  10. package/agents/coder.md +21 -29
  11. package/agents/completion-gate.md +20 -4
  12. package/agents/constraint-check.md +18 -4
  13. package/agents/context-engine.md +22 -4
  14. package/agents/context-pack.md +32 -0
  15. package/agents/cook.md +41 -4
  16. package/agents/db.md +19 -4
  17. package/agents/debug.md +33 -4
  18. package/agents/dependency-doctor.md +20 -4
  19. package/agents/deploy.md +27 -4
  20. package/agents/design.md +22 -4
  21. package/agents/doc-processor.md +27 -0
  22. package/agents/docs-seeker.md +19 -4
  23. package/agents/docs.md +31 -0
  24. package/agents/fix.md +37 -4
  25. package/agents/git.md +29 -0
  26. package/agents/hallucination-guard.md +20 -4
  27. package/agents/incident.md +21 -4
  28. package/agents/integrity-check.md +18 -4
  29. package/agents/journal.md +19 -4
  30. package/agents/launch.md +32 -4
  31. package/agents/logic-guardian.md +26 -11
  32. package/agents/marketing.md +23 -4
  33. package/agents/mcp-builder.md +26 -0
  34. package/agents/neural-memory.md +30 -0
  35. package/agents/onboard.md +22 -4
  36. package/agents/perf.md +21 -4
  37. package/agents/plan.md +29 -4
  38. package/agents/preflight.md +22 -4
  39. package/agents/problem-solver.md +20 -4
  40. package/agents/rescue.md +23 -4
  41. package/agents/research.md +19 -4
  42. package/agents/researcher.md +19 -29
  43. package/agents/retro.md +32 -0
  44. package/agents/review-intake.md +20 -4
  45. package/agents/review.md +32 -4
  46. package/agents/reviewer.md +20 -28
  47. package/agents/safeguard.md +19 -4
  48. package/agents/sast.md +18 -4
  49. package/agents/scaffold.md +41 -0
  50. package/agents/scanner.md +19 -28
  51. package/agents/scope-guard.md +18 -4
  52. package/agents/scout.md +23 -4
  53. package/agents/sentinel-env.md +26 -0
  54. package/agents/sentinel.md +33 -4
  55. package/agents/sequential-thinking.md +20 -4
  56. package/agents/session-bridge.md +24 -4
  57. package/agents/skill-forge.md +22 -4
  58. package/agents/skill-router.md +26 -4
  59. package/agents/slides.md +24 -0
  60. package/agents/surgeon.md +19 -4
  61. package/agents/team.md +30 -4
  62. package/agents/test.md +36 -4
  63. package/agents/trend-scout.md +17 -4
  64. package/agents/verification.md +20 -4
  65. package/agents/video-creator.md +20 -4
  66. package/agents/watchdog.md +19 -4
  67. package/agents/worktree.md +17 -4
  68. package/compiler/__tests__/analytics.test.js +370 -0
  69. package/compiler/adapters/openclaw.js +2 -2
  70. package/compiler/analytics.js +385 -0
  71. package/compiler/bin/rune.js +68 -2
  72. package/compiler/dashboard.js +883 -0
  73. package/compiler/transforms/branding.js +1 -1
  74. package/extensions/ui/skills/animation-patterns.md +21 -0
  75. package/extensions/ui/skills/component-patterns.md +25 -0
  76. package/extensions/ui/skills/landing-patterns.md +1 -1
  77. package/hooks/context-watch/index.cjs +95 -68
  78. package/hooks/metrics-collector/index.cjs +86 -42
  79. package/hooks/post-session-reflect/index.cjs +41 -5
  80. package/hooks/session-start/index.cjs +8 -2
  81. package/package.json +2 -2
  82. package/skills/audit/SKILL.md +1 -0
  83. package/skills/autopsy/SKILL.md +78 -2
  84. package/skills/autopsy/references/repo-analysis-patterns.md +113 -0
  85. package/skills/ba/SKILL.md +72 -2
  86. package/skills/brainstorm/SKILL.md +1 -0
  87. package/skills/completion-gate/SKILL.md +26 -3
  88. package/skills/context-engine/SKILL.md +49 -1
  89. package/skills/cook/SKILL.md +72 -3
  90. package/skills/cook/references/output-format.md +33 -0
  91. package/skills/db/SKILL.md +1 -0
  92. package/skills/debug/SKILL.md +57 -1
  93. package/skills/deploy/SKILL.md +1 -1
  94. package/skills/design/SKILL.md +110 -3
  95. package/skills/docs/SKILL.md +2 -1
  96. package/skills/fix/SKILL.md +47 -1
  97. package/skills/graft/SKILL.md +352 -0
  98. package/skills/graft/references/challenge-framework.md +98 -0
  99. package/skills/graft/references/mode-decision.md +44 -0
  100. package/skills/incident/SKILL.md +2 -0
  101. package/skills/journal/SKILL.md +2 -0
  102. package/skills/launch/SKILL.md +2 -0
  103. package/skills/marketing/SKILL.md +46 -2
  104. package/skills/mcp-builder/SKILL.md +3 -1
  105. package/skills/mcp-builder/references/auto-discovery-pattern.md +169 -0
  106. package/skills/plan/SKILL.md +60 -4
  107. package/skills/plan/references/feature-map.md +84 -0
  108. package/skills/preflight/SKILL.md +20 -1
  109. package/skills/rescue/SKILL.md +25 -1
  110. package/skills/research/SKILL.md +24 -1
  111. package/skills/retro/SKILL.md +2 -0
  112. package/skills/review/SKILL.md +55 -2
  113. package/skills/scaffold/SKILL.md +1 -0
  114. package/skills/scope-guard/SKILL.md +35 -17
  115. package/skills/scout/SKILL.md +22 -1
  116. package/skills/sentinel/SKILL.md +29 -1
  117. package/skills/sentinel-env/SKILL.md +0 -2
  118. package/skills/session-bridge/SKILL.md +155 -9
  119. package/skills/skill-forge/SKILL.md +43 -1
  120. package/skills/skill-router/{skill.md → SKILL.md} +27 -2
  121. package/skills/team/SKILL.md +24 -1
  122. package/skills/test/SKILL.md +29 -2
  123. package/skills/verification/SKILL.md +1 -2
@@ -3,12 +3,12 @@ name: session-bridge
3
3
  description: Universal context persistence across sessions. Auto-saves decisions, conventions, and progress to .rune/ files. Loads state at session start. Use when any skill makes architectural decisions or establishes patterns that must survive session boundaries.
4
4
  metadata:
5
5
  author: runedev
6
- version: "0.5.0"
6
+ version: "0.6.0"
7
7
  layer: L3
8
8
  model: haiku
9
9
  group: state
10
10
  tools: "Read, Write, Edit, Glob, Grep"
11
- listen: phase.complete
11
+ listen: phase.complete, checkpoint.request
12
12
  ---
13
13
 
14
14
  # session-bridge
@@ -23,6 +23,8 @@ Solve the #1 developer complaint: context loss across sessions. Session-bridge a
23
23
  - Auto-trigger: when a convention/pattern is established
24
24
  - Auto-trigger: before context compaction
25
25
  - Auto-trigger: at session end (stop hook)
26
+ - Signal: `checkpoint.request` — explicit checkpoint from cook/team mid-phase
27
+ - `/checkpoint` — manual checkpoint (save exact resume point)
26
28
  - `/rune status` — manual state check
27
29
 
28
30
  ## Calls (outbound)
@@ -40,12 +42,14 @@ Solve the #1 developer complaint: context loss across sessions. Session-bridge a
40
42
 
41
43
  ```
42
44
  .rune/
43
- ├── decisions.md — Architectural decisions log
44
- ├── conventions.md — Established patterns & style
45
- ├── progress.md — Task progress tracker
46
- ├── session-log.md — Brief log of each session
47
- ├── instincts.md — Learned project-specific patterns (trigger→action)
48
- └── cumulative-notes.md — Living project understanding (profile, themes, relationships)
45
+ ├── decisions.md — Architectural decisions log
46
+ ├── conventions.md — Established patterns & style
47
+ ├── progress.md — Task progress tracker
48
+ ├── session-log.md — Brief log of each session
49
+ ├── instincts.md — Learned project-specific patterns (trigger→action)
50
+ ├── cumulative-notes.md — Living project understanding (profile, themes, relationships)
51
+ ├── learnings.jsonl — Structured learning log (append-only, queryable)
52
+ └── checkpoint.md — Exact resume point for cross-session continuity
49
53
  ```
50
54
 
51
55
  ## Execution
@@ -199,6 +203,48 @@ Extract atomic "instincts" — learned trigger→action patterns — from this s
199
203
 
200
204
  **Max instincts**: Keep `.rune/instincts.md` under 20 entries. When full, evict the lowest-confidence entry.
201
205
 
206
+ #### Step 5.8 — Learnings Log (Structured JSONL)
207
+
208
+ Append structured learning entries to `.rune/learnings.jsonl` — an append-only log that captures decisions, insights, and error resolutions in a machine-queryable format. Unlike markdown state files (which are for human reading), JSONL enables fast filtering and "latest winner" lookups.
209
+
210
+ **Entry schema** — one JSON object per line:
211
+
212
+ ```json
213
+ {"ts":"2026-04-04T14:30:00Z","skill":"cook","type":"decision","key":"state-lib","insight":"Chose Zustand over Redux — fewer re-renders in dashboard with 50+ real-time widgets","confidence":0.8,"files":["src/store/index.ts"]}
214
+ ```
215
+
216
+ | Field | Type | Description |
217
+ |-------|------|-------------|
218
+ | `ts` | ISO 8601 | When the learning was captured |
219
+ | `skill` | string | Which skill produced this learning |
220
+ | `type` | enum | `decision` · `error` · `insight` · `convention` · `performance` |
221
+ | `key` | string | Dedup key — latest entry per key+type wins on read |
222
+ | `insight` | string | 1-2 sentences, causal language ("Chose X because Y", "Root cause was X") |
223
+ | `confidence` | 0.1–1.0 | How certain this learning is (0.3=hunch, 0.7=validated, 0.9=battle-tested) |
224
+ | `files` | string[] | Optional — affected file paths |
225
+
226
+ **Write rules:**
227
+ - Append only — never edit or delete lines in the JSONL file
228
+ - Max 1-3 entries per session (only genuinely transferable learnings)
229
+ - Use causal/comparative language, not flat facts
230
+ - Key must be kebab-case, descriptive (e.g., `auth-lib`, `db-migration-strategy`, `react-hook-pitfall`)
231
+
232
+ **Read rules (latest-winner):**
233
+ - When loading learnings, group by `key+type` and take the entry with the latest `ts`
234
+ - This means updating a learning = just append a new entry with the same key+type
235
+ - No dedup needed on write — dedup happens on read
236
+
237
+ **Query patterns** (for other skills or session-start):
238
+ - All learnings: read `.rune/learnings.jsonl`, parse line-by-line
239
+ - By type: filter `type === "error"` to surface past mistakes before coding
240
+ - By skill: filter `skill === "cook"` to see cook-specific learnings
241
+ - By recency: sort by `ts` descending, take top N
242
+ - Surface top 5 learnings at session start if file has 10+ entries
243
+
244
+ **Pruning**: When file exceeds 100 entries, compact by keeping only the latest-winner per key+type. Write compacted entries to a new file, replace original.
245
+
246
+ **Why**: Markdown state files (decisions.md, conventions.md) are great for human reading but hard to query programmatically. JSONL enables structured recall — "show me all errors from last week" or "what did we decide about auth?" — without parsing markdown headers.
247
+
202
248
  #### Step 5.9 — Cumulative Project Notes (Structured Memory)
203
249
 
204
250
  Maintain a running **cumulative notes** file at `.rune/cumulative-notes.md` that evolves across sessions. Unlike `progress.md` (which tracks tasks) or `decisions.md` (which logs choices), cumulative notes capture the **living understanding** of the project — patterns learned, relationships discovered, recurring themes, and open threads.
@@ -336,6 +382,81 @@ Present the loaded context to the agent in a structured summary:
336
382
 
337
383
  Identify the next concrete task from `progress.md` → "Next Session Should" section. Present it as the recommended starting point to the calling orchestrator.
338
384
 
385
+ ### Checkpoint Mode (explicit save-and-resume point)
386
+
387
+ Unlike Save Mode (which captures session state broadly), Checkpoint Mode creates an **exact resume point** — a single file that tells the next session precisely where to pick up, what's in-flight, and what decisions are load-bearing.
388
+
389
+ **Trigger**: User says `/checkpoint`, or `cook`/`team` emits `checkpoint.request` signal when pausing mid-phase.
390
+
391
+ #### Step 1 — Capture resume state
392
+
393
+ Collect into a structured checkpoint:
394
+
395
+ ```markdown
396
+ # Checkpoint — [YYYY-MM-DD HH:MM]
397
+
398
+ ## What I Was Doing
399
+ [1-2 sentences: the exact task and sub-step in progress]
400
+
401
+ ## Current Git State
402
+ - Branch: [branch name]
403
+ - Last commit: [short hash + message]
404
+ - Uncommitted changes: [list of modified/untracked files, or "clean"]
405
+ - Stashed: [yes/no — if yes, stash message]
406
+
407
+ ## Decisions Made This Session (Load-Bearing)
408
+ [Only decisions that affect the remaining work — not all decisions]
409
+ - [Decision 1]: [choice + why]
410
+ - [Decision 2]: [choice + why]
411
+
412
+ ## What's Left (Ordered)
413
+ 1. [Next immediate step — be specific: file, function, what to change]
414
+ 2. [Step after that]
415
+ 3. [Remaining steps...]
416
+
417
+ ## Context the Next Session Needs
418
+ [Critical info that's NOT in the code or git history — mental model, gotchas discovered, things tried and failed]
419
+ - [Item 1]
420
+ - [Item 2]
421
+
422
+ ## Resume Command
423
+ [Exact instruction for the next session to pick up — e.g., "Continue Phase 2 Task 3: implement the retry logic in src/api/client.ts, the happy path is done, need error handling"]
424
+ ```
425
+
426
+ #### Step 2 — Write checkpoint file
427
+
428
+ Write to `.rune/checkpoint.md` (overwrite — only one active checkpoint at a time).
429
+
430
+ #### Step 3 — Confirm to user
431
+
432
+ ```
433
+ ## Checkpoint Saved
434
+ - **Resume point**: [1-line summary of what to continue]
435
+ - **Git state**: [branch] @ [commit hash] — [clean/N uncommitted files]
436
+ - **Remaining tasks**: [count]
437
+ - Next session will auto-detect this checkpoint and offer to resume.
438
+ ```
439
+
440
+ #### Checkpoint Resume (in Load Mode)
441
+
442
+ At Load Mode Step 1, after checking `.rune/*.md` existence, also check for `.rune/checkpoint.md`:
443
+
444
+ - If checkpoint exists, read it FIRST (before other state files)
445
+ - Present the resume point prominently:
446
+ ```
447
+ ## Checkpoint Detected — [date]
448
+ **Resume**: [Resume Command from checkpoint]
449
+ **Git state**: [branch] @ [commit] — [clean/dirty]
450
+ **Tasks remaining**: [count]
451
+ ```
452
+ - After successful resume (user confirms they've picked up where they left off), rename checkpoint:
453
+ ```bash
454
+ mv .rune/checkpoint.md .rune/checkpoint-[date].resolved.md
455
+ ```
456
+ - Keep last 3 resolved checkpoints for history, delete older ones
457
+
458
+ **Why**: Save Mode captures everything broadly. Checkpoint captures the **exact needle position** — like a bookmark in a book vs. a summary of chapters read. The next session doesn't need to scan all state files to figure out what to do; the checkpoint tells it directly.
459
+
339
460
  ## Output Format
340
461
 
341
462
  ### Save Mode
@@ -352,11 +473,21 @@ Identify the next concrete task from `progress.md` → "Next Session Should" sec
352
473
  ```
353
474
  ## Session Bridge — Loaded
354
475
  - **Last session**: [date and summary]
476
+ - **Checkpoint**: [detected — resume point] | [none]
355
477
  - **Decisions on file**: [count]
356
478
  - **Conventions on file**: [count]
479
+ - **Learnings on file**: [count] (top 5 surfaced if 10+)
357
480
  - **Next task**: [task description]
358
481
  ```
359
482
 
483
+ ### Checkpoint Mode
484
+ ```
485
+ ## Checkpoint Saved
486
+ - **Resume point**: [1-line summary]
487
+ - **Git state**: [branch] @ [hash] — [clean/N files]
488
+ - **Remaining tasks**: [count]
489
+ ```
490
+
360
491
  ## Constraints
361
492
 
362
493
  1. MUST save decisions, conventions, and progress — not just a status line
@@ -374,6 +505,9 @@ Known failure modes for this skill. Check these before declaring done.
374
505
  | Load mode presenting stale context without age marker | MEDIUM | Mark each loaded entry with its session date — caller knows how fresh it is |
375
506
  | Silent failure when git unavailable | MEDIUM | Note "no git available" in report — do not fail silently or skip without logging |
376
507
  | Loading poisoned .rune/ files without verification | CRITICAL | Step 1.5 integrity-check MUST run before loading — TAINTED = block load |
508
+ | Learnings JSONL grows unbounded | MEDIUM | Auto-compact at 100 entries — keep only latest-winner per key+type |
509
+ | Checkpoint stale after code changes | MEDIUM | Checkpoint includes git state — if branch/commit differ at resume, warn user that checkpoint may be outdated |
510
+ | Multiple checkpoints overwrite each other | LOW | By design — only one active checkpoint. Resolved ones archived with date suffix |
377
511
 
378
512
  ## Done When (Save Mode)
379
513
 
@@ -381,17 +515,29 @@ Known failure modes for this skill. Check these before declaring done.
381
515
  - conventions.md updated with all new patterns established
382
516
  - progress.md updated with completed/in-progress/blocked task status
383
517
  - session-log.md appended with one-line session summary
518
+ - learnings.jsonl appended with 1-3 structured entries (if transferable learnings exist)
384
519
  - Git commit made (or "no git" noted in report)
385
520
  - Session Bridge Saved report emitted
386
521
 
387
522
  ## Done When (Load Mode)
388
523
 
389
524
  - .rune/*.md files found and read
525
+ - Checkpoint detected and presented (if exists)
526
+ - Learnings surfaced (top 5 if 10+ entries)
390
527
  - Last session summary presented
391
528
  - Current in-progress and blocked tasks identified
392
- - Next task recommendation from progress.md
529
+ - Next task recommendation from progress.md (or checkpoint resume command)
393
530
  - Session Bridge Loaded report emitted
394
531
 
532
+ ## Done When (Checkpoint Mode)
533
+
534
+ - Git state captured (branch, commit, uncommitted files)
535
+ - Load-bearing decisions documented
536
+ - Remaining tasks listed in execution order
537
+ - Resume command written (specific enough for a fresh session to act on)
538
+ - checkpoint.md written to .rune/
539
+ - Checkpoint Saved report emitted
540
+
395
541
  ## Cost Profile
396
542
 
397
543
  ~100-300 tokens per save. ~500-1000 tokens per load. Always haiku. Negligible cost.
@@ -3,7 +3,7 @@ name: skill-forge
3
3
  description: Use when creating new Rune skills, editing existing skills, or verifying skill quality before deployment. Applies TDD discipline to skill authoring — test before write, verify before ship.
4
4
  metadata:
5
5
  author: runedev
6
- version: "1.6.0"
6
+ version: "1.7.0"
7
7
  layer: L2
8
8
  model: opus
9
9
  group: creation
@@ -33,6 +33,7 @@ The skill that builds skills. Applies Test-Driven Development to skill authoring
33
33
  ## Called By (inbound)
34
34
 
35
35
  - `cook` (L1): when the feature being built IS a new skill
36
+ - `scaffold` (L1): when scaffolded project includes custom skills
36
37
 
37
38
  ## References
38
39
 
@@ -276,6 +277,47 @@ Research (Meincke et al., 2025, 28,000 conversations) shows 33% → 72% complian
276
277
 
277
278
  **Ethical test**: Would this serve the user's genuine interests if they fully understood the technique?
278
279
 
280
+ ### Phase 5.5 — SECURITY MODEL
281
+
282
+ Every skill that touches external systems, user data, or destructive operations MUST define an explicit Security Model section. This is a contract — not aspirational, but testable.
283
+
284
+ **Add to SKILL.md after Sharp Edges:**
285
+
286
+ ```markdown
287
+ ## Security Model
288
+
289
+ ### Trust Boundaries
290
+ - [What this skill reads] — e.g., "Reads .env files, user source code, git history"
291
+ - [What this skill writes] — e.g., "Writes to .rune/ only, never modifies source code"
292
+ - [What this skill executes] — e.g., "Runs npm test, never runs arbitrary shell commands"
293
+
294
+ ### This Skill Will NEVER
295
+ - [Explicit denial 1] — e.g., "Execute user-provided strings as shell commands"
296
+ - [Explicit denial 2] — e.g., "Read or log credential files (.env, secrets.json)"
297
+ - [Explicit denial 3] — e.g., "Send data to external endpoints"
298
+
299
+ ### Threat Surface
300
+ | Threat | Mitigated By |
301
+ |--------|-------------|
302
+ | Prompt injection via user input | Input validated before processing |
303
+ | Credential exposure in output | Secrets pattern detection before emit |
304
+ | Destructive operation on wrong target | Confirmation gate before delete/overwrite |
305
+ ```
306
+
307
+ **When to require Security Model:**
308
+ - Skill uses `Bash` tool → REQUIRED (can execute arbitrary commands)
309
+ - Skill reads `.env` or credentials → REQUIRED
310
+ - Skill writes/deletes files outside `.rune/` → REQUIRED
311
+ - Skill calls external APIs or MCP tools → REQUIRED
312
+ - Skill is read-only analysis (review, audit, scout) → OPTIONAL but recommended
313
+
314
+ **Eval integration**: Phase 7 evals for skills with Security Model MUST include:
315
+ - E05: Attempt to make skill execute unintended command
316
+ - E06: Attempt to make skill expose credentials in output
317
+ - E07: Attempt to make skill write outside its declared boundary
318
+
319
+ If Security Model is required but missing → Phase 7 EVAL HARD-GATE blocks ship.
320
+
279
321
  ### Phase 6 — INTEGRATE
280
322
 
281
323
  Wire the skill into the mesh:
@@ -4,7 +4,7 @@ description: "Meta-enforcement layer that routes EVERY agent action through the
4
4
  user-invocable: false
5
5
  metadata:
6
6
  author: runedev
7
- version: "1.3.0"
7
+ version: "1.4.0"
8
8
  layer: L0
9
9
  model: haiku
10
10
  group: orchestrator
@@ -328,9 +328,34 @@ These DO NOT need skill routing:
328
328
 
329
329
  At the end of a skill's workflow, skill-router MAY suggest a **complementary skill** — limited to ONE recommendation to prevent infinite referral chains.
330
330
 
331
+ ### Chain Metadata Awareness (Priority Source)
332
+
333
+ When a previous skill's output contains a `chain_metadata` block in the conversation context, skill-router MUST use it as the PRIMARY source for next-skill suggestions:
334
+
335
+ 1. **Read `chain_metadata.suggested_next`** — these are data-driven recommendations from the skill that just ran. They have MORE context than the hardcoded table below.
336
+ 2. **Read `chain_metadata.status`** — override suggestion logic based on outcome:
337
+ - `BLOCKED` → suggest `debug` or `fix` regardless of what the hardcoded table says
338
+ - `NEEDS_CONTEXT` → suggest `scout` or `research`
339
+ - `DONE_WITH_CONCERNS` → suggest `review` or `sentinel`
340
+ 3. **Read `chain_metadata.domain`** — trigger L4 pack auto-suggest (see below)
341
+ 4. **Forward `chain_metadata.exports`** — when announcing the suggestion, mention what data is available: "Review can use the 5 changed files and test results from cook."
342
+
343
+ **Conflict resolution:** If `chain_metadata.suggested_next` recommends skill A but the hardcoded table below recommends skill B, **prefer chain_metadata** — it was generated from actual output data, not generic rules.
344
+
345
+ **Announcement format with chain_metadata:**
346
+ ```
347
+ Suggested next: `rune:<skill>` — <chain_metadata.suggested_next.reason>
348
+ Available data: <list of export keys the suggested skill would consume>
349
+ Run it? (skip to continue)
350
+ ```
351
+
352
+ ### Hardcoded Fallback Table
353
+
354
+ When NO chain_metadata is present (skill didn't emit one, or legacy invocation), fall back to this static table:
355
+
331
356
  | After This Skill | Suggest | Rationale |
332
357
  |-----------------|---------|-----------|
333
- | `debug` | `review` | Root cause found — review the fix area for broader issues |
358
+ | `debug` | `fix` | Root cause found — apply the fix |
334
359
  | `fix` | `test` | Code changed — verify with tests |
335
360
  | `plan` | `adversary` | Plan created — stress-test before implementation |
336
361
  | `test` (GREEN) | `preflight` | Tests pass — check for edge cases and completeness |
@@ -5,7 +5,7 @@ context: fork
5
5
  agent: general-purpose
6
6
  metadata:
7
7
  author: runedev
8
- version: "0.7.0"
8
+ version: "0.8.0"
9
9
  layer: L1
10
10
  model: opus
11
11
  group: orchestrator
@@ -477,6 +477,29 @@ All streams done → MERGE sequentially (avoid conflicts)
477
477
  | Integration test results | Inline stdout | Captured in Phase 5 verify |
478
478
  | Team Report | Markdown (inline) | Emitted at end of session |
479
479
 
480
+ ## Document Ownership
481
+
482
+ | Scope | Access | Files |
483
+ |-------|--------|-------|
484
+ | **Owns** (read + write) | `.rune/team-report-*.md`, worktree branches, merge commits |
485
+ | **Reads** (never writes) | `.rune/plan-*.md`, `.rune/contract.md`, `CLAUDE.md`, cook reports from sub-agents |
486
+ | **Never modifies** | Source files directly (delegates to cook instances), `SKILL.md` files, `compiler/**` |
487
+
488
+ Each cook instance owns its declared file set (disjoint). Team owns coordination artifacts only — never touches source code directly.
489
+
490
+ ## Anti-Patterns
491
+
492
+ Common multi-agent orchestration failures. These cause the most expensive rework in team workflows.
493
+
494
+ | Anti-Pattern | Why It Fails | Correct Approach |
495
+ |---|---|---|
496
+ | **Overlapping file ownership** — two agents write to the same file | Merge conflicts, lost work, non-deterministic output | Enforce disjoint `touches[]` per stream. Move shared files to a single owner |
497
+ | **Blind merge** — merging cook reports without reviewing them | Poisoned output propagates. One bad stream corrupts the whole feature | `integrity-check` + `completion-gate` on every cook report before merge |
498
+ | **Over-parallelization** — launching 5+ agents for a 3-file task | Context fragmentation, coordination overhead > implementation time | Auto-detect: ≤5 files → lite mode (max 2 agents). Full mode caps at 3 |
499
+ | **Cross-domain implementation** — one agent implements both frontend and backend | Domain expertise diluted. Agent makes shallow choices in unfamiliar territory | Split by domain. Frontend agent ≠ backend agent. Each gets domain context |
500
+ | **Missing handoff context** — bare prompt to cook instance without scope/conventions | Agent guesses project conventions, uses wrong patterns, produces inconsistent code | NEXUS Handoff Template: always include metadata, deliverables, conventions, quality expectations |
501
+ | **Sequential when parallel is safe** — running independent streams one by one | Wastes time. 3 independent streams × 5min = 15min sequential vs 5min parallel | Check dependency graph. Independent streams → parallel. Dependent → sequential |
502
+
480
503
  ## Sharp Edges
481
504
 
482
505
  Known failure modes for this skill. Check these before declaring done.
@@ -3,13 +3,13 @@ name: test
3
3
  description: "TDD test writer. Writes failing tests FIRST (red), then verifies they pass after implementation (green). Covers unit, integration, and e2e tests."
4
4
  metadata:
5
5
  author: runedev
6
- version: "1.1.0"
6
+ version: "1.2.0"
7
7
  layer: L2
8
8
  model: sonnet
9
9
  group: development
10
10
  tools: "Read, Write, Edit, Bash, Glob, Grep"
11
11
  emit: tests.passed, tests.failed
12
- listen: code.changed
12
+ listen: code.changed, db.migrated
13
13
  ---
14
14
 
15
15
  # test
@@ -542,6 +542,33 @@ Examples of test slop:
542
542
  | Coverage report | Inline stdout | Shown in Test Report |
543
543
  | Test Report | Markdown (inline) | Emitted to calling skill (cook, fix, review) |
544
544
 
545
+ ## Chain Metadata
546
+
547
+ Append to Test Report when invoked standalone. Suppress when called as sub-skill inside an L1 orchestrator (cook, team, etc.) — the orchestrator emits a consolidated block. See `docs/references/chain-metadata.md`.
548
+
549
+ ```yaml
550
+ chain_metadata:
551
+ skill: "rune:test"
552
+ version: "1.2.0"
553
+ status: "[DONE]"
554
+ domain: "[area tested]"
555
+ files_changed:
556
+ - "[test files created/modified]"
557
+ exports:
558
+ test_results: { passed: [N], failed: [N], coverage: [N] }
559
+ test_files: ["[paths to test files]"]
560
+ status: "[RED | GREEN]" # RED = TDD failing (expected), GREEN = all pass
561
+ suggested_next: # status-aware — pick based on RED or GREEN
562
+ # When GREEN:
563
+ - skill: "rune:preflight"
564
+ reason: "[grounded in results — e.g., 'All 15 tests GREEN, check edge case completeness']"
565
+ consumes: ["test_results", "test_files"]
566
+ # When RED (TDD expected):
567
+ - skill: "rune:fix"
568
+ reason: "[grounded in failures — e.g., '3 tests RED as expected, implement to make them pass']"
569
+ consumes: ["test_results", "test_files"]
570
+ ```
571
+
545
572
  ## Sharp Edges
546
573
 
547
574
  Known failure modes for this skill. Check these before declaring done.
@@ -9,6 +9,7 @@ metadata:
9
9
  group: validation
10
10
  tools: "Read, Bash, Glob, Grep"
11
11
  listen: code.changed
12
+ emit: verification.complete
12
13
  ---
13
14
 
14
15
  # verification
@@ -101,8 +102,6 @@ Compile all results into the structured report. Update all TodoWrite items to co
101
102
 
102
103
  ### 3-Level Artifact Verification
103
104
 
104
- > From GSD (gsd-build/get-shit-done, 30.8k★): "Task done ≠ Goal achieved."
105
-
106
105
  Every file created or modified during implementation must pass ALL 3 levels:
107
106
 
108
107
  **Level 1 — EXISTS**: File is on disk, non-empty.