agentleFS
DeL-TaiseiOzakiDeL-TaiseiOzaki/claude-code-orchestra/.claude/skills/context-loader/SKILL.md

context-loader

Skill199 starsChanged 2 months agoMITView on GitHub

ALWAYS activate this skill at the start of every task. Load shared rules from .claude/rules/ and project design context before executing any task.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 1

    Distinctive

    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. Very specific:

    Run load_context.py to get a deterministic read order instead of a hand-maintained file list, so the plan never drifts from what actually …

    line 21
  2. Very specific:

    Read each path in read_order.

    line 48
  3. Distinctive:

    If the work was delegated, verification stays here: run the acceptance checks and inspect the diff before reporting the result as done.

    line 97
  4. Very specific:

    After loading context, briefly confirm to the user per .claude/rules/language.md:

    line 110

“Common” is measured: kept by at least 6 in 10 of the 3 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 Loader Skill

Purpose

Load canonical shared context from .claude/ plus project-owned design documentation so every agent runtime uses the same source files.

When to Activate

ALWAYS - This skill must run at the beginning of every task to load project context.

Workflow

Step 1: Resolve the Read Plan

Run load_context.py to get a deterministic read order instead of a hand-maintained file list, so the plan never drifts from what actually exists on disk:

python3 .claude/skills/context-loader/load_context.py [--task-libraries name,name]

Pass --task-libraries (comma-separated) when the task names specific libraries; the script matches them against .claude/docs/libraries/ and folds any hits into the read order.

The JSON reports {ok, read_order, rules, state, design, progress, libraries, missing, unreadable, warnings}. read_order is the exact ordered list of repo-relative paths to read, in this order:

  1. the rule files in .claude/rules/ (coding principles, delegation, dev environment, language, security, testing, tiers, CLI execution, Codex delegation, and any newly added rule file);
  2. .claude/STATE.md — the active main agent and current working blocks;
  3. PROGRESS.md — the rolling record of the latest five checkpoints, and the session-to-session continuity /feature reads first;
  4. .claude/docs/DESIGN.md — architecture decisions and constraints;
  5. any matched library docs.

Step 2: Read Everything in read_order, Then Surface Gaps

Read each path in read_order. Then check the rest of the report:

  • missing — canonical files that do not exist at all (e.g. .claude/docs/DESIGN.md, PROGRESS.md). Report these; do not silently proceed as if they were empty.
  • unreadable — files that do exist but could not be read or decoded. This is a filesystem or encoding problem, not an un-bootstrapped repository: do not respond by suggesting /init.
  • warnings — design.placeholder is tri-state: true means .claude/docs/DESIGN.md is absent or still the uninitialised /init template (its "Background & Purpose" section is empty), false means real prose, and null means the marker heading is gone so the question cannot be answered. progress.entries: 0 means PROGRESS.md exists but holds no checkpoint entry.
  • libraries.matched vs libraries.files — matched is what read_order included for the current task; files is every doc that exists. If a library relevant to the task isn't in files at all, its documentation simply doesn't exist yet.

Exit code 2 means .claude/rules/ or .claude/STATE.md is missing entirely or unreadable — treat this as a hard stop, not a warning.

Step 3: Route the Task Before Touching It

.claude/rules/delegation.md was just loaded, and it applies from here on: the default is to delegate, and working alone is the exception. Before the first Read, Grep, or Edit of the actual task, decide the route out loud:

  1. Does the whole task fall on the Self-Handle List (answer from loaded context · one known file, ~20 lines or fewer · a named gate or a skill-bundled lead script · user interaction)? If yes, do it directly.
  2. Otherwise name the route from the rule's table — general-purpose-sonnet, general-purpose-opus, codex-debugger, Codex, fable-advisor — or the skill that owns the workflow, and delegate with all six elements of the Subagent Prompt Contract.
  3. Split independent units and launch them in one message so they run in parallel.

Deciding the route after investigating is the anti-pattern the rule names: the investigation was itself the delegable work. When both routes look defensible, delegate.

Step 4: Execute or Delegate the Task

With the loaded context, execute the route chosen in Step 3, following:

  • Coding principles from rules
  • Design decisions from DESIGN.md
  • Library constraints from docs

If the work was delegated, verification stays here: run the acceptance checks and inspect the diff before reporting the result as done.

Key Rules

The rules themselves live in the files read_order enumerates — restating them here would be a hand-maintained duplicate of authoritative content, which is the drift this script exists to prevent. Apply what you read in .claude/rules/coding-principles.md, dev-environment.md, language.md, security.md, and testing.md.

Output

After loading context, briefly confirm to the user per .claude/rules/language.md:

  • how many rule files were read, and that .claude/STATE.md was read;
  • the missing, unreadable, and warnings arrays quoted verbatim from the JSON — not paraphrased, not summarised as "no issues";
  • design.placeholder and progress.entries as reported;
  • the route chosen in Step 3 — the subagent, Codex, or skill that will do the work, or, when handling it directly, which Self-Handle List item applies;
  • ready to execute the task.

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.