skills/assembling-context/SKILL.md
Use when preparing context for subagent dispatch or managing token budgets. Triggers: 'prepare context for', 'assemble context', 'token budget', 'context package', 'what context does the subagent need'. Also invoked by develop during planning and execution phases.
npx skillsauth add axiomantic/spellbook assembling-contextInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
| Input | Required | Description |
|-------|----------|-------------|
| purpose | Yes | design, implementation, review, handoff, subagent |
| token_budget | Yes | Maximum tokens available |
| source_context | Yes | Raw context to select from |
| Output | Description |
|--------|-------------|
| context_package | Tiered context ready for injection |
| truncation_report | What was excluded and why |
<CRITICAL>Over budget: remove Tier 3 first, then Tier 2. Never remove Tier 1.</CRITICAL>
| Tier | Budget | Content | Examples | |------|--------|---------|----------| | 1: Essential | 40-60% | Active instructions, user decisions, current artifact, interface contracts, blocking issues | Task spec, APIs, unresolved feedback | | 2: Supporting | 20-35% | Recent learnings, patterns, prior feedback, success criteria | Last 2-3 iterations, codebase patterns | | 3: Reference | 10-20% | Historical context, rejected alternatives, verbose docs | Early iterations, full docs (summarize instead) |
| Purpose | Tier 1 Focus | Budget Split | Use With | |---------|--------------|--------------|----------| | Design | Requirements, decisions, constraints, integration points | 50/30/20 | brainstorming, writing-plans | | Implementation | Task spec, acceptance criteria, interfaces, test expectations | 60/25/15 | test-driven-development, executing-plans | | Review | Code diff, requirements traced, test results | 55/30/15 | code-review, fact-checking | | Handoff | Current position, pending work, active decisions, blocking issues | 70/20/10 | session boundaries, compaction | | Subagent | Task, constraints, expected output format | 65/25/10 | dispatching-parallel-agents |
Estimation: tokens ≈ chars / 4 (conservative)
Available: context_window - system_prompt - response_reserve - tool_overhead
Example: 200000 - 8000 - 4000 - 2000 = 186000
Smart Truncation: Never blind head/tail. Preserve structure: intro (30%) + conclusion (20%), mark omitted middle.
| Action | Items | |--------|-------| | Persist | User decisions, validated assumptions, glossary, blocking issues | | Regenerate | File contents, test results, code patterns (may have changed) | | Discard | Exploration paths, rejected alternatives, verbose logs |
Handoff format: Position → Pending work → Active decisions → Key learnings → Verification commands
<FINAL_EMPHASIS> Context assembly is invisible infrastructure. Calculate budget. Prioritize by tier. Truncate intelligently. Every token earns its place. </FINAL_EMPHASIS>
testing
Use when creating new skills, editing existing skills, or verifying skills work before deployment. Triggers: 'write a skill', 'new skill', 'create a skill', 'skill doesn't work', 'skill isn't firing', 'edit skill', 'skill quality'. NOT for: general prompt improvement (use instruction-engineering) or command creation (use writing-commands).
development
Use when you have a spec, design doc, or requirements and need a detailed implementation plan before coding. Triggers: 'write a plan', 'create implementation plan', 'plan this out', 'break this down into steps', 'convert design to tasks', 'implementation order'. Also invoked by develop during planning. NOT for: reviewing existing plans (use reviewing-impl-plans).
testing
Use when creating new commands, editing existing commands, or reviewing command quality. Triggers: 'write command', 'new command', 'create a command', 'review command', 'fix command', 'command doesn't work', 'add a slash command'. NOT for: skill creation (use writing-skills).
development
Use when about to claim discovery during debugging. Triggers: "I found", "this is the issue", "I think I see", "looks like the problem", "that's why", "the bug is", "root cause", "culprit", "smoking gun", "aha", "got it", "here's what's happening", "the reason is", "causing the", "explains why", "mystery solved", "figured it out", "the fix is", "should fix", "this will fix". Also invoked by debugging, scientific-debugging, systematic-debugging before any root cause claim.