Agent skill

Codebase Handbook Builder

by Ruhan-Wang in Ruhan-Wang/Harness_Handbook

Generates, refreshes, validates and uses a compact handbook that maps where a change touches in a repository, using the active Codex session and no external LLM API.

Apache-2.0Auto-check passedAgent Workflows

Install Codebase Handbook Builder

skills CLI
$ npx skills add Ruhan-Wang/Harness_Handbook --skill build-codebase-handbook -a claude-code

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

GitHub CLI
$ gh skill install Ruhan-Wang/Harness_Handbook build-codebase-handbook --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/Ruhan-Wang/Harness_Handbook.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/build-codebase-handbook .claude/skills/build-codebase-handbook && 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
build-codebase-handbook
GitHub stars
332
Token cost
~2.2k tokens
SKILL.md length
992 words
Files
8 (incl. scripts, references)
Skills in repo
1
Repo updated
First seen
Licence
Apache-2.0

At a glance

Generates, refreshes, validates and uses a compact handbook that maps where a change touches in a repository, using the active Codex session and no external LLM API.

  • Works in 5 steps: Inventory before interpreting → Derive the behavioral map → Write the generated skill → …
  • Creating a navigation handbook for an unfamiliar repository
  • SKILL.md covers Choose the workflow, Use an existing handbook for a…, Build or refresh a handbook and Package this builder skill for…
  • Runs Python scripts from its folder; calls python3

What it does

Three modes are available. Build mode generates, refreshes or validates a handbook skill for a repository, task mode uses an existing handbook to route a concrete planning, coding, debugging, testing or review task, and combined mode builds first and then applies it. A handbook is only created on request, not because a normal coding task mentions a repository, and all analysis happens in the current session.

In task mode the agent reads the handbook's overview, routes through its index to the relevant stage pages and registers, checks `coverage.json` for freshness, then reads the real source at every cited path, since handbook prose is never authoritative. Explanation, diagnosis, planning and review stay read-only; requested changes are implemented and verified, and stale coverage hashes are reported unless you ask to keep the handbook in sync. Bundled scripts inventory the repository, compile coverage and validate the handbook.

When your agent uses it

  • Creating a navigation handbook for an unfamiliar repository
  • Locating every file a cross-cutting change will touch
  • Validating or refreshing a handbook after the code has changed
  • Reviewing a repository task with a handbook as a coverage checklist

Example prompts

  • “Build a handbook for this repository so we can plan the auth refactor.”
  • “Use the existing handbook to find everything that touches session handling before I change it.”
  • “Validate the handbook under .agents/skills and tell me which sections have gone stale.”

Requirements

  • Python, for the bundled scripts

Workflow steps

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

  1. Inventory before interpreting
  2. Derive the behavioral map
  3. Write the generated skill
  4. Compile complete coverage
  5. Validate and reconcile

What it can do on your machine

Read from SKILL.md and the folder at commit d913d8c. 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

    Ships 4 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    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

Codebase Handbook Builder loads about 2.2k tokens when it runs, and up to ~3.4k if it reads all its reference files. Until then it costs about 195 tokens; SKILL.md has 992 words of instructions outside code blocks.

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

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); the scripts in this folder are not scanned.

SKILL.md

The full file from Ruhan-Wang/Harness_Handbook at commit d913d8c, republished under its Apache-2.0 licence (© Ruhan-Wang). 992 words, ~2,213 tokens.

Download SKILL.mdSave it as .claude/skills/build-codebase-handbook/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
build-codebase-handbook
description
Generate, refresh, validate, or use a planner-ready handbook for a software repository. Use when Codex is asked to map or document a codebase, create a navigation skill, replace an API-backed handbook generator, update or validate an existing handbook, or use a handbook to locate, plan, implement, debug, test, or review a repository task—especially unfamiliar or cross-cutting work. Do not use when no handbook exists and the user only wants an ordinary code change without requesting one, for non-code research or writing, for API/product documentation lookup, or for an isolated edit whose exact file is already known and has no plausible repository-wide impact. Performs reasoning in the active Codex session and never requires an external LLM API key.

Build Codebase Handbook

Create or use a compact source-location index that helps Codex find every place a change touches. Use the active Codex session for analysis; do not call an LLM endpoint, API client, or API-backed generator.

Choose the workflow

Resolve this skill's directory from the selected SKILL.md and call it HANDBOOK_BUILDER_ROOT.

Choose one mode:

  • Task mode: Use an existing generated handbook to route a concrete planning, implementation, debugging, testing, explanation, or review task.
  • Build mode: Generate, refresh, or validate a handbook skill.
  • Combined mode: Build or refresh the handbook first, then use it for the task.

Do not generate a handbook merely because a normal coding task mentions a repository. Task mode requires an existing handbook or an explicit request to create/use one.

Use an existing handbook for a task

  1. Resolve the handbook named by the user or already selected by Codex. Otherwise inspect <source>/.agents/skills/*-handbook/SKILL.md, excluding this builder. If several match, choose by repository name and described scope; ask only when ambiguity would materially change the task.
  2. Read the generated handbook's SKILL.md completely. Read its references/overview.md, route through references/index.md, then load only the relevant stage pages and references/registers.md.
  3. Inspect references/coverage.json for freshness of the routed files. When useful, run this builder's validator. Treat validation failures as drift signals, not as permission to skip the user's task.
  4. Read the real source at every cited path and symbol. Search for callers, tests, configuration, and state readers/writers that may have changed since generation.
  5. Follow the user's requested action boundary:
    • For explanation, diagnosis, planning, or review, remain read-only.
    • For a requested change, implement it and verify it in proportion to risk.
    • For broad changes, use the handbook index and registers as a coverage checklist.
  6. If the task changes covered source, refresh the handbook only when the user asks to keep it synchronized or repository instructions require it. Otherwise report that its coverage hashes are now stale.

Never treat handbook prose as authoritative code text.

Build or refresh a handbook

Set the scope

Use:

  • Source root: the user's requested repository, otherwise the current repository.
  • Output: the user's requested path, otherwise <source>/.agents/skills/<repository-slug>-handbook.
  • Work directory: a task-specific temporary directory outside the output skill.
  • Language: the user's requested language, otherwise English.

Run the bundled utilities with Python 3.10 or newer. They use only the Python standard library, so this skill intentionally has no requirements.txt. If a future version adds a third-party import, add and package a pinned requirements.txt.

Make the generated folder independently shareable. Do not import code or templates from the source repository or this skill. Do not add a README, build log, scratch notes, or source snapshot.

If the output already exists, update it in place. Preserve useful hand-written content, inspect changes before overwriting, and never delete the whole folder as a shortcut.

1. Inventory before interpreting

Read applicable AGENTS.md files and repository instructions first.

Run:

bash
python3 "$HANDBOOK_BUILDER_ROOT/scripts/inventory.py" \
  --source-root "<source>" \
  --output "<work>/inventory.json"

Review the summary and skipped-file reasons. Add --exclude PATTERN for generated trees or project-specific noise. Never weaken the default secret and private-key exclusions.

Treat the inventory as the coverage contract. Do not silently omit an eligible file because it looks unimportant.

2. Derive the behavioral map

Inspect the actual source with repository search and targeted reads. Use the inventory to work in bounded batches.

Identify:

  1. Entry points and external inputs.
  2. Ordered runtime or build stages.
  3. Core domain logic and orchestration.
  4. State, configuration, persistence, queues, caches, and other registers.
  5. Boundaries such as APIs, CLIs, databases, providers, and subprocesses.
  6. Error, retry, cancellation, cleanup, and shutdown paths.
  7. Tests that establish contracts or exercise cross-stage behavior.

Group files by behavior and lifecycle, not merely by directory. Prefer 4–12 stages for a typical repository. A file must have one primary stage even when referenced from several pages.

For large repositories, analyze independent inventory slices concurrently with subagents when that capability is available. Give each agent only its file slice and request factual notes with exact paths and symbols. Reconcile their notes against the source yourself. Otherwise process the slices sequentially.

Show full SKILL.md (323 more words)Show less
3. Write the generated skill

Read references/handbook-format.md completely before creating or updating output files. Follow its required layout and schemas.

Create:

text
<output>/
├── SKILL.md
├── agents/openai.yaml
└── references/
    ├── overview.md
    ├── index.md
    ├── registers.md
    ├── stage-rules.json
    ├── coverage.json
    └── stages/<stage-id>.md

Write exact repository-relative paths and symbol names. Summarize behavior rather than copying source bodies. Never include credentials, environment values, private keys, or secret file contents.

The generated SKILL.md must tell future agents to use the handbook for routing, then inspect real source before planning or editing. The handbook is not ground truth for verbatim code.

4. Compile complete coverage

Express the primary file-to-stage assignment in references/stage-rules.json. Prefer narrow, non-overlapping glob rules; use exact path overrides for exceptions.

Run:

bash
python3 "$HANDBOOK_BUILDER_ROOT/scripts/compile_coverage.py" \
  --inventory "<work>/inventory.json" \
  --rules "<output>/references/stage-rules.json" \
  --output "<output>/references/coverage.json"

Fix unmatched files, overlapping rules, unknown overrides, and invalid stage IDs. Do not use a catch-all rule to conceal an incomplete architecture analysis.

5. Validate and reconcile

Run:

bash
python3 "$HANDBOOK_BUILDER_ROOT/scripts/validate_handbook.py" \
  --source-root "<source>" \
  --skill-dir "<output>"

Resolve every error. Review warnings and fix any that affect routing quality. Then:

  • Check that every stage page links from index.md.
  • Spot-check paths, symbols, lifecycle order, and register read/write claims against current source.
  • Review the output diff for accidental source excerpts or sensitive information.
  • Report the output path, eligible-file coverage, validation result, and any intentionally skipped categories.
Refresh an existing handbook

Re-run the inventory and validator first. Use stale hashes and new/deleted paths to identify affected stages. Re-read changed source, update those stage pages, then roll changes upward into registers.md, index.md, and overview.md. Recompile coverage and validate again.

Do not rewrite unaffected prose solely for stylistic consistency.

Package this builder skill for sharing

The builder carries its own Apache-2.0 LICENSE, so a ZIP remains licensed when detached from this repository. The repository has no NOTICE file to propagate.

Create a deterministic archive:

bash
python3 "$HANDBOOK_BUILDER_ROOT/scripts/package_skill.py" \
  --output "<destination>/build-codebase-handbook.zip"

The archive contains one top-level build-codebase-handbook/ directory and excludes caches, temporary files, existing archives, and VCS metadata. It includes requirements.txt automatically if one exists.

Do not assume the same Apache license applies to handbooks generated from someone else's repository. Before distributing a generated handbook, use the license and notices authorized by that repository's owner.

© Ruhan-Wang, Apache-2.0. 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 7 other files (scripts, references) in .agents/skills/build-codebase-handbook of Ruhan-Wang/Harness_Handbook.

  • SKILL.md
  • LICENSE
  • agents/openai.yaml
  • references/handbook-format.md
  • scripts/compile_coverage.py
  • scripts/inventory.py
  • scripts/package_skill.py
  • scripts/validate_handbook.py

Open the folder on GitHubat commit d913d8c

Compare with similar skills

Codebase Handbook Builder 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.

Codebase Handbook Builder compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Codebase Handbook Builder this skillRuhan-Wang/Harness_Handbook332—~2.2kAutomated safety check: PassApache-2.0
Acquire Codebase Knowledgegithub/awesome-copilot40k1 repos~2.3kAutomated safety check: PassMIT
ccc Semantic Code Searchcocoindex-io/cocoindex-code2.7k—~938Automated safety check: PassApache-2.0
Repomix Codebase Packeryamadashy/repomix29k—~1.3kAutomated safety check: NotesMIT
CodemapJordanCoin/codemap704—~1.8kAutomated safety check: PassMIT
Codebase SearchHelweg/open-codebase-index217—~1.3kAutomated safety check: PassMIT

Similar skills

  • Acquire Codebase Knowledge

    github/awesome-copilot

    Official

    Maps an unfamiliar codebase into seven evidence-backed documents in docs/codebase/, using a scan script and templates, for onboarding or architecture write-ups.

    40k GitHub starsUsed in 1 repo~2.3k tokens
    DevelopmentAuto-check passed
  • ccc Semantic Code Search

    cocoindex-io/cocoindex-code

    Semantic code search and index management with the ccc CLI: the agent initializes, indexes and queries the project by concept, filtering by language or path.

    2.7k GitHub stars~938 tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Repomix Codebase Packer

    yamadashy/repomix

    Packs a local directory or remote GitHub repository into one AI-friendly file with Repomix, then searches it to explore structure, find patterns and count tokens.

    29k GitHub stars~1.3k tokensUpdated 4 days ago
    Agent WorkflowsAuto-check: notes
  • Codemap

    JordanCoin/codemap

    Gives an agent a quick map of a codebase's structure, dependencies, changes and handoffs, and tunes per-project config so the output stays code-first.

    704 GitHub stars~1.8k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Codebase Search

    Helweg/open-codebase-index

    Chooses the right retrieval tool for code questions: compact context for unfamiliar repos, direct lookup for known symbols, call graphs for relationships and grep for exhaustive matches.

    217 GitHub stars~1.3k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Ripwire Subsystem Handoff

    redhat-et/ripwire

    Produces a short brief for handing a code subsystem to a teammate or fresh session, using ripwire to rank symbols, expand bodies and surface design docs.

    2.4k GitHub stars~1.8k tokensUpdated today
    Agent WorkflowsAuto-check: notes

Questions about Codebase Handbook Builder

What does Codebase Handbook Builder do?

Generates, refreshes, validates and uses a compact handbook that maps where a change touches in a repository, using the active Codex session and no external LLM API. Three modes are available. Build mode generates, refreshes or validates a handbook skill for a repository, task mode uses an existing handbook to route a concrete planning, coding, debugging, testing or review task, and combined mode builds first and then applies it.

When should I use Codebase Handbook Builder?

Codebase Handbook Builder fits situations like: creating a navigation handbook for an unfamiliar repository; locating every file a cross-cutting change will touch; validating or refreshing a handbook after the code has changed; reviewing a repository task with a handbook as a coverage checklist.

How do I install Codebase Handbook Builder in Claude Code?

Run `npx skills add Ruhan-Wang/Harness_Handbook --skill build-codebase-handbook -a claude-code`. Or copy the skill folder (.agents/skills/build-codebase-handbook in Ruhan-Wang/Harness_Handbook) into .claude/skills/build-codebase-handbook in your project. Claude Code loads it when a task matches its description.

How do I install Codebase Handbook Builder in Codex?

Run `npx skills add Ruhan-Wang/Harness_Handbook --skill build-codebase-handbook -a codex`. Or copy the skill folder (.agents/skills/build-codebase-handbook in Ruhan-Wang/Harness_Handbook) into .agents/skills/build-codebase-handbook in your project. Codex loads it when a task matches its description.

Can I use Codebase Handbook Builder 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 Ruhan-Wang/Harness_Handbook --skill build-codebase-handbook -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/build-codebase-handbook, .gemini/skills/build-codebase-handbook, .github/skills/build-codebase-handbook and .opencode/skills/build-codebase-handbook in your project.

What does Codebase Handbook Builder need to run?

Going by SKILL.md and its folder, Codebase Handbook Builder needs Python for the scripts in its folder and the command-line tools its instructions call (python3). Our summary lists: Python, for the bundled scripts.

Does Codebase Handbook Builder 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 Codebase Handbook Builder 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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Codebase Handbook Builder use?

Codebase Handbook Builder is published under the Apache-2.0 licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Codebase Handbook Builder use?

About 2.2k tokens (SKILL.md is roughly 8.9k 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 1.2k tokens, read only when the agent opens those files.

What are the alternatives to Codebase Handbook Builder?

Skills that share tags, products or a category with Codebase Handbook Builder: Acquire Codebase Knowledge (github/awesome-copilot, 40k stars), ccc Semantic Code Search (cocoindex-io/cocoindex-code, 2.7k stars), Repomix Codebase Packer (yamadashy/repomix, 29k stars) and Codemap (JordanCoin/codemap, 704 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Codebase Handbook Builder?

Ruhan-Wang (a GitHub user) maintains it in Ruhan-Wang/Harness_Handbook, which has 332 GitHub stars. The repository was last updated on August 11, 2026.

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