harness-repo-knowledge
Skill4 starsChanged 6 months agoMITView on GitHub
Builds a short repo map so agents find the right files instead of wandering. Use when the agent explores the whole tree, edits the wrong module, or keeps asking where things live.
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- templates/agents.mdAGENTS.md
- harness-auditSkill
- harness-diagnoseSkill
- harness-e2eSkill
- harness-environmentSkill
- harness-evaluatorSkill
- harness-instructionsSkill
- harness-lifecycleSkill
- harness-observabilitySkill
- harness-scaffoldSkill
- harness-scopeSkill
- harness-stateSkill
- harness-verificationSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 7 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
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
- Distinctive: line 38
Ask only what you cannot infer: which folder is the product vs tooling, and which paths are off-limits.
- Very specific: line 42
Create docs/REPO_MAP.md (or docs/architecture.md if that already exists).
- Very specific: line 79
Read the map before a broad find / recursive grep
- Distinctive: line 80
Search inside the folder the map names
- Distinctive: line 81
Do not open every file in a directory “just in case”
- Distinctive: line 85
Add one line under Structure or Detailed documentation — do not paste the whole map:
- Distinctive: line 91
If AGENTS.md is already over ~100 lines, move directory lists into the map instead of growing the root file.
- Very specific: line 96
Write or update docs/REPO_MAP.md from the template
- Distinctive: line 98
Remove duplicate tree dumps from AGENTS.md / README if they drifted
- Distinctive: line 99
Check: a new agent can name the file to edit for one typical change using only the map
≈ “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.
Files
Harness Repo Knowledge
What this does for you
- Faster start — the agent reads a map, not the entire tree
- Fewer wrong-folder edits — “where X lives” is on disk
- Progressive disclosure — root map is short; details stay in
docs/
harness-instructions writes the rules. This skill writes the map those rules should point to.
Based on Lesson 04 (map, not manual) and the context-engineering pattern (SELECT + progressive disclosure).
When to use
- Agent lists or greps the whole repo before every change
- Changes land in the wrong package or folder
- New sessions re-discover architecture from scratch
AGENTS.mdis already short but the agent still cannot find codeharness-diagnoseattributed the failure to the context layer
Inspect first
Infer the map from the repo. Do not invent modules.
- Top-level directories (skip
node_modules,.git,dist,build) - Package manifests (
package.jsonworkspaces,pyproject.toml,go.mod) - Entry points (
scripts/cli.mjs,src/main.ts,app/,cmd/) - Existing docs (
README,docs/,AGENTS.md)
Ask only what you cannot infer: which folder is the product vs tooling, and which paths are off-limits.
Repo map contract
Create docs/REPO_MAP.md (or docs/architecture.md if that already exists). Keep it under ~80 lines.
Required sections:
# Repo map
## What this repo is
One sentence.
## Where to look
| If you need… | Open |
|--------------|------|
| CLI entry | `scripts/cli.mjs` |
| Skills | `skills/<name>/SKILL.md` |
## Do not touch (unless the feature says so)
- generated / vendor / lockfile-only paths
## How to load more
- Deep docs: `docs/…` (read only when the feature needs them)
- Do not dump the whole tree into contextTemplate: templates/repo-map.md
Progressive disclosure
Tier 1 (always): AGENTS.md + feature_list.json + this map
Tier 2 (on skill): SKILL.md body
Tier 3 (on demand): module README, API docs, examplesRules for the agent:
- Read the map before a broad
find/ recursive grep - Search inside the folder the map names
- Do not open every file in a directory “just in case”
AGENTS.md pointer
Add one line under Structure or Detailed documentation — do not paste the whole map:
- Repo map: `docs/REPO_MAP.md` (read before exploring)If AGENTS.md is already over ~100 lines, move directory lists into the map instead of growing the root file.
Workflow
- Inspect layout and entry points
- Write or update
docs/REPO_MAP.mdfrom the template - Link it from
AGENTS.md - Remove duplicate tree dumps from
AGENTS.md/ README if they drifted - Check: a new agent can name the file to edit for one typical change using only the map
This skills repo (example)
| If you need… | Open |
| CLI | scripts/cli.mjs |
| Install / uninstall | scripts/lib/install-skills.mjs, uninstall-skills.mjs |
| Skill body | skills/<name>/SKILL.md |
| Templates | templates/ |
| Course notes | references/course/ |
Anti-patterns
- Pasting
treeoutput intoAGENTS.md - A 400-line architecture essay nobody opens
- Map that lists every file instead of jobs → paths
- Letting the agent explore
node_modulesordist - Updating the map only in chat
Related skills
harness-instructions— short rules; this skill is the map they link toharness-diagnose— context-layer failures (“wrong pattern / wrong folder”)harness-scaffold— create harness files first if the repo has noneharness-environment— how to run the repo; this skill is how to navigate it
Templates
- templates/repo-map.md
Course reference
- Lesson 04: Why a giant instruction file fails
- Context engineering: SELECT, progressive disclosure, JIT loading
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.

