From vini-workflow
Captures post-task learnings, promotes patterns to docs/ADRs, updates workflows/systems from failures and user corrections. Auto-invokes on task completion or 'done'.
How this skill is triggered — by the user, by Claude, or both
Slash command
/vini-workflow:compoundThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
0. **No-op guard** — before starting, check if compound already ran recently:
No-op guard — before starting, check if compound already ran recently:
LAST_COMPOUND=$(find "${HOME}/.claude/state/" -name ".claude-compound-done-*" -mmin -30 2>/dev/null | head -1)
LAST_COMMIT=$(git log -1 --format=%ct 2>/dev/null || echo 0)
MARKER_TIME=$(stat -c %Y "$LAST_COMPOUND" 2>/dev/null || echo 999999999)
If LAST_COMPOUND exists AND LAST_COMMIT < MARKER_TIME (no new commits since last compound):
→ Report "Compound skipped — no new work since last run (marker: [timestamp])." and STOP.
Otherwise proceed normally.
Review what was done — read PRD, recent changes, or conversation context
Identify learnings:
Update session-learnings with key findings (use structured format — see Step 6)
Knowledge Promotion Chain — check if promotion is warranted:
docs/solutions/docs/architecture/decisions/4b. System Update Loop (when compound identifies workflow failures):
~/.claude/evolution/workflow-changelog.md with date, what, why, source.4c. Feedback Capture (mine user corrections for learning signal): User corrections are the richest learning signal. Scan the conversation for:
For each correction found:
approaches_that_failedThe Three Compound Questions:
Structured Session Learnings — when updating session-learnings, use categorized format:
## Errors
- [CATEGORY] description → fix applied
Categories: ENV, LOGIC, CONFIG, DEPENDENCY, SECURITY, TEST, DEPLOY, PROOT, MERGE, PERFORMANCE
## Rules Generated
- Rule text (category: CATEGORY)
## Model Performance
- model_name: N/M tasks first-try success (note any upgrades/downgrades needed)
## Metrics
- Total retries: N
- Phases that caught bugs: [list]
- Phase 5 duration: Ns
Cross-Project Promotion — check if learnings apply beyond the current project:
a. Error registry update — ALWAYS write errors to the registry, even on first occurrence. You can't detect cross-project patterns without capturing data points from day one.
~/.claude/evolution/error-registry.jsonerror-registry.json.bak (or create empty {"entries":[]} if no backup).error-registry.json.bak before modifying.{
"pattern": "error message or symptom regex",
"category": "ENV|LOGIC|CONFIG|...",
"root_cause": "why it happens",
"fix": "how to fix it",
"auto_preventable": false,
"prevention": "hook/rule that prevents it (if auto_preventable)",
"approaches_that_failed": [
{ "approach": "what was tried", "why_bad": "why it didn't work" }
],
"projects_seen": ["project-name"],
"first_seen": "2026-03-14",
"last_seen": "2026-03-14",
"occurrences": 1
}
occurrences, update last_seen, add project to projects_seen, merge any new approaches_that_failedauto_preventable: false: flag for hook creationb. Model performance update — ALWAYS record model performance, even on first session.
bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/record-model-performance.sh <model> <task_type> <first_try_success>
model: sonnet | opus | haikutask_type: free-form label (e.g., sprint_execution, verification, bug_fix,
implementation, compound, file_scanning)first_try_success: true | falsemodel_requested,
first_try_success, task_types) and orchestrator metrics (sprint_model_performance).
Don't guess — use the structured data. Call the script once per (model, task_type, outcome) triple.bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/evaluate-model-performance.sh
~/.claude/evolution/workflow-changelog.md
and update the default model in the relevant agent frontmatter.c. Memory promotion — if a learning applies across all projects:
~/.claude/projects/-root/memory/ (use appropriate memory type: feedback, project, or reference)MEMORY.md indexd. Workflow changelog — if any system file was modified (CLAUDE.md, skill, agent, hook):
~/.claude/evolution/workflow-changelog.md with date, what, why, sourceSession Postmortem (MANDATORY — ALWAYS run, never skip):
This file is the foundation of trend analysis in /workflow-audit. Skipping it makes future audits blind. Never batch, never skip — one file per /compound invocation.
How to write it:
TS=$(date +%Y-%m-%d_%H%M)~/.claude/evolution/session-postmortems/${TS}_${PROJECT_NAME}.mdThe filename includes HHmm so multiple /compound invocations on the same day produce distinct files. Do NOT overwrite existing files.
Template to write:
# Session Postmortem — [date] — [project]
## Summary
- Tasks completed: N
- Tasks blocked: N
- Total retries: N
- Models used: [list with task counts]
## Error Categories
- [CATEGORY]: N occurrences
## Verification Gate Effectiveness
- Gate that caught real bugs: [list]
- Gates that always passed (may be redundant for this project): [list]
## Model Performance This Session
| Model | Task Type | Attempts | 1st Try | Rate |
|-------|-----------|----------|---------|------|
## Compound Actions Taken
- [list of system updates, promotions, rules generated]
## Open Questions
- [from Three Compound Questions]
Write completion marker so the compound-reminder hook knows compound ran:
touch "${HOME}/.claude/state/.claude-compound-done-${CLAUDE_SESSION_ID:-unknown}"
Workflow Integrity Gate — if compound modified ANY workflow files (~/.claude/ — hooks,
skills, agents, settings.json, CLAUDE.md), run the integrity test suite:
bash ~/.claude/test-workflow-mods/run-tests.sh
~/.claude/
files were touched during this compound cycle.If using git backup for ~/.claude/: suggest committing workflow changes
When compound is triggered after a Quick Fix (single-file, <30 lines):
npx claudepluginhub vinicius91carvalho/.claude --plugin vini-workflowReviews completed work to extract learnings, validate shipping, and promote insights. Activates after tasks, PR arcs, or sessions finish, or after 5+ PRs.
Logs errors, user corrections, missing features, API failures, knowledge gaps, and best practices to .learnings/ markdown files. Promotes key insights to CLAUDE.md and AGENTS.md for AI agent self-improvement.
Captures learnings from completed development sessions into reusable knowledge files organized by pattern, pitfall, decision, tool insight, and process improvement.