skill-depot
Enables AI agents to semantically search and retrieve relevant skills from a local Markdown skill database, reducing context waste by loading only needed skills through tiered detail levels and tool calls.
README
skill-depot
RAG-based skill retrieval system for AI agents. Scalable long-term storage with semantic search via MCP.
skill-depot replaces the "dump all skill frontmatter into context" approach with selective, semantic retrieval. Agent skills are stored as Markdown files and indexed with vector embeddings — only the relevant skills are loaded when needed, keeping context lean.
✨ Features
- 🔍 Semantic Search — Find skills by meaning, not just keywords, using embedded vector search
- 🏠 Fully Local — No API keys, no cloud. Uses SQLite + sqlite-vec for storage and a local transformer model for embeddings
- 🤖 Agent-Agnostic — Works with Claude Code, Codex, OpenClaw, Gemini, and any MCP-compatible agent
- 📂 Two-Scope Storage — Global skills (
~/.skill-depot/) available everywhere, project skills (.skill-depot/) synced via git - ⚡ Auto-Discovery — Finds existing skills from your AI agents during setup
- 🔌 MCP Protocol — Integrates seamlessly as an MCP server with 9 tools for skill management
- 📊 Tiered Detail Levels — Three levels of detail (snippet → overview → full content) to minimize token usage
- 📈 Activity Scoring — Frequently used skills rank higher in search results automatically
- 🔗 Relation Tracking — Link related skills together so agents can discover connected knowledge
🚀 Quick Start
1. Initialize
npx skill-depot init
This will:
- Create the
~/.skill-depot/global directory - Scan for existing skills in Claude Code, Codex, OpenClaw directories
- Let you select which skills to import via an interactive checklist
- Download the embedding model (~80MB, one-time)
- Index all imported skills
2. Configure Your Agent
Add skill-depot to your agent's MCP configuration:
Claude Code (~/.claude/mcp.json):
{
"mcpServers": {
"skill-depot": {
"command": "npx",
"args": ["skill-depot", "serve"]
}
}
}
Codex / OpenClaw / Cursor: Add the same MCP server config in your agent's settings.
3. Use
Your agent now has access to these tools:
| Tool | Description |
|---|---|
skill_search |
Semantic search — accepts optional context for better relevance |
skill_preview |
Get a structured overview (headings + first sentences) without loading full content |
skill_read |
Load the full content of a skill |
skill_learn |
Learn something new — creates or appends to a skill (upsert) |
skill_save |
Save a new skill and index it |
skill_update |
Update an existing skill |
skill_delete |
Remove a skill |
skill_reindex |
Rebuild the search index |
skill_list |
List all indexed skills |
📖 How It Works
The Problem
Traditional agent skill systems load all skill file frontmatter into the agent's context window every session. With a large skill library, this wastes precious context on irrelevant information.
The Solution
skill-depot acts as a RAG layer for agent skills:
- Skills are stored as Markdown files with YAML frontmatter
- Each skill is embedded into a 384-dimensional vector using a local transformer model
- When an agent needs a skill, it searches by meaning — only the most relevant skills are returned
- Results include a
hasOverviewflag — agents can load a structured overview (skill_preview) or the full content (skill_read)
Tiered Detail Levels
skill-depot serves context at three levels of detail to minimize token usage:
| Level | Tool | What You Get | Typical Size |
|---|---|---|---|
| L0 — Snippet | skill_search |
200-char preview + metadata | ~200 chars |
| L1 — Overview | skill_preview |
Headings + first sentence per section | ~500-2000 chars |
| L2 — Full | skill_read |
Complete raw markdown | Unbounded |
Agents can progressively load detail — check the snippet, preview the outline, and only load full content when needed:
Agent → skill_search("deploy nextjs to vercel")
← [{ name: "deploy-vercel", score: 0.92, snippet: "...", hasOverview: true }, ...]
Agent → skill_preview("deploy-vercel")
← { overview: "## Steps\nInstall the Vercel CLI.\n\n## Configuration\nSet environment variables." }
Agent → skill_read("deploy-vercel")
← Full markdown content of the skill
Context-Aware Search
Pass an optional context parameter to skill_search for more relevant results. The context is combined with the query before generating the search embedding:
Agent → skill_search({ query: "deploy", context: "Next.js app with Vercel, fixing CI pipeline" })
← deploy-vercel ranks higher than deploy-aws because the context narrows the search
Agent Learning
Agents can save knowledge on the fly using skill_learn. If the skill doesn't exist, it's created. If it does, the new content is appended with a --- separator, and tags/keywords are merged automatically.
Agent → skill_learn({ name: "nextjs-gotchas", content: "API routes cache by default...", tags: ["nextjs"] })
← { action: "created" }
Agent → skill_learn({ name: "nextjs-gotchas", content: "Image optimization requires sharp...", tags: ["images"] })
← { action: "appended" } // tags merged: ["nextjs", "images"]
Storage Architecture
~/.skill-depot/ # Global (all projects)
├── config.json
├── models/ # Embedding model cache
├── skills/ # Global skill files
└── index.db # SQLite + vector index
<project>/.skill-depot/ # Project-level (git-synced)
├── skills/ # Project-specific skills
└── index.db # Project vector index (gitignored)
🛠️ CLI Reference
# Setup
skill-depot init # Interactive setup + agent discovery
skill-depot init --auto # Non-interactive, import everything
# Server
skill-depot serve --project . # Start MCP server (foreground/stdio)
skill-depot start --project . # Start as background daemon
skill-depot stop # Stop daemon
skill-depot status # Check daemon status
skill-depot restart # Restart daemon
# Skill Management
skill-depot add <file> # Add a skill file (project scope)
skill-depot add <file> --global # Add as global skill
skill-depot remove <name> # Remove a skill
skill-depot list # List all skills
skill-depot list --global # List global skills only
skill-depot search <query> # Search skills from CLI
# Maintenance
skill-depot reindex # Rebuild all indexes
skill-depot doctor # Health check
📝 Skill Format
Skills use standard YAML frontmatter + Markdown — the same format used by Claude Code, Codex, and other agents:
---
name: deploy-to-vercel
description: How to deploy a Next.js application to Vercel
tags: [deployment, vercel, nextjs]
keywords: [vercel cli, production build, environment variables]
related: [setup-env-vars, vercel-domains]
---
## Steps
1. Install the Vercel CLI: `npm i -g vercel`
2. Run `vercel` in the project root
3. Follow the prompts to link your project
...
🏗️ Tech Stack
| Component | Technology |
|---|---|
| Language | TypeScript (ESM) |
| Database | SQLite via better-sqlite3 |
| Vector Search | sqlite-vec extension |
| Embeddings | @xenova/transformers (all-MiniLM-L6-v2) |
| Fallback | BM25 term-frequency hashing |
| Protocol | MCP via @modelcontextprotocol/sdk |
| CLI | commander + inquirer + chalk + ora |
🤝 Contributing
Contributions are welcome! This is an open-source project.
# Clone and install
git clone https://github.com/your-username/skill-depot.git
cd skill-depot
pnpm install
# Development
pnpm dev # Watch mode build
pnpm test # Run tests
pnpm lint # Type check
pnpm build # Production build
📄 License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。