harvest

📁 shihyuho/skills 📅 2 days ago
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_id in 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

  1. Ensure docs/notes/ exists (initialize when missing).
  2. Run lesson review for this harvest run.
  3. Detect context_id and check whether matching context file exists.
  4. Create new context or smart-merge existing context.
  5. Update docs/notes/00-INDEX.md and related MOCs.
  6. Confirm created/updated files to user.

Workflow

Phase 1: Prepare

  1. 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.md then CLAUDE.md; if both exist or neither exists, ask user which file to append, then append section from references/agents-lessons-section.md.
  2. Mandatory lesson review for this harvest run:
    • Read docs/notes/00-INDEX.md when available.
    • Scan docs/notes/mocs/lessons-learned.md when available.
    • Apply matched lessons (tech, operation type, error pattern).

Phase 2: Detect + Route

  1. Build context_id:
    • First env var that matches *SESSION*ID*, *CONVERSATION*ID*, or *THREAD*ID* (case-insensitive).
    • Fallback timestamp YYYYMMDDHHmmss.
  2. 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

  1. 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/.
  2. Generate filename <context_id>-<topic-slug>.md and confirm:
Found: [N] decisions, [N] unsolved, [N] lessons
Suggested: contexts/<context_id>-<topic-slug>.md
1. Use this  2. Change slug  3. Cancel
  1. Create docs/notes/contexts/<filename>.md from references/context-template.md.
  2. Use obsidian-markdown when available for wikilinks/frontmatter/anchors.
  3. Update docs/notes/00-INDEX.md according to references/index-template.md:
    • Recent Updates (top 5), Topics, Key Decisions, Open Questions, Recent Lessons, Stats.
  4. Manage MOCs:
  5. 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

  1. Read the existing context file.
  2. 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
  1. Update frontmatter (updated, tags), keep created unchanged.
  2. Update 00-INDEX.md stats and recent updates.
  3. Update mocs/lessons-learned.md with links only when new error-related lessons were added.
  4. 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 outside 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-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 into 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).