agentleFS
itsmuskanagarwalitsmuskanagarwal/claude-pack/skills/code-archaeology/SKILL.md

code-archaeology

Skill0 starsChanged 4 months agoMITView on GitHub

Understand an unfamiliar or legacy module before changing it. Use whenever the user asks what code does, asks to modify/refactor/migrate code in a module with no tests or docs, mentions "legacy", "old code", "nobody knows how this works", or before any change to a module the session has not read. Produces a findings document and a change plan; never writes production code during archaeology.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 3

    Distinctive

    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 NOT write or edit production code in this skill.

    line 10
  2. Very specific:

    Write docs/archaeology/<module>-findings.md with sections: Surface, Data flow, Touchpoints, Oddities, Open questions.

    line 24
  3. Distinctive:

    If the module has no tests: require characterization tests first (consult the characterization-tests skill) and say so in the plan.

    line 32
  4. Distinctive:

    Commit message references the findings doc.

    line 39

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “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
<!-- owner: Muskan, added: 2026-07-16, model: claude-sonnet-5, review: quarterly -->

Code Archaeology (Explore → Plan → Code → Commit)

Phase gate

Do NOT write or edit production code in this skill. Output of this skill is understanding + a plan. Announce phase transitions explicitly.

Explore

  1. Map the surface: exported functions/classes/components, who calls them (grep call sites; use LSP tools for symbol references if available — prefer LSP over grep for symbols).
  2. Trace one primary data flow end to end (input → transformations → output/ side effect). Name every state mutation.
  3. Touchpoints: list DB tables, HTTP endpoints, files, env vars, globals, events. Exact file:line for each.
  4. Oddity hunt: magic numbers, date/timezone math, rounding, locale assumptions, catch-and-ignore blocks, commented-out code, TODOs older than 1 year. For each: "looks wrong / probably load-bearing / evidence".
  5. Write docs/archaeology/<module>-findings.md with sections: Surface, Data flow, Touchpoints, Oddities, Open questions. This file is the documentation byproduct — always write it, even for small digs.

Plan

  1. State the change as: goal, acceptance criteria (machine-checkable: commands that must pass), files to touch (explicit allowlist), blast radius (dependents that could break), and rollback (how to revert).
  2. If the module has no tests: require characterization tests first (consult the characterization-tests skill) and say so in the plan.
  3. Present the plan and STOP for user approval before any code phase.

Code / Commit (after approval)

  1. Touch only allowlisted files. After each logical edit, run the acceptance commands. Never claim they pass without running them.
  2. Commit message references the findings doc. If any oddity was intentionally preserved, say which and why.

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.