Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计异常

secondbrain-search-init第二脑搜索初始化

Agent Skill

secondbrain-search-init 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

612

周安装

26

GitHub Stars

12

下载量

214
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:secondbrain-search-init(第二脑搜索初始化)
来源仓库:https://github.com/sergio-bershadsky/ai
仓库路径:skills/secondbrain-search-init
安装命令:
npx skills add https://github.com/sergio-bershadsky/ai --skill secondbrain-search-init
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/sergio-bershadsky/ai --skill secondbrain-search-init

简介

secondbrain-search-init 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。

  • 它可协助基于关键词或上下文生成检索策略,筛选相关资源或内容,支持研究类任务的信息组织。
  • 通过 npx skills add 命令从指定仓库安装,具体用法请参考原始 README 和项目文档。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Initialize Semantic Search

Set up qmd semantic search for an existing secondbrain project.

Prerequisites

  1. Secondbrain project exists: Check for .claude/data/config.yaml
  2. qmd installed: Check with which qmd

Workflow

Step 1: Validate Environment

# Check secondbrain exists
ls .claude/data/config.yaml

# Check qmd installation
which qmd

If secondbrain not found:

No secondbrain project found in current directory.
Run `/secondbrain-init` to create a new project first.

If qmd not installed:

## qmd Not Installed

qmd is required for semantic search. Install it:

### Using Bun (Recommended)
bun install -g qmd

### Using npm
npm install -g qmd

After installation, run this skill again.

**Note:** First run will download ~1.5GB of embedding models.

Step 2: Check Existing Search

ls .claude/search/ 2>/dev/null

If search already initialized:

## Search Already Initialized

Search is already configured for this project.

**Index location:** .claude/search/
**Last indexed:** 2026-01-15 10:30

### Options

1. **Rebuild index** — Re-index all documents
   `/secondbrain-search-init --rebuild`

2. **Search now** — Start searching
   `/secondbrain-search "your query"`

3. **Check status** — View index statistics
   `qmd status`

Step 3: Create Search Configuration

Create .claude/search/ directory and qmd config:

mkdir -p .claude/search

Generate qmd.config.json in project root:

{
  "name": "{{project_name}}-secondbrain",
  "paths": ["docs"],
  "ignore": [
    "**/node_modules/**",
    "**/.vitepress/cache/**",
    "**/.vitepress/dist/**",
    "**/TEMPLATE.md"
  ],
  "indexDir": ".claude/search",
  "chunk": {
    "size": 800,
    "overlap": 0.15
  },
  "metadata": {
    "extractFrontmatter": true,
    "includeFileMetadata": true
  }
}

Step 4: Update.gitignore

Add search index to .gitignore (index should not be committed):

# Semantic search index (regenerate with /secondbrain-search-init)
.claude/search/
qmd.config.json

Step 5: Build Initial Index

Run initial indexing:

qmd index

Show progress:

## Building Search Index

Scanning docs/...
Found 47 documents

Indexing:
[████████████████████░░░░░░░░░░] 35/47 documents

Downloading models (first run only):
- embedding-gemma-300M... done
- qwen3-reranker... done

Building embeddings:
[██████████████████████████████] 47/47 documents

Index built successfully!
- Documents: 47
- Chunks: 312
- Index size: 2.4 MB
- Location: .claude/search/

Step 6: Register Hook (Optional)

Ask user if they want automatic index updates:

## Automatic Index Updates

Would you like to automatically update the search index
when documents are modified?

[x] Yes, add PostToolUse hook (Recommended)
    - Updates index incrementally on file changes
    - Adds ~0.5s to Write/Edit operations

[ ] No, I'll rebuild manually
    - Run `qmd index` or `/secondbrain-search-init --rebuild`

If yes, add hook to .claude/settings.local.json:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Write|Edit",
        "hooks": [
          {
            "type": "command",
            "command": "python3 \"${CLAUDE_PROJECT_DIR}/.claude/hooks/search-index-update.py\"",
            "timeout": 30000
          }
        ]
      }
    ]
  }
}

Copy hook script:

cp "${CLAUDE_PLUGIN_ROOT}/hooks/search-index-update.py" .claude/hooks/

Step 7: Show Summary

## Search Initialized Successfully!

**Project:** my-knowledge-base
**Documents indexed:** 47
**Index location:** .claude/search/

### Quick Start

Search your knowledge base:
/secondbrain-search "kubernetes deployment strategies"

Search with filters:
/secondbrain-search --entity=adrs "database"
/secondbrain-search --recent=30d "authentication"

### Index Management

Rebuild index:
qmd index --rebuild

Check status:
qmd status

View recent searches:
qmd history

### Automatic Updates

Index updates: Enabled (PostToolUse hook)
Documents in docs/ will be re-indexed on save.

Options

--rebuild

Force rebuild of entire index:

qmd index --rebuild

--no-hook

Skip adding the automatic update hook:

/secondbrain-search-init --no-hook

Troubleshooting

Models Download Stuck

If model download hangs:

# Clear cache and retry
rm -rf ~/.cache/qmd/models/
qmd index

Index Corruption

If search returns errors:

# Remove and rebuild
rm -rf .claude/search/
qmd index

Slow Indexing

For large document sets (>500 docs):

  • Initial indexing may take several minutes
  • Consider using --batch-size=50 for progress visibility

Related Skills

  • secondbrain-search — Search your knowledge base
  • secondbrain-init — Create new secondbrain project

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.32%
按下载量换算73

Claude

29.38%
按下载量换算63

Cursor

18.73%
按下载量换算40

Gemini CLI

9.4%
按下载量换算20

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills