harvest
29
总安装量
11
周安装量
#12880
全站排名
安装命令
npx skills add https://github.com/shihyuho/skills --skill harvest
Agent 安装分布
opencode
11
antigravity
11
github-copilot
11
codex
11
kimi-cli
8
Skill 文档
Harvest
Capture high-signal conversation knowledge into docs/notes/ for reuse across sessions.
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.
Non-Negotiables
- Never auto-execute. Always wait for explicit user confirmation.
- Use template files as the single source of structure.
- Keep
context_idin frontmatter for smart merge. - 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/.
Quick Start
- Ensure
docs/notes/exists (initialize when missing). - Run lesson review for this harvest run.
- Detect
context_idand check whether matching context file exists. - Create new context or smart-merge existing context.
- Update
docs/notes/00-INDEX.mdand related MOCs. - Confirm created/updated files to user.
Workflow
Phase 1: Prepare
- Initialize second brain storage when
docs/notes/is missing:- 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
AGENTS.mdthenCLAUDE.md; if both exist or neither exists, ask user which file to append, then append section from references/agents-lessons-section.md.
- Mandatory lesson review for this harvest run:
- Read
docs/notes/00-INDEX.mdwhen available. - Scan
docs/notes/mocs/lessons-learned.mdwhen available. - Apply matched lessons (tech, operation type, error pattern).
- Read
Phase 2: Detect + Route
- Build
context_id:- First env var that matches
*SESSION*ID*,*CONVERSATION*ID*, or*THREAD*ID*(case-insensitive). - Fallback timestamp
YYYYMMDDHHmmss.
- First env var that matches
- 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 |
Phase 3: New Context
- Extract high-signal items: work, decisions (with rationale), unsolved, lessons, optional source notes.
- Use stable item IDs for merge safety:
D-*,Q-*,LL-*. - If planning files (
task_plan.md,findings.md,progress.md) are present, capture medium-density snapshots (conclusion + evidence + source note) into context content. - Do not copy full planning files. Do not create Obsidian wikilinks to files outside
docs/notes/.
- Use stable item IDs for merge safety:
- Generate filename
<context_id>-<topic-slug>.mdand confirm:
Found: [N] decisions, [N] unsolved, [N] lessons
Suggested: contexts/<context_id>-<topic-slug>.md
1. Use this 2. Change slug 3. Cancel
- Create
docs/notes/contexts/<filename>.mdfrom references/context-template.md. - Use
obsidian-markdownwhen available for wikilinks/frontmatter/anchors. - Update
docs/notes/00-INDEX.mdaccording to references/index-template.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
docs/notes/mocs/lessons-learned.mdexists via references/lessons-learned-moc-template.md, then append links only. - 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)
Phase 4: Smart Merge
- Read the existing context file.
- Merge new items from current conversation.
| Section | Existing Topic | New Item |
|---|---|---|
| Decisions Made | Match by D-* first, update entry and preserve anchor |
Append |
| Still Unsolved | Match by Q-*; move resolved items to Decisions with trace |
Append |
| Lessons Learned | Match by LL-* first; merge same lesson and preserve anchor |
Append |
| What We Worked On | Keep existing | Append |
| Source Notes | Merge by source note signature if duplicated | Append |
- Update frontmatter (
updated, tags), keepcreatedunchanged. - Update
00-INDEX.mdstats and recent updates. - Update
mocs/lessons-learned.mdwith links only when new error-related lessons were added. - Confirm:
â Updated: contexts/<filename>.md
Changes: [added/updated/moved items]
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.
- Use stable IDs (
D-*,Q-*,LL-*) with anchored headings for merge-safe entries. - For lessons, include: what happened, root cause, solution, guardrail, apply-when.
- For carry-over items from prior sessions, label clearly and avoid presenting them as new outcomes.
- For planning-derived content, store medium-density snapshots (
conclusion + evidence + source note) in context files; avoid external-file wikilinks outsidedocs/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-7 items |
| Still Unsolved | Optional | up to 3-5 items |
| Lessons Learned | Optional | up to 3-5 items |
| Source Notes | Optional | up to 3-5 items |
| Notes | Optional | short snippets only |
Integration
Recommended: obsidian-markdown skill for enhanced Obsidian compatibility. Without it, AI may write files directly and suggest installation:
For optimal Obsidian compatibility, consider installing obsidian-markdown skill:
npx skills add <obsidian-markdown-repo>
Optional companion: planning-with-files for stronger in-progress capture.
- Harvest remains fully functional without it.
- When available, Harvest may consume planning outputs (
task_plan.md,findings.md,progress.md) as snapshot sources, then persist reusable knowledge intodocs/notes/contexts/. - Prefer provenance text over external links when planning files are outside Obsidian vault scope.
See Also
Use these files as references (single source for structure and formats).