harvest
Original:🇺🇸 English
Translated
1 scripts
Use when users ask to capture conversation decisions, problems, and lessons into persistent notes (e.g. 'harvest', '/harvest', 'save this to second brain', 'document this work').
6installs
Sourceshihyuho/skills
Added on
NPX Install
npx skill4agent add shihyuho/skills harvestTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →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
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 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.
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.
Workflow
Phase 1: Prepare
- 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
Phase 2: Detect + Route
- 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 |
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-* - 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)Phase 4: Smart Merge
- 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]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 |
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.
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