Loading...
Loading...
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 skill4agent add parcadei/continuous-claude-v3 compound-learnings# 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| Section Header | What to Extract |
|---|---|
| Direct candidates for rules |
| Decision heuristics |
| Success patterns |
| Anti-patterns (invert to rules) |
| Design principles |
| Pattern | Sessions | Category |
|---------|----------|----------|
| "Check artifacts before editing" | abc, def, ghi | debugging |
| "Pass IDs explicitly" | abc, def, ghi, jkl | reliability |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)| 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 |
---
## 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`
---AskUserQuestion# 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.claude/skills/<name>/SKILL.mdskill-rules.json# 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>.shsrc/<name>.tssettings.json{
"hooks": {
"EventName": [{
"hooks": [{
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/<name>.sh"
}]
}]
}
}.claude/agents/<name>.md## 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.**.claude/rules/.claude/skills/.claude/cache/learnings/*.md.claude/skills/<name>/SKILL.md.claude/rules/<name>.md.claude/hooks/<name>.shsrc/<name>.tsdist/<name>.mjs.claude/agents/<name>.md.claude/skills/skill-rules.json.claude/settings.jsonhooks