agentleFS
solanodzsolanodz/harness-engineering-skills/skills/harness-repo-knowledge/SKILL.md

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.

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
  1. Distinctive:

    Ask only what you cannot infer: which folder is the product vs tooling, and which paths are off-limits.

    line 38
  2. Very specific:

    Create docs/REPO_MAP.md (or docs/architecture.md if that already exists).

    line 42
  3. Very specific:

    Read the map before a broad find / recursive grep

    line 79
  4. Distinctive:

    Search inside the folder the map names

    line 80
  5. Distinctive:

    Do not open every file in a directory “just in case”

    line 81
  6. Distinctive:

    Add one line under Structure or Detailed documentation — do not paste the whole map:

    line 85
  7. Distinctive:

    If AGENTS.md is already over ~100 lines, move directory lists into the map instead of growing the root file.

    line 91
  8. Very specific:

    Write or update docs/REPO_MAP.md from the template

    line 96
  9. Distinctive:

    Remove duplicate tree dumps from AGENTS.md / README if they drifted

    line 98
  10. Distinctive:

    Check: a new agent can name the file to edit for one typical change using only the map

    line 99

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

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.md is already short but the agent still cannot find code
  • harness-diagnose attributed the failure to the context layer

Inspect first

Infer the map from the repo. Do not invent modules.

  1. Top-level directories (skip node_modules, .git, dist, build)
  2. Package manifests (package.json workspaces, pyproject.toml, go.mod)
  3. Entry points (scripts/cli.mjs, src/main.ts, app/, cmd/)
  4. 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 context

Template: 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, examples

Rules 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

  1. Inspect layout and entry points
  2. Write or update docs/REPO_MAP.md from the template
  3. Link it from AGENTS.md
  4. Remove duplicate tree dumps from AGENTS.md / README if they drifted
  5. 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
CLIscripts/cli.mjs
Install / uninstallscripts/lib/install-skills.mjs, uninstall-skills.mjs
Skill bodyskills/<name>/SKILL.md
Templatestemplates/
Course notesreferences/course/

Anti-patterns

  • Pasting tree output into AGENTS.md
  • A 400-line architecture essay nobody opens
  • Map that lists every file instead of jobs → paths
  • Letting the agent explore node_modules or dist
  • Updating the map only in chat

Related skills

  • harness-instructions — short rules; this skill is the map they link to
  • harness-diagnose — context-layer failures (“wrong pattern / wrong folder”)
  • harness-scaffold — create harness files first if the repo has none
  • harness-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

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.