agentleFS
BlazityBlazity/atlas/skills/atlas-compact/SKILL.md

atlas-compact

Skill26 starsChanged 5 months agoMITView on GitHub

Use when AI context needs cleanup — atlas doctor context-size advisories, an oversized AGENTS.md or CLAUDE.md, bloated memory or vocabulary files, or durable docs that need compaction, relocation, or dedup

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Call the CLI through npx, preferring a locally installed @blazity-atlas/core (npx --no-install @blazity-atlas/core …) and falling back to …

    line 12
  2. Distinctive:

    Run the phases below in order.

    line 16
  3. Distinctive:

    Follow the result before compacting anything:

    line 26
  4. Distinctive:

    No context-size advisory and no user-named target: report that the AI context is within thresholds and stop.

    line 30
  5. Distinctive:

    Treat its entry lines as the worklist.

    line 38
  6. Distinctive:

    Read each flagged file and bucket its content:

    line 44

≈ “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

Compact AI Context

Overview

Use this skill when atlas doctor reports context-size advisories or AI-facing context files grow oversized. The published CLI owns deterministic measurement — which files count, their sizes, thresholds, and statuses. This skill owns semantic judgment — what to cut, move, merge, or keep. Never reimplement measurement, guess sizes, or invent thresholds.

Call the CLI through npx, preferring a locally installed @blazity-atlas/core (npx --no-install @blazity-atlas/core …) and falling back to the published package only when none is installed. Every npx --yes @blazity-atlas/core@latest … command in this skill is the fallback spelling of that rule, not an instruction to skip the local copy.

This skill edits content only. Structure repair — directories, config, symlinks, managed files — stays with doctor --fix.

Run the phases below in order.

Phase 1 — Deterministic Measurement

From the repository root, run:

npx --no-install @blazity-atlas/core doctor

Follow the result before compacting anything:

  • Manual findings (exit 2): summarize the conflicts and stop.
  • Fixable drift (exit 1): offer npx --yes @blazity-atlas/core@latest doctor --fix first — structure repair precedes compaction. If --fix refuses because of a dirty worktree, ask the user whether to commit, stash, or explicitly rerun with --force; never use --force automatically.
  • No context-size advisory and no user-named target: report that the AI context is within thresholds and stop.

Capture the authoritative per-file worklist:

npx --no-install @blazity-atlas/core doctor --handoff context-size

Treat its entry lines as the worklist; do not re-measure by hand.

Phase 2 — Read and Classify

Resolve every path through the workspace config — never hardcode .ai/: read .ai/config.json, or when absent, follow the .atlas repo-root pointer to <root>/config.json.

Read each flagged file and bucket its content:

  • Commands, invariants, and safety rules → stay in root instructions.
  • Durable product, architecture, stack, and lesson detail → configured memory files.
  • Decisions and rationale → configured decisions/ADR paths.
  • Canonical terms → the configured language file.
  • Duplicated content → keep one canonical location and reference it from the rest.
  • Stale content contradicted by the repository (with evidence) → delete.

Managed Atlas skill files are report-only: never hand-edit them — the byte-equality drift check reverts any edit on the next doctor --fix. An oversized managed skill is package-maintenance work; record it, do not fix it locally.

Phase 3 — Propose

Present a per-file plan before touching anything: exact moves (source section → destination path), merges, deletions with reasons, and expected size deltas. Never rewrite silently; get explicit approval, whole-plan or per-file.

Everything relocated or rewritten follows the durable-documentation rules: record needs, decisions, and reasons — never individuals or internal process. Keep personal names, private schedules, internal-only references, and absolute local paths out of workspace artifacts.

Phase 4 — Apply

Apply approved edits only. Preserve the AGENTS.md managed block, user rules, commands, and safety boundaries. Do not create new documentation roots and do not touch config or structure — that is the CLI's job.

Phase 5 — Re-verify

  1. Rerun npx --no-install @blazity-atlas/core doctor — actually run it, never assume the result.
  2. Show before/after context-size lines. The exit code must be unchanged or better.
  3. Advisories never affect exit codes; do not chase zero warnings at the cost of deleting real guidance. If a file still warns after one bounded iteration, record the residual as accepted with a reason.
  4. Suggest a commit of the compaction result.

Boundaries

  • Missing or thin context (empty vocabulary, empty memory, setup pending) → the atlas-setup skill.
  • Reviews, gates, and verdicts on AI tools and changes → the atlas-review skill.
  • Workspace structure, managed skills, and config → the Atlas CLI (init, doctor --fix).

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.