agent-context-budget
Prepare bounded context for a task without inventing a second budget source.
Numeric limits come from the policy referenced by the current TaskCheckpoint.
The public contract and commands are documented in
../../docs/public-harness-contract.md.
Use this skill for
- A task that may spawn a delegated executor or reviewer.
- A transcript approaching its configured checkpoint boundary.
- A fresh session that needs a compact, evidence-linked primer.
- Results or logs that are too large for the primary-agent context.
Do not use it to summarize away unresolved failures, human decisions, raw
scientific evidence, or security findings.
Inputs
- Goal and task id.
- Readable agent policy.
- Current TaskCheckpoint.
- Evidence and artifact paths needed by the next role.
- Optional existing .coord/plan.yml and approved memory events.
If the policy is configured but unreadable, stop. If the optional
agent-collab-harness package is unavailable, do not start an autonomous loop or
child spawn; prepare the packet for human-controlled execution instead.
Workflow
Validate policy and checkpoint:
agent-collab policy validate --policy <policy-ref> --json
agent-collab checkpoint validate --checkpoint <checkpoint-ref> --json
Record current observed metrics in the checkpoint. Do not estimate a lower
number to fit the policy.
Run policy evaluation before a child spawn:
agent-collab policy evaluate \
--policy <policy-ref> \
--checkpoint <checkpoint-ref> \
--json
Obey the result:
- continue and spawn_allowed=true: create the bounded task packet.
- checkpoint: write a checkpoint/primer. A v2 slice with auto_continue
advances atomically and resumes under the same goal; v1 returns control.
For v2 scope=action with context_compaction_required, perform local context
maintenance without asking for renewed approval: preserve full artifacts,
acceptance evidence, failures, and authorization; build a smaller linked
packet or use native compaction, record measured sizes, then re-evaluate.
Do not spawn or advance a slice while this context gate is pending.
- stop or spawn_allowed=false: do not spawn. Respect v2 decision scope;
exhaustion of one action does not prohibit safe primary-agent diagnosis.
Put only decision-relevant material in the packet:
- goal and acceptance contract
- explicit files and tools in scope
- direct evidence references
- current recorded human decisions
- relevant interfaces or schemas
Keep raw logs and complete artifacts at paths. Include a short failure
excerpt only when it is needed to diagnose the next action.
After a result returns, update observed metrics and evaluate again.
Outputs
- .coord/context_.md: round-specific packet plan.
- .coord/session_primer.md: bounded fresh-session digest.
- Updated TaskCheckpoint at the plan's checkpoint_ref.
These are scratch artifacts by default. Promote a checkpoint snapshot only when
the repository explicitly needs it for resume, shipping, or acceptance
evidence. Agent boundaries do not imply commits.
Packet shape
# Context packet — <task id>
Policy
- policy_ref: <path>
- policy_hash: <sha256>
- checkpoint_ref: <path>
Goal
<one bounded objective>
Recorded decisions
- <gate / actor / decision / action hash>
Evidence
- <path or stable source locator>
Scope
- may read: <paths>
- may write: <paths>
- must not touch: <paths>
Acceptance
- <runnable check>
Return contract
- concise summary
- files changed
- tests run
- risks and blockers
- raw logs by path only
Invariants
- Policy values have one machine-readable source.
- v2 slice counters reset only through checkpoint advance; goal totals and
accepted evidence never reset. Retain the stricter explicit native/host limit.
- Reserve child capacity for required independent review. Completed children
release active concurrency; the host's actual capacity also limits spawning.
- No silent retry, model switch, context discard, or result truncation.
- Compaction changes active context, not cumulative usage or failure history.
If safe compaction is unavailable, report that limitation, not a generic
request to continue. Never clear an ambiguous legacy blocker automatically.
- Missing evidence is reported as missing, not summarized as success.
- A decline, cancellation, timeout, error, or null result remains non-success.
- Recall systems may suggest context; they do not override repository state or
recorded human decisions.
1---2name: agent-context-budget3description: Use when an agent task needs bounded context packets, checkpoint-aware compaction, a fresh-session primer, or policy-controlled child results without loading raw logs into the primary session.4metadata:5 source: https://skillmd.com/skills/wenyuchiou/agent-context-budget6---78# agent-context-budget910Prepare bounded context for a task without inventing a second budget source.11Numeric limits come from the policy referenced by the current TaskCheckpoint.12The public contract and commands are documented in13../../docs/public-harness-contract.md.1415## Use this skill for1617- A task that may spawn a delegated executor or reviewer.18- A transcript approaching its configured checkpoint boundary.19- A fresh session that needs a compact, evidence-linked primer.20- Results or logs that are too large for the primary-agent context.2122Do not use it to summarize away unresolved failures, human decisions, raw23scientific evidence, or security findings.2425## Inputs2627- Goal and task id.28- Readable agent policy.29- Current TaskCheckpoint.30- Evidence and artifact paths needed by the next role.31- Optional existing .coord/plan.yml and approved memory events.3233If the policy is configured but unreadable, stop. If the optional34agent-collab-harness package is unavailable, do not start an autonomous loop or35child spawn; prepare the packet for human-controlled execution instead.3637## Workflow38391. Validate policy and checkpoint:4041 agent-collab policy validate --policy <policy-ref> --json42 agent-collab checkpoint validate --checkpoint <checkpoint-ref> --json43442. Record current observed metrics in the checkpoint. Do not estimate a lower45 number to fit the policy.463. Run policy evaluation before a child spawn:4748 agent-collab policy evaluate \49 --policy <policy-ref> \50 --checkpoint <checkpoint-ref> \51 --json52534. Obey the result:54 - continue and spawn_allowed=true: create the bounded task packet.55 - checkpoint: write a checkpoint/primer. A v2 slice with auto_continue56 advances atomically and resumes under the same goal; v1 returns control.57 For v2 scope=action with context_compaction_required, perform local context58 maintenance without asking for renewed approval: preserve full artifacts,59 acceptance evidence, failures, and authorization; build a smaller linked60 packet or use native compaction, record measured sizes, then re-evaluate.61 Do not spawn or advance a slice while this context gate is pending.62 - stop or spawn_allowed=false: do not spawn. Respect v2 decision scope;63 exhaustion of one action does not prohibit safe primary-agent diagnosis.645. Put only decision-relevant material in the packet:65 - goal and acceptance contract66 - explicit files and tools in scope67 - direct evidence references68 - current recorded human decisions69 - relevant interfaces or schemas706. Keep raw logs and complete artifacts at paths. Include a short failure71 excerpt only when it is needed to diagnose the next action.727. After a result returns, update observed metrics and evaluate again.7374## Outputs7576- .coord/context_<NNN>.md: round-specific packet plan.77- .coord/session_primer.md: bounded fresh-session digest.78- Updated TaskCheckpoint at the plan's checkpoint_ref.7980These are scratch artifacts by default. Promote a checkpoint snapshot only when81the repository explicitly needs it for resume, shipping, or acceptance82evidence. Agent boundaries do not imply commits.8384## Packet shape8586 # Context packet — <task id>8788 Policy89 - policy_ref: <path>90 - policy_hash: <sha256>91 - checkpoint_ref: <path>9293 Goal94 <one bounded objective>9596 Recorded decisions97 - <gate / actor / decision / action hash>9899 Evidence100 - <path or stable source locator>101102 Scope103 - may read: <paths>104 - may write: <paths>105 - must not touch: <paths>106107 Acceptance108 - <runnable check>109110 Return contract111 - concise summary112 - files changed113 - tests run114 - risks and blockers115 - raw logs by path only116117## Invariants118119- Policy values have one machine-readable source.120- v2 slice counters reset only through checkpoint advance; goal totals and121 accepted evidence never reset. Retain the stricter explicit native/host limit.122- Reserve child capacity for required independent review. Completed children123 release active concurrency; the host's actual capacity also limits spawning.124- No silent retry, model switch, context discard, or result truncation.125- Compaction changes active context, not cumulative usage or failure history.126 If safe compaction is unavailable, report that limitation, not a generic127 request to continue. Never clear an ambiguous legacy blocker automatically.128- Missing evidence is reported as missing, not summarized as success.129- A decline, cancellation, timeout, error, or null result remains non-success.130- Recall systems may suggest context; they do not override repository state or131 recorded human decisions.