knowledge-build

knowledge-build is a skill for Claude Code from rp1-run/rp1. It costs 25 tokens per session (3,063 once invoked), scanned A, original, Apache-2.0.

A tool for building and updating a structured knowledge base about a software project. It divides the work among parallel tasks and combines their findings into documents about the project's design, features, modules, and behavior.

In plain words
What is it for?
Use it to generate project documentation, map concepts and architecture, record features and interaction patterns, and track knowledge-base state.
Why use it?
It reduces the effort of understanding a large or unfamiliar codebase and keeps existing project knowledge updated while looking for missing information.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the rp1-base plugin — 20 skills, 17 agents, 1 hook shipped together

Good fit Use it to generate project documentation, map concepts and architecture, record features and interaction patterns, and track knowledge-base state.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rp1-run/rp1/knowledge-build
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.

Any agent
npx skills add rp1-run/rp1 --skill knowledge-build
Clone the repo
git clone --depth 1 https://github.com/rp1-run/rp1

Made for: Claude Code.

Or install rp1-base, the plugin that ships this one along with the rest of its 20 skills, 17 agents, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for knowledge-build

README.md
[![agentmods](https://agentmods.dev/badge/skills/rp1-run/rp1/knowledge-build.svg)](https://agentmods.dev/skills/rp1-run/rp1/knowledge-build)
Your own site
<a href="https://agentmods.dev/skills/rp1-run/rp1/knowledge-build"><img src="https://agentmods.dev/badge/skills/rp1-run/rp1/knowledge-build.svg" alt="Measured on agentmods" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,063 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00025 $0.03063
Opus 5 $0.00013 $0.01532
Sonnet 5 $0.00005 $0.00613
Haiku 4.5 $0.00003 $0.00306

Measured 8d ago against content hash c339e1c2663d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

knowledge-build 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 8d ago.

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.

plugins/base/skills/knowledge-build/SKILL.md · 335 lines

How it starts

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

Knowledge Build

§ROLE: KB orchestrator. Update kbRoot, not workRoot.

§CTX

  • Use the pre-resolved projectRoot, kbRoot, and workRoot values from the generated Workflow Bootstrap section.
  • KB outputs live under kbRoot:
    • index.md
    • concept_map.md
    • architecture.md
    • interaction-model.md
    • modules.md
    • patterns.md
    • features.md
    • state.json
    • meta.json
  • index.md is orchestrator-owned. Never delegate it.
  • state.json is shareable. meta.json is local-only and SHOULD be gitignored.
  • Exclude these paths from change scope and file hygiene:
    • node_modules/, .git/, build/, dist/, cli/dist/, target/, .next/, __pycache__/, vendor/, .venv/, .rp1/context/

§DO

  • Execute immediately. No approval loop.
  • Single pass. No refinement loop.
  • Treat this as an orchestrator, not a wrapper.
  • FULL means wide evidence collection, not blank-slate regeneration.
  • When prior KB exists, section agents MUST reconcile against it, even in FULL.
  • Section agents MUST also treat prior KB as incomplete and perform one explicit novelty scan for material knowledge absent from it.
  • Replace all placeholders with concrete values before dispatching child agents.
  • Spawn the 6 analysis agents in one parallel batch.
  • Wait patiently for child agents on the critical path. Do not declare them stalled after a short wait.
  • Keep user-visible output terse:
    1. Initial status line
    2. Sparse progress only when useful
    3. Final report or fatal error

§PROC

1. Detect Mode

  1. Use the pre-resolved directories. Create kbRoot if missing.
  2. If FEATURE_ID is non-empty:
    • Set MODE=FEATURE_LEARNING.
    • Search, in order:
      • {workRoot}/archives/features/{FEATURE_ID}
      • {workRoot}/features/{FEATURE_ID}
    • If neither exists: report the checked paths, stop.
    • Read:
      • requirements.md
      • design.md
      • field-notes.md if present
      • tasks.md
    • Extract FILES_MODIFIED from tasks.md implementation summaries. Accept patterns like **Files**: and **Files Modified**:.
    • If FILES_MODIFIED is empty: explain that feature learning needs a concrete file scope, stop.
    • Build FEATURE_CONTEXT with:
      • feature id
      • feature path
      • summarized requirements
      • architectural decisions
      • discoveries from field notes
      • implementation patterns
      • files_modified
    • Set:
      • FILE_SCOPE=FILES_MODIFIED
      • FILE_DIFFS={}
      • INITIAL_MESSAGE=Feature learning build for {FEATURE_ID}
  3. Else use git-driven mode:
    • Read {kbRoot}/state.json if it exists.
    • Get CURRENT_COMMIT via git rev-parse HEAD.
    • If no state.json:
      • Set MODE=FULL
      • FILE_SCOPE=[]
      • FILE_DIFFS={}
      • INITIAL_MESSAGE=First-time KB generation with parallel analysis (10-15 min)
    • Else read:
      • OLD_COMMIT=state.json.git_commit
      • REPO_TYPE=state.json.repo_type // "single-project"
      • repo_root + current_project_path from {kbRoot}/meta.json
      • Fallback: use state.json for those local fields only if meta.json is absent
    • If OLD_COMMIT == CURRENT_COMMIT:
      • Output KB is up-to-date (commit {CURRENT_COMMIT}). No regeneration needed. and stop
    • Build scoped changed-file list:
      • If REPO_TYPE=monorepo, run diff from repo_root and filter to current_project_path unless it is . or empty
      • Else diff the current repo normally
      • Drop excluded paths and obviously irrelevant binary/media files
    • If scoped change list is empty:
      • Update only git_commit in state.json
      • Keep all other fields unchanged
      • Output No in-scope changes. Updated commit reference ({OLD_COMMIT} -> {CURRENT_COMMIT}). and stop
    • Preserve the full scoped changed-file list as the evidence frontier in both FULL and INCREMENTAL.
    • Count changed files:
      • > 50 -> MODE=FULL
      • <= 50 -> MODE=INCREMENTAL
    • If MODE=FULL:
      • INITIAL_MESSAGE=Large change set ({N} files). Wide reconcile (10-15 min)
      • FILE_SCOPE=<scoped changed files>
      • Build FILE_DIFFS as path -> git diff OLD_COMMIT CURRENT_COMMIT -- path
    • If MODE=INCREMENTAL:
      • INITIAL_MESSAGE=Changes detected since last build ({OLD_COMMIT} -> {CURRENT_COMMIT}). Analyzing {N} changed files (2-5 min)
      • FILE_SCOPE=<scoped changed files>
      • Build FILE_DIFFS as path -> git diff OLD_COMMIT CURRENT_COMMIT -- path
  4. Print INITIAL_MESSAGE.

Read the full file on GitHub · 335 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. 8d ago First seen · 335 lines · 25 tokens per session scan A c339e1c2663d

Subscribe to this mod's changes

knowledge-build is a skill published in the GitHub repository rp1-run/rp1 (38 stars, last pushed yesterday), licensed Apache-2.0. It adds 25 tokens to every session and 3,063 once invoked, about $0.0001 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-30.