Produced by 43 COLLEGE KAIYU | v1.0
Review this conversation, extract valuable insights and knowledge, categorize them, and store them in the knowledge base.
On first use or when there is no config.json, read SETUP.md to complete initialization. The following workflow assumes the configuration is ready.
Execution Steps
Step 1: Load configuration
1. 读取 ${CLAUDE_SKILL_DIR}/config.json
→ 找不到?读 SETUP.md 引导用户完成初始化,然后回到这里
2. 确定参数:
- knowledge_base(默认当前工作目录)
- index_file(默认 _INDEX.md)
- file_prefix(默认 chat-)
- categories(有 → 模式 A 映射;无 → 模式 B 自动发现)
3. 告知用户:「将归档到 [knowledge_base 路径]」
Step 2: Scan existing files
Mode A: Glob scan each directory under categories for {file_prefix}*.md。
Mode B:ls first-level subdirectories → read each directory's index file (if any) → Glob scan **/{file_prefix}*.md。
Record the list of existing files for deduplication.
Step 3: Review the conversation and extract valuable content
Extract: knowledge and understanding, decision conclusions, patterns and methods, technical solutions, personal insights.
Filter: purely operational content, intermediate trial and error, conclusions that have been overturned, the skill modification process itself.
Step 4: Categorize
Mode A: From categories choose the best match. If it matches no category → use default_category, or ask the user.
Mode B: Determine based on the directory structure and index descriptions. If uncertain → list candidates for the user to choose.
Deduplicate: If the topic overlaps with an existing file → append rather than create a new one.
Step 5: Confirm with the user
本次对话提取了 N 条内容:
1. [新建] {file_prefix}xxx-YYYY-MM-DD.md → 目标目录/
摘要:一句话描述
确认写入?可调整分类、删除条目或补充遗漏。
Do not write automatically; wait for confirmation.
Step 6: Write
- New: Write to create
- Append: Read → Edit to append at the end (
---separator), update the date - Directory does not exist:
mkdir -pcreate
Step 7: Update the index file
If there is an index file → append an entry:- [文件名] - 一句话描述 (YYYY-MM-DD)
If there is no index file → skip; do not create one automatically.
Step 8: Report
Briefly list which files were created/modified and their paths.
File Naming
{file_prefix}[主题关键词]-[YYYY-MM-DD].md
主题关键词:英文小写,连字符分隔,2-4 个词
File Template
# [中文标题]
*来源:与 AI 的对话沉淀*
*日期:[YYYY-MM-DD]*
*对话主题:[本次对话的主要话题]*
## 背景
[1-2 句]
## 关键结论
- [结论 1]
- [结论 2]
## 详细内容
[按逻辑组织]
## 行动项
- [ ] [待办]
(没有则省略此节)
Special Cases
- No content worth archiving → directly say "there is no content that needs to be archived"
- Topic overlap → append to the end of the existing file
- Multiple topics → split into multiple files
Writing Principles
Distill conclusions; do not store the raw conversation. Write in Chinese, no emoji. Concise and direct; each file focuses on one topic.