Agent skill

Map Codebase

by jszmajda in jszmajda/lid

Bootstrap LID in an existing (brownfield) codebase. An agent skill from jszmajda/lid.

MITAuto-check passedDevelopment

Install Map Codebase

skills CLI
$ npx skills add jszmajda/lid --skill map-codebase -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jszmajda/lid map-codebase --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jszmajda/lid.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/arrow-maintenance/skills/map-codebase .claude/skills/map-codebase && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
map-codebase
GitHub stars
105
Token cost
~3.4k tokens
SKILL.md length
1,726 words
Files
6 (incl. references)
Skills in repo
6
Repo updated
First seen
Licence
MIT

At a glance

Bootstrap LID in an existing (brownfield) codebase. An agent skill from jszmajda/lid.

  • Works in 6 steps: Sweep (Reconnaissance) → Seam Identification: Lens Selection → Seam Identification: Slicing Granularity → …
  • Asked to map a codebase
  • SKILL.md covers Five Critical Rules, At invocation, State dispatch and Phase 1 — Sweep (Reconnaissance), plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Map Codebase is an agent skill from jszmajda/lid. Bootstrap LID in an existing (brownfield) codebase. Deep-reads every file in the declared scope, offers lens-based clustering options, generates skeleton LLDs/HLD/EARS bottom-up, then creates arrow docs and prompts the user to flesh out the skeletons. Token-intensive by design. Use when asked to map a codebase, bootstrap arrows, reverse-engineer the design, or start LID on an existing project.

Its SKILL.md is about 3.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files (for example `evals/evals.json`, `references/brownfield-bootstrap.md` and `references/reconciliation-template.md`).

It sits in Development. The repository describes itself as: Linked-Intent Development - a SDD methodology for agentic coding. The licence is MIT.

When your agent uses it

  • Asked to map a codebase
  • Bootstrap arrows
  • Reverse-engineer the design
  • Start LID on an existing project

Example prompts

  • “/map-codebase”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Sweep (Reconnaissance)
  2. Seam Identification: Lens Selection
  3. Seam Identification: Slicing Granularity
  4. User Reconciliation
  5. Artifact Generation
  6. Terminal Verification & Flesh-out Prompt

What it can do on your machine

Read from SKILL.md and the folder at commit 831c195. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Map Codebase loads about 3.4k tokens when it runs, and up to ~9.1k if it reads all its reference files. Until then it costs about 102 tokens; SKILL.md has 1,726 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~102
When it runs · the whole SKILL.md, loaded when a task matches
~3.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~9.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jszmajda/lid at commit 831c195, republished under its MIT licence (© jszmajda). 1,726 words, ~3,401 tokens.

Download SKILL.mdSave it as .claude/skills/map-codebase/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
map-codebase
description
Bootstrap LID in an existing (brownfield) codebase. Deep-reads every file in the declared scope, offers lens-based clustering options, generates skeleton LLDs/HLD/EARS bottom-up, then creates arrow docs and prompts the user to flesh out the skeletons. Token-intensive by design. Use when asked to map a codebase, bootstrap arrows, reverse-engineer the design, or start LID on an existing project.
disable-model-invocation
true

Map Codebase (Brownfield Arrow Bootstrap)

This skill maps an existing codebase into the arrow of intent. It works bottom-up: read all the code in scope first, then propose lens-based clusterings for the user to choose among, then generate skeleton docs that describe what actually exists.

See brownfield-bootstrap.md for detailed guidance per phase.

Five Critical Rules

These govern every phase. Apply consistently.

  1. Read actual code, don't guess. Every claim in generated artifacts traces to file/line evidence. Speculation is flagged explicitly rather than presented as fact.
  2. Each STOP is mandatory. The workflow has multiple stop points. None are optional. Rushing past a stop is how brownfield mapping produces bad LLDs that poison subsequent work.
  3. LLDs describe current reality, not aspirational design. Output is what the code is, not what a greenfield version would be. Inferred design decisions carry [inferred] markers; known technical debt and behavioral quirks go in Open Questions.
  4. Thoroughness over speed. Token budget is real but not dominant; skimming produces mappings that miss behaviors and lock in the wrong segmentation.
  5. Humble but guide. The agent is not the expert on the user's system; the user is. But don't silently defer — when the user's framing conflicts with the evidence, surface the tension with evidence rather than just going along.

At invocation

Ask one question first:

  • Whole project, or specific parts?
    • Whole project → implies Full LID mode. Scope is the entire project.
    • Specific parts → implies Scoped LID mode. Ask the user to name the parts (directories, file lists, or component names). The declared parts are both the sweep scope and the LID scope going forward.

This question determines scope and mode simultaneously — the user is not asked a separate "Full or Scoped?" later at terminal verification. Default to Full (whole project) if the user is undecided.

Then ask:

  • Subagent parallelism — offer as an option. Recommended for large codebases; single-agent works for smaller ones.

Token-intensity warning. Tell the user upfront this is token-intensive by design — reading every file, proposing multiple lenses, drafting skeletons for every segment, multi-step reconciliation. Not a lightweight operation. Users expecting a quick one-shot map should reconsider.

Undo. The workflow's STOPs between phases are the undo mechanism — aborting at any STOP leaves nothing written to disk. Agent harnesses also provide their own session-level rewind. LID does not ship a dedicated /unmap-codebase command; users roll back via the agent framework's rewind or by reverting a git commit.

State dispatch

Inspect the project before starting:

  • Partial LID docs exist (HLD or some LLDs, but not complete). Ask the user: treat existing docs as authoritative (draft skeletons only for uncovered segments) or supersede them? Do not silently overwrite.
  • Full LID docs exist but no docs/arrows/. Redirect the user to /arrow-maintenance — that command bootstraps the overlay from existing docs without the brownfield sweep. Do not proceed here.
  • No LID docs, no overlay. Standard brownfield flow (below).

Phase 1 — Sweep (Reconnaissance)

Read every file in the declared scope. Not a sample. Sampling risks missing behaviors that only surface in edge-case files and locks in segmentation based on incomplete view.

For each file, record a structured summary:

  • Purpose — what this file appears to do.
  • Exports — functions, classes, types, endpoints exposed to other parts of the system.
  • Dependencies — what the file imports or calls.
  • Data shapes — structures it produces or consumes.
  • Side effects — filesystem, network, database, logs.
  • Role — how this file fits into the larger system (UI component, API handler, background job, pure utility, etc.).
  • Observations — anything unusual, deprecated-looking, or flagged by comments.

Output: a flat list of observed behaviors with file/line references. No segmentation attempted here.

Capacity constraint handling. If the declared scope exceeds the invocation's capacity (single-agent context window, or the chosen subagent budget), surface the constraint with concrete sizing evidence, warn the user that a sampled sweep produces lower-quality mapping, and recommend narrowing scope or enabling subagent parallelism. The user may override and proceed with sampling anyway. Under override, preserve state across truncation points via per-subagent files (.lid/map-codebase/sweep-{N}.md) or by incrementally writing arrow-doc partial drafts during reconnaissance — never silently discard information the orchestrator cannot hold.

When subagents ran in parallel, each subagent writes its sweep to its own file; the orchestrator processes them in chunks during Phase 2.

See subagent-sweep-prompt.md for the prompt template given to sweep workers.

Phase 2 — Seam Identification: Lens Selection

Propose 3–5 fundamentally different clusterings, each using a distinct lens. Not variations on one theme — entirely different mental models.

Good lenses to propose:

  • Data flow — what data originates where, how it moves between modules.
  • User-facing capability — clusters organized around things a user can do (sign in, check out, export data).
  • Domain concept — clusters matching domain language (order, inventory, keeper, entry).
  • Behavioral boundary — where the system changes state in coordinated ways (authentication flow, payment pipeline).
  • Creative / unconventional — a lens not already tried, presented as a counterweight.

Anti-pattern lenses to explicitly avoid:

  • Frontend vs. backend split (deployment-location, not intent).
  • Files that deploy together (infrastructure grouping, not intent).
  • Team ownership (org chart, not intent).
  • Utils / shared / common directory (tooling leftover, not a real concept).

For each proposed clustering, present: name, lens, the clusters it produces, pros, cons, and best-for (what kind of reasoning it supports well).

STOP. User picks a lens. Multiple lenses are the primary edge-detection mechanism — the user's choice of lens reveals latent intent in a way no single clustering can.

See reconciliation-template.md for the presentation format.

Phase 3 — Seam Identification: Slicing Granularity

Within the chosen lens, propose 2–3 slicing variations:

  • Coarse — 3–4 large segments. Fewer LLDs to maintain, less precise tracking.
  • Medium — 6–8 segments. Balanced.
  • Fine — 10+ finer-grained segments. More precise tracking at the cost of more docs.

Coarse absorbs more code per LLD; fine gives precise segment-scoped tracking. Pick based on project maturity and the user's appetite for maintenance.

When a fine slicing produces more segments than sit comfortably at one level, propose grouping related leaves under sub-HLD (grouping) nodes — a shallow tree rather than a long flat list. Most projects map flat (depth-2: leaves directly under the root); nesting is offered only when the leaf count makes a grouping level genuinely clarifying. The tree placement chosen here drives the parent/children links and the mirrored artifact paths in Phase 5.

STOP. User picks a slicing.

Show full SKILL.md (695 more words)Show less

Phase 4 — User Reconciliation

Present the final candidate clustering (chosen lens + chosen granularity). User:

  • Approves, or
  • Modifies individual segment boundaries, or
  • Rejects and goes back to lens/slicing selection, or
  • Combines or splits proposed segments.

Where parallel subagents disagreed on segment assignments earlier, flag those conflicts prominently here.

Component quality check. When reviewing, apply the working definition: a segment should be an independent system achieving an independent purpose. Flag proposed segments that match anti-patterns (team boundaries, deployment units, file locations, generic "utils") rather than accepting them silently.

Derive segment and component names from the codebase's existing vocabulary — its module and directory names, its domain terms — rather than imposing LID labels on the project (HLD tenet: Speak the project's language).

STOP. User approves the final clustering before artifact generation begins.

Phase 5 — Artifact Generation

The design layer is a recursive tree. A leaf node owns EARS and an arrow doc; an intermediate (sub-HLD) node groups its children and owns neither. Where the chosen granularity produces nested structure — leaf segments gathered under a grouping node — that nesting is the design tree, and every artifact path mirrors it. A flat depth-2 mapping (the common case) has every segment at the root level, so the mirrored path collapses to a single file name. {segment-path} below means the root-to-leaf path; at depth-2 it is just the segment name.

For each approved leaf segment, generate these artifacts in order with a STOP after each:

  1. Per-segment arrow doc at the tree-mirrored path docs/arrows/{segment-path}.md (e.g. docs/arrows/billing/invoicing.md for an invoicing leaf under a billing group; docs/arrows/auth.md for a root-level auth leaf) — References pointing to actual files, initial status: MAPPED. Grouping (sub-HLD) nodes are directories, not arrow docs. See arrow-doc template. STOP.
  2. Skeleton LLD at the mirroring path docs/intent/{segment-path}.md — standard LLD template (lld-templates), no separate brownfield template. Content carries brownfield state: [inferred] markers in Decisions & Alternatives table, Open Questions for observed-but-unexplained behaviors. STOP.
  3. EARS spec file beside the segment's design doc at docs/intent/<segment-path>/{segment-name}-specs.md — reserved spec-ID prefix that is the segment's root-to-leaf path (path-concatenated: the leaf prefix is the full path from the root, e.g. a runner leaf under prompt-eval reserves PEVAL-RUN). Ask the user for a namespacing parent if the prefix collides with an existing one. Initial status semantics:
    • [x] — behavior is observed as working in current code.
    • [ ] — behavior is specified but broken or partial in current code.
    • [D] — explicit non-wants (intentional non-features); rare in brownfield. STOP.
  4. index.yaml entry under arrows: with the taxonomy placement and the parent/children tree links chosen during reconciliation. A leaf segment carries parent (its grouping node, or null at the root level) and no children; each grouping (sub-HLD) node gets its own entry carrying its children list and no detail. The detail of a leaf points at its tree-mirrored arrow-doc path. At depth-2 every segment sits at the root level with parent: null and no children. Follow the schema in index-schema.md.

After all segments are generated, if no HLD exists:

  1. Skeleton HLD at docs/high-level-design.md — standard template (hld-template), bodies marked *(not yet specified)* rather than filled with placeholder content. If an HLD already exists, skip this step — never modify an existing HLD. STOP.

Phase 6 — Terminal Verification & Flesh-out Prompt

Before completing:

  • Ensure CLAUDE.md is configured. Invoke the /update-lid behavior (equivalent to running the update-lid skill), passing the mode that was determined from the invocation-time scope question. update-lid honors caller-provided mode and does not re-prompt. Result: LID directives block present, the ## LID block's - Mode: bullet set to the determined mode, arrow-navigation rows included (since the overlay is now installed), and a ## LID Tooling section scaffolded if a coherence script is to be declared. update-lid runs exactly once per /map-codebase invocation — at terminal verification, not during artifact generation.

  • Issue the flesh-out prompt. Direct the user to move into the linked-intent-dev workflow segment-by-segment to populate the skeleton LLDs and EARS specs. Without this prompt the user may leave reconstruction incomplete — and partial arrows propagate incoherence into future sessions. The flesh-out prompt is the terminal step; do not exit without issuing it.

Reference files

© jszmajda, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references) in plugins/arrow-maintenance/skills/map-codebase of jszmajda/lid.

  • SKILL.md
  • evals/evals.json
  • references/brownfield-bootstrap.md
  • references/reconciliation-template.md
  • references/skeleton-hld-template.md
  • references/subagent-sweep-prompt.md

Open the folder on GitHubat commit 831c195

Compare with similar skills

Map Codebase next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Map Codebase compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Map Codebase this skilljszmajda/lid105—~3.4kAutomated safety check: PassMIT
Vercel Composition Patternssupabase/supabase111k59 repos~726Automated safety check: PassMIT
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Typescript Advanced Typesrolling-scopes/rsschool-app10k25 repos~4.2kAutomated safety check: PassMPL-2.0
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • Official

    React composition patterns that scale. An agent skill from supabase/supabase.

    111k GitHub starsUsed in 59 repos~726 tokens
    DevelopmentAuto-check passed
  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Typescript Advanced Types

    rolling-scopes/rsschool-app

    Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.

    10k GitHub starsUsed in 25 repos~4.2k tokens
    DevelopmentAuto-check passed
  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Greploop

    onyx-dot-app/onyx

    Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.

    32k GitHub starsUsed in 4 repos~3.3k tokens
    DevelopmentAuto-check passed

More from jszmajda/lid

  • Audit coherence across an arrow of intent by running two parallel fresh Claude sessions — one reconstructs code from a single EARS, the other reconstructs the EARS from stripped code — then…

    105 GitHub stars~2.9k tokensUpdated 2 days ago
    Auto-check passed
  • Arrow Maintenance

    jszmajda/lid

    Navigation and audit overlay for linked-intent development. An agent skill from jszmajda/lid.

    105 GitHub stars~3.5k tokensUpdated 2 days ago
    Auto-check passed
  • Update Lid

    jszmajda/lid

    Configure or reconcile a project for linked-intent development (LID).

    105 GitHub stars~4.2k tokensUpdated 2 days ago
    Auto-check passed
  • Lid Coach

    jszmajda/lid

    Review a project's current linked-intent-development (LID) usage against LID's own principles and produce a prioritized report of recommendations for getting more out of the methodology.

    105 GitHub stars~13k tokensUpdated 2 days ago
    Auto-check passed
  • Linked Intent Dev

    jszmajda/lid

    Guide for linked-intent development (LID). An agent skill from jszmajda/lid.

    105 GitHub stars~5.3k tokensUpdated 2 days ago
    Auto-check passed

Categories

Questions about Map Codebase

What does Map Codebase do?

Bootstrap LID in an existing (brownfield) codebase. An agent skill from jszmajda/lid. Map Codebase is an agent skill from jszmajda/lid. Bootstrap LID in an existing (brownfield) codebase.

When should I use Map Codebase?

Map Codebase fits situations like: asked to map a codebase; bootstrap arrows; reverse-engineer the design; start LID on an existing project.

How do I install Map Codebase in Claude Code?

Run `npx skills add jszmajda/lid --skill map-codebase -a claude-code`. Or copy the skill folder (plugins/arrow-maintenance/skills/map-codebase in jszmajda/lid) into .claude/skills/map-codebase in your project. Claude Code loads it when a task matches its description.

How do I install Map Codebase in Codex?

Run `npx skills add jszmajda/lid --skill map-codebase -a codex`. Or copy the skill folder (plugins/arrow-maintenance/skills/map-codebase in jszmajda/lid) into .agents/skills/map-codebase in your project. Codex loads it when a task matches its description.

Can I use Map Codebase in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jszmajda/lid --skill map-codebase -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/map-codebase, .gemini/skills/map-codebase, .github/skills/map-codebase and .opencode/skills/map-codebase in your project.

What does Map Codebase need to run?

SKILL.md names no scripts, command-line tools or credentials: Map Codebase is instructions for the agent only.

Does Map Codebase access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Map Codebase safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Map Codebase use?

Map Codebase is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Map Codebase use?

About 3.4k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.7k tokens, read only when the agent opens those files.

What are the alternatives to Map Codebase?

Skills that share tags, products or a category with Map Codebase: Vercel Composition Patterns (supabase/supabase, 111k stars), Finishing a Development Branch (obra/superpowers, 296k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars) and PR Babysitter (openinterpreter/openinterpreter, 69k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Map Codebase?

jszmajda (a GitHub user) maintains it in jszmajda/lid, which has 105 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 6, 2026.

Source: jszmajda/lid on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.