Document a recently solved problem as a reusable solution. Use after completing work to capture problem, root cause, fix, and prevention. Not for planning or implementation — use after the fix is verified.
Step 5 of the connected pipeline: Capture → Plan → Work → Review → Compound.
This skill closes the knowledge loop. When a problem is solved, it documents the solution so future work can reference it. This is the mechanism that makes the system smarter over time.
Pipeline mode: If a plan file is provided as argument AND the file contains status: in YAML frontmatter, enforce pipeline state validation (read plan file sections, update status: done, append activity log entries).
Standalone mode: If no plan file is provided or the file lacks state machine fields, skip status transitions and activity log entries. Document the learning directly from user-provided input.
Activate when:
Read assets/solution-template.md for the solution document template and tagging guidelines.
If an issue file is provided, read it thoroughly — including all accumulated sections from prior pipeline steps:
## Context — initial problem analysis (from /capture-issue)## Research Notes — findings, patterns, constraints (from /plan-issue)## Implementation Notes — decisions, trade-offs, gotchas (from /work-on-task)## Activity — timestamped session logs (from /work-on-task)These sections contain the full history of the issue lifecycle. Use them to extract learnings.
If no issue file is provided, ask the user:
Choose the most appropriate category for docs/solutions/:
performance-issues/ — slow queries, memory leaks, scaling problemssecurity-issues/ — vulnerabilities, auth bugs, data exposurebuild-errors/ — dependency issues, compilation failures, CI problemsconfiguration-fixes/ — environment config, deployment issues, integration problemsIf none fit, create a new category directory.
Path: docs/solutions/<category>/<descriptive-slug>.md
Use the template from assets/solution-template.md. Follow the tagging guidelines in that file.
Evaluate whether this learning should be graduated to .github/agent-context.md — the curated project memory that every agent session reads at start.
Graduate when the learning reveals:
Don't graduate when the learning is:
docs/solutions/ is sufficient)When graduating, add to the appropriate section of agent-context.md:
### [Category]: [Brief finding]
[One-sentence summary. See docs/solutions/<file> for details.]
Curation check: If agent-context.md exceeds ~200 lines, review for stale entries — patterns that are no longer accurate, decisions that have been superseded, or gotchas that have been fixed. Remove or archive stale entries to keep the file compact and high-signal.
If working from a plan file, set status: done and append a final activity entry:
### YYYY-MM-DD HH:MM — Issue completed
- Learning documented: `docs/solutions/<category>/<file>.md`
- Agent context updated: [Yes/No]
- **Status:** Done
Confirm: "Learning documented at docs/solutions/<path>. Future agents will reference this when encountering similar problems."
Should trigger:
Should not trigger: