‹ 首页

setup-knowledge-base

@techwolf-ai · 收录于 1 周前

Interactive onboarding to create a structured knowledge base. Defines categories, scaffolds the directory structure, creates the index, and optionally imports initial content. Run this first before using /kb-answer or /kb-import.

适合你,如果需要为团队快速搭建一个分类清晰的知识库

/ 下载安装
setup-knowledge-base.skill双击,或拖进 Claude 桌面版 / Cowork,即完成安装↓ .skill↓ .zip
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
Claude Code~/.claude/skills/(项目级 .claude/skills/)
Codex CLI~/.codex/skills/
Cursor自动读取上面两处目录
其他工具见其文档的「skills」目录;两个下载是同一份文件,只是名字不同
/ 通过 npx 安装 校验哈希
npx oh-my-skill add techwolf-ai/ai-first-toolkit/setup-knowledge-base
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- techwolf-ai/ai-first-toolkit/setup-knowledge-base
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify techwolf-ai/ai-first-toolkit/setup-knowledge-base
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
90GitHub stars
~1.1K上下文体积 · 单文件
镜像托管

怎么用

技能原文 SKILL.md作者撰写 · MIT · 8b3107b

Knowledge Base Setup

Interactive setup that creates a structured, evidence-backed knowledge base in your project.

When to Use
  • Starting a new knowledge base from scratch
  • Adding a KB to an existing project
Step 1: Discover Purpose

Ask the user (one question at a time, use AskUserQuestion):

  1. What is this KB for? (e.g., product documentation, security/compliance, company knowledge, sales enablement, internal policies)
  2. Who will query it? (e.g., you personally, your team, AI agents answering questions)
  3. What categories make sense? Suggest 3-5 based on the domain, let the user adjust.

Example category suggestions by domain:

  • Product docs: technical, integrations, deployment, security, faq
  • Company knowledge: general, policies, processes, teams, faq
  • Sales enablement: product, competitive, customer-success, pricing, faq
  • Security/compliance: security, compliance, technical, general, faq
Step 2: Confirm Plan

Before creating anything, present the plan to the user:

I'll create this structure in your project:

kb/
  .kb-config.yaml
  index.md
  scopes/
    _default.yaml
    README.md
  {category1}/
  {category2}/
  {category3}/
scripts/
  kb-index.py
  kb-verify.py
  kb-validate.py
  kb-search.py
CLAUDE.md (or append to existing)

Ready to proceed?

Wait for user confirmation.

Step 3: Scaffold the KB

Read the template files from this plugin and adapt them for the user's project:

  1. Read templates/kb/.kb-config.yaml from this plugin. Create kb/.kb-config.yaml in the user's project, replacing the placeholder categories with the ones chosen in Step 1. Replace {{today}} with today's date.
  1. Read templates/kb/index.md from this plugin. Create kb/index.md, adding seed keywords for each chosen category. For example, if the user chose "security" and "technical", add initial keyword entries:

`` | encryption, certificates, access | security/ | | API, architecture, deployment | technical/ | ``

  1. Read templates/kb/scopes/_default.yaml from this plugin. Copy to kb/scopes/_default.yaml.
  1. Read templates/kb/scopes/README.md from this plugin. Copy to kb/scopes/README.md.
  1. Create empty directories for each chosen category: kb/{category1}/, kb/{category2}/, etc.
  1. Read scripts/kb-index.py from this plugin. Copy to scripts/kb-index.py in the user's project.
  1. Read scripts/kb-verify.py from this plugin. Copy to scripts/kb-verify.py in the user's project.
  1. Read scripts/kb-validate.py from this plugin. Copy to scripts/kb-validate.py in the user's project.
  1. Read scripts/kb-search.py from this plugin. Copy to scripts/kb-search.py in the user's project.
Step 4: Create Project CLAUDE.md

Read templates/CLAUDE.md from this plugin. Create (or append to existing) CLAUDE.md in the user's project root. Replace {{category}} placeholders with the actual categories chosen in Step 1.

Step 5: Populate from Sources

The KB structure is ready, but empty. Ask the user:

"Do you have existing knowledge sources you'd like to import? (Notion pages, Slack channels, Confluence, local files)"

  • If yes: run /kb-refresh to populate the KB from those sources. It handles source discovery, scraping, and entry creation.
  • If no or skip: create one example entry in the first category to demonstrate the format. Read templates/kb/example/sample-entry.md from this plugin for the format, but write an entry relevant to the user's domain rather than copying the sample.
Step 6: Verify

Run the index script to confirm everything is wired up:

python3 scripts/kb-index.py

Regenerate the "All Files by Category" section of kb/index.md from the current entries:

python3 scripts/kb-index.py --write

Validate KB health (frontmatter, categories, related links):

python3 scripts/kb-validate.py

If kb-index.py lists the entries and kb-validate.py reports "All entries valid", setup is complete.

Step 7: Summary

Tell the user:

  • What was created and where
  • How to add new entries (create .md files with YAML frontmatter in the right kb/{category}/ folder; nested sub-folders like kb/security/access/ are supported)
  • How to query the KB (/kb-answer)
  • How to import documents or bulk-import a directory (/kb-import)
  • How to add more sources or refresh existing ones (/kb-refresh)
  • How to list all entries (python3 scripts/kb-index.py)
  • How to search (python3 scripts/kb-search.py "keyword")
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。