kb-find
Read-only KB discovery with progressive 4-tier loading and --challenge mode for counter-evidence.
- License 许可
- MIT
- 最近更新
- 2026-04-09
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- kb-find
- effort
- medium
- description
- Read-only KB discovery with progressive 4-tier loading and --challenge mode for counter-evidence.
- argument-hint
- <query> [--challenge]
02 资源文件 1
- 脚本scripts/kb_loader.py16.4 KB
03 SKILL.md 正文
/kb-find
Progressive 4-tier KB discovery. Read-only.
Constraints
- NEVER Read
index.mdorconfig.json— kb_loader handles these; config auto-detects. - Combine reasoning + tool calls per turn. Batch parallel Bash/Read calls.
- Only Read individual concept
.mdfiles (Tier 2/3/4). - Global KBs (shown with
[read-only]badge in topic listing) are searchable but not writable. Treat them identically for discovery.
1. Input Parsing
Parse query from $0, strip flags. Two modes:
- Default: find concept notes matching query keywords.
--challenge: find content that contradicts or complicates the query. Score by contradiction potential. Include adjacent topics. Read 1-2 extra notes in Tier 3/4. Skip KB meta-topics unless query is about them.
2. Tier 1 — KB Loader Queries
KB_LOADER="${CLAUDE_SKILL_DIR}/scripts/kb_loader.py"
$KB_LOADER --list-topics— tree by@kb-namewith[skill]tags.- Pick relevant topics. Slash paths (
compact) or@kb-name/path. Challenge: also contradicting topics. $KB_LOADER --topic <path>per topic. All calls in one turn.- Build topic map:
{topic_name, notes[], children[], has_skill}.
--topic returns JSON (names/descriptions) for Tier 2 scoring. Empty list → report and stop.
3. Tier 2 — Frontmatter Scan
Skip if Tier 1 name+description clearly shows relevance → Tier 3/4. Only scan ambiguous notes.
- Read first 15 lines. Extract name, description, summary.
- Score relevance; promote if warranted. Cap 2-3 candidates.
4. Tier 3 — TOC Section Read
Skip to Tier 4 if no TOC or note is <100 lines.
- Read first 30 lines (frontmatter + TOC). If already read 15, use
offset=16, limit=15. - Read relevant sections ±1 adjacent.
- Follow relevant markdown links → Tier 2. Cross-KB links (
@kb-name/path) →--topic @kb-name/topic. - Follow soft references (lines starting with
see:followed by@kb/topic) →--topic @kb/topic. These are semantic hints to global KBs.
5. Tier 4 — Full Read
- Full read when no TOC or Tier 3 insufficient. Use
offsetto skip prior lines. - Cap 500 lines/note; note truncation. >10 notes → ask user to narrow.
- Follow relevant links → Tier 2.
6. Output
Return: ## Topic Map (paths), ## Relevant Concept Notes (path + title + content, label concept vs skill), ## Notes (caveats).
Challenge mode output: ## Topic Map, ## Counter-Evidence (path, strength, type, excerpt), ## Summary (1-3 sentences), ## Notes.
04 同仓库更多 Skills
kb-view
Opens the KB viewer in the browser. Starts a local HTTP server that renders all configured knowledge bases with working links, fuzzy search, and knowledge graph visualization.
kb-monitor
Monitors KB usage patterns and skill health. Activates when KB access tracking detects frequently-read content that could become a skill, or when user corrections suggest a skill is underperforming. Also triggers on `this isn't working right`, `this skill keeps getting X wrong`, `convert this to a skill`, or `what should become a skill`. Tracks cross-session observations via memory.
kb-mint
Mints skills from KB topics, packages skills into plugins, and prepares them for Cowork. Use when asked to create a skill from KB content, convert to a plugin, package for distribution, or make something cowork-ready. Also triggers on `convert this to a skill`, `package as plugin`, `mint a skill`, or `make this a plugin`.
kb-learn
Manages a personal knowledge base with learning tracking. Modes: (1) learn from articles, (2) learn about topics, (3) fix errors. Uses markdown links with relative paths for cross-references. Maintains a rolling changelog, validates links, and keeps a markdown-compatible knowledge base. When a note reaches ~500 lines, suggests /kb-compact.
kb-compact
Compacts KB directories — extracts legacy, unifies terminology, splits oversized notes, fixes indexes, reconciles with skill folders. Default: single directory. Use --deep for recursive bottom-up traversal.
kb-bootstrap
Sets up the knowledge base for a project. Creates the KB config, directory structure, and appends minimal instructions to the project's CLAUDE.md. Run this once when first using KB skills in a new project.