codebase-discovery

A guided analysis of an existing codebase that documents its domain, software structure, business rules, workflows, and important terms. It can also validate the findings through one-question-at-a-time interviews with a senior business analyst or product owner.

In plain words
What is it for?
Use it to analyse all or part of a repository, exclude selected files, resume or restart discovery, and save the resulting documentation under docs/.
Why use it?
It turns poorly documented code into onboarding material that new people can understand.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/dius/agent-toolkit/codebase-discovery
Any agent
npx skills add DiUS/agent-toolkit --skill codebase-discovery
Clone the repo
git clone --depth 1 https://github.com/DiUS/agent-toolkit

Made for: Claude Code, Codex.

Per session 107 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,837 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00107 $0.04837
Opus 5 $0.00053 $0.02419
Sonnet 5 $0.00021 $0.00967
Haiku 4.5 $0.00011 $0.00484

Measured yesterday against content hash a37a9a5b3cff, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

codebase-discovery scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/codebase-discovery/SKILL.md · 358 lines

How it starts

The opening of the file, as written. The whole thing — 358 lines — stays where its author put it; the contents beside it link to each section on GitHub.

User Input

$ARGUMENTS

You MUST consider the user input before proceeding (if not empty). It says what to analyse and how, either in plain words or with the options below.

Options

Each one pre-answers a question this skill would otherwise ask, or overrides something it would infer. All optional; absent means work it out as usual.

Argument Effect
full | code-only the mode (see Modes)
--exclude <globs> additional exclusions, gitignore syntax — see recon-heuristics
--output <dir> the output root, instead of agreeing it in Phase 0
--fresh start cold instead of resuming. Where a previous run exists, Phase 0 confirms first — a clean run discards its _discovery/ files (see Phase 0)
--on-drift <recon|full-recon|proceed|report> pre-answer the freshness check's question
--interview enter at Phase 2 and continue the interview queue

How to read them

  • Resolve the request, however it's phrased. These are a shorthand, not the interface: "skip the test projects, don't touch the docs site, and there's nobody to interview yet" must land on the same settings as the equivalent flags. Extract from prose, flags, or a mix.
  • Echo the resolved set back in one line before starting"code-only · excluding tests/* · output docs/discovery/ · drift → recon". There's no parser; the user needs to see what was understood.
  • Report anything you couldn't resolve; never guess. A silently dropped --exclude means reading a tree the user told you to leave alone, and "skip the old stuff" needs a question, not a decision.
  • An option means don't ask that question — state the value you were given and move on.
  • But no option authorises discarding existing work. It pre-answers a choice, not a deletion, so --fresh over a previous run still needs sign-off (see Phase 0).
  • Record the resolved options in discovery-state.md, so a resumed run reuses them.

Read the full file on GitHub · 358 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 358 lines · 107 tokens per session scan A a37a9a5b3cff

Subscribe to this mod's changes

codebase-discovery is a skill published in the GitHub repository DiUS/agent-toolkit (2 stars, last pushed yesterday), licensed MIT. It adds 107 tokens to every session and 4,837 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

render-artifact

Render a structured input (JSON or Markdown) into a paired HTML + DESIGN.md + meta.yaml artifact triple. Serves the result on loopback HTTP and opens a browser tab (unless running headless/remote). Invokes paperboard render via the atv-paperboard CLI.

All-The-Vibes/ATV-PaperBoard · 62 tokens

regenerate-artifact

3-step differentiated retry for a failing artifact slug: switch tier, drop optional components, fall back to default design. Invokes paperboard regenerate.

All-The-Vibes/ATV-PaperBoard · 35 tokens

validate-artifact

Run ENFORCE checks on a rendered artifact slug: Google design.md lint + HTML-side color-token trace. Reports ACCEPT or FAIL with failclass. Invokes paperboard validate.

All-The-Vibes/ATV-PaperBoard · 41 tokens

gallery

Regenerate the Paperboard Gallery — a local HTML index of all rendered artifact triples. Invokes paperboard gallery via the atv-paperboard CLI.

All-The-Vibes/ATV-PaperBoard · 34 tokens

impeccable-design

Bind agent-authored .DESIGN.md files to paperboard's design doctrine. Loads the impeccable anti-slop methodology (vendored, Apache 2.0, pinned to commit 4af581e23f17d112d8f9d6b7a5b7ff37823494e1) and the binding rules in core/designs/DESIGN-AUTHORITY.md. Read these BEFORE writing or editing any .DESIGN.md file.

All-The-Vibes/ATV-PaperBoard · 103 tokens

rulesync

Generates and syncs AI rule configuration files (.cursorrules, CLAUDE.md, copilot-instructions.md) across 20+ coding tools from a single source. Use when syncing AI rules, running rulesync commands, importing or generating rule files, or managing shared AI coding configurations.

dyoshikawa/rulesync · 64 tokens