Second Brain AI Skill v2.0 (Repair Build)
A lightweight skill for working with a user-chosen Markdown knowledge base with controlled write operations and attribution requirements.
Requirements
- - Node.js >= 16.0.0
- Environment variable
SECOND_BRAIN_VAULT must be set explicitly - Optional: Frontmatter support (YAML)
- Optional: WikiLinks support INLINECODE1
Configuration
CODEBLOCK0
Safety Boundaries
- - Only operates within the configured vault path
- Write operations require INLINECODE2
- Append operations require
appended_by attribution
Tools
1. init_vault
Initialize a new vault with standard folder structure.
Input: INLINECODE4
2. capture_note
Create a new note.
Input:
CODEBLOCK1
3. append_note
Append content to an existing note with attribution.
Input:
CODEBLOCK2
Required: appended_by must identify who is appending.
4. search_notes
Search notes by keywords.
Input: INLINECODE6
5. find_related
Find notes related to a topic.
Input: INLINECODE7
6. get_backlinks
Get notes that link to a specific note.
Input: INLINECODE8
7. buildcontextpack
Build a context pack for agent consumption.
Input: INLINECODE9
8. suggest_links
Get smart link suggestions for a note.
Input: INLINECODE10
9. rebuild_index
Refresh index (currently returns skip status as SQLite is not implemented).
Input: INLINECODE11
Note Format
Standard frontmatter:
CODEBLOCK3
Append Attribution Format
When appending, the skill adds:
CODEBLOCK4
Limitations (Repair Build)
- - SQLite indexing is not implemented; uses file-based scanning
- No semantic/vector search
- No automatic link insertion
- No conflict detection
- Single vault only
Testing
CODEBLOCK5
第二大脑AI技能v2.0(修复版本)
一个轻量级技能,用于处理用户选择的Markdown知识库,具有受控写入操作和归属要求。
要求
- - Node.js >= 16.0.0
- 必须显式设置环境变量 SECONDBRAINVAULT
- 可选:Frontmatter支持(YAML)
- 可选:WikiLinks支持 [[笔记标题]]
配置
bash
export SECONDBRAINVAULT=/绝对/路径/到/你的/知识库
安全边界
- - 仅在配置的知识库路径内操作
- 写入操作需要 allowwrite: true
- 追加操作需要 appendedby 归属信息
工具
1. init_vault
使用标准文件夹结构初始化新知识库。
输入: { allow_write: true }
2. capture_note
创建新笔记。
输入:
json
{
allow_write: true,
title: 笔记标题,
content: 正文内容,
type: idea,
tags: [标签1, 标签2],
links: [相关笔记]
}
3. append_note
向现有笔记追加内容并记录归属信息。
输入:
json
{
allow_write: true,
title: 笔记标题,
content: 附加内容,
section: 更新记录,
appended_by: 代理名称
}
必填: appended_by 必须标识追加者身份。
4. search_notes
通过关键词搜索笔记。
输入: { query: 搜索词, limit: 5 }
5. find_related
查找与主题相关的笔记。
输入: { topic: 主题名称, limit: 5 }
6. get_backlinks
获取链接到特定笔记的所有笔记。
输入: { note_title: 目标笔记 }
7. buildcontextpack
构建供代理使用的上下文包。
输入: { topic: 主题, limit: 10 }
8. suggest_links
获取笔记的智能链接建议。
输入: { title: 笔记标题, limit: 5 }
9. rebuild_index
刷新索引(当前返回跳过状态,因为未实现SQLite)。
输入: {}
笔记格式
标准前置元数据:
yaml
id: 20260313
title: 笔记标题
type: idea
tags: [标签1, 标签2]
created: 2026-03-13
updated: 2026-03-13
status: active
追加归属格式
追加时,技能会添加:
markdown
追加记录
添加者:{appended_by}
添加时间:{timestamp}
{内容}
限制(修复版本)
- - 未实现SQLite索引;使用基于文件的扫描
- 无语义/向量搜索
- 无自动链接插入
- 无冲突检测
- 仅支持单个知识库
测试
bash
npm test