agentleFS
PedroMosqueraPedroMosquera/squadai/.agents/skills/context-discipline/SKILL.md

context-discipline

Skill10 starsChanged 20 days agoMITView on GitHub

Recover from context compaction and keep long agent sessions token-efficient. Load on demand, after a compaction event, or when the session context is filling with tool/MCP output.

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When context is compacted or truncated mid-task, re-anchor before acting:

    line 13
  2. Very specific:

    Session state: read AGENTS.md or CLAUDE.md for recorded decisions.

    line 15
  3. Very specific:

    Recent history: run git log --oneline -10 to see the latest commits and infer phase progress from their prefixes (test: = red, feat: = …

    line 18
  4. Distinctive:

    Ground truth: run the project test command.

    line 21
  5. Very specific:

    Artifacts: check specs/ for written specification documents and read the most recently modified files to see what was last changed.

    line 23
  6. Distinctive:

    After an MCP documentation lookup, keep only the signatures, parameters, and constraints you need.

    line 37
  7. Distinctive:

    When delegating, pass file paths and one-line conclusions, not the raw output you collected.

    line 42
  8. Distinctive:

    Keep a running checklist of pipeline phases.

    line 47
  9. Distinctive:

    After each phase or sub-agent result, write a 3-5 line summary and drop the detail from active use.

    line 48
  10. Distinctive:

    Write large intermediate products (specs, plans, analyses) to disk and reference them by path.

    line 50
  11. Distinctive:

    Prefer re-reading a small file over keeping its content in context "just in case".

    line 52

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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

Context Discipline Skill

On-demand procedures for context recovery and long-session hygiene. Load this skill only when needed: after a compaction, or when context pressure builds.

Compaction Recovery Procedure

When context is compacted or truncated mid-task, re-anchor before acting:

  1. Session state: read AGENTS.md or CLAUDE.md for recorded decisions; in solo sessions, look for === PHASE: <name> === markers in the visible context to find your position.
  2. Recent history: run git log --oneline -10 to see the latest commits and infer phase progress from their prefixes (test: = red, feat: = green, refactor:, docs: add spec = spec phase, etc.).
  3. Ground truth: run the project test command; the pass/fail state is a reliable phase indicator.
  4. Artifacts: check specs/ for written specification documents and read the most recently modified files to see what was last changed.
  5. Resume, don't restart: continue from the last completed phase. Never restart a pipeline from scratch after a compaction.
  6. Confirm when unsure: tell the user: "Context was compacted. Last commit was X. Shall I continue with [phase]?"

Summarizing Tool and MCP Output

Tool results and MCP responses (Context7 documentation, search results, API lookups) are the fastest way to fill a context window. Rules:

  • Extract the relevant findings from any tool output longer than ~30 lines; never leave a full dump in the transcript.
  • After an MCP documentation lookup, keep only the signatures, parameters, and constraints you need; drop prose, examples you won't use, and unrelated sections.
  • Record what you learned in 3-5 lines in your working notes, then reference the note instead of re-querying.
  • When delegating, pass file paths and one-line conclusions, not the raw output you collected.

Working-Notes Protocol for Long Sessions

  • Keep a running checklist of pipeline phases; tick them off as they finish.
  • After each phase or sub-agent result, write a 3-5 line summary and drop the detail from active use.
  • Write large intermediate products (specs, plans, analyses) to disk and reference them by path. The file system is your external memory.
  • Prefer re-reading a small file over keeping its content in context "just in case".

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.

Reviews can't be read right now.

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.