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:
- 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); .claude/STATE.md— the active main agent and current working blocks;PROGRESS.md— the rolling record of the latest five checkpoints, and the session-to-session continuity/featurereads first;.claude/docs/DESIGN.md— architecture decisions and constraints;- 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.placeholderis tri-state:truemeans.claude/docs/DESIGN.mdis absent or still the uninitialised/inittemplate (its "Background & Purpose" section is empty),falsemeans real prose, andnullmeans the marker heading is gone so the question cannot be answered.progress.entries: 0meansPROGRESS.mdexists but holds no checkpoint entry.libraries.matchedvslibraries.files—matchedis whatread_orderincluded for the current task;filesis every doc that exists. If a library relevant to the task isn't infilesat 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:
- 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.
- 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. - 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 in Japanese:
- how many rule files were read, and that
.claude/STATE.mdwas read; - the
missing,unreadable, andwarningsarrays quoted verbatim from the JSON — not paraphrased, not summarised as "no issues"; design.placeholderandprogress.entriesas 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.