review-mistakes
Interactive review of pending mistake reports from the learning loop. Walk through each report with the user, accepting/rejecting/discarding as appropriate.
What this skill does
# Review Mistakes
Interactively review pending mistake reports from the Intent Layer learning loop.
## Overview
When agents make mistakes during development, skeleton reports are auto-captured in `.intent-layer/mistakes/pending/`. This skill helps you and the user review these reports conversationally, deciding which should become pitfalls in the Intent Layer.
## Prerequisites
Check for pending reports:
```bash
ls -la ${CLAUDE_PROJECT_DIR:-.}/.intent-layer/mistakes/pending/
```
## Workflow
### Step 1: List Pending Reports
```bash
find "${CLAUDE_PROJECT_DIR:-.}/.intent-layer/mistakes/pending" \
\( -name "MISTAKE-*.md" -o -name "SKELETON-*.md" \) \
-type f 2>/dev/null | sort
```
If no reports, inform the user there's nothing to review.
### Step 2: For Each Report
Read the report and present a summary:
```markdown
---
**Report**: SKELETON-2026-01-23-1234.md
**Directory**: src/auth/
**Operation**: Edit on login.ts
**What happened**: Tool Edit failed - old_string not found
**Covering node**: src/auth/AGENTS.md
**Analysis**: [Your assessment - is this a real mistake or exploratory?]
---
```
### Step 3: Ask User Decision
Present options clearly:
> **What would you like to do with this report?**
>
> 1. **Accept** - This is a real gotcha, add as pitfall to AGENTS.md
> 2. **Reject** - Not useful (I'll ask for a reason)
> 3. **Discard** - Exploratory failure, not a real mistake
> 4. **Enrich** - Add more context before deciding
> 5. **Skip** - Review later
### Step 4: Execute Decision
#### On Accept
Run the integration script:
```bash
${CLAUDE_PLUGIN_ROOT}/lib/integrate_pitfall.sh "${CLAUDE_PROJECT_DIR:-.}/.intent-layer/mistakes/pending/<filename>"
```
This will:
- Find the covering AGENTS.md
- Extract/generate a pitfall entry
- Append to the Pitfalls section
- Move report to `integrated/`
#### On Reject
Ask for rejection reason, then:
```bash
# Create rejected directory if needed
mkdir -p "${CLAUDE_PROJECT_DIR:-.}/.intent-layer/mistakes/rejected"
# Add rejection reason to file
echo -e "\n### Rejection\n**Reason**: <reason>\n**Date**: $(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> "<file>"
# Move to rejected
mv "<file>" "${CLAUDE_PROJECT_DIR:-.}/.intent-layer/mistakes/rejected/"
```
#### On Discard
Simply delete the skeleton:
```bash
rm "<file>"
```
Confirm to user: "Discarded - this was an exploratory failure, not a real mistake."
#### On Enrich
Open the file for editing or help the user add:
- Better description of what went wrong
- Root cause analysis
- Suggested pitfall text
Then return to Step 3.
#### On Skip
Move to the next report. Track skipped files to mention at the end.
### Step 5: Summary
After reviewing all reports (or when user wants to stop):
```markdown
## Review Summary
- **Accepted**: 2 (pitfalls added to AGENTS.md)
- **Rejected**: 1
- **Discarded**: 3 (exploratory failures)
- **Skipped**: 1 (still pending)
Remaining pending: 1 report(s)
```
---
## Report Types
### Skeleton Reports (SKELETON-*.md)
Auto-created by PostToolUseFailure hook. Contains:
- Tool and file context
- Placeholder fields for root cause and suggested fix
- Often exploratory failures - review carefully
**Common skeleton dispositions:**
- **Discard** if: Edit failed because string wasn't found (typo, wrong file)
- **Discard** if: Bash command failed during exploration
- **Accept** if: Failure revealed a non-obvious gotcha about the codebase
- **Enrich then Accept** if: Real mistake but needs better description
### Full Reports (MISTAKE-*.md)
Created manually via `capture_mistake.sh`. Contains:
- Detailed description from human/agent
- Root cause analysis
- Suggested fix
**Common full report dispositions:**
- **Accept** if: Well-documented, clear pitfall
- **Reject** if: One-off issue, not worth documenting
- **Enrich then Accept** if: Good insight but needs clearer pitfall text
---
## Example Conversation
**Agent**: "I found 3 pending mistake reports. Would you like to review them now?"
**User**: "yes"
**Agent**:
> ---
> **Report**: SKELETON-2026-01-23-4521.md
>
> **Directory**: src/api/
> **Operation**: Edit on routes.ts
> **What happened**: Edit failed - old_string not found
> **Covering node**: src/api/AGENTS.md
>
> **Analysis**: This looks like the Edit tool couldn't find the exact string to replace. This could be:
> - A typo in the old_string (exploratory)
> - The file had been modified and the string changed (possible gotcha)
> ---
>
> What would you like to do? (1) Accept (2) Reject (3) Discard (4) Enrich (5) Skip
**User**: "3 - it was just a typo"
**Agent**: "Discarded. Moving to next report..."
---
## Scripts Reference
| Script | Purpose |
|--------|---------|
| `lib/integrate_pitfall.sh` | Auto-add pitfall to covering AGENTS.md |
| `scripts/capture_mistake.sh` | Manual capture (if needed) |
All paths: `${CLAUDE_PLUGIN_ROOT}/`
---
## Tips
- **Be conservative with Accept** - Only document genuine gotchas that would trip up future agents
- **Discard freely** - Most skeletons from exploratory failures should be discarded
- **Enrich before Accept** - A well-written pitfall is more useful than a vague one
- **Batch review** - Review all pending reports periodically rather than one at a time
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.