:: EXECUTABLE_SKILLS

Feedback loop skills

Copy these skill definitions into your .claude/skills/ directory. They implement the error and success logging patterns from Lesson 01.

// SETUP_INSTRUCTIONS

  1. 1. Create .claude/skills/ directory in your project root
  2. 2. Create .claude/error-logs/ directory for log storage
  3. 3. Copy each skill below into its own .md file
  4. 4. Invoke with /log_error or /log_success when needed

/log_error

Systematic failure capture and analysis

// PURPOSE

When Claude makes a mistake, this skill guides you through a structured process to capture what went wrong, why it happened, and how to prevent it in the future. The key is capturing the exact prompt wording, not a paraphrase.

// WORKFLOW

1

Fork conversation (create checkpoint)

2

Interview Claude about the failure

3

Document exact prompt

4

Rewind to pre-error state

// SKILL_DEFINITION

Save as: .claude/skills/log-error.md

# /log_error

Systematic error capture for building feedback loops.

## Trigger
Invoke when Claude produces incorrect output, misses instructions, or behaves unexpectedly.

## Workflow

### Step 1: Create Checkpoint
Fork the conversation to preserve the error state before investigating.

### Step 2: Root Cause Interview
Ask Claude:
- "What prompt or instruction triggered this behavior?"
- "What did you think I was asking for?"
- "What context were you missing?"

### Step 3: Document the Failure
Create log entry in `.claude/error-logs/` with timestamp:

```markdown
## Error Log: [YYYY-MM-DD-HHMM]

**Context:** [What were you trying to accomplish?]

**Incorrect Behavior:** [What Claude did wrong]

**Exact Prompt (verbatim, not paraphrased):**
> [Copy the exact text you sent]

**What Claude Misunderstood:** [The gap between intent and interpretation]

**Root Cause Category:**
- [ ] Ambiguous instruction
- [ ] Missing context
- [ ] Assumed knowledge
- [ ] Faulty mental model
- [ ] Other: ___

**Preventive Guideline:** [What rule would prevent this?]

**Consider Hook?** [ ] Yes - if this is a recurring pattern
```

### Step 4: Recovery
Rewind to pre-error state using double-escape restore.

## Key Principle
Capture the EXACT prompt wording. Paraphrasing loses the specific language that caused the failure.

ROOT_CAUSE_CATEGORIES

Ambiguous instruction Missing context Assumed knowledge Faulty mental model Hallucination Context lost

/log_success

Capture what works for reuse

// PURPOSE

When Claude produces excellent results, capture the interaction pattern while context is fresh. Look for recurring patterns that can be promoted to CLAUDE.md or converted into reusable skills.

// WORKFLOW

1

Pause to preserve context

2

Identify what worked

3

Record exact prompt

4

Extract reusable template

// SKILL_DEFINITION

Save as: .claude/skills/log-success.md

# /log_success

Capture effective patterns for reuse.

## Trigger
Invoke when Claude produces excellent results that you want to replicate.

## Workflow

### Step 1: Pause
Capture while context is fresh - don't wait until later.

### Step 2: Identify Success Factors
What made this work?
- Clear, specific instruction?
- Good examples provided?
- Appropriate context given?
- Right level of detail?

### Step 3: Document the Success
Create log entry:

```markdown
## Success Log: [YYYY-MM-DD-HHMM]

**Context:** [What were you building?]

**Outcome:** [What Claude produced that impressed you]

**Exact Prompt (verbatim):**
> [Copy the exact text you sent]

**Success Factors:**
- [ ] Clear, specific instruction
- [ ] Effective example included
- [ ] Appropriate context scope
- [ ] Good constraint definition
- [ ] Other: ___

**What Made It Work:**
1. [Factor 1]
2. [Factor 2]
3. [Factor 3]

**Generalized Template:**
> [Reusable version with placeholders]

**Promote to CLAUDE.md?** [ ] Yes - if this is a recurring need
**Convert to Skill?** [ ] Yes - if this is a complex workflow
```

### Step 4: Pattern Recognition
Look across multiple success logs to identify recurring patterns worth promoting.

## Key Principle
Success patterns compound. What works once can work many times if documented properly.

SUCCESS_FACTORS_CHECKLIST

Clear instruction Good examples Right context scope Defined constraints Specific output format Iterative refinement

// RECOMMENDED_DIRECTORY_STRUCTURE

your-project/
├── .claude/
│   ├── skills/
│   │   ├── log-error.md
│   │   └── log-success.md
│   ├── error-logs/
│   │   ├── 2024-01-15-1430.md
│   │   └── 2024-01-16-0900.md
│   ├── success-logs/
│   │   └── 2024-01-15-1600.md
│   └── commands/
│       └── [your custom commands]
└── CLAUDE.md