Transform session learnings into permanent capabilities (skills, rules, agents). Use when asked to "improve setup", "learn from sessions", "compound learnings", or "what patterns should become skills".
npx skills add https://github.com/vibeeval/vibecosystem --skill compound-learnings
Transform ephemeral session learnings into permanent, compounding capabilities.
# List learnings (most recent first)
ls -t $CLAUDE_PROJECT_DIR/.claude/cache/learnings/*.md | head -20
# Count total
ls $CLAUDE_PROJECT_DIR/.claude/cache/learnings/*.md | wc -l
Read the most recent 5-10 files (or specify a date range).
For each learnings file, extract entries from these specific sections:
| Section Header | What to Extract |
|----------------|-----------------|
| ## Patterns or Reusable techniques | Direct candidates for rules |
| Takeaway: or Actionable takeaway: | Decision heuristics |
| ## What Worked | Success patterns |
| ## What Failed | Anti-patterns (invert to rules) |
| ## Key Decisions | Design principles |
Build a frequency table as you go:
| Pattern | Sessions | Category |
|---------|----------|----------|
| "Check artifacts before editing" | abc, def, ghi | debugging |
| "Pass IDs explicitly" | abc, def, ghi, jkl | reliability |
Before counting, merge patterns that express the same principle:
Example consolidation:
→ All express: "Observe outputs before editing code"
Use the most general formulation. Update the frequency table.
Critical step: Look at what the learnings cluster around.
If >50% of patterns relate to one topic (e.g., "hooks", "tracing", "async"):
→ That topic may need a dedicated skill rather than multiple rules
→ One skill compounds better than five rules
Ask yourself: *"Is there a skill that would make all these rules unnecessary?"*
For each pattern, determine artifact type:
Is it a sequence of commands/steps?
→ YES → SKILL (executable > declarative)
→ NO ↓
Should it run automatically on an event (SessionEnd, PostToolUse, etc.)?
→ YES → HOOK (automatic > manual)
→ NO ↓
Is it "when X, do Y" or "never do X"?
→ YES → RULE
→ NO ↓
Does it enhance an existing agent workflow?
→ YES → AGENT UPDATE
→ NO → Skip (not worth capturing)
Artifact Type Examples:
| Pattern | Type | Why |
|---------|------|-----|
| "Run linting before commit" | Hook (PreToolUse) | Automatic gate |
| "Extract learnings on session end" | Hook (SessionEnd) | Automatic trigger |
| "Debug hooks step by step" | Skill | Manual sequence |
| "Always pass IDs explicitly" | Rule | Heuristic |
| Occurrences | Action |
|-------------|--------|
| 1 | Note but skip (unless critical failure) |
| 2 | Consider - present to user |
| 3+ | Strong signal - recommend creation |
| 4+ | Definitely create |
Present each proposal in this format:
---
## Pattern: [Generalized Name]
**Signal:** [N] sessions ([list session IDs])
**Category:** [debugging / reliability / workflow / etc.]
**Artifact Type:** Rule / Skill / Agent Update
**Rationale:** [Why this artifact type, why worth creating]
**Draft Content:**
\`\`\`markdown
[Actual content that would be written to file]
\`\`\`
**File:** `.claude/rules/[name].md` or `.claude/skills/[name]/SKILL.md`
---
Use AskUserQuestion to get approval for each artifact (or batch approval).
# Write to rules directory
cat > $CLAUDE_PROJECT_DIR/.claude/rules/<name>.md << 'EOF'
# Rule Name
[Context: why this rule exists, based on N sessions]
## Pattern
[The reusable principle]
## DO
- [Concrete action]
## DON'T
- [Anti-pattern]
## Source Sessions
- [session-id-1]: [what happened]
- [session-id-2]: [what happened]
EOF
Create .claude/skills/<name>/SKILL.md with:
Add triggers to skill-rules.json if appropriate.
Create shell wrapper + TypeScript handler:
# Shell wrapper
cat > $CLAUDE_PROJECT_DIR/.claude/hooks/<name>.sh << 'EOF'
#!/bin/bash
set -e
cd "$CLAUDE_PROJECT_DIR/.claude/hooks"
cat | node dist/<name>.mjs
EOF
chmod +x $CLAUDE_PROJECT_DIR/.claude/hooks/<name>.sh
Then create src/<name>.ts, build with esbuild, and register in settings.json:
{
"hooks": {
"EventName": [{
"hooks": [{
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/<name>.sh"
}]
}]
}
}
Edit existing agent in .claude/agents/<name>.md to add the learned capability.
## Compounding Complete
**Learnings Analyzed:** [N] sessions
**Patterns Found:** [M]
**Artifacts Created:** [K]
### Created:
- Rule: `explicit-identity.md` - Pass IDs explicitly across boundaries
- Skill: `debug-hooks` - Hook debugging workflow
### Skipped (insufficient signal):
- "Pattern X" (1 occurrence)
**Your setup is now permanently improved.**
Before creating any artifact:
.claude/rules/ and .claude/skills/ first.claude/cache/learnings/*.md.claude/skills/<name>/SKILL.md.claude/rules/<name>.md.claude/hooks/<name>.sh + src/<name>.ts + dist/<name>.mjs.claude/agents/<name>.md.claude/skills/skill-rules.json.claude/settings.json → hooks sectionCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Replace with description of the skill and when Claude should use it.
Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill content", or needs guidance on skill structure, progressive disclosure, or skill development best practices for Claude Code plugins.
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
Use when creating new skills, editing existing skills, or verifying skills work before deployment
Take vibeeval/compound-learnings from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.