harness-context-loader
Skill1 starsChanged 3 months agoMITView on GitHub
Use before generating or modifying code in a harness-grounded project to assemble a compact per-task context packet — pull the verbatim requirement (.claude/harness/requirement.md) and loop state (.claude/harness/state.md) plus only the project-* skills and diagrams the current task needs (via project-index.md) into a focused brief with acceptance criteria. Keeps each task's context precise.
In this repository6 other files it gives its agents.
- harness-analyzerSkill
- harness-learningsSkill
- harness-model-routerSkill
- harness-orchestratorSkill
- harness-verifierSkill
- verifySkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Before writing code for a task, consult the project's generated grounding skills and distill them into a focused brief with acceptance …
- Very specific: line 20
Check for project-* skills under .claude/skills/ (e.g.
- Very specific: line 57
Stay grounded: Every constraint should trace to a project-* skill or the actual repo — not to generic best practice.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.
Files
Harness Context Loader
Before writing code for a task, consult the project's generated grounding skills and distill them into a focused brief with acceptance criteria. You do this yourself — there is no external loader program.
The grounding lives in the project-* skills that harness-analyzer generated under .claude/skills/. Those auto-load by description, but this skill makes the grounding task-specific: it picks what's relevant and turns it into a concrete checklist.
When to run
- At the start of any implementation task in a harness-grounded repo.
- Called by the dispatched task instance itself — since every task now runs in a fresh
Agent()instance (seeharness-orchestrator), that instance grounds itself by invoking this skill rather than receiving a pre-built packet.
Procedure
1. Ensure grounding exists
Check for project-* skills under .claude/skills/ (e.g. project-patterns-*, project-architecture, project-test-patterns, project-design-tokens). If none exist, run harness-analyzer first — it generates them.
2. Read the requirement, the loop state, and resolve the task's grounding
Read .claude/harness/requirement.md for the full verbatim ask and its ## Artifacts (description / reference URL / screenshot path). Then read .claude/harness/state.md for the user-ask summary, the current ([>]) task, and the two handoff ledgers — Conventions & Decisions and Files touched — plus any Done so far entries in the same area as the current task. These ledgers, not a prose transcript, are what carry prior tasks' decisions into this one; trust them over inferring from scratch.
Then read .claude/skills/project-index.md and match the current task to its area row(s) to get the exact skills + diagrams to pull. Also check CLAUDE.md's config sub-block (## Harness configuration → "Area → grounding skill overrides") for the same area — if it lists an extra skill, add it to the pulled set (union, never replace what project-index.md already resolved; default config has no overrides, so this is a no-op unless configured). Don't load everything else — context bloat degrades output. Read only the selected project-* skill bodies and only the .mmd files those rows name.
If project-index.md is missing, fall back to inferring relevance from the task text and project-architecture (and suggest re-running harness-analyzer to regenerate the index). If requirement.md is missing (e.g. this skill was invoked standalone, or against a pre-redesign run), report SPEC ARTIFACT: unknown — requirement.md not found in the packet rather than failing — don't invent a requirement.
Determine if this task is UI-touching (creates/modifies a component, page, or other user-visible surface). If so, and requirement.md's ## Artifacts has at least one non-"none" entry, this task gets the spec-conformance acceptance criterion in step 3.
3. Emit the per-loop context packet
Assemble a compact packet for THIS task only and hold it in context (do not write it to a file — it is rebuilt each loop from requirement.md + state.md, so it never goes stale):
USER ASK (summary): <from state.md>
RELEVANT DECISIONS: <the subset of Conventions & Decisions / Files touched that bears on this task>
CURRENT TASK: <the [>] task>
SPEC ARTIFACT: <requirement.md's Artifacts — description | url | screenshot path | "none">
CONTEXT FOR THIS TASK:
- <selected project-* skills, e.g. project-patterns-ts (naming/imports)>
- <selected diagrams, e.g. diagrams/idiom-form-submit.mmd>
ACCEPTANCE CRITERIA:
- [ ] lives in the right place per project-architecture
- [ ] follows naming + import conventions
- [ ] respects layering in diagrams/layers.mmd (if loaded)
- [ ] (UI) uses project design tokens, accessible
- [ ] (UI, only if SPEC ARTIFACT is not "none") matches the spec artifact
- [ ] tests added in the project's style, passing
- [ ] (complexity) every new file/dependency/abstraction traces to this task or an existing patternThe packet carries only the ledger facts relevant to this task, not the full ledgers or any conversation history — that is what keeps every loop's context tight regardless of how long the run has run. This packet is what the build step works against and what harness-verifier checks the result against.
Guidance
- Keep it lean. A few hundred words of sharp, project-specific guidance beats dumping every generated skill.
- Stay grounded. Every constraint should trace to a
project-*skill or the actual repo — not to generic best practice. - Ledgers over transcripts. Pull only the ledger lines relevant to this task into the emitted packet, never the full
Conventions & Decisions/Files touchedledgers wholesale — even though the dispatch brief you received carries those two ledgers' full current content, don't re-inflate that into the packet you emit.
See also
harness-analyzer— generates theproject-*skills this consultsharness-orchestrator— dispatches a fresh instance per task; that instance calls this skill itselfharness-verifier— checks output against the acceptance criteria, including the spec-conformance and complexity gates this packet feeds
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
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.

