/sdlc-knowledge-base:kb-ingest-bulk <glob|dir|file-list> [--library <path>] [--parallel <N>] [--extractor-model <id>] [--size-threshold <tokens>] [--retry-failed] [--clean]from sdlc-knowledge-base
Parallel map-reduce bulk ingest for large source sets into the knowledge base. Map phase dispatches read-only knowledge-extractor agents; Python routes extracts by target library file; reduce phase dispatches one agent-knowledge-updater per file. Resumable.
Ships in sdlc-knowledge-base. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Load a large source set into the knowledge base in parallel. Four phases: map (parallel extract) → route (Python) → reduce (parallel synthesis, one writer per file) → finalize (one rebuild + one log entry).
| Argument | Description |
|---|---|
<glob|dir|file-list> | Sources to ingest |
--library <path> | Target library, bypassing CLAUDE.md resolution (default: CLAUDE.md-resolved). For isolated testing / multi-library — see #209 |
--parallel <N> | Concurrency for map + reduce rounds (default 16, max 64) |
--extractor-model <id> | Map model (default claude-haiku-4-5) |
--size-threshold <tokens> | Per-file reduce size guard (default 200000) |
--retry-failed | Re-queue failed sources/targets from a prior run |
--clean | Remove library/.extracts/ after a successful run |
library_path: if --library given, use it; else read CLAUDE.md
## Knowledge Base section. Derive shelf_index_path = <library>/_shelf-index.md,
log_path = <library>/log.md, extracts_dir = <library>/.extracts.knowledge-extractor and agent-knowledge-updater agents are available.--parallel to [1, 64].Use this CLAUDE_PLUGIN_ROOT importlib loader block to import the
sdlc_knowledge_base_scripts.kb_ingest_bulk helpers. It is self-contained — no
other file needs to be opened.
python3 -c "
import sys, os, importlib.util, json
PLUGIN_ROOT = os.environ.get('CLAUDE_PLUGIN_ROOT', '')
SCRIPTS = os.path.join(PLUGIN_ROOT, 'scripts')
INIT = os.path.join(SCRIPTS, '__init__.py')
if os.path.isfile(INIT) and 'sdlc_knowledge_base_scripts' not in sys.modules:
spec = importlib.util.spec_from_file_location(
'sdlc_knowledge_base_scripts', INIT, submodule_search_locations=[SCRIPTS])
if spec and spec.loader:
mod = importlib.util.module_from_spec(spec)
sys.modules['sdlc_knowledge_base_scripts'] = mod
spec.loader.exec_module(mod)
from sdlc_knowledge_base_scripts.kb_ingest_bulk import (
discover_sources, build_bulk_manifest, load_manifest, save_manifest,
retry_failed, persist_extract, slug_for_source, mark_source_extracted,
mark_source_failed, route_extracts, format_extract_prompt,
format_reduce_prompt, ReduceDispatchRequest, mark_target_reduced,
mark_target_failed, summarize_run, write_log_entry, ExtractDispatchRequest
)
"
discover_sources(<spec>) → source list; build_bulk_manifest(...) (merge prior
manifest via load_manifest if present; retry_failed if --retry-failed);
save_manifest.knowledge-extractor with format_extract_prompt(...), up to N
concurrently (parallel Agent-tool calls). Capture each agent's JSON reply.persist_extract(extracts_dir, slug, json) then
mark_source_extracted; on error/invalid-JSON mark_source_failed.
save_manifest after each round.existing_files = set of *.md in the
library (excluding _shelf-index.md, log.md, _index.md, and anything under raw/).route = route_extracts(extracts, existing_files, size_threshold). Record each
route.targets entry into manifest["targets"] as pending with source_count
and is_new. Report route.oversized (skipped). save_manifest.agent-knowledge-updater with
format_reduce_prompt(ReduceDispatchRequest(...)), up to N concurrently. Exactly
one agent per file — never two agents on the same file.mark_target_reduced (success) or mark_target_failed (error).
save_manifest after each round.build_shelf_index.main([library_path]).
Directories listed in <library>/.kb-index-ignore (plus raw/) are excluded.
If it exits with code 2, the bulk-add safety rail refused the rebuild (>= 50
entries added and index >= 2x): neither _shelf-index.md nor log.md was
written. Show the user the per-directory breakdown (e.g. iso20022/: 412 added)
and re-run with --force only after the user confirms — never
automatically. Skip step 9 until the rebuild has actually succeeded.write_log_entry(log_path, "## [<date>] ingest-bulk\n" + summarize_run(manifest, route.oversized)).--clean, remove extracts_dir.A failed source drops out of routing; a failed target leaves its extracts on disk
for --retry-failed. Report all failures + oversized topics. Non-zero exit only if
nothing succeeded.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
16 skills in this plugin
/kb-audit-queryFilter and summarise the cross-library KB audit log. Reports confidentiality events (attribution drops, synthesis aborts, dispatcher failures, no-evidence markers, cross-library promotions) over a date range, by event type, and by source handle./kb-ingestIntegrate a new source into the project knowledge base. Wraps the agent-knowledge-updater agent. Source can be a local file path, a URL, or pasted content. The updater reads the source, classifies it, identifies which existing library files it touches, makes surgical updates or creates new files, rebuilds the shelf-index, and appends to log.md./kb-ingest-batchnpx claudepluginhub stevegjones/ai-first-sdlc-practices --plugin sdlc-knowledge-baseOther plugins' skills for the same job