repo-search by dandcg/claude-skills
npx skills add https://github.com/dandcg/claude-skills --skill repo-search使用 ChromaDB 向量嵌入对文档目录进行语义搜索。支持 Markdown、PDF、DOCX 和 XLSX 文件。检索相关片段而无需将整个文件加载到上下文中。专为"第二大脑"或个人知识库设计,但适用于任何文档集合。
.vectordb/ 目录,请运行 ingest)# 设置 Python 环境(一次性操作)
~/.claude/skills/repo-search/setup.sh
# 构建索引(从 brain 仓库根目录运行)
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/ingest.py /path/to/your/markdown-repo --verbose
# 增量更新(仅处理已更改的文件)
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/ingest.py /path/to/your/markdown-repo
# 完全重建
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/ingest.py /path/to/your/markdown-repo --force --verbose
查找与查询语义相关的内容:
# 基本搜索(返回前 10 个片段)
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb search "查询文本"
# 更多结果
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb search "查询文本" -k 20
# 按领域筛选
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb search "查询文本" --area finance
# JSON 输出(用于编程)
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb -f json search "查询文本" -k 5
Semantic search across a directory of documents using ChromaDB vector embeddings. Supports markdown , PDF , DOCX , and XLSX files. Retrieves relevant chunks without loading entire files into context. Designed for use with a "second brain" or personal knowledge base, but works with any collection of documents.
.vectordb/ directory exists)# Set up Python environment (one-time)
~/.claude/skills/repo-search/setup.sh
# Build the index (run from brain repo root)
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/ingest.py /path/to/your/markdown-repo --verbose
# Incremental update (only changed files)
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/ingest.py /path/to/your/markdown-repo
# Full rebuild
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/ingest.py /path/to/your/markdown-repo --force --verbose
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
结合语义相似度和 BM25 关键词匹配,以提高精确度,特别是在处理确切术语、名称或缩写时:
# 混合搜索(推荐用于大多数查询)
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb search "查询文本" --mode hybrid
# 仅关键词搜索(BM25)
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb search "确切短语" --mode keyword
搜索模式:semantic(默认)、hybrid(通过 Reciprocal Rank Fusion 实现向量 + BM25)、keyword(仅 BM25)。
检索某个领域的所有片段(适用于摘要生成):
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb area finance
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb area health -k 100
获取特定文件的所有片段:
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb file "areas/finance/index.md"
检索指定日期范围内的片段(用于时间线):
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb date-range 2025-01-01 2025-12-31
# 统计信息
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb stats
# 列出所有已索引的文件
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb list
# 清理孤立片段(针对已从磁盘删除的文件)
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb prune /path/to/your/markdown-repo
使用 --collection 管理不同语料库的独立索引:
# 将文档摄取到命名集合中
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/ingest.py /path/to/work-docs --collection work
# 搜索命名集合
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/work-docs/.vectordb --collection work search "查询"
默认集合名称为 brain。
适用于大型聚合任务(时间线、领域摘要、交叉分析):
"总结我的财务状况"的示例工作流:
# 步骤 1:以 JSON 格式获取所有财务相关片段
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb -f json area finance -k 100
# 步骤 2:读取 JSON 输出并使用 Claude 进行综合
# (Claude 在读取片段后会自然地执行此步骤)
大脑按以下领域组织:
areas → 业务、技术、健康、人际关系、财务、哲学、心理、职业、收入projects → 活跃项目decisions → 决策日志resources → 参考资料reviews → 每日/每周/每月反思outputs → 已完成的内容docs → 计划和设计文档#、##、### 边界)。每个片段都丰富了其标题链(例如 [标题 > 章节 > 子章节])和文档标题,以提供更好的嵌入上下文。all-MiniLM-L6-v2(ChromaDB 默认)。模型名称存储在集合元数据中。--mode hybridprune 命令删除已删除文件的片段每周安装次数
1
仓库
首次出现
1 天前
安全审计
安装于
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1
Find content semantically related to a query:
# Basic search (returns top 10 chunks)
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb search "query text here"
# More results
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb search "query text here" -k 20
# Filter by area
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb search "query text" --area finance
# JSON output (for programmatic use)
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb -f json search "query text" -k 5
Combines semantic similarity with BM25 keyword matching for better precision, especially with exact terms, names, or acronyms:
# Hybrid search (recommended for most queries)
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb search "query text" --mode hybrid
# Keyword-only search (BM25)
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb search "exact phrase" --mode keyword
Search modes: semantic (default), hybrid (vector + BM25 via Reciprocal Rank Fusion), keyword (BM25 only).
Retrieve all chunks for an area (useful for summarisation):
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb area finance
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb area health -k 100
Get all chunks for a specific file:
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb file "areas/finance/index.md"
Retrieve chunks within a date range (for timelines):
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb date-range 2025-01-01 2025-12-31
# Statistics
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb stats
# List all indexed files
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb list
# Prune orphaned chunks (for files deleted from disk)
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb prune /path/to/your/markdown-repo
Use --collection to manage separate indexes for different corpora:
# Ingest into a named collection
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/ingest.py /path/to/work-docs --collection work
# Search a named collection
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/work-docs/.vectordb --collection work search "query"
Default collection name is brain.
For large aggregation tasks (timelines, domain summaries, cross-cutting analysis):
Example workflow for "summarise my financial position":
# Step 1: Get all finance chunks as JSON
~/.claude/skills/repo-search/.venv/bin/python ~/.claude/skills/repo-search/query.py --db-path /path/to/your/markdown-repo/.vectordb -f json area finance -k 100
# Step 2: Read the JSON output and synthesise with Claude
# (Claude does this step naturally after reading the chunks)
The brain is organised into these areas:
areas → business, technical, health, relationships, finance, philosophy, mental, career, incomeprojects → Active initiativesdecisions → Decision logsresources → Reference materialreviews → Daily/weekly/monthly reflectionsoutputs → Finished contentdocs → Plans and design documents#, ##, ### boundaries). Each chunk is enriched with its heading chain (e.g. [Title > Section > Subsection]) and document title for better embedding context.all-MiniLM-L6-v2 (ChromaDB default). Model name is stored in collection metadata.--mode hybridprune command to remove chunks for deleted filesWeekly Installs
1
Repository
First Seen
1 day ago
Security Audits
Installed on
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
36,300 周安装
desloppify代码质量提升工具 - 自动化代码扫描与修复,提高代码严格性评分
3 周安装
API文档生成技能:OpenAPI规范、Swagger文档、团队协作与接口管理
6 周安装
OpenContext:AI助手持久化记忆与上下文管理工具 - 跨会话知识存储
10 周安装
ralph (Ouroboros) - 规范优先的AI开发工具:通过苏格拉底式提问和自主迭代,将模糊需求转化为清晰规范
11 周安装
Playwriter - 连接AI代理与Chrome浏览器的自动化工具,保留登录状态与扩展程序
11 周安装
Firebase Genkit:AI工作流编排与部署框架,支持多模型和RAG流水线
11 周安装