agentleFS
yeaight7yeaight7/agent-powerups/skills/context-compression/SKILL.md

context-compression

Skill6 starsChanged 4 months agoApache-2.0View on GitHub

Use when conversation context is bloated, constraints are being forgotten, or a compact handoff is needed before continuing work.

16 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use bdi-mental-states, hosted-agents and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Downey6689Skill

    bdi-mental-states

    Transforms external RDF context into BDI mental states. Invoke when modeling beliefs, desires, and intentions.

    Also in 3 projects that use this

  • Downey6689Skill

    hosted-agents

    Guidance for hosted/sandboxed agents. Invoke when running background agents in isolated VMs or multi-client setups.

    Also in 3 projects that use this

  • Svenja-devSkill

    project-development

    Design and build LLM-powered projects from ideation through deployment. Use when starting new agent projects, choosing between LLM and traditional approaches, or structuring batch processing pipelines.

    Also in 3 projects that use this

  • +1 more from Downey6689

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 14 edited versions we read keep these.

  • 5

    Distinctive

    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:

    Use when context approaches limits or response quality degrades (repeated mistakes, forgotten constraints, lost-in-the-middle effects) — …

    line 9
  2. Distinctive:

    Before finalizing, verify the handoff can answer:

    line 52
  3. Distinctive:

    Do NOT silently drop critical architectural constraints or user preferences during compression.

    line 59
  4. Distinctive:

    Write the handoff document to disk before asking the user to restart.

    line 60
  5. Distinctive:

    All four quality probes (recall, artifact, continuation, decision) can be answered from the artifact without re-reading the full transcript.

    line 65

“Common” is measured: kept by at least 6 in 10 of the 14 edited versions of this file we could read. “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

Context Compression

When to use

Use when context approaches limits or response quality degrades (repeated mistakes, forgotten constraints, lost-in-the-middle effects) — typically after many turns of debugging or complex planning.

Requirements / Checks

  • Active session contains long stack traces, large file dumps, or multiple failed iterations.

Workflow

  1. Diagnose bloat — identify: redundant outputs (same file read multiple times), contradictory instructions that accumulated over turns, constraint forgetting (earlier requirements no longer respected).
  2. Draft summary — synthesize the current valid state of the code or plan in 3–5 sentences.
  3. Extract anti-patterns — list what failed and why: "Attempted X → failed because Y". These are critical to prevent the next session from looping on the same mistakes.
  4. Generate handoff artifact — write the following template to disk:

    ## Goal
    [One-sentence objective]
    
    ## Current state
    [What is working / what is in place right now]
    
    ## Blocker / next step
    [The exact next action to take]
    
    ## Anti-patterns (do not repeat)
    - Tried X → failed because Y
    - Tried A → blocked by B
    
    ## Key files
    - `path/to/file.ts` — [what it does / why it matters]
    
    ## Open risks
    - [Anything uncertain or requiring verification]
    
    ## Decisions made
    - [Key tradeoffs and why alternatives were rejected]
  5. Restart — tell the user to start a new chat session and attach the handoff file as the first message.

Quality Probes

Before finalizing, verify the handoff can answer:

  • Recall: exact commands, errors, versions, decisions that still matter.
  • Artifact: files created, modified, inspected, intentionally untouched.
  • Continuation: next action, current blocker, validation state, open risks.
  • Decision: why key tradeoffs were chosen and what alternatives were rejected.

Safety Constraints

  • Do NOT silently drop critical architectural constraints or user preferences during compression.
  • Write the handoff document to disk before asking the user to restart.

Validation / Done Criteria

  • Handoff artifact exists on disk and is in the template format above.
  • User is explicitly told to restart the session and attach the file.
  • All four quality probes (recall, artifact, continuation, decision) can be answered from the artifact without re-reading the full transcript.

Anti-loss Checklist

  • Goal is clearly stated.
  • Current blocker / next step is identified.
  • Failed approaches are documented to prevent looping.
  • Relevant file paths are listed.
  • Key decisions and their reasons are recorded.

References

  • references/compression-quality-probes.md

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.