agentsclimarketplace

Context optimizer

Skill rafaelghif/antigravity-agents/.agents/skills/context-optimizer

Enterprise-Grade Guardrails, Zero-Assumption Execution, and Quality Gates for Autonomous AI Coding Agents.

Install
npx -y skills add rafaelghif/antigravity-agents --skill context-optimizer

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Token janitor that compresses memory and clears obsolete artifacts to prevent LLM context bloat.

SKILL.md

1.6 KB, as published. Nobody here has run it

Context Optimizer Skill (Token Janitor)

Objective

To preserve the agent's cognitive capabilities during long-running sessions by proactively summarizing past activities, deleting irrelevant scratch files, and rotating logs to prevent Token Window exhaustion.

When to Execute

  • When the internal token usage metric exceeds 80%.
  • At the end of a very complex task before starting a new one.
  • When the .agents/scratch/ directory contains more than 5 files.

Execution Steps

  1. Artifact Triage:

    • Scan .agents/scratch/ and .agents/incidents/.
    • Identify files that are no longer actively relevant to the current task.
  2. Summarization (Compression):

    • For incident logs or long debugging outputs, read the file and write a 2-3 sentence dense summary containing the core error, the root cause, and the fix.
    • Append this summary to .agents/brain/rules.md if it represents a permanent lesson, or to .agents/brain/audit.jsonl as a completed track.
  3. Purge:

    • Delete the raw, bulky log files and temporary scratch artifacts that have been summarized.
    • Clear out outdated state backups (state.json.bak.*) keeping only the most recent one.
  4. Report:

    • Log a "Context Garbage Collection" event in the audit log, noting how many files were purged to maintain token efficiency.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.