@rune-kit/rune 2.14.0 → 2.15.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 (67) hide show
  1. package/README.md +19 -11
  2. package/compiler/__tests__/adapter-model-mapping.test.js +152 -0
  3. package/compiler/__tests__/context-preview-signal.test.js +166 -0
  4. package/compiler/__tests__/oracle-bundle-format.test.js +210 -0
  5. package/compiler/__tests__/oracle-pending-schema.test.js +209 -0
  6. package/compiler/__tests__/skill-description-quality.test.js +147 -0
  7. package/compiler/adapters/antigravity.js +17 -1
  8. package/compiler/adapters/claude.js +4 -0
  9. package/compiler/adapters/codex.js +16 -1
  10. package/compiler/adapters/cursor.js +4 -0
  11. package/compiler/adapters/generic.js +14 -1
  12. package/compiler/adapters/openclaw.js +15 -1
  13. package/compiler/adapters/opencode.js +17 -1
  14. package/compiler/adapters/windsurf.js +4 -0
  15. package/package.json +1 -1
  16. package/skills/adversary/SKILL.md +61 -1
  17. package/skills/adversary/evals.md +79 -0
  18. package/skills/adversary/references/context-bundle-format.md +122 -0
  19. package/skills/adversary/references/oracle-mode.md +116 -0
  20. package/skills/asset-creator/SKILL.md +1 -1
  21. package/skills/audit/SKILL.md +2 -1
  22. package/skills/autopsy/SKILL.md +1 -1
  23. package/skills/ba/SKILL.md +1 -1
  24. package/skills/brainstorm/SKILL.md +1 -1
  25. package/skills/browser-pilot/SKILL.md +1 -1
  26. package/skills/completion-gate/SKILL.md +1 -1
  27. package/skills/constraint-check/SKILL.md +1 -1
  28. package/skills/context-engine/SKILL.md +85 -1
  29. package/skills/context-engine/references/preview-gate.md +139 -0
  30. package/skills/cook/SKILL.md +1 -0
  31. package/skills/db/SKILL.md +1 -1
  32. package/skills/debug/SKILL.md +6 -4
  33. package/skills/dependency-doctor/SKILL.md +1 -1
  34. package/skills/design/SKILL.md +1 -1
  35. package/skills/doc-processor/SKILL.md +1 -1
  36. package/skills/docs/SKILL.md +1 -1
  37. package/skills/docs-seeker/SKILL.md +1 -1
  38. package/skills/fix/SKILL.md +4 -3
  39. package/skills/git/SKILL.md +1 -1
  40. package/skills/hallucination-guard/SKILL.md +1 -1
  41. package/skills/integrity-check/SKILL.md +1 -1
  42. package/skills/journal/SKILL.md +1 -1
  43. package/skills/logic-guardian/SKILL.md +1 -1
  44. package/skills/marketing/SKILL.md +1 -1
  45. package/skills/mcp-builder/SKILL.md +1 -1
  46. package/skills/onboard/SKILL.md +1 -1
  47. package/skills/perf/SKILL.md +1 -1
  48. package/skills/plan/SKILL.md +1 -1
  49. package/skills/preflight/SKILL.md +1 -1
  50. package/skills/research/SKILL.md +1 -1
  51. package/skills/retro/SKILL.md +1 -1
  52. package/skills/review/SKILL.md +2 -2
  53. package/skills/review-intake/SKILL.md +1 -1
  54. package/skills/safeguard/SKILL.md +1 -1
  55. package/skills/scaffold/SKILL.md +1 -1
  56. package/skills/sentinel/SKILL.md +1 -1
  57. package/skills/sentinel-env/SKILL.md +1 -1
  58. package/skills/session-bridge/SKILL.md +91 -4
  59. package/skills/session-bridge/references/detach-protocol.md +111 -0
  60. package/skills/skill-forge/SKILL.md +1 -1
  61. package/skills/slides/SKILL.md +1 -1
  62. package/skills/surgeon/SKILL.md +1 -1
  63. package/skills/team/SKILL.md +3 -0
  64. package/skills/trend-scout/SKILL.md +1 -1
  65. package/skills/video-creator/SKILL.md +1 -1
  66. package/skills/watchdog/SKILL.md +1 -1
  67. package/skills/worktree/SKILL.md +1 -1
@@ -0,0 +1,139 @@
1
+ # Context Preview Gate
2
+
3
+ ## Purpose
4
+
5
+ Pre-flight cost check for expensive escalations. Before any caller bundles a large context for dispatch (oracle-mode second-opinion, parallel workstream spawn, multi-file review, cross-pack audit), `context-engine` emits `context.preview` with a token-cost estimate and an action recommendation. The caller decides whether to proceed, warn, or abort.
6
+
7
+ ## Why
8
+
9
+ Without a preview gate:
10
+ - Callers learn about budget overruns only after dispatch — too late to prune
11
+ - `team` parallel workstreams can blow $20 of Opus tokens silently
12
+ - Users have no way to enforce per-call cost ceilings
13
+
14
+ With the preview gate:
15
+ - Costs are visible at decision time, not bill time
16
+ - Per-caller thresholds enforce different budgets per use case
17
+ - Hard `block` action prevents accidental runaway
18
+
19
+ ## Token Estimation
20
+
21
+ ```
22
+ estimated_tokens = total_chars × 0.25
23
+ ```
24
+
25
+ Where `total_chars` includes:
26
+ - The bundle's `[SYSTEM]` line
27
+ - The `[USER]` problem statement
28
+ - Every `### File N: <path>` header
29
+ - Every file body (post-truncation, post-redaction)
30
+
31
+ The `0.25` ratio is calibrated for English code/markdown:
32
+
33
+ | Content type | Calibration |
34
+ |--------------|-------------|
35
+ | English code (TypeScript/Python/JS) | accurate ±10% |
36
+ | English markdown / docs | accurate ±5% |
37
+ | Japanese / Chinese / Korean | underestimates by 30-50% |
38
+ | Highly-repetitive (lots of imports) | overestimates by 20-30% |
39
+
40
+ Both error directions are safe:
41
+ - Overestimate → over-cautious block, caller can manually override
42
+ - Underestimate → caller still hits the dispatch-time hard cap (e.g. adversary's 100k token limit) and aborts with `oracle.failed`
43
+
44
+ ## Threshold Defaults
45
+
46
+ | Caller | warn-at | block-at | Rationale |
47
+ |--------|---------|----------|-----------|
48
+ | `adversary` oracle-mode | 50,000 | 100,000 | Single-shot diagnosis; 100k matches second-model context budget |
49
+ | `team` parallel workstream (per worker) | 30,000 | 80,000 | Per-worker; total may be 5x if 5 workers spawn |
50
+ | `review` multi-file | 40,000 | 100,000 | Code review benefits from breadth; cap protects opus budget |
51
+ | `audit` cross-pack | 60,000 | 120,000 | Audit is intentionally broad; raised cap reflects intent |
52
+
53
+ ### Override
54
+
55
+ Set environment variables to override per-caller thresholds:
56
+
57
+ ```
58
+ RUNE_CONTEXT_THRESHOLDS_ADVERSARY=warn:60000,block:120000
59
+ RUNE_CONTEXT_THRESHOLDS_TEAM=warn:40000,block:100000
60
+ RUNE_CONTEXT_THRESHOLDS_REVIEW=warn:50000,block:130000
61
+ RUNE_CONTEXT_THRESHOLDS_AUDIT=warn:80000,block:150000
62
+ ```
63
+
64
+ ## Action Decision
65
+
66
+ ```
67
+ if estimated_tokens >= block_at:
68
+ action = "block"
69
+ elif estimated_tokens >= warn_at:
70
+ action = "warn"
71
+ else:
72
+ action = "proceed"
73
+ ```
74
+
75
+ ## Caller Integration
76
+
77
+ ### `adversary` oracle-mode
78
+
79
+ ```
80
+ Phase 0 (pre-bundle): emit context.preview { caller: adversary, files: [...], prompt: "..." }
81
+ context-engine returns { action: "proceed" } → continue with bundle build
82
+ context-engine returns { action: "warn" } → log warning, continue
83
+ context-engine returns { action: "block" } → abort, emit oracle.failed reason=context_budget_exceeded
84
+ ```
85
+
86
+ ### `team` parallel workstream
87
+
88
+ ```
89
+ Phase 2 ASSIGN (per worker): emit context.preview { caller: team, files: [...] }
90
+ proceed → spawn worker
91
+ warn → log warning, spawn worker
92
+ block → reduce worker scope or split into 2 smaller workers
93
+ ```
94
+
95
+ ### `review` multi-file
96
+
97
+ ```
98
+ Entry step: emit context.preview { caller: review, files: [...] }
99
+ proceed → run review
100
+ warn → log warning, run review
101
+ block → ask user to narrow file scope (e.g. specific subdirectory)
102
+ ```
103
+
104
+ ### `audit` cross-pack
105
+
106
+ ```
107
+ Entry step: emit context.preview { caller: audit, files: [...] }
108
+ proceed → run audit
109
+ warn → log warning, run audit
110
+ block → reduce audit scope (e.g. one pack at a time)
111
+ ```
112
+
113
+ ## Signal Payload
114
+
115
+ ```yaml
116
+ context.preview:
117
+ caller: adversary | team | review | audit
118
+ estimated_tokens: 73000
119
+ file_count: 8
120
+ top_5_files_by_size:
121
+ - { path: "src/auth/login.ts", chars: 12400 }
122
+ - { path: "src/middleware/auth.ts", chars: 9800 }
123
+ - { path: "src/services/session.ts", chars: 8200 }
124
+ - { path: "tests/auth.test.ts", chars: 6100 }
125
+ - { path: "src/types/user.ts", chars: 4500 }
126
+ threshold:
127
+ warn_at: 50000
128
+ block_at: 100000
129
+ action: warn
130
+ ```
131
+
132
+ ## Failure Modes
133
+
134
+ | Symptom | Reason | Mitigation |
135
+ |---------|--------|------------|
136
+ | Caller bundles before preview | Caller didn't follow contract | context-engine rejects late preview requests with explicit error |
137
+ | Estimate way off for non-English content | Tokenizer ratio assumes English | Document limitation; safe both directions due to dispatch-time hard cap |
138
+ | Block action ignored by caller | Caller bug | Each caller's Done When MUST verify `action != block` before dispatch |
139
+ | Threshold env-var malformed | User typo | context-engine logs warning, falls back to default |
@@ -384,6 +384,7 @@ If the coder model needs info from other phases, it's in the Cross-Phase Context
384
384
  4. Run tests after each significant change — if fail → debug and fix
385
385
  - **Python async** (if async-first flagged): no blocking calls in async functions — `time.sleep` → `asyncio.sleep`, `requests` → `httpx.AsyncClient`, use `asyncio.gather()` for parallel I/O
386
386
  5. If stuck → invoke `rune:debug` (max 3 debug↔fix loops). Fixes outside plan scope require user approval (R4).
387
+ - **Oracle reattach check** — between tasks, glob `.rune/oracle-pending/*.json`. For any record with `status=pending`, invoke `session-bridge --reattach <sessionId>`. If `complete` → consume the response (route to debug/fix per `sourceSkill`). If `pending` → continue with next independent task. If `failed` → continue without second opinion.
387
388
  6. **Re-plan check** — evaluate before Phase 5: max debug loops hit? out-of-scope files changed? new dep changes approach? user scope change? If any fire → invoke `rune:plan` with delta context, get user approval before resuming.
388
389
  7. **Approach Pivot Gate** — if re-plan ALSO fails:
389
390
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: db
3
- description: Database workflow specialist. Generates migration files with rollback scripts, detects breaking schema changes, and validates query parameterization.
3
+ description: "Database workflow specialist. Generates migration files with rollback scripts, detects breaking schema changes, and validates query parameterization."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "0.2.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: debug
3
- description: Root cause analysis for bugs and unexpected behavior. Traces errors through code, uses structured reasoning, and hands off to fix when cause is found. Core of the debug↔fix mesh.
3
+ description: "Root cause analysis for bugs and unexpected behavior. Traces errors through code, uses structured reasoning, and hands off to fix when cause is found. Core of the debug↔fix mesh."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "1.1.0"
@@ -9,7 +9,7 @@ metadata:
9
9
  group: development
10
10
  tools: "Read, Bash, Glob, Grep"
11
11
  emit: bug.diagnosed, agent.stuck
12
- listen: tests.failed
12
+ listen: tests.failed, oracle.response
13
13
  ---
14
14
 
15
15
  # debug
@@ -21,8 +21,9 @@ Root cause analysis ONLY. Debug investigates — it does NOT fix. It traces erro
21
21
  <HARD-GATE>
22
22
  Do NOT fix the code. Debug investigates only. Any code change is out of scope.
23
23
  If root cause cannot be identified after 3 hypothesis cycles:
24
- - Emit `agent.stuck` signal — `scout` zoom-out mode may surface the broader module map that's hiding the root cause
25
- - Escalate to `rune:problem-solver` for structured 5-Whys or Fishbone analysis
24
+ - Emit `agent.stuck` signal — `scout` zoom-out mode surfaces broader module map (structural pivot); `adversary` oracle-mode dispatches a stateless second-model pass (semantic pivot); both fire in parallel
25
+ - If `oracle.response` arrives with confidence=high and cites file:line, treat as new hypothesis H_oracle and test directly (skip 3-cycle gate it's externally validated)
26
+ - Otherwise, escalate to `rune:problem-solver` for structured 5-Whys or Fishbone analysis
26
27
  - Or escalate to `rune:sequential-thinking` for multi-variable analysis
27
28
  - Report escalation in the Debug Report with all evidence gathered so far
28
29
  </HARD-GATE>
@@ -46,6 +47,7 @@ If root cause cannot be identified after 3 hypothesis cycles:
46
47
  - `browser-pilot` (L3): capture browser console errors, network failures, visual bugs
47
48
  - `sequential-thinking` (L3): multi-variable root cause analysis
48
49
  - `neural-memory` (L3): after root cause found — capture error pattern for future recognition
50
+ - `adversary` (L2): on `agent.stuck` — oracle-mode dispatches stateless second-model pass to break confirmation-bias loop (parallel with scout zoom-out)
49
51
 
50
52
  ## Called By (inbound)
51
53
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: dependency-doctor
3
- description: Dependency health management. Detects package manager, checks outdated packages and vulnerabilities, and produces a prioritized update plan.
3
+ description: "Dependency health management. Detects package manager, checks outdated packages and vulnerabilities, and produces a prioritized update plan."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "0.2.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: design
3
- description: Design system reasoning. Maps product domain to style, palette, typography, and platform-specific patterns. Generates .rune/design-system.md as the shared design contract for all UI-generating skills.
3
+ description: "Design system reasoning. Maps product domain to style, palette, typography, and platform-specific patterns. Generates .rune/design-system.md as the shared design contract for all UI-generating skills."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "0.5.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: doc-processor
3
- description: Generate and parse office documents — PDF, DOCX, XLSX, PPTX, CSV. Pure format utility for creating reports, exporting data, and processing uploaded documents.
3
+ description: "Generate and parse office documents — PDF, DOCX, XLSX, PPTX, CSV. Use when creating reports, exporting tabular data, or processing uploaded office files. NOT for project documentation (use docs)."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "0.2.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: docs
3
- description: Auto-generate and maintain project documentation. Creates README, API docs, architecture docs, changelogs, and keeps them in sync with code changes. The "docs are never outdated" skill.
3
+ description: "Auto-generate and maintain project documentation. Creates README, API docs, architecture docs, changelogs, and keeps them in sync with code changes. The \"docs are never outdated\" skill."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "0.3.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: docs-seeker
3
- description: Find documentation for APIs, libraries, and error messages. Looks up official docs, changelog entries, and migration guides.
3
+ description: "Find documentation for APIs, libraries, and error messages. Looks up official docs, changelog entries, and migration guides."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "0.2.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: fix
3
- description: Apply code changes and fixes. Writes implementation code, applies bug fixes, and verifies changes with tests. Core action hub in the development mesh.
3
+ description: "Apply code changes and fixes. Writes implementation code, applies bug fixes, and verifies changes with tests. Core action hub in the development mesh."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "1.0.0"
@@ -9,7 +9,7 @@ metadata:
9
9
  group: development
10
10
  tools: "Read, Write, Edit, Bash, Glob, Grep"
11
11
  emit: code.changed, agent.stuck
12
- listen: bug.diagnosed, review.issues, preflight.blocked, security.blocked
12
+ listen: bug.diagnosed, review.issues, preflight.blocked, security.blocked, oracle.response
13
13
  ---
14
14
 
15
15
  # fix
@@ -41,6 +41,7 @@ If unsure whether the test is wrong or the implementation is wrong → call `run
41
41
  - `hallucination-guard` (L3): verify imports after code changes
42
42
  - `scout` (L2): find related code before applying changes
43
43
  - `neural-memory` (L3): after fix verified — capture fix pattern (cause → solution)
44
+ - `adversary` (L2): on `agent.stuck` after 2+ failed attempts — oracle-mode dispatches stateless second-model pass to break confirmation-bias loop
44
45
 
45
46
  ## Called By (inbound)
46
47
 
@@ -142,7 +143,7 @@ When fix is called repeatedly (e.g., by cook Phase 4, or iterative fix loops), t
142
143
  **Thresholds:**
143
144
  - **>20% WTF-likelihood**: STOP fixing. Report current state to cook/user with: "Quality decay detected — continued fixes risk introducing more bugs than they resolve. {N} fixes applied, {score}% risk. Recommend: commit current progress, re-assess remaining issues."
144
145
  - **Hard cap: 30 fixes per session** — regardless of score. After 30, STOP and report.
145
- - **2+ consecutive fixes on the same file all failed**: emit `agent.stuck` signal (listened by `scout` zoom-out mode). Receiving agents may zoom out to the surrounding module map to recover bigger-picture context.
146
+ - **2+ consecutive fixes on the same file all failed**: emit `agent.stuck` signal. `scout` zoom-out mode (structural pivot) and `adversary` oracle-mode (semantic pivot via stateless second-model dispatch) both listen and fire in parallel. If `oracle.response` arrives with confidence=high, apply its recommended edit (still routes through normal validation gates).
146
147
 
147
148
  **Reset conditions:** WTF-likelihood resets to 0% when:
148
149
  - User explicitly says "continue fixing"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: git
3
- description: Specialized git operations — semantic commits, PR descriptions, branch management, conflict resolution guidance. Replaces ad-hoc git commands with a dedicated, convention-aware utility.
3
+ description: "Specialized git operations — semantic commits, PR descriptions, branch management, conflict resolution guidance. Replaces ad-hoc git commands with a dedicated, convention-aware utility."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "0.3.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: hallucination-guard
3
- description: Verify AI-generated imports, API calls, and packages actually exist. Catches phantom functions, non-existent packages, and slopsquatting attacks.
3
+ description: "Verify AI-generated imports, API calls, and packages actually exist. Use when finishing AI-generated code that introduces new imports or external API calls — auto-fires after fix/cook to catch phantom functions, non-existent packages, and slopsquatting attacks."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "0.3.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: integrity-check
3
- description: "Verify integrity of persisted state, skill outputs, and context bus data. Detects prompt injection, memory poisoning, identity spoofing, and adversarial payloads in .rune/ files and agent outputs. Called by sentinel, team, and session-bridge."
3
+ description: "Verify integrity of persisted state, skill outputs, and context bus data. Use when validating .rune/ files or sub-agent outputs against prompt injection, memory poisoning, identity spoofing, or adversarial payloads. Called by sentinel, team, session-bridge."
4
4
  user-invocable: false
5
5
  metadata:
6
6
  author: runedev
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: journal
3
- description: Persistent state tracking and Architecture Decision Records across sessions. Use when recording a decision, ADR, or progress that must survive session boundaries. Manages progress state, module health, dependency graphs, and ADRs for any workflow.
3
+ description: "Persistent state tracking and Architecture Decision Records across sessions. Use when recording a decision, ADR, or progress that must survive session boundaries. Manages progress state, module health, dependency graphs, and ADRs for any workflow."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "0.4.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: logic-guardian
3
- description: Protects complex business logic from accidental deletion or overwrite. Maintains a logic manifest, enforces pre-edit gates, and validates post-edit diffs.
3
+ description: "Protects complex business logic from accidental deletion or overwrite. Use when editing payment, trading, state-machine, or other load-bearing business logic where a single deleted line can cause silent data corruption. Maintains a logic manifest, enforces pre-edit gates, validates post-edit diffs."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "0.3.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: marketing
3
- description: Create marketing assets and execute launch strategy. Generates landing copy, social banners, SEO meta, blog posts, and video scripts.
3
+ description: "Create marketing assets and execute launch strategy. Generates landing copy, social banners, SEO meta, blog posts, and video scripts."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "0.6.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: mcp-builder
3
- description: Build Model Context Protocol servers from specifications. Generates tool definitions, resource handlers, and test suites for MCP servers in TypeScript or Python (FastMCP).
3
+ description: "Build Model Context Protocol servers from specifications. Use when creating an MCP server for a tool, resource, or service that AI agents should access. Generates tool definitions, resource handlers, and test suites in TypeScript or Python (FastMCP)."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "0.5.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: onboard
3
- description: Auto-generate project context for AI sessions. Scans codebase, creates CLAUDE.md and .rune/ setup so every future session starts with full context.
3
+ description: "Auto-generate project context for AI sessions. Use when starting on a new repo for the first time, or when CLAUDE.md / .rune/ context is missing or stale. Scans codebase and creates the setup so every future session starts with full context."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "0.4.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: perf
3
- description: Performance regression gate. Detects N+1 queries, sync-in-async, missing indexes, memory leaks, and bundle bloat before they reach production.
3
+ description: "Performance regression gate. Detects N+1 queries, sync-in-async, missing indexes, memory leaks, and bundle bloat before they reach production."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "0.3.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
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.
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
4
  metadata:
5
5
  author: runedev
6
6
  version: "1.5.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: preflight
3
- description: Pre-commit quality gate that catches "almost right" code. Goes beyond lintingchecks logic correctness, error handling, regressions, and completeness.
3
+ description: "Pre-commit quality gate that catches 'almost right' code. Use when about to commit auto-fires before commit to validate logic correctness, error handling, regressions, and completeness. Goes beyond linting."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "1.1.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: research
3
- description: Web search and external knowledge lookup. Gathers data on technologies, libraries, best practices, and competitor solutions.
3
+ description: "Web search and external knowledge lookup. Gathers data on technologies, libraries, best practices, and competitor solutions."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "0.4.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: retro
3
- description: Engineering retrospective. Analyzes commit history, work patterns, and code quality metrics with trend tracking. Per-person breakdowns, shipping streaks, and actionable improvements. Use when asked for "retro", "weekly review", "what did we ship", or "engineering retrospective".
3
+ description: "Engineering retrospective. Analyzes commit history, work patterns, and code quality metrics with trend tracking. Per-person breakdowns, shipping streaks, and actionable improvements. Use when asked for \"retro\", \"weekly review\", \"what did we ship\", or \"engineering retrospective\"."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "0.3.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: review
3
- description: Code quality review — patterns, security, performance, correctness. Finds bugs, suggests improvements, triggers fix for issues found. Escalates to opus for security-critical code.
3
+ description: "Code quality review — patterns, security, performance, correctness. Finds bugs, suggests improvements, triggers fix for issues found. Escalates to opus for security-critical code."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "1.1.0"
@@ -9,7 +9,7 @@ metadata:
9
9
  group: development
10
10
  tools: "Read, Glob, Grep"
11
11
  emit: review.complete, review.issues
12
- listen: code.changed, docs.updated
12
+ listen: code.changed, docs.updated, context.preview
13
13
  ---
14
14
 
15
15
  # review
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: review-intake
3
- description: Use when receiving code review feedback, PR comments, or external suggestions before implementing any changes. Prevents blind implementation, enforces verification-first discipline.
3
+ description: "Use when receiving code review feedback, PR comments, or external suggestions before implementing any changes. Prevents blind implementation, enforces verification-first discipline."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "1.2.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: safeguard
3
- description: Build safety nets before refactoring. Use when running surgeon or any risky refactor that needs a rollback point. Creates characterization tests, boundary markers, config freezes, and rollback points.
3
+ description: "Build safety nets before refactoring. Use when running surgeon or any risky refactor that needs a rollback point. Creates characterization tests, boundary markers, config freezes, and rollback points."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "0.2.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: scaffold
3
- description: Autonomous project bootstrapper. Generates complete project from a description — structure, code, tests, docs, config. Orchestrates ba → plan → design → fix → test → docs → git in one pipeline. The "0 to production-ready" skill.
3
+ description: "Autonomous project bootstrapper. Generates complete project from a description — structure, code, tests, docs, config. Orchestrates ba → plan → design → fix → test → docs → git in one pipeline. The \"0 to production-ready\" skill."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "0.1.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: sentinel
3
- description: Automated security gatekeeper. Blocks unsafe code before commit — secret scanning, OWASP top 10, dependency audit, permission checks. A GATE, not a suggestion.
3
+ description: "Automated security gatekeeper. Blocks unsafe code before commit — secret scanning, OWASP top 10, dependency audit, permission checks. A GATE, not a suggestion."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "1.0.0"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: sentinel-env
3
- description: Environment-aware pre-flight check. Validates OS, runtime versions, installed tools, port availability, env vars, and disk space BEFORE coding starts. Prevents "works on my machine" failures. Like sentinel but for the environment, not the code.
3
+ description: "Environment-aware pre-flight check. Use when starting work in a new environment, switching machines, or when 'works on my machine' bugs surface. Validates OS, runtime versions, installed tools, port availability, env vars, and disk space BEFORE coding starts. Like sentinel but for the environment, not the code."
4
4
  metadata:
5
5
  author: runedev
6
6
  version: "0.3.0"
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  name: session-bridge
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.
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.7.0"
6
+ version: "0.8.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, checkpoint.request
12
- emit: invariants.loaded
11
+ listen: phase.complete, checkpoint.request, oracle.dispatched
12
+ emit: invariants.loaded, oracle.failed
13
13
  ---
14
14
 
15
15
  # session-bridge
@@ -40,6 +40,7 @@ Solve the #1 developer complaint: context loss across sessions. Session-bridge a
40
40
  - `context-engine` (L3): save state before compaction
41
41
  - `context-pack` (L3): coordinate state for sub-agent handoff
42
42
  - `neural-memory` (L3): sync key decisions back to `.rune/` files after Capture Mode
43
+ - `adversary` (L2): (oracle-mode) detach protocol when target model is opus-class for non-blocking dispatch
43
44
 
44
45
  ## State Files Managed
45
46
 
@@ -540,11 +541,86 @@ At Load Mode Step 1, after checking `.rune/*.md` existence, also check for `.run
540
541
  - **Remaining tasks**: [count]
541
542
  ```
542
543
 
544
+ ## Detach Mode (v0.8.0)
545
+
546
+ Triggered by `oracle.dispatched` from `adversary` oracle-mode. Decouples the primary agent from a slow heavy-model call so the agent can continue adjacent work while the second model reasons.
547
+
548
+ **Why**: Opus-class reasoning takes 1-10 minutes wall time. Synchronous waits kill primary-agent throughput, especially in `team` parallel workstreams.
549
+
550
+ ### Step D1 — Receive dispatch
551
+
552
+ When `oracle.dispatched` arrives, payload contains:
553
+ - `sessionId` — caller-provided unique id
554
+ - `triggerSignal` — `agent.stuck` or manual
555
+ - `sourceSkill` — `debug` | `fix` | manual
556
+ - `targetModel` — concrete model name (e.g. `gpt-5-pro`, `gemini-3-pro`, `claude-opus-4-7`)
557
+ - `bundleHash` — sha256 of the bundled context (idempotency key)
558
+
559
+ ### Step D2 — Idempotency check
560
+
561
+ Look up `.rune/oracle-pending/<sessionId>.json` AND any pending file with matching `bundleHash`. If a pending record with status=`pending` and the same `bundleHash` exists, **return the existing sessionId** — do NOT dispatch a duplicate.
562
+
563
+ ### Step D3 — Write pending record
564
+
565
+ Create `.rune/oracle-pending/<sessionId>.json`:
566
+
567
+ ```json
568
+ {
569
+ "sessionId": "oracle-1714234500-abc123",
570
+ "dispatchedAt": "2026-04-27T12:34:56Z",
571
+ "triggerSignal": "agent.stuck",
572
+ "sourceSkill": "debug",
573
+ "targetModel": "claude-opus-4-7",
574
+ "bundleHash": "sha256:9f3a...",
575
+ "status": "pending",
576
+ "timeoutAt": "2026-04-27T12:44:56Z",
577
+ "responseId": null,
578
+ "responseExcerpt": null
579
+ }
580
+ ```
581
+
582
+ `timeoutAt` defaults to `dispatchedAt + 10min`.
583
+
584
+ ### Step D4 — Return control to caller
585
+
586
+ Caller (`adversary`) receives the sessionId and returns to the primary orchestrator. Primary agent (`cook`/`team`) continues adjacent phases.
587
+
588
+ ### Step D5 — Reattach (called by primary agent between phases)
589
+
590
+ Invocation: `session-bridge --reattach <sessionId>` (or via `oracle.dispatched` listen → poll).
591
+
592
+ Behavior:
593
+ 1. Read `.rune/oracle-pending/<sessionId>.json`
594
+ 2. If `status=complete` → return `responseExcerpt` to caller, mark record as consumed
595
+ 3. If `status=pending` AND `now >= timeoutAt` → set `status=failed`, emit `oracle.failed` reason=`timeout`
596
+ 4. If `status=pending` AND `now < timeoutAt` → return `not_ready` to caller, primary agent works on next independent task
597
+
598
+ ### Step D6 — Cleanup
599
+
600
+ On every session start, scan `.rune/oracle-pending/` for records older than 24h. Delete them — they are orphaned.
601
+
602
+ ### Pending Record Schema
603
+
604
+ | Field | Type | Required |
605
+ |-------|------|----------|
606
+ | sessionId | string (matches `^oracle-\d+-[a-z0-9]+$`) | yes |
607
+ | dispatchedAt | ISO 8601 timestamp | yes |
608
+ | triggerSignal | string | yes |
609
+ | sourceSkill | enum: `debug` \| `fix` \| `manual` | yes |
610
+ | targetModel | string | yes |
611
+ | bundleHash | string (matches `^sha256:[a-f0-9]{8,64}$`) | yes |
612
+ | status | enum: `pending` \| `complete` \| `failed` | yes |
613
+ | timeoutAt | ISO 8601 timestamp | yes |
614
+ | responseId | string \| null | yes (null until status=complete) |
615
+ | responseExcerpt | string ≤500 chars \| null | yes |
616
+
543
617
  ## Constraints
544
618
 
545
619
  1. MUST save decisions, conventions, and progress — not just a status line
546
620
  2. MUST verify saved context can be loaded in a fresh session — test the round-trip
547
621
  3. MUST NOT overwrite existing bridge data without merging
622
+ 4. (Detach) MUST be idempotent — same sessionId or bundleHash returns existing record, never dispatches twice
623
+ 5. (Detach) MUST clean up orphaned pending records (age >24h) on session start
548
624
 
549
625
  ## Sharp Edges
550
626
 
@@ -560,6 +636,9 @@ Known failure modes for this skill. Check these before declaring done.
560
636
  | Learnings JSONL grows unbounded | MEDIUM | Auto-compact at 100 entries — keep only latest-winner per key+type |
561
637
  | Checkpoint stale after code changes | MEDIUM | Checkpoint includes git state — if branch/commit differ at resume, warn user that checkpoint may be outdated |
562
638
  | Multiple checkpoints overwrite each other | LOW | By design — only one active checkpoint. Resolved ones archived with date suffix |
639
+ | (Detach) Pending file orphaned forever — process crashed mid-dispatch | MEDIUM | Step D6 cleanup runs every session start; records >24h auto-deleted |
640
+ | (Detach) Two adversary calls dispatch same bundle simultaneously | MEDIUM | Step D2 idempotency: bundleHash-keyed lookup returns existing sessionId |
641
+ | (Detach) Reattach polls indefinitely without timeout | HIGH | Step D5 enforces `timeoutAt` — exceeded → emit `oracle.failed` reason=`timeout`, free the primary agent |
563
642
 
564
643
  ## Done When (Save Mode)
565
644
 
@@ -590,6 +669,14 @@ Known failure modes for this skill. Check these before declaring done.
590
669
  - checkpoint.md written to .rune/
591
670
  - Checkpoint Saved report emitted
592
671
 
672
+ ## Done When (Detach Mode)
673
+
674
+ - Pending record written to `.rune/oracle-pending/<sessionId>.json` with valid schema
675
+ - Idempotency verified: duplicate bundleHash returned existing sessionId, no duplicate dispatch
676
+ - Reattach API returns `complete` / `pending` / `failed` based on record status + timeout
677
+ - Orphan cleanup runs at session start (records >24h deleted)
678
+ - `oracle.failed` emitted with `reason=timeout` if timeoutAt exceeded
679
+
593
680
  ## Cost Profile
594
681
 
595
682
  ~100-300 tokens per save. ~500-1000 tokens per load. Always haiku. Negligible cost.