From wingman
Root-cause a mistake and implement systemic repairs to prevent recurrence. Analyzes what went wrong, surveys all customization layers (instructions, skills, agents, memory, docs) for the gap that allowed it, recommends specific fixes, and implements them on approval. USE FOR: root cause, postmortem, why did that happen, prevent this mistake, continuous improvement, never again, what went wrong, fix the process. DO NOT USE FOR: fixing the immediate bug itself (do that first, then invoke this skill), code review, or drift audits.
How this skill is triggered — by the user, by Claude, or both
Slash command
/wingman:never-againThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
When a mistake is discovered — a wrong approach, a repeated error, a misunderstood convention, a flawed instruction — this skill performs root-cause analysis and implements systemic repairs across the project's customization layers so the same class of mistake doesn't recur.
When a mistake is discovered — a wrong approach, a repeated error, a misunderstood convention, a flawed instruction — this skill performs root-cause analysis and implements systemic repairs across the project's customization layers so the same class of mistake doesn't recur.
Philosophy: Mistakes are inevitable. Repeating the same mistake is a system failure. Every error is an opportunity to strengthen the guardrails — not by adding bureaucracy, but by putting knowledge where it will be found at the right moment.
Typical flow: Fix the immediate problem first, then invoke this skill to prevent recurrence.
Establish exactly what went wrong. Sources (check in order):
Produce a concise Mistake Statement:
MISTAKE: {what happened}
EXPECTED: {what should have happened}
IMPACT: {what it cost — wasted time, wrong code, broken build, etc.}
Checkpoint: If the mistake and root cause are completely obvious (e.g., a known convention was violated), state the mistake statement and proceed directly to the repair phase. Otherwise, present the mistake statement to the user and confirm you've understood correctly before continuing. Don't waste time on deep analysis if the user needs to course-correct your understanding first.
Ask "why?" iteratively (5-whys style) until you reach a systemic root cause — not "I made a mistake" but "what about the system allowed or encouraged this mistake?"
Root causes typically fall into these categories:
| Category | Example |
|---|---|
| Missing instruction | No rule existed to guide the correct behavior |
| Wrong instruction | A rule existed but was incorrect or outdated |
| Buried instruction | The rule exists but is in a file that wasn't loaded for this context |
| Missing enforcement | The rule is documented but nothing enforces it (no lint rule, no CI check, no validation) |
| Stale documentation | Docs describe how something used to work |
| Skill/agent gap | A skill or agent definition doesn't handle this case or gives wrong guidance |
| Memory gap | A lesson was learned before but never recorded in persistent memory |
| Assumption error | The agent assumed something that should have been verified |
| Missing context | The right information existed but wasn't available when the decision was made |
Identify which category (or categories) apply. Be specific about which file or which gap.
Systematically check each customization layer for where a fix would be most effective. Read the actual files — don't guess at their contents.
| Layer | Where to look | What to look for |
|---|---|---|
| copilot-instructions.md | .github/copilot-instructions.md | Should a new Common Mistakes row be added? Is an existing rule wrong or unclear? |
| Instruction files | .github/instructions/*.instructions.md | Is there an applyTo-scoped instruction file that should catch this? Does one exist but miss this case? |
| Skills | .github/skills/*/SKILL.md | Did a skill give wrong guidance? Does a skill need a new constraint or step? |
| Agents | .github/agents/*.agent.md | Did an agent definition miss a responsibility or give wrong context? |
| User memory | /memories/*.md | Should a lesson be recorded for cross-session persistence? Is an existing memory note wrong? |
| Repo memory | /memories/repo/*.md | Should a repo-scoped fact be recorded? |
| Documentation | Project docs (README, guides, architecture docs) | Is the relevant doc wrong, missing, or misleading? |
| Lint/CI | Lint configs, CI pipelines, validation scripts | Could this be enforced by tooling rather than relying on the agent to remember? |
For each layer, determine:
For each gap or wrong-content finding, propose a specific repair:
## Repair Plan
### Repair 1: {short title}
- **Target**: {file path}
- **Type**: Add / Update / Remove
- **Rationale**: {why this repair prevents recurrence}
- **Change**: {description of what to add, change, or remove}
- **Priority**: Implement now / Defer
### Repair 2: ...
Prioritization rules:
Quality criteria for repairs:
applyTo when editing the relevant file type is better than a general rule in copilot-instructions.mdChoosing the right location for repairs:
| Location | Audience | Use when |
|---|---|---|
.github/instructions/*.instructions.md with applyTo | All contributors working on matching files in this repo | The lesson is repo-specific and most useful when editing particular files. This is the default choice for most repairs. |
.github/copilot-instructions.md | All AI conversations in this repo | The lesson is a universal guardrail or project-wide context. |
.github/skills/*/SKILL.md or .github/agents/*.agent.md | AI agents following that skill/agent | The skill or agent itself gave wrong guidance or missed a step. |
| Project documentation (README, guides, etc.) | All contributors reading docs | The lesson is project knowledge, not an AI instruction. |
/memories/*.md (user memory) | Only the current user, across all repos | Last resort. Only for purely personal preferences. Never use for project lessons — those must be version-controlled. |
/memories/repo/*.md (repo memory) | Only the current user, in this repo | Avoid. Use only for personal scratch notes that don't belong in version control. |
| Lint rules / CI checks | All contributors, enforced automatically | The mistake can be detected mechanically. Best durability but highest cost to implement. |
Key principle: Repairs must be version-controlled so they help ALL contributors — not just the current user. If a lesson would prevent mistakes for other people or other AI sessions, it belongs in .github/instructions/, .github/copilot-instructions.md, skills, agents, or docs. Never put project lessons in user memory or repo memory — those files are invisible to the rest of the team.
Present the full analysis to the user:
## Never Again: {short title}
### What Happened
{Mistake Statement from Step 1}
### Root Cause
{Analysis from Step 2}
### Repair Plan
{Repairs from Step 4, grouped by priority}
### Deferred Items
{Any larger changes noted for follow-up}
Then ask: "Implement the repairs marked 'implement now'?"
If the user says yes (or any affirmative), proceed to Step 6. If the user wants to adjust the plan, incorporate feedback and re-present.
Execute each "implement now" repair:
After each repair, briefly confirm what was changed.
After implementation, verify each repair:
Report the verification results.
Example 1: Agent used console.log in a project that bans it
Example 2: Agent pushed to the wrong branch
--no-track when created.github/copilot-instructions.md reinforcing the branching workflow, or add a constraint to the relevant shipping skill.Example 3: Documentation sent user to a moved file
npx claudepluginhub dornstein/wingman --plugin wingmanCaptures agent mistakes, corrections, and discovered gotchas so they are not repeated. Use when: (1) a command or operation fails unexpectedly, (2) the user corrects the agent, (3) the agent discovers non-obvious behavior through debugging, (4) an API or tool behaves differently than expected, (5) a better approach is found for a recurring task. Also searches past learnings before starting tasks to avoid known pitfalls. Activate alongside the memory skill — they share sage-memory but serve different purposes (memory = codebase knowledge, self-learning = agent mistakes and gotchas). Also trigger on "sage review" or "review learnings" to curate and improve the learning database.
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 lessons from code reviews and error corrections as persistent rules. Activates on /evolve or when user says 'we should remember this'.