with one click
compound
// Capture knowledge from solved problems to prevent re-discovery. Creates searchable solution documents after non-trivial debugging, fixes, or investigations.
// Capture knowledge from solved problems to prevent re-discovery. Creates searchable solution documents after non-trivial debugging, fixes, or investigations.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | compound |
| description | Capture knowledge from solved problems to prevent re-discovery. Creates searchable solution documents after non-trivial debugging, fixes, or investigations. |
Capture knowledge from solved problems to prevent re-discovery. Creates searchable solution documents after non-trivial debugging, fixes, or investigations.
/compound [--category <category>] [--from-commit <hash>]
--category: Override auto-detected category (see categories below)--from-commit: Extract context from a specific commit instead of current state| Category | When to Use |
|---|---|
build-errors | Build/compile failures, dependency resolution |
test-failures | Test failures, flaky tests, fixture issues |
runtime-errors | Crashes, unhandled exceptions, unexpected behavior |
performance | Slow queries, memory leaks, optimization wins |
database | Migration issues, schema problems, query optimization |
security | Vulnerability fixes, auth issues, data exposure |
integration | API issues, third-party service problems, webhook failures |
deployment | CI/CD failures, environment issues, infrastructure |
logic-errors | Incorrect business logic, edge cases, race conditions |
When this skill is invoked:
Autonomy:
Quality:
Collect from the current session or recent git history:
If --from-commit is specified:
git show {hash} --stat
git log {hash} -1 --format="%B"
git diff {hash}^..{hash}
# Search existing solutions for similar problems
ls docs/solutions/
grep -r "{key_error_term}" docs/solutions/ || true
If a similar solution exists:
Directory structure:
docs/solutions/{category}/{YYYY-MM-DD}-{slug}.md
Template:
---
title: "{Descriptive title of the problem and fix}"
category: "{category}"
date: "{YYYY-MM-DD}"
tags: ["{tag1}", "{tag2}", "{tag3}"]
stack: ["{language}", "{framework}", "{tool}"]
severity: "{critical|high|medium|low}"
time_to_resolve: "{approximate time spent}"
---
# {Title}
## Problem
{What went wrong — include exact error message or symptom}
{exact error output or stack trace snippet}
## Root Cause
{Why it happened — be specific about the mechanism}
## Failed Attempts
{What was tried and why it didn't work — this saves the most future time}
1. **{Attempt 1}**: {Why it didn't work}
2. **{Attempt 2}**: {Why it didn't work}
## Solution
{What fixed it — include exact code changes}
```{language}
// Before
{old code}
// After
{new code}
{file_path} — {what changed}{How to avoid this in the future — config changes, linting rules, tests}
#### 4. Create Directory if Needed
```bash
mkdir -p docs/solutions/{category}
Present a summary:
Solution captured: docs/solutions/{category}/{date}-{slug}.md
Category: {category}
Tags: {tags}
Severity: {severity}
Summary: {one-line description}
$ /compound
Analyzing recent debug session...
Solution captured: docs/solutions/database/2025-01-15-prisma-enum-migration-failure.md
Category: database
Tags: prisma, migration, enum, postgresql
Severity: medium
Summary: Prisma enum migrations fail on PostgreSQL when adding values to
existing enums. Fix: use raw SQL migration with IF NOT EXISTS guard.
Use /compound after:
Don't use for: