agentleFS
WenyuChiouWenyuChiou/agent-collab-skills/skills/agent-context-budget/SKILL.md

agent-context-budget

Skill30 starsChanged 3 months agoMITView on GitHub

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.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 11 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not use it to summarize away unresolved failures, human decisions, raw scientific evidence, or security findings.

    line 20
  2. Distinctive:

    If the policy is configured but unreadable, stop.

    line 31
  3. Distinctive:

    Run policy evaluation before a child spawn:

    line 44
  4. Distinctive:

    Do not spawn or advance a slice while this context gate is pending.

    line 59
  5. Distinctive:

    stop or spawn_allowed=false: do not spawn.

    line 60
  6. Distinctive:

    Put only decision-relevant material in the packet:

    line 62
  7. Distinctive:

    Keep raw logs and complete artifacts at paths.

    line 68
  8. Distinctive:

    After a result returns, update observed metrics and evaluate again.

    line 70
  9. Distinctive:

    must not touch: <paths>

    line 103
  10. Distinctive:

    No silent retry, model switch, context discard, or result truncation.

    line 122
  11. Distinctive:

    If safe compaction is unavailable, report that limitation, not a generic request to continue.

    line 124

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. Validate policy and checkpoint:

    agent-collab policy validate --policy <policy-ref> --json
    agent-collab checkpoint validate --checkpoint <checkpoint-ref> --json
  2. Record current observed metrics in the checkpoint. Do not estimate a lower number to fit the policy.
  3. Run policy evaluation before a child spawn:

    agent-collab policy evaluate \
      --policy <policy-ref> \
      --checkpoint <checkpoint-ref> \
      --json
  4. 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.
  5. 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
  6. Keep raw logs and complete artifacts at paths. Include a short failure excerpt only when it is needed to diagnose the next action.
  7. After a result returns, update observed metrics and evaluate again.

Outputs

  • .coord/context_<NNN>.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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.