본문으로 건너뛰기
cccskills
무료GitHub에 공개

creating-kb

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).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(8)

  • SKILL.md5.9 KB
  • CHANGELOG.md387 B
  • scripts/build_lexkb.js8.2 KB
  • scripts/bundle_SKILL.md5.8 KB
  • scripts/search.js13.5 KB
  • scripts/search.py16.1 KB
  • scripts/zipstore.js3.9 KB
  • test_parity.py4.4 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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: 1500–4000.
  • 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

FileRole
SKILL.mdthe query protocol the consuming agent follows (expand → search → cite)
search.js / search.pyequivalent BM25 + RM3 + metadata-filter searchers; return query-focused passages (matched sentences kept in neighbour context, merged); the agent runs whichever runtime it has
index.jsonprecomputed inverted index (postings, df, doc lengths, BM25 params)
chunks.jsonlchunk 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.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

GitHub repository access in containerized environments using REST API and credential detection. Use when git clone fails, or when accessing private repos/writing files via API.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oaustegard/claude-skills1542026년 10월 21일 업데이트

Decide which model, effort level, and cascade shape each subagent gets, and how to keep improvement loops safe (evaluator-as-selector, stop on regression). Routes on measured cost-per-completed-task rather than per-token price, because a tier's token count varies more by task shape than price varies across tiers. Covers per-model effort semantics, the concision lever, cascade preconditions, context handoff, and watching a subagent fan-out live. Use when choosing a subagent's model or effort, when choosing how to escalate a failed attempt, or when asked which model or effort a task should get. Grounded in a 2026-07 calibration, a 2026-08 coding-cost study, a 2026-09 seeded-bug repair battery, a 2026-10 Haiku 5.5 ladder priced per spawn, and a 2026-10 retry-versus-escalation ladder on 295 SWE-bench Verified tasks; Managed Agents API specifics are operational, not calibrated.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oaustegard/claude-skills1542026년 10월 21일 업데이트

Securely manages API credentials for multiple providers (Anthropic Claude, Google Gemini, GitHub). Use when skills need to access stored API keys for external service invocations.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oaustegard/claude-skills1542026년 10월 21일 업데이트

Guidance for asking clarifying questions when user requests are ambiguous, have multiple valid approaches, or require critical decisions. Use when implementation choices exist that could significantly affect outcomes.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oaustegard/claude-skills1542026년 10월 21일 업데이트

Pre-change blast-radius report for a symbol or file. Walks tree-sitting references, augments with a plain-text scan over non-parsed files (configs, plain docs), and clusters affected sites by feature (`_FEATURES.md`) or top-level package. Use when about to refactor, rename, or delete something in a repo you don't own — "what breaks if I change `validateUser`", "who calls this", "is this safe to remove", "where is this used", "blast radius", "impact analysis". This is the CONVERGENT pre-change risk skill — for "what is this repo?" use exploring-codebases; for "where is X?" use searching-codebases.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oaustegard/claude-skills1542026년 10월 21일 업데이트

Read Bluesky/ATProto without depending on Bluesky's AppView — interactions on a user's posts, thread replies, any repo's records, network-wide backlinks across every lexicon, an account's handle and PDS history, which collections are active network-wide, and layer-by-layer outage diagnosis. Use when bsky.app or the AppView is down or slow, when a Bluesky read returns timeouts or 5xx, when asked who liked/replied/quoted/reposted something, when pulling live Bluesky context cheaply, when reading records straight from a PDS, when asked who references a record or account anywhere on the network, whether an account has changed handle or migrated servers, or which lexicons and non-Bluesky apps are active on atproto. Complements browsing-bluesky, which routes everything through the AppView and fails when it does.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oaustegard/claude-skills1542026년 10월 21일 업데이트

oaustegard의 스킬 모두 보기

이 스킬의 문제 신고