agentleFS
jacksoswagjacksoswag/ObsidAgent/.claude/skills/map-project/SKILL.md

map-project

Skill1 starsChanged 3 months agoMITView on GitHub

Map an entire codebase with subagents and write code-map.md to the session scratchpad, at a detail level another model can rebuild the system's logic from without reading the repo. Covers contracts, data shapes, algorithms, interfaces, a real test run, dead surface, and defects. Use to "map the repo", "explore project", "what does this codebase do", before a large refactor, or when `resolve-project` needs `code-map.md`. Read-only apart from one approved copy into docs/technical-spec.md at the end, and that copy is skipped when resolve-project is driving.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. ulpi-io/browse★ 15same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository12 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do this inline. It is cheap and the fan-out shape depends on it.

    line 18
  2. Very specific:

    Read the root: manifest (Cargo.toml, package.json, pyproject.toml), the test config, and the entry points it names.

    line 20
  3. Distinctive:

    Cite or drop it: Every claim names a file, a symbol, or a line.

    line 107

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

map-project

Produce a document another model can rebuild the system's logic and functionality from, holding nothing but that document. Every line is an observation about the code, cited to a file, function/struct, and variable.

That standard sets the detail level everywhere. A responsibility in one line describes; a signature with its error cases, an invariant, and the ordering rule inside a loop reconstructs. When a passage would leave a reimplementer guessing, it is not done.

Scope

Read-only, with one exception: the approved copy to docs/technical-spec.md in §3. Subagents may read, grep, and run the existing test suite. Nothing else edits, stages, or commits. Load the code-standards skill for enhanced understanding of enforced structure and procedures. Be extremely thorough and comprehensive; this doc will become the foundation for upcoming analysis and implementation.

1. Scout, before dispatching anything

Do this inline. It is cheap and the fan-out shape depends on it.

  • Read the root: manifest (Cargo.toml, package.json, pyproject.toml), the test config, and the entry points it names.
  • List the real subsystems. Group by concern, not by file type, and follow the repo's own layout rather than imposing one.
  • Get the commit (git rev-parse --short HEAD) and whether the tree is dirty. The map is only true for one commit, and it says which.

A repo with no manifest and no tests still maps. Say so in Unknowns and work from the entry points.

2. Fan out

One agent per subsystem, plus the three fixed roles below, all dispatched in a single message so they run concurrently. Every dispatch passes an explicit model. Read these at minimum: README.md, the Notes document at $VAULT/projects/<Name>.md, every file in src/, docs/, tests/, and appropriate files in output/. That is the bar; read more files or git history outside that if necessary.

RoleCountModel - EffortReturns
Subsystem readerone per subsystem, cap 8sonnet - highReconstruction-grade detail for its files: every public signature with parameter and return types, units, error and edge cases; the shape of every type it owns, field by field; the non-obvious logic written out well enough to reimplement (ordering, tie-breaks, state transitions, numeric methods); the invariants it maintains; what it imports, who imports it, and anything unreachable from an entry point.
Entry-point tracer1opus - highEach entry point followed to its output, naming the real stages, where execution branches or fans out, and every IO boundary it crosses. Goal is to analyze cross-system interactions. Byte-exact on anything a consumer sees: CLI flags, wire messages, event shapes, file paths, exit codes.
Test runner1opus - xhighThe test layout, the actual command, the real run output (counts, failures, duration), and which subsystems no test touches. Each suite framed as what it proves, so a rebuild can be checked against it. A failing or unrunnable suite is a result to report, never a blocker. Use standard testing run/analysis procedure.
Code analyst1opus - xhighRuns last, after the others return. Cross-cutting facts one reader cannot see: import cycles, logic duplicated across subsystems, dead surface, and defects with a concrete failure path.

More than 8 subsystems means grouping the smallest ones together rather than raising the cap.

Each subagent gets: the repo path, its scope, the return shape, and a reminder that its final text is the return value rather than a message to a human. Tell it to cite specific files and symbols, and to report what it could not determine instead of filling the gap.

3. Synthesize

You write code-map.md in the session scratchpad, not a subagent. Dedupe overlapping findings, resolve contradictions between two readers by opening the file yourself, and investigate anything no agent could evidence (drop if inaccurate or useless). An evidenced finding that fits no heading gets its own heading; fit is never the reason something gets cut.

When finished, report the path. On a standalone invocation, use AskUserQuestion to ask whether to overwrite docs/technical-spec.md with its content. When resolve-project invoked this skill, stop at the path and skip that question: it writes the spec itself in §2.1, after its resolutions are approved, and asking here would land the write before the audit is read.

Output

Sections are numbered throughout, so an agent can cite §7 and a human can jump.

# {project}: technical specification

`{commit}` · {clean|dirty} · {date}

## 1. What the system is
What it does and the mechanism it uses, in 3-6 sentences.

## 2. Design invariants
What holds everywhere, stated so a violation is recognizable. The rules a reimplementation is wrong without.

## 3. Vocabularies
Closed sets with exact counts: states, event kinds, error variants, commands. Name every member.

## 4. Data model
Every type that persists or crosses a boundary: fields, types, units, defaults, and what makes an instance invalid. Include on-disk formats, schemas, and serialization.

## 5. Build and run
Toolchain, dependencies with versions and what each is for, build and run commands, entry points, environment variables.

## 6 to N. {one section per subsystem, named for the domain}
Per subsystem, in this order: its contracts (signature, what it promises, error and edge cases, invariants), the non-obvious logic in enough detail to reimplement (ordering rules, tie-breaks, state transitions, numeric methods, concurrency and locking), and what it exposes to a consumer byte for byte (CLI flags, wire messages, event shapes, file paths, exit codes). Pseudocode wherever prose would be ambiguous.

## N+1. Data flow
Entry point to output, naming the real stages, the IO boundaries crossed, and the state persisted. Draw the graph when execution branches or fans out.

## N+2. Module map
| Path | Owns | Public surface | Depends on |

## N+3. Configuration
| Key | Type | Default | Effect |

## N+4. Test evidence
The suite as conformance criteria: what each suite proves, the command, and the real output from this run. A rebuild is correct when these pass.

## N+5. Defects
| Symptom | File:line | Trigger |
Where the code does something other than what it intends. Rebuild the intent, not the defect.

## N+6. Dead surface
Unreachable code, unused exports, config nothing reads. A rebuild leaves these out.

## N+7. Limits
The honest ceiling: what the system cannot do, where it degrades, and what extending it would take.

## N+8. Unknowns
What no agent could determine, and what would settle it. Every entry is a hole in the reconstruction.

Subsystem sections carry the weight, one per concern from the scout, named for the domain rather than the file path. A spec that stops at the module map has skipped what a maintainer needs most.

Defects, Dead surface, and Unknowns are fixed, by name: they hold what a reader would otherwise never learn, and resolve-project reads Defects by heading. Everything above them is a starting shape. Add a section for what this repo has that the list does not cover (a wire protocol, a plugin system, a build that generates code), add a column to a table or drop the table when prose carries it better, and scale the whole document to the size of the repo. Mine run 13k to 70k characters; under 10k is a README wearing a spec's title.

Rules

  • Write for a reimplementer. The test for any passage: could a model holding only this document produce code that behaves the same? Detail scales with how much a reader would otherwise have to guess.
  • Cite or drop it. Every claim names a file, a symbol, or a line. An unattributed claim gets cut. Broad analysis can cite a specific, grounded chain of reasoning based in files or real-world facts.
  • Report the tests you ran. Paste the real output. A suite that fails is a result about the repo, not a reason to stop mapping.
  • Report what you could not determine. A stated unknown beats a confident guess, and Unknowns is where it goes.

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.