harvest
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHarvest
Harvest
Capture high-signal conversation knowledge into for reuse across sessions.
docs/notes/Terminology:is the skill name (the action of capturing knowledge). The second brain it builds belongs to the project — name itharvest, not "Harvest".[Project Name] Second Brain
将高价值对话知识捕获到目录中,以便在不同会话间复用。
docs/notes/术语说明:是技能名称(即捕获知识的操作)。它构建的第二大脑属于项目,命名为harvest,而非“Harvest”。[Project Name] Second Brain
When to Trigger
触发时机
Explicit request:
- "harvest", "/harvest"
- "harvest this", "harvest this conversation"
- "save this to second brain"
- "document this work", "capture this knowledge"
Natural breakpoints — AI may suggest (never auto-execute):
- Significant decision made
- Complex problem solved after multiple attempts
- Important lesson learned
- Discussion wrapping up with valuable content
We just [made a decision/solved X/learned Y].
Would you like me to update the second brain?Wait for user confirmation. Never auto-execute.
明确请求:
- "harvest"、"/harvest"
- "harvest this"、"harvest this conversation"
- "save this to second brain"
- "document this work"、"capture this knowledge"
自然断点——AI可建议(绝不能自动执行):
- 做出重大决策时
- 多次尝试后解决复杂问题时
- 学到重要经验时
- 讨论结束且内容有价值时
我们刚刚[做出了一项决策/解决了问题X/学到了经验Y]。
是否需要我更新第二大脑?等待用户确认,绝不能自动执行。
Non-Negotiables
不可违背规则
- Never auto-execute. Always wait for explicit user confirmation.
- Use template files as the single source of structure.
- Keep in frontmatter for smart merge.
context_id - Keep MOCs as index files: link to context anchors, do not duplicate full lesson content.
- Omit optional empty sections. Do not write empty headers or "None" placeholders.
- Keep behavior logic in this file; keep structure/manifest data in .
references/ - Use list-first formatting for context content. Use tables only for short, fixed-width, easy-to-scan fields.
- 绝不能自动执行,始终等待用户明确确认。
- 将模板文件作为结构的唯一来源。
- 在前置元数据中保留以实现智能合并。
context_id - 将MOC作为索引文件:链接到上下文锚点,不要复制完整的经验内容。
- 省略可选的空章节,不要写入空标题或“无”占位符。
- 行为逻辑保留在本文件中;结构/清单数据存放在目录下。
references/ - 上下文内容优先使用列表格式。仅在字段简短、固定宽度且易于扫描时使用表格。
Quick Start
快速开始
- Ensure exists (initialize when missing).
docs/notes/ - Run lesson review for this harvest run.
- Detect and check whether matching context file exists.
context_id - Create new context or smart-merge existing context.
- Update and related MOCs.
docs/notes/00-INDEX.md - Confirm created/updated files to user.
- 确保目录存在(若缺失则初始化)。
docs/notes/ - 针对本次Harvest运行进行经验回顾。
- 检测并检查是否存在匹配的上下文文件。
context_id - 创建新上下文或智能合并现有上下文。
- 更新及相关MOC文件。
docs/notes/00-INDEX.md - 向用户确认已创建/更新的文件。
Workflow
工作流程
Phase 1: Prepare
阶段1:准备
- Initialize second brain storage when is missing:
docs/notes/- Use references/initialization-manifest.md as the single source for initialization inventory.
- Follow idempotent behavior: create missing files/directories, preserve existing files unless explicit update is requested.
- Check then
AGENTS.md; if both exist or neither exists, ask user which file to append, then append section from references/agents-lessons-section.md.CLAUDE.md - Do not own or maintain template syntax in this skill. If
.baseis available, delegate default base-file creation toobsidian-basesusing references/bases-generation-spec.md.obsidian-bases
- Mandatory lesson review for this harvest run:
- Read when available.
docs/notes/00-INDEX.md - Scan when available.
docs/notes/mocs/lessons-learned.md - Apply matched lessons (tech, operation type, error pattern).
- Read
- 当目录缺失时初始化第二大脑存储:
docs/notes/- 以[references/initialization-manifest.md]作为初始化清单的唯一来源。
- 遵循幂等行为:创建缺失的文件/目录,除非明确要求更新,否则保留现有文件。
- 检查和
AGENTS.md;若两者都存在或都不存在,询问用户要追加到哪个文件,然后从[references/agents-lessons-section.md]追加内容。CLAUDE.md - 本技能不负责维护模板语法。若
.base可用,将默认基础文件的生成委托给obsidian-bases,使用[references/bases-generation-spec.md]。obsidian-bases
- 针对本次Harvest运行进行强制经验回顾:
- 若存在则阅读该文件。
docs/notes/00-INDEX.md - 若存在则扫描该文件。
docs/notes/mocs/lessons-learned.md - 应用匹配的经验(技术、操作类型、错误模式)。
- 若
Phase 2: Detect + Route
阶段2:检测与路由
- Build :
context_id- Prefer helper script (Python stdlib only, no third-party packages).
scripts/context_id.py - Default call: (or
python3 scripts/context_id.py --format jsonwhenpythonis unavailable).python3 - Stateless policy (no state file): env keys (/
OPENCODE_*_ID) -> optional*_ID-> generated--infer-latest-session.ctx-YYYYMMDDHHMMSS-<hex6> - Do not pass by default. Use it only when the user explicitly requests latest-session inference.
--infer-latest-session - If script is unavailable or fails, use inline fallback: first env var matching /
*SESSION*ID*/*CONVERSATION*ID*; otherwise generate*THREAD*ID*.ctx-YYYYMMDDHHMMSS-<hex6>
- Prefer helper script
- Look for .
docs/notes/contexts/<context_id>-*.md
| Condition | Action |
|---|---|
| Matching context file exists | Run Phase 4 (Smart Merge) |
| No matching context file | Run Phase 3 (New Context) |
| User rejects suggested filename | Ask for new slug and regenerate filename |
| User cancels confirmation | Stop without writing files |
- 生成:
context_id- 优先使用辅助脚本(仅使用Python标准库,无第三方依赖)。
scripts/context_id.py - 默认调用方式:(若
python3 scripts/context_id.py --format json不可用则使用python3)。python - 无状态策略(无状态文件):环境变量(/
OPENCODE_*_ID)→ 可选*_ID→ 生成--infer-latest-session。ctx-YYYYMMDDHHMMSS-<hex6> - 默认不传递参数,仅当用户明确请求最新会话推断时使用。
--infer-latest-session - 若脚本不可用或执行失败,使用内联回退方案:优先匹配/
*SESSION*ID*/*CONVERSATION*ID*的环境变量;否则生成*THREAD*ID*。ctx-YYYYMMDDHHMMSS-<hex6>
- 优先使用辅助脚本
- 查找文件。
docs/notes/contexts/<context_id>-*.md
| 条件 | 操作 |
|---|---|
| 存在匹配的上下文文件 | 执行阶段4(智能合并) |
| 无匹配的上下文文件 | 执行阶段3(新上下文) |
| 用户拒绝建议的文件名 | 询问新的slug并重新生成文件名 |
| 用户取消确认 | 停止操作,不写入任何文件 |
Phase 3: New Context
阶段3:新上下文
- Extract high-signal items: work, decisions (with rationale), unsolved, lessons, optional source notes.
- Use stable item IDs for merge safety: ,
D-*,Q-*.LL-* - Keep technical signal high: merge routine process/SOP chatter into one short note instead of many standalone decisions.
- If planning files (,
task_plan.md,findings.md) are present, capture medium-density snapshots (progress.md) into context content.conclusion + evidence + source note - Do not copy full planning files. Do not create Obsidian wikilinks to files outside .
docs/notes/ - Exclude harvest-process artifacts from captured knowledge (command menus, filename suggestion prompts, merge/update status lines, and other capture bookkeeping).
- Use stable item IDs for merge safety:
- Generate filename and confirm:
<context_id>-<topic-slug>.md
Found: [N] decisions, [N] unsolved, [N] lessons
Suggested: contexts/<context_id>-<topic-slug>.md
1. Use this 2. Change slug 3. Cancel- Create from references/context-template.md.
docs/notes/contexts/<filename>.md - Use when available for wikilinks/frontmatter/anchors.
obsidian-markdown - Update according to references/index-template.md:
docs/notes/00-INDEX.md- Recent Updates (top 5), Topics, Key Decisions, Open Questions, Recent Lessons, Stats.
- Manage MOCs:
- Lessons MOC: for error-related lessons (>15 min impact), ensure exists via references/lessons-learned-moc-template.md, then append links only.
docs/notes/mocs/lessons-learned.md - Topic MOC: when a topic appears in 3+ contexts without MOC, ask user first; create from references/moc-template.md after confirmation.
- Lessons MOC: for error-related lessons (>15 min impact), ensure
- Confirm:
✓ Created: contexts/<filename>.md
✓ Updated: 00-INDEX.md
✓ Updated: mocs/lessons-learned.md (when relevant)
✓ Created: mocs/<topic>.md (when relevant)- 提取高价值内容:工作内容、决策(含理由)、未解决问题、经验、可选的源笔记。
- 使用稳定的条目ID确保合并安全:、
D-*、Q-*。LL-* - 保持技术价值密度:将常规流程/SOP对话合并为一条简短笔记,而非多个独立决策。
- 若存在规划文件(、
task_plan.md、findings.md),将中等密度快照(progress.md)捕获到上下文内容中。结论+证据+源笔记 - 不要复制完整的规划文件。不要创建指向目录外文件的Obsidian维基链接。
docs/notes/ - 排除Harvest流程相关的 artifacts(命令菜单、文件名建议提示、合并/更新状态行及其他捕获操作记录)。
- 使用稳定的条目ID确保合并安全:
- 生成文件名并确认:
<context_id>-<topic-slug>.md
已提取:[N]项决策,[N]个未解决问题,[N]条经验
建议文件名:contexts/<context_id>-<topic-slug>.md
1. 使用此文件名 2. 修改slug 3. 取消- 基于[references/context-template.md]创建文件。
docs/notes/contexts/<filename>.md - 若可用,使用其生成维基链接/前置元数据/锚点。
obsidian-markdown - 根据[references/index-template.md]更新:
docs/notes/00-INDEX.md- 最近更新(前5条)、主题、关键决策、未解决问题、近期经验、统计数据。
- 管理MOC文件:
- 经验MOC:对于影响时间超过15分钟的错误相关经验,确保通过[references/lessons-learned-moc-template.md]存在,然后仅追加链接。
docs/notes/mocs/lessons-learned.md - 主题MOC:当某个主题出现在3个以上上下文但无对应MOC时,先询问用户;确认后基于[references/moc-template.md]创建。
- 经验MOC:对于影响时间超过15分钟的错误相关经验,确保
- 确认完成:
✓ 已创建:contexts/<filename>.md
✓ 已更新:00-INDEX.md
✓ 已更新:mocs/lessons-learned.md(若相关)
✓ 已创建:mocs/<topic>.md(若相关)Phase 4: Smart Merge
阶段4:智能合并
- Read the existing context file.
- Merge new items from current conversation.
| Section | Existing Topic | New Item |
|---|---|---|
| Decisions Made | Match by | Append |
| Still Unsolved | Match by | Append |
| Lessons Learned | Match by | Append |
| What We Worked On | Keep existing | Append |
| Source Notes | Merge by source note signature if duplicated | Append |
- Update frontmatter (, tags), keep
updatedunchanged.created - Update stats and recent updates.
00-INDEX.md - Update with links only when new error-related lessons were added.
mocs/lessons-learned.md - Confirm:
✓ Updated: contexts/<filename>.md
Changes: [added/updated/moved items]- 读取现有上下文文件。
- 合并当前对话中的新条目。
| 章节 | 现有主题 | 新条目 |
|---|---|---|
| 已做出的决策 | 优先按 | 追加 |
| 未解决问题 | 按 | 追加 |
| 学到的经验 | 优先按 | 追加 |
| 我们的工作内容 | 保留现有内容 | 追加 |
| 源笔记 | 按源笔记签名合并重复内容 | 追加 |
- 更新前置元数据(、标签),保留
updated字段不变。created - 更新中的统计数据和最近更新。
00-INDEX.md - 若添加了新的错误相关经验,仅更新中的链接。
mocs/lessons-learned.md - 确认完成:
✓ 已更新:contexts/<filename>.md
变更内容:[添加/更新/移动的条目]Content Quality Rules
内容质量规则
- Quality over quantity: concise, reusable, high-signal notes.
- One idea per bullet; include rationale for decisions.
- Keep content relevant for future reuse (3+ months horizon).
- Skip raw transcripts, dead ends without insight, and obvious process noise.
- Exclude harvest operational chatter: confirmation menus, summaries, and "how harvest processed this" narration unless it records a reusable lesson.
created/updated/skipped - Use stable IDs (,
D-*,Q-*) with anchored headings for merge-safe entries.LL-* - Prefer list-first sections for long text. Use tables only when each cell stays short (for example ).
ID | Question | Next - Avoid duplicate restatement: decision headings should carry title intent; item body should add why/impact.
- For lessons, default to compact triad (,
Issue,Root Cause); addFix/Guardrailonly when they provide non-obvious value.Apply When - Avoid repeating links on every item; prefer one section-level related MOC link.
Related - Omit low-signal metadata (,
Deadline) unless it materially changes follow-up decisions.Carry-Over - For carry-over items from prior sessions, label clearly and avoid presenting them as new outcomes.
- For planning-derived content, store medium-density snapshots () in context files; avoid external-file wikilinks outside
conclusion + evidence + source note.docs/notes/
Recommended section limits:
| Section | Requirement | Typical Size |
|---|---|---|
| Summary | Required | 1-2 sentences |
| What We Worked On | Required | 5-7 bullets |
| Decisions | Optional | up to 5 items |
| Still Unsolved | Optional | up to 3-5 items |
| Lessons Learned | Optional | up to 3 items |
| Source Notes | Optional | up to 3-5 items |
| Notes | Optional | short snippets only |
- 质量优先:简洁、可复用、高价值的笔记。
- 每个项目符号对应一个想法;决策需包含理由。
- 内容需对未来复用有价值(以3个月以上为视角)。
- 跳过原始转录、无洞见的死胡同和明显的流程噪音。
- 排除Harvest操作相关的对话:确认菜单、摘要、以及“Harvest如何处理此内容”的说明,除非这些内容记录了可复用的经验。
已创建/已更新/已跳过 - 使用稳定ID(、
D-*、Q-*)和锚定标题确保条目可安全合并。LL-* - 长文本章节优先使用列表格式。仅当每个单元格内容简短时使用表格(例如)。
ID | 问题 | 下一步 - 避免重复表述:决策标题应明确意图;条目正文补充原因/影响。
- 经验内容默认使用紧凑三元组(、
问题、根本原因);仅当解决方案/防护措施提供非显而易见的价值时才添加。适用场景 - 避免在每个条目上重复链接;优先使用章节级别的相关MOC链接。
相关 - 省略低价值元数据(、
截止日期),除非这些内容会实质性影响后续决策。待跟进 - 对于来自之前会话的待跟进条目,需明确标注,避免呈现为新成果。
- 对于来自规划文件的内容,在上下文文件中存储中等密度快照();避免创建指向
结论+证据+源笔记目录外文件的外部维基链接。docs/notes/
推荐章节限制:
| 章节 | 要求 | 典型规模 |
|---|---|---|
| 摘要 | 必填 | 1-2句话 |
| 我们的工作内容 | 必填 | 5-7个项目符号 |
| 决策 | 可选 | 最多5项 |
| 未解决问题 | 可选 | 最多3-5项 |
| 学到的经验 | 可选 | 最多3项 |
| 源笔记 | 可选 | 最多3-5项 |
| 备注 | 可选 | 仅简短片段 |
Integration
集成
Recommended: skill for enhanced Obsidian compatibility. Without it, AI may write files directly and suggest installation:
obsidian-markdownFor optimal Obsidian compatibility, consider installing obsidian-markdown skill:
npx skills add <obsidian-markdown-repo>Optional companion: for file generation.
obsidian-bases.base- This skill does not own syntax templates.
.base - When is available, delegate generation of default base files to that skill.
obsidian-bases - Keep desired base content in references/bases-generation-spec.md, not syntax templates.
.base - If is unavailable, skip
obsidian-basescreation and continue markdown-only harvest flow..base
Optional companion: for stronger in-progress capture.
planning-with-files- This skill remains fully functional without it.
- When available, this skill may consume planning outputs (,
task_plan.md,findings.md) as snapshot sources, then persist reusable knowledge intoprogress.md.docs/notes/contexts/ - Prefer provenance text over external links when planning files are outside Obsidian vault scope.
推荐:使用技能增强Obsidian兼容性。若未安装,AI可直接写入文件并建议安装:
obsidian-markdown为获得最佳Obsidian兼容性,建议安装obsidian-markdown技能:
npx skills add <obsidian-markdown-repo>可选配套工具:用于生成文件。
obsidian-bases.base- 本技能不负责语法模板。
.base - 若可用,将默认基础文件的生成委托给该技能。
obsidian-bases - 将所需基础内容存储在[references/bases-generation-spec.md]中,而非语法模板。
.base - 若不可用,跳过
obsidian-bases文件创建,继续仅使用Markdown的Harvest流程。.base
可选配套工具:用于增强进行中的内容捕获。
planning-with-files- 即使没有该工具,本技能仍可完全正常工作。
- 若可用,本技能可将规划输出(、
task_plan.md、findings.md)作为快照来源,然后将可复用知识持久化到progress.md目录中。docs/notes/contexts/ - 若规划文件在Obsidian库范围外,优先使用来源说明文本而非外部链接。
See Also
另请参阅
Use these files as references (single source for structure and formats).
- context-template.md
- moc-template.md
- index-template.md
- lessons-learned-moc-template.md
- bases-generation-spec.md
- agents-lessons-section.md
- initialization-manifest.md
- context_id.py
以下文件作为参考(结构和格式的唯一来源)。
- context-template.md
- moc-template.md
- index-template.md
- lessons-learned-moc-template.md
- bases-generation-spec.md
- agents-lessons-section.md
- initialization-manifest.md
- context_id.py