From marvin
Capture knowledge — solutions, context docs, learnings, and principles. Use after fixing non-trivial bugs, creating context for AI, or discovering patterns worth preserving. Triggers: compound, document solution, capture fix, save solution, knowledge compound, document this, save this fix, context, create context, update context, build context, learn, save learning, remember this.
npx claudepluginhub ondrej-svec/heart-of-gold-toolkit --plugin marvinThis skill is limited to using the following tools:
Capture knowledge while context is fresh. Solutions, context docs, learnings — whatever you just discovered, structure it so it's findable and useful next time.
Coordinates parallel subagents to document recent problem solutions as structured Markdown with YAML frontmatter in docs/solutions/ for team knowledge retention.
Coordinates parallel subagents to document recently solved problems into searchable YAML-frontmatter Markdown files in docs/solutions/. Offers full research/cross-reference mode or lightweight single-pass.
Coordinates subagents to document recently solved problems into searchable YAML-frontmatter Markdown files in docs/solutions/ while context is fresh.
Share bugs, ideas, or general feedback.
Capture knowledge while context is fresh. Solutions, context docs, learnings — whatever you just discovered, structure it so it's findable and useful next time.
This skill MAY: read code/docs for context, write knowledge documents (solutions, context docs, learnings), update CLAUDE.md. This skill MAY NOT: edit application code, run tests, deploy, fix bugs. Knowledge capture only.
| Shortcut | Why It Fails | The Cost |
|---|---|---|
| "Skip duplicate check — I'll write a new doc" | Parallel docs drift and eventually contradict | Knowledge drift → wrong fix applied next time |
| "Skip frontmatter — it's just metadata" | Frontmatter IS the search index. Without it, the solution is unfindable. | Captured but never surfaced → wasted effort |
| "Good enough — I'll refine later" | You won't. Context is freshest NOW. | Incomplete doc → next person can't reproduce the fix |
| "Too trivial to document" | The "trivial" fix that took 30 minutes will take someone else 30 minutes too | Repeated debugging of known problems |
Entry: User invoked /compound — possibly after a fix, with a topic, or with no context.
Auto-detect capture type:
| Context | Capture Type | Output Location |
|---|---|---|
| Just fixed a bug, resolved an error | Solution | docs/solutions/{domain}/{topic}.md |
| Need to create/update AI context | Context doc | CLAUDE.md, ../knowledge/{topic}.md, or docs/ |
| Discovered a pattern or principle | Learning | CLAUDE.md or memory files |
If invoked after a fix: Scan conversation for what broke, what was investigated, what fixed it.
If invoked with a topic (e.g., /compound auth token refresh): Use as hint.
If unclear: Use AskUserQuestion with:
Repeated workflow friction counts as captureable knowledge. If the same clarification keeps happening during brainstorm, plan, work, or review, capture whether it belongs in repo doctrine or in reusable toolkit workflow guidance.
Exit: Capture type determined.
Entry: Capture type known.
WAIT — search before writing:
Search docs/solutions/, CLAUDE.md, ../knowledge/ for:
- Similar symptoms or component names
- Same error messages or topic
- Same root cause or pattern
If related content exists: Use AskUserQuestion (header: "Duplicate?", question: "Found related: {path}. Update existing or create new?") with options: "Update existing (Recommended)" (description: "Extend the existing doc — avoids parallel docs that drift") and "Create new" (description: "This is different enough to warrant a separate document").
Principle: update > create. Don't create parallel docs that drift.
After the duplicate check, apply capture heuristics:
related: frontmatter.In autonomous mode: make the capture decision using these heuristics, document the reasoning in the output. Skip AskUserQuestion for clear-cut cases (obvious duplicate → update, obvious novel → create).
Exit: Confirmed new or updating existing.
Entry: Duplicate check done.
Extract from conversation or user input:
Determine the right location:
| Type | When | Where |
|---|---|---|
| Project CLAUDE.md | Core conventions, rules for every session | Root CLAUDE.md |
| Knowledge file | Domain reference loaded on demand | ../knowledge/{topic}.md |
| Onboarding doc | Setup, architecture overview | docs/developers/ |
| Decision record | Why a specific decision was made | architecture/decisions/ |
../knowledge/ directory or skill docsExit: Knowledge extracted and structured.
Entry: Knowledge extracted, location determined.
Check the project's CLAUDE.md for a "Toolkit Output Paths" table. Use those paths if present, otherwise use defaults.
Output path: {solutions_path}/{domain}/{kebab-topic}.md
(Default solutions_path: docs/solutions/)
Domains: auth, database, scoring, frontend, backend, infrastructure, deployment, testing, integration, or create a new one.
---
title: "{Brief description of problem and fix}"
type: solution
date: YYYY-MM-DD
domain: {domain}
component: {specific component or service}
symptoms:
- "symptom 1"
- "symptom 2"
root_cause: "{one-line root cause}"
severity: low | medium | high | critical
related: []
---
# {Title}
## Problem
{What happened. Symptoms. How it manifested.}
## Root Cause
{Why it happened. The actual underlying issue.}
## Fix
{What resolved it. Specific code changes, config changes, or commands.}
## Prevention
{How to avoid this in the future. Tests, patterns, checks.}
## Related
- {Links to related solutions, ADRs, or documentation}
For CLAUDE.md: Keep concise. Tables for quick reference. Link to details. For knowledge files: 800-1200 words. What and why → how → pitfalls.
Exit: Document written.
Entry: Document written.
Verify:
Present:
Knowledge captured at {path}
Searchable by: {frontmatter keywords}
Use AskUserQuestion with:
If user selects "Capture more": Return to Phase 0.
Before delivering, verify:
/deep-thought:plan checks docs/solutions/ before planning. /marvin:review suggests /marvin:compound when it finds insights.