plugins/base/skills/knowledge-build/SKILL.md
Orchestrates parallel KB generation using spatial analysis and a map-reduce architecture with incremental and feature-learning modes.
npx skillsauth add rp1-run/rp1 knowledge-buildInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
§ROLE: KB orchestrator. Update kbRoot, not workRoot.
projectRoot, kbRoot, and workRoot values from the generated Workflow Bootstrap section.kbRoot:
index.mdconcept_map.mdarchitecture.mdinteraction-model.mdmodules.mdpatterns.mdstate.jsonmeta.jsonindex.md is orchestrator-owned. Never delegate it.state.json is shareable. meta.json is local-only and SHOULD be gitignored.node_modules/, .git/, build/, dist/, cli/dist/, target/, .next/, __pycache__/, vendor/, .venv/, .rp1/context/FULL means wide evidence collection, not blank-slate regeneration.FULL.kbRoot if missing.FEATURE_ID is non-empty:
MODE=FEATURE_LEARNING.{workRoot}/archives/features/{FEATURE_ID}{workRoot}/features/{FEATURE_ID}requirements.mddesign.mdfield-notes.md if presenttasks.mdFILES_MODIFIED from tasks.md implementation summaries.
Accept patterns like **Files**: and **Files Modified**:.FILES_MODIFIED is empty: explain that feature learning needs a concrete file scope, stop.FEATURE_CONTEXT with:
files_modifiedFILE_SCOPE=FILES_MODIFIEDFILE_DIFFS={}INITIAL_MESSAGE=Feature learning build for {FEATURE_ID}{kbRoot}/state.json if it exists.CURRENT_COMMIT via git rev-parse HEAD.state.json:
MODE=FULLFILE_SCOPE=[]FILE_DIFFS={}INITIAL_MESSAGE=First-time KB generation with parallel analysis (10-15 min)OLD_COMMIT=state.json.git_commitREPO_TYPE=state.json.repo_type // "single-project"repo_root + current_project_path from {kbRoot}/meta.jsonstate.json for those local fields only if meta.json is absentOLD_COMMIT == CURRENT_COMMIT:
KB is up-to-date (commit {CURRENT_COMMIT}). No regeneration needed. and stopREPO_TYPE=monorepo, run diff from repo_root and filter to current_project_path unless it is . or emptygit_commit in state.jsonNo in-scope changes. Updated commit reference ({OLD_COMMIT} -> {CURRENT_COMMIT}). and stopFULL and INCREMENTAL.> 50 -> MODE=FULL<= 50 -> MODE=INCREMENTALMODE=FULL:
INITIAL_MESSAGE=Large change set ({N} files). Wide reconcile (10-15 min)FILE_SCOPE=<scoped changed files>FILE_DIFFS as path -> git diff OLD_COMMIT CURRENT_COMMIT -- pathMODE=INCREMENTAL:
INITIAL_MESSAGE=Changes detected since last build ({OLD_COMMIT} -> {CURRENT_COMMIT}). Analyzing {N} changed files (2-5 min)FILE_SCOPE=<scoped changed files>FILE_DIFFS as path -> git diff OLD_COMMIT CURRENT_COMMIT -- pathINITIAL_MESSAGE.{% dispatch_agent "rp1-base:kb-spatial-analyzer" %} Use the computed build inputs from the parent orchestrator.
FULL, INCREMENTAL, or FEATURE_LEARNING)FULLindex_files, concept_files, arch_files, interaction_files, module_filesrepo_typemonorepo_projectstotal_files_scannedindex_filesconcept_filesarch_filesinteraction_filesmodule_fileslocal_meta
Do not echo placeholder tokens.
{% enddispatch_agent %}repo_typemonorepo_projectslocal_meta.repo_rootlocal_meta.current_project_pathPATTERN_FILES = unique(concept_files + module_files)INTERACTION_FILES = unique(interaction_files)FILE_DIFFS{% dispatch_agent "rp1-base:kb-concept-extractor", background %} Use the parent-computed inputs.
concept_map.md
{% enddispatch_agent %}{% dispatch_agent "rp1-base:kb-architecture-mapper", background %} Use the parent-computed inputs.
architecture.md
{% enddispatch_agent %}{% dispatch_agent "rp1-base:kb-interaction-mapper", background %} Use the parent-computed inputs.
interaction-model.md
{% enddispatch_agent %}{% dispatch_agent "rp1-base:kb-module-analyzer", background %} Use the parent-computed inputs.
modules.md
{% enddispatch_agent %}{% dispatch_agent "rp1-base:kb-pattern-extractor", background %} Use the parent-computed inputs.
patterns.mdpatterns.md MUST stay <=150 lines
{% enddispatch_agent %}rp1-base:artifact-templates (read SKILL.md index, then read needed KB templates from templates/knowledge-base/).concept_map.mdarchitecture.mdinteraction-model.mdmodules.mdpatterns.mdarchitecture.md Mermaid diagram via rp1-base:mermaid.
{kbRoot}/concept_map.md{kbRoot}/architecture.md{kbRoot}/interaction-model.md{kbRoot}/modules.md{kbRoot}/patterns.mdindex.md directly from aggregated results plus measured line counts.{kbRoot}/index.md last.{kbRoot}/state.json with:
strategy=parallel-map-reducerepo_typemonorepo_projectsgenerated_atgit_commitfiles_analyzedlanguagesmetrics{kbRoot}/meta.json with:
repo_rootcurrent_project_pathmeta.json is local-only. Write it, but do not register it anywhere.Fatal errors:
FILES_MODIFIED in feature modeOn any fatal error:
User-visible output only:
Final report must include:
Knowledge Base Generated SuccessfullyFeature Learnings CapturedPartial KB Generated.rp1/context/knowledge-load neededtools
Plan and execute splitting a large PR or branch into a reviewable stacked PR sequence.
documentation
Ask about rp1 capabilities, discover skills, and get workflow guidance.
tools
Generate an evidence-grounded markdown walkthrough for a pull request.
development
Run a bounded, evidence-driven two-agent debate into a separate rp1 debate artifact with backend locks only.