$npx -y skills add Rune-kit/rune --skill context-packCreates structured handoff briefings between agents. Use when delegating complex work to subagents that would otherwise lose context. Packages task context, constraints, and progress into a compact packet that subagents can consume without re-reading the full conversation. Preven
| 1 | # context-pack |
| 2 | |
| 3 | ## Purpose |
| 4 | |
| 5 | When a parent agent delegates work to a subagent, critical context gets lost — the subagent starts fresh without knowing what was tried, what failed, what constraints apply, or what the parent already decided. Context-pack solves this by creating structured handoff briefings (context packets) that compress the essential information into a compact, parseable format. The packet is small enough to fit in a subagent's system prompt but complete enough to prevent redundant work and constraint violations. |
| 6 | |
| 7 | ## Triggers |
| 8 | |
| 9 | - Called by `cook`, `team`, `rescue` before spawning subagents |
| 10 | - Called by any L1/L2 skill that delegates work to another skill |
| 11 | - Manual: when user says "hand off", "delegate", "split this task" |
| 12 | |
| 13 | ## Calls (outbound) |
| 14 | |
| 15 | - `session-bridge` (L3): read persisted state for inclusion in packet |
| 16 | - `context-engine` (L3): check current context budget before deciding packet size |
| 17 | |
| 18 | ## Called By (inbound) |
| 19 | |
| 20 | - `cook` (L1): before Phase 2-5 subagent spawning |
| 21 | - `team` (L1): before dispatching parallel workstreams |
| 22 | - `rescue` (L1): before delegating module-level refactoring |
| 23 | - `scaffold` (L1): before delegating component generation |
| 24 | - Any L2 skill that spawns subagents |
| 25 | |
| 26 | ## Data Flow |
| 27 | |
| 28 | ### Feeds Into → |
| 29 | |
| 30 | - All subagent invocations: context packet → subagent system prompt |
| 31 | - `completion-gate` (L3): packet's success criteria → claim validation baseline |
| 32 | |
| 33 | ### Fed By ← |
| 34 | |
| 35 | - Parent agent conversation: decisions, constraints, failed attempts |
| 36 | - `session-bridge` (L3): persisted state from prior sessions |
| 37 | - `plan` (L2): phase files with task breakdowns |
| 38 | |
| 39 | ## Workflow |
| 40 | |
| 41 | 1. **COLLECT** — Gather context from the current conversation: |
| 42 | - Task description and user intent (verb-led behavioral phrasing) |
| 43 | - Decisions already made (and WHY) |
| 44 | - Constraints and hard-stops |
| 45 | - Failed attempts (what NOT to do) |
| 46 | - Files already read or modified |
| 47 | - Current progress state |
| 48 | - **Type Surface** — types / function signatures / contracts that callers cross. These are the durable spine of the brief. |
| 49 | |
| 50 | 2. **COMPRESS** — Reduce to essential information: |
| 51 | - Strip conversational noise |
| 52 | - Deduplicate repeated context |
| 53 | - Prioritize by relevance to the delegated task |
| 54 | - Target: <500 tokens for simple tasks, <1500 tokens for complex |
| 55 | |
| 56 | 3. **STRUCTURE** — Format as a context packet (v2 — see Output Format and [references/brief-template.md](references/brief-template.md)) |
| 57 | |
| 58 | 4. **VALIDATE** — Check packet completeness: |
| 59 | - Does it include the task goal? |
| 60 | - Does it include constraints that could cause failure? |
| 61 | - Does it include what was already tried? |
| 62 | - Does it include `### Out of scope`? (mandatory) |
| 63 | - Does it include `### Type Surface` (mandatory if task >= 300 tokens)? |
| 64 | - Is it small enough for the target agent's context budget? |
| 65 | |
| 66 | 5. **PHASE 4.5 — SMELL TESTS** — Run mechanical regex gates before emit. See [references/durability-rules.md](references/durability-rules.md). |
| 67 | |
| 68 | | Regex | Tier | Reason | |
| 69 | |-------|------|--------| |
| 70 | | `\b\S+\.[a-z]{1,4}:\d+\b` | BLOCK | file:line reference (e.g., `login.ts:42`) — line numbers go stale | |
| 71 | | `^- \S*[\\/]\S+\.(ts\|js\|py\|go\|rs\|java)\b` outside `### Files Touched` | BLOCK | Path-only bullet in narrative | |
| 72 | | `\b(line \|on line )\d+\b` | BLOCK | "line 42" / "on line 100" | |
| 73 | | `\b(src\|lib\|app)/\S+` in narrative paragraphs | WARN | Path mention; verify it belongs in Files Touched section | |
| 74 | |
| 75 | <HARD-GATE> |
| 76 | Any BLOCK-tier match → DO NOT emit. Rewrite the offending lines to use type/function/module names. |
| 77 | Missing `### Out of scope` section → DO NOT emit (completion-gate rejects). |
| 78 | Missing `### Type Surface` for tasks >= 300 tokens → DO NOT emit. |
| 79 | </HARD-GATE> |
| 80 | |
| 81 | 6. **EMIT** — Send the validated packet to the receiving agent. |
| 82 | |
| 83 | ## Output Format (v2) |
| 84 | |
| 85 | ```markdown |
| 86 | ## Context Packet |
| 87 | |
| 88 | **Task**: [One-line behavioral description, verb-led] |
| 89 | **Parent**: [delegating skill] |
| 90 | **Scope**: [type names / module names — NOT file paths] |
| 91 | |
| 92 | ### Decisions Made |
| 93 | - [Decision]: chose [X] over [Y] because [reason] |
| 94 | |
| 95 | ### Constraints |
| 96 | - MUST: [behavioral assertion] |
| 97 | - MUST NOT: [behavioral prohibition] |
| 98 | - BLOCKED BY: [contract dependency, not file path] |
| 99 | |
| 100 | ### Already Tried |
| 101 | - [approach] — [observable failure mode] |
| 102 | |
| 103 | ### Type Surface (durable) |
| 104 | - `TypeName { field: type }` — [what it represents] |
| 105 | - `Module.method(input: T): Result<O, E>` — [contract] |
| 106 | |
| 107 | ### Files Touched (locator-only, may rename) |
| 108 | - `path/to/file.ts` (TypeName, Module.method) — [behavioral hint] |
| 109 | |
| 110 | ### Acceptance Criteria |
| 111 | - [ ] |