skills/harvest-context/SKILL.md
Context and artifact hub — extract, generate, and manage project context from sessions and codebase
npx skillsauth add Thomashighbaugh/opencode harvest-contextInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Unified entry point for extracting, generating, and managing project context. Each subcommand captures a different type of knowledge artifact, with a shared pattern of scanning existing state, checking for overlaps, and saving to the right location.
When invoked without arguments (/harvest-context), list the subcommands as plain text and ask the user to choose. Do NOT call hubMenu or any other tool — just output the list directly. Available operations: session, codebase, skill, agent, rule, command, memory, docs, decompose, context, compress, secondbrain, journal.
Directly invoke the matching subcommand. Print the reminder, then delegate to the corresponding skill or agent.
/harvest-context session — Extract Session ContextExtract decisions, patterns, and learnings from the current session.
Process:
Output: .opencode/state/harvest/session-{timestamp}.md + promotions to memory/notepad/wiki
Reminder:
Session: I'll review our conversation, extract key decisions, patterns, and learnings, then classify them for memory, notepad, or reusable artifacts.
/harvest-context codebase — Generate Codebase ContextRun deepinit to create/update hierarchical AGENTS.md documentation across the codebase.
Process:
<!-- MANUAL --> sections in existing filesDelegates to: deepinit skill
Output: Hierarchical AGENTS.md files across the codebase
Reminder:
Codebase: I'll generate hierarchical AGENTS.md documentation across your codebase, preserving any manual sections in existing files.
/harvest-context skill — Create a SkillCreate a reusable skill from session knowledge.
Process:
.opencode/skills/{name}/SKILL.md (project) or ~/.config/opencode/skills/{name}/SKILL.md (user)Delegates to: skill-creator skill for complex skills
Output: .opencode/skills/{name}/SKILL.md or ~/.config/opencode/skills/{name}/SKILL.md
Reminder:
Skill: I'll extract a repeatable workflow from our session, structure it as a skill with triggers and steps, and save it for future reuse.
/harvest-context agent — Create an AgentCreate a project-specific agent definition.
Process:
.opencode/agents/{name}.md (project) or ~/.config/opencode/agents/{name}.md (user)Delegates to: opencode-agent-creator skill
Output: .opencode/agents/{name}.md or ~/.config/opencode/agents/{name}.md
Reminder:
Agent: I'll define a specialized agent from our session's needs, including its role, instructions, and tool access.
/harvest-context rule — Create a Project RuleCreate a project rule in .opencode/rules/.
Process:
.opencode/rules/{name}.md.opencode/opencode.jsonc includes the rules pathOutput: .opencode/rules/{name}.md
Reminder:
Rule: I'll capture a convention or constraint from our session as a project rule that agents will automatically load.
/harvest-context command — Create a Slash CommandCreate a project slash command.
Process:
.opencode/commands/{name}.mdDelegates to: opencode-command-creator skill
Output: .opencode/commands/{name}.md
Reminder:
Command: I'll create a slash command that wraps a repeatable workflow, making it accessible with a single invocation.
/harvest-context memory — Promote to MemoryPromote session knowledge to durable project memory, notepad, or wiki.
Process:
.opencode/state/project-memory.json) — durable team knowledge.opencode/state/notepad.md) — high-signal context for next turnswiki skill) — persistent knowledge base articlesDelegates to: remember skill for classification, wiki skill for articles
Output: Updated memory/notepad/wiki files
Reminder:
Memory: I'll review what we've learned, classify it as project memory, session notes, wiki articles, or AGENTS.md updates, and save it to the right place.
/harvest-context docs — Fetch Library DocumentationFetch up-to-date documentation for any library, framework, or package using Context7 MCP.
Process:
.opencode/context/Delegates to: Context7 MCP (resolve-library-id + query-docs)
Usage:
/harvest-context docs react — General React documentation/harvest-context docs react hooks — React hooks topic/harvest-context docs next.js app router — Next.js App RouterOutput: Documentation content on screen, optionally saved to .opencode/context/
Reminder:
Docs: I'll fetch up-to-date official documentation for any library using Context7. Give me a library name and optional topic.
/harvest-context decompose — Decompose ConceptsBreak down concepts, problems, goals, or code into smaller actionable units.
Process:
Delegates to: planner agent
Output: Structured decomposition with units, dependencies, effort estimates, and recommended sequence
Reminder:
Decompose: I'll break down your concept, problem, or goal into smaller, independently actionable units with dependencies and effort estimates.
/harvest-context context — Manage Context FilesManage OpenCode context files for knowledge persistence and organization.
Process:
map: Scan workspace for harvestable summary files and show context structureharvest [path]: Convert summaries to permanent context files in MVI formatextract from <source>: Create context from documentation, URLs, or codeorganize <category>: Restructure flat files into function-based structurecompact <file>: Reduce verbose file to MVI format (under 200 lines)Usage:
/harvest-context context — Scan and show status/harvest-context context harvest — Convert summaries to context/harvest-context context extract from https://docs.example.com — Extract from URL/harvest-context context organize concepts/ — Organize by function/harvest-context context compact verbose.md — Compact a fileOutput: Context files in .opencode/context/ organized by function
Reminder:
Context: I'll manage your context files — harvest summaries, extract from docs, organize by function, or compact verbose files.
Every subcommand follows this pattern:
# Check for relevant prior artifacts
ls .opencode/state/harvest/ 2>/dev/null
ls .opencode/state/ideation/ 2>/dev/null
ls .opencode/state/orchestration/ 2>/dev/null
If overlapping artifacts exist, ask user: "Found prior harvest on [topic]. Use as context, overwrite, or skip?"
Load and execute the appropriate skill or inline process (see each subcommand above).
Write the output to the appropriate location:
| Subcommand | Save Location |
|------------|---------------|
| session | .opencode/state/harvest/session-{ts}.md + promotions |
| codebase | {directory}/AGENTS.md files across codebase |
| skill | .opencode/skills/{name}/SKILL.md or ~/.config/opencode/skills/{name}/SKILL.md |
| agent | .opencode/agents/{name}.md or ~/.config/opencode/agents/{name}.md |
| rule | .opencode/rules/{name}.md |
| command | .opencode/commands/{name}.md |
| memory | .opencode/state/project-memory.json, notepad.md, wiki articles |
| docs | On screen, optionally .opencode/context/ |
| decompose | On screen, optionally .opencode/context/ |
| context | .opencode/context/ organized by function |
✓ Harvested: {artifact type}
Saved to: {file path}
{Description of what was created}
Related:
- /ideation to plan next steps
- /orchestrate to execute a plan
For skill and agent, ask user about scope:
.opencode/skills/ or .opencode/agents/) — specific to this project, committed to VCS~/.config/opencode/skills/ or ~/.config/opencode/agents/) — available across all projectsDefault to project scope unless user specifies otherwise.
Before creating a new skill, agent, or rule, check if something similar already exists:
# Check for existing artifacts with similar names
ls .opencode/skills/*/SKILL.md 2>/dev/null
ls .opencode/agents/*.md 2>/dev/null
ls .opencode/rules/*.md 2>/dev/null
ls ~/.config/opencode/skills/*/SKILL.md 2>/dev/null
ls ~/.config/opencode/agents/*.md 2>/dev/null
If overlap found: "A similar '{name}' already exists at {path}. Update it, or create a new one with a different name?"
When invoked after /orchestrate, automatically scan:
.opencode/state/orchestration/ for completion reports.opencode/state/orchestration/progress/ for stage reports.opencode/state/orchestration/checkpoints/ for decision recordsExtract decisions, patterns, and lessons learned into the appropriate artifact type.
/ideation — Plan before you build/orchestrate — Execute with a specific patternremember skill — Classify and promote knowledgewiki skill — Persistent knowledge baseskill-creator skill — Deep skill creation guideopencode-agent-creator skill — Deep agent creation guidedocumentation
Agentic memory system for writers - track characters, relationships, scenes, and themes
documentation
LLM Wiki — persistent markdown knowledge base that compounds across sessions (Karpathy model)
tools
Use ONLY when the user explicitly says: 'use the skill web-to-markdown ...' (or 'use a skill web-to-markdown ...'). Converts webpage URLs to clean Markdown by calling the local web2md CLI (Puppeteer + Readability), suitable for JS-rendered pages.
testing
Structured visual QA verdict for screenshot-to-reference comparisons