codekb-init

Initialize a CodeKB semantic knowledge base with hybrid vector and BM25 code indexing.

1|Updated Jun 27, 2026
One-click install
npx skills add https://github.com/TE-QuanBZhang/skills-pool --skill codekb-init-te-quanbzhang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codekb-init
Source: https://github.com/TE-QuanBZhang/skills-pool/tree/main/codekb/skills/codekb-init
Command: npx skills add https://github.com/TE-QuanBZhang/skills-pool --skill codekb-init-te-quanbzhang

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @yun918/codekb.

What problem does it solve? When starting work on an unfamiliar codebase, AI assistants lack project memory and cannot retrieve design decisions, business rules, or coding conventions. This Skill sets up a persistent, searchable knowledge base so AI tools can answer questions about the project. ## Core Features & Use Cases - Project Indexing: Runs codekb init to chunk code with tree-sitter and build a hybrid vector + BM25 retrieval index. - Knowledge Extraction: Optionally extracts initial knowledge entries stored in Git-managed codekb/knowledge/ files. - MCP Integration: Generates MCP server configuration so AI coding tools can query the knowledge base directly. - Use Case: You clone a large legacy repository and want your AI assistant to answer questions like "where is authentication handled" — run this Skill to index the codebase and wire up retrieval. ## Quick Start Ask the AI to initialize the CodeKB knowledge base for this project and verify the index status.

Frequently Asked Questions about codekb-init

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I initialize a semantic code knowledge base for my project?

Install the codekb CLI with npm install -g @yun918/codekb, then run codekb init in the project root. It creates the config, knowledge directory, and hybrid vector plus BM25 index, with optional initial knowledge extraction.

How do I connect a code knowledge base to my AI coding tool?

After initialization, add the printed MCP configuration to your AI tool, pointing the codekb MCP server at your project path via the CODEKB_PROJECT environment variable. The AI can then query indexed code and knowledge entries.

Does codekb require CodeGraph to work?

No, CodeGraph is optional. If a .codegraph directory exists, structural retrieval is enabled; otherwise codekb warns and continues with semantic and lexical retrieval channels only.

Is codekb init safe to run multiple times?

Yes, codekb init is idempotent. Re-running it rebuilds the index without destroying existing knowledge entries, since the index directory is gitignored while knowledge entries are committed to Git.

What happens if tree-sitter is not installed for code chunking?

Code chunking falls back to a heuristic method when the optional node-tree-sitter dependency is missing. AST-aware chunking is recommended but not required for the index to build.