mark393295827/context-manager
Use when a long-running agent task needs context budgeting, checkpointing, compaction, retrieval, or capability-based model routing.
npx skills add https://github.com/Mark393295827/third-brain-v7-skills --skill context-manager
<skill_contract>
<input>An active objective, runtime context limits, decision-critical state, evidence, budgets, and durable storage.</input>
<output>A bounded context manifest, checkpoint, compaction decision, and capability-routing receipt.</output>
<done>The next decision can be resumed without losing constraints, permissions, provenance, or failure history.</done>
<non_goals>Task orchestration, vendor-specific routing, hidden truncation, or retaining history that cannot change a decision.</non_goals>
Treat context as RAM, durable storage as disk, and tools as retrieval. Pay only for information that changes the next decision or prevents an execution error.
Provide: objective, phase, runtime context limit, token/cost budget, active constraints, current evidence, durable state location, and expected next decisions.
<intake>
Measure available budget from runtime data; do not infer limits or prices from model names. Partition context into objective, constraints, active state, evidence, open unknowns, and history. Identify the next irreversible or high-cost decision.
</intake>
<unknowns_gate>
If runtime limits or durable state are unavailable, choose a conservative explicit budget or return NEEDS_INPUT. Never silently drop constraints, approvals, source provenance, failed attempts, or user decisions.
</unknowns_gate>
<execute>
Apply KEEP / SUMMARIZE / DROP / RETRIEVE:
Checkpoint at phase boundaries or before compaction. Route work by capability requirements such as reasoning depth, tool use, latency, cost, multimodality, and context capacity; runtime policy selects the implementation. Keep stable prompt prefixes unchanged when caching is available.
For Graph workflows, treat each node context as private RAM and each typed edge
payload as a bounded transfer contract. Pass artifact locators, schemas,
decisions, and verifier receipts; do not concatenate all branch histories into
every successor. A join loads only the declared inputs needed for its decision.
</execute>
<evaluate>
Simulate the next action using only the checkpoint. It must recover objective, constraints, state, evidence, unknowns, last error, and next action without consulting lost chat. Compare estimated budget with runtime telemetry and correct drift.
</evaluate>
<state_contract>
Persist {run_id, status, attempt, budget, evidence, unknowns, last_error, next_action} plus phase, decisions, permissions, active resources, completed work, rejected approaches, retrieval pointers, and budget telemetry. Version checkpoints; never replace the only recoverable state.
</state_contract>
NEEDS_INPUT: no reliable limit or cost policy exists and the choice changes execution.INSUFFICIENT_EVIDENCE: a proposed summary cannot preserve a material decision or locator; keep the source segment.VERIFY_FAILED: checkpoint replay loses required state; restore the prior version and recompact.BUDGET_STOP: reserve enough capacity for receipt and handoff, persist state, then stop.Return status, result (budget plan or checkpoint), evidence (runtime telemetry and replay check), unknowns, and next_action with required retrieval pointers.
artifacts and receipts, not the full private context of every branch.
</skill_contract>
Take mark393295827/context-manager from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.