mcpbeat Sign in

Creating Kb Skill for Claude

Builds a portable, embedding-free knowledgebase from a set of files and delivers it as a self-contained `.skill` bundle (BM25 index + bundled searcher + query protocol). Use when a user wants to turn uploaded files, a folder, or a corpus into a searchable knowledgebase they can hand to any agent — phrased as "make a knowledgebase", "build a KB skill", "package these docs for retrieval", "create a searchable bundle", or references to a `.skill` KB. The output runs anywhere with Node or Python — no model, no install, no network. Distinct from `bm25` (ephemeral in-session search) and `building-github-index` (markdown project-knowledge index).

15k tokens
context cost
the whole folder, loaded on every use
8
files
ships runnable scripts
0
copies elsewhere
how many repositories repackaged it
137
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/oaustegard/claude-skills --skill creating-kb

The instruction itself

9 sections, as written by the author

creating-kb

Turn a pile of files into a portable, deployable knowledgebase. The output

is a .skill bundle — an ordinary zip — containing a BM25 inverted index, the

chunk text, a pure-Node searcher, and a query protocol. It has no embedding

model and no semantic search: retrieval is lexical, and the consuming agent

supplies the semantic layer by expanding the query at search time. That is what

makes the bundle portable — any agent that can run node can query it with no

npm install, no model download, and no network.

The whole toolchain is JavaScript so one implementation serves both this builder

and the in-browser packer. Build with the bundled script; do not hand-roll the

index.

SCRIPTS=/mnt/skills/user/creating-kb/scripts
node $SCRIPTS/build_lexkb.js CORPUS_DIR --out /tmp/kb --name my-kb --zip

Workflow

1. Gather the sources

Collect the files into one directory. In a Claude.ai chat, uploads land in

/mnt/user-data/uploads/ — point the builder there. Otherwise use any path the

user names. Supported extensions default to txt,md,html,htm; pass --ext to

change them.

This MVP interface is bounded by how many files a chat can accept. For a large

corpus, stage the files in a directory first, or use the browser packer (built

from the same scripts) that runs entirely client-side.

2. Build the bundle

SCRIPTS=/mnt/skills/user/creating-kb/scripts
node $SCRIPTS/build_lexkb.js /mnt/user-data/uploads \
  --out /tmp/kb --name my-kb --zip \
  --source "human description of the corpus"

The script chunks each file, builds the BM25 index, writes the bundle dir

(SKILL.md + search.js + index.json + chunks.jsonl), and — with --zip

emits my-kb.skill next to --out.

3. Deliver

Move the .skill to the outputs directory and give the user a download link:

cp /tmp/my-kb.skill /mnt/user-data/outputs/
[Download my-kb.skill](computer:///mnt/user-data/outputs/my-kb.skill)

Tell the user how to deploy it: unzip into an agent's skill directory (or upload

it as a skill). The bundle's own SKILL.md then drives querying — the consuming

agent reads it, expands each question into search terms, and runs the bundled

search.js. No further setup.

Choosing chunk size

The retrieval unit and the reasoning unit are decoupled, which makes chunk size a

low-stakes choice. search.py/search.js rank on the whole chunk (best

recall) but return only the query-densest passage of it by default

(--snippet, ~1200 chars), so a big chunk does not flood the consuming agent's

context with surrounding noise. Index for recall; the searcher handles signal.

--target-chars controls chunk size (whole paragraphs are packed up to the

target; --target-chars 0 makes each file one chunk). Lexical BM25 tolerates —

and on a real-corpus sweep slightly *preferred* — larger chunks than

embedding-based retrieval, because there is no vector to dilute: BM25 scores

individual term presence with length normalization, so a big chunk still ranks on

the exact terms it contains.

  • Default: --target-chars 0 (whole document). Best recall, fewest chunks;

the snippet return keeps reasoning context focused.

  • Long, multi-topic files where you want tighter citation units: 15004000.
  • 500 only if you need very fine-grained chunk ids and accept more chunks.

Verifying the bundle

Test before delivering. Run a query against the freshly built bundle and confirm

it returns sensible hits:

node /tmp/kb/search.js --query "a representative question" \
  --core "key term" --expand "synonym" --k 3

Each hit's text is the query-focused passage by default; add --snippet 0 to

inspect a full chunk.

search.js prints JSON {"hits": [...]}. Confirm the right chunks surface.

What ships in the bundle

| File | Role |

|---|---|

| SKILL.md | the query protocol the consuming agent follows (expand → search → cite) |

| search.js / search.py | equivalent BM25 + RM3 + metadata-filter searchers; return query-focused passages (matched sentences kept in neighbour context, merged); the agent runs whichever runtime it has |

| index.json | precomputed inverted index (postings, df, doc lengths, BM25 params) |

| chunks.jsonl | chunk text + structured metadata |

Both searchers are thin readers of the same neutral JSON index, so the bundle

runs in a Node-only or a Python-only consumer. Metadata stays structured (not

folded into the indexed text), which lets the consuming agent filter on it

(--filter section=blog, --filter date>=2025).

Scripts

  • scripts/build_lexkb.js — chunker + BM25 index builder + .skill writer.
  • scripts/search.js — the JS runtime searcher, copied verbatim into every

bundle. It owns the tokenizer; the builder imports it so index and queries

tokenize identically.

  • scripts/search.py — the Python runtime searcher, copied verbatim into every

bundle; a thin reader of the same neutral JSON index, parity-pinned to

search.js (identical results on a shared index).

  • scripts/zipstore.js — pure-JS ZIP-STORED writer (used by the builder; shared

with the in-browser packer).

  • scripts/bundle_SKILL.md — the query-side SKILL.md template written into each

bundle.

Other skills for the same job

different authors, same section of the catalogue
Skill Creator
by anthropics
vendor ×10

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

56k tokens scripts
Pufferlib
by ComeOnOliver
×3

This skill should be used when working with reinforcement learning tasks including high-performance RL training, custom environment development, vectorized parallel simulation, multi-agent systems, or integration with existing RL environments (Gymnasium, PettingZoo, Atari, Procgen, etc.). Use this skill for implementing PPO training, creating PufferEnv environments, optimizing RL performance, or developing policies with CNNs/LSTMs.

28k tokens scripts
Run Evals
by flutter
vendor ×2

Run evaluations for one, multiple, or all skills using the agent orchestration framework. Make sure to use this skill whenever the user asks to run evals, test a skill's performance, run benchmarks, or compare baseline versus with-skill execution.

2k tokens
LLM Application Dev Prompt Optimize
by ComeOnOliver
×2

You are an expert prompt engineer specializing in crafting effective prompts for LLMs through advanced techniques including constitutional AI, chain-of-thought reasoning, and model-specific optimizati

6k tokens
Nowait Reasoning Optimizer
by ComeOnOliver
×2

Implements the NOWAIT technique for efficient reasoning in R1-style LLMs. Use when optimizing inference of reasoning models (QwQ, DeepSeek-R1, Phi4-Reasoning, Qwen3, Kimi-VL, QvQ), reducing chain-of-thought token usage by 27-51% while preserving accuracy. Triggers on "optimize reasoning", "reduce thinking tokens", "efficient inference", "suppress reflection tokens", or when working with verbose CoT outputs.

8k tokens scripts
Evolving AI Agents
by Orchestra-Research
×1

Provides guidance for automatically evolving and optimizing AI agents across any domain using LLM-driven evolution algorithms. Use when building self-improving agents, optimizing agent prompts and skills against benchmarks, or implementing automated agent evaluation loops.

36k tokens
Context Manager
by lingxling
×1

Elite AI context engineering specialist mastering dynamic context management, vector databases, knowledge graphs, and intelligent memory systems.

2k tokens
Zach Seller Skill Creator
by zach22-1999
×1

亚马逊卖家专用的 skill 创建器(中文)。当用户想把一个亚马逊运营/自媒体/日常工作流程变成可复用的 skill 时使用。触发场景包括但不限于:用户说"我想做一个 skill""把这个流程变成 skill""帮我写个自动化""优化我已有的 skill""给这个工作流做个自动化",即使用户没用"skill"这个词,只要在描述"以后每次都这样做"的重复性工作时也应触发。本 skill 的核心差异:强制用户先回答 6 个业务问题(业务目标/过去做法/具体步骤/方法论/调用方式/期望输出)再进入创建流程,防止产出空洞 skill。Create new skills, improve existing skills, run evals and benchmarks — tailored for Amazon sellers with a Chinese-first workflow.

63k tokens scripts zh

How to use it

Copy the folder

Take oaustegard/creating-kb from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.

Install what it needs

The instructions reference npm. Without those the skill loads but fails at the first command.