agentleFS
rkalievrkaliev/eng-kit/skills/onboarding-existing-codebase/SKILL.md

onboarding-existing-codebase

Skill1 starsChanged 13 days agoMITView on GitHub

Use when starting work in an unfamiliar or legacy repository, when CLAUDE.md is missing or stale, or when asked to map a codebase or set it up for agent work

  • Reads credentials

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are 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.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run install, build, test and typecheck/lint exactly as CI does.

    line 24
  2. Very specific:

    Create or update CLAUDE.md from ../../templates/CLAUDE.md (in a project install: .claude/eng-kit/templates/CLAUDE.md).

    line 28
  3. Very specific:

    Create .claude/verify.json with the fast, reliable checks (the kit-init skill does this and the rest of the .claude/ setup):

    line 37
  4. Distinctive:

    If something is unclear (ownership, "is this dead code?", what not to touch), ask the user.

    line 43

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

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Onboarding an existing codebase

Learn the repo from its evidence (manifests, CI, scripts, tests), not from guesses. Then write down what you learned, so every later session starts oriented. Read-only until the map is done.

1. Map

  • Configuration: the environment variables, where they are read and validated, and .env.example.
  • Stack and runtime: package.json, lockfiles, pyproject.toml, go.mod, Cargo.toml, *.csproj/global.json, build.gradle(.kts)/libs.versions.toml, Podfile/Package.swift, .nvmrc, .tool-versions, Dockerfiles.
  • Real commands: the CI config (.github/workflows, .gitlab-ci.yml, Jenkinsfile), Makefile/justfile, package scripts, the Gradle wrapper, Xcode schemes. CI is the truth; the README may be stale.
  • Structure: entry points, modules and layers, and where business logic lives. Note generated code, vendored code, migrations and anything else that must not be hand-edited.
  • Conventions: formatter and linter configs, commit style (git log --oneline -30), branch naming, test layout and naming, error-handling and logging patterns, and the design system (a design.md, token files, Storybook), if there is UI.
  • Existing agent files: AGENTS.md, CLAUDE.md, .cursor/rules, .github/copilot-instructions.md. Reuse them; don't duplicate them.
  • Risky areas: payments, auth, data migrations, fiscal or device integrations, anything without tests.

On a large repo, dispatch Explore agents per area in parallel (dispatching-parallel-agents), then merge their findings.

2. Prove the commands

Run install, build, test and typecheck/lint exactly as CI does. Record which ones pass, fail (with the reason) or can't run here (missing credentials or devices). Don't fix anything yet. Report the baseline.

3. Write the manifest

Create or update CLAUDE.md from ../../templates/CLAUDE.md (in a project install: .claude/eng-kit/templates/CLAUDE.md). If the repo already has AGENTS.md for other agents, keep the content there and make CLAUDE.md import it with a line @AGENTS.md:

  • stack and versions, as pointers to their source files;
  • the proven commands;
  • the rules that differ from defaults;
  • the boundaries (don't touch, ask first);
  • the Definition of Done.

Keep it under about 150 lines: it loads in every session. Link to docs instead of copying them, and fill its Docs section: the index, a task map, which source wins. In a monorepo, a short nested CLAUDE.md per package loads when work reads files there. Rules for one area go into .claude/rules/*.md with paths: frontmatter, so they load only for matching files.

Create .claude/verify.json with the fast, reliable checks (the kit-init skill does this and the rest of the .claude/ setup):

{ "commands": ["npm run typecheck", "npm test"], "timeoutSec": 600 }

If something is unclear (ownership, "is this dead code?", what not to touch), ask the user. Don't encode guesses as rules.

4. Hand off

Summarize the stack, how to run it, the baseline results, the risky areas, and open questions. If the repo has no README or docs index, offer the docs entry point to write them. New changes then follow changing-legacy-code.

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.