home / skills / yeachan-heo / oh-my-claudecode / learner

learner skill

/skills/learner

This skill helps you extract reusable decision-making insights from conversations to improve Claude's problem-solving approach.

npx playbooks add skill yeachan-heo/oh-my-claudecode --skill learner

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
5.3 KB
---
name: learner
description: Extract a learned skill from the current conversation
---

# Learner Skill

## The Insight

Reusable skills are not code snippets to copy-paste, but **principles and decision-making heuristics** that teach Claude HOW TO THINK about a class of problems.

**The difference:**
- BAD (mimicking): "When you see ConnectionResetError, add this try/except block"
- GOOD (reusable skill): "In async network code, any I/O operation can fail independently due to client/server lifecycle mismatches. The principle: wrap each I/O operation separately, because failure between operations is the common case, not the exception."

A good skill changes how Claude APPROACHES problems, not just what code it produces.

## Why This Matters

Before extracting a skill, ask yourself:
- "Could someone Google this in 5 minutes?" → If yes, STOP. Don't extract.
- "Is this specific to THIS codebase?" → If no, STOP. Don't extract.
- "Did this take real debugging effort to discover?" → If no, STOP. Don't extract.

If a potential skill fails any of these questions, it's not worth saving.

## Recognition Pattern

Use /oh-my-claudecode:learner ONLY after:
- Solving a tricky bug that required deep investigation
- Discovering a non-obvious workaround specific to this codebase
- Finding a hidden gotcha that wastes time when forgotten
- Uncovering undocumented behavior that affects this project

## The Approach

### Extraction Process

**Step 1: Gather Required Information**

- **Problem Statement**: The SPECIFIC error, symptom, or confusion that occurred
  - Include actual error messages, file paths, line numbers
  - Example: "TypeError in src/hooks/session.ts:45 when sessionId is undefined after restart"

- **Solution**: The EXACT fix, not general advice
  - Include code snippets, file paths, configuration changes
  - Example: "Add null check before accessing session.user, regenerate session on 401"

- **Triggers**: Keywords that would appear when hitting this problem again
  - Use error message fragments, file names, symptom descriptions
  - Example: ["sessionId undefined", "session.ts TypeError", "401 session"]

- **Scope**: Almost always Project-level unless it's a truly universal insight

**Step 2: Quality Validation**

The system REJECTS skills that are:
- Too generic (no file paths, line numbers, or specific error messages)
- Easily Googleable (standard patterns, library usage)
- Vague solutions (no code snippets or precise instructions)
- Poor triggers (generic words that match everything)

**Step 3: Save Location**

- **User-level**: ~/.claude/skills/omc-learned/ - Rare. Only for truly portable insights.
- **Project-level**: .omc/skills/ - Default. Version-controlled with repo.

### What Makes a USEFUL Skill

**CRITICAL**: Not every solution is worth saving. A good skill is:

1. **Non-Googleable**: Something you couldn't easily find via search
   - BAD: "How to read files in TypeScript" ❌
   - GOOD: "This codebase uses custom path resolution in ESM that requires fileURLToPath + specific relative paths" ✓

2. **Context-Specific**: References actual files, error messages, or patterns from THIS codebase
   - BAD: "Use try/catch for error handling" ❌
   - GOOD: "The aiohttp proxy in server.py:42 crashes on ClientDisconnectedError - wrap StreamResponse in try/except" ✓

3. **Actionable with Precision**: Tells you exactly WHAT to do and WHERE
   - BAD: "Handle edge cases" ❌
   - GOOD: "When seeing 'Cannot find module' in dist/, check tsconfig.json moduleResolution matches package.json type field" ✓

4. **Hard-Won**: Took significant debugging effort to discover
   - BAD: Generic programming patterns ❌
   - GOOD: "Race condition in worker.ts - the Promise.all at line 89 needs await before the map callback returns" ✓

### Anti-Patterns (DO NOT EXTRACT)

- Generic programming patterns (use documentation instead)
- Refactoring techniques (these are universal)
- Library usage examples (use library docs)
- Type definitions or boilerplate
- Anything a junior dev could Google in 5 minutes

## Skill Format

Skills are saved as markdown with this structure:

### YAML Frontmatter

Standard metadata fields:
- id, name, description, source, triggers, quality

### Body Structure (Required)

```markdown
# [Skill Name]

## The Insight
What is the underlying PRINCIPLE you discovered? Not the code, but the mental model.
Example: "Async I/O operations are independently failable. Client lifecycle != server lifecycle."

## Why This Matters
What goes wrong if you don't know this? What symptom led you here?
Example: "Proxy server crashes on client disconnect, taking down other requests."

## Recognition Pattern
How do you know when this skill applies? What are the signs?
Example: "Building any long-lived connection handler (proxy, websocket, SSE)"

## The Approach
The decision-making heuristic, not just code. How should Claude THINK about this?
Example: "For each I/O operation, ask: what if this fails right now? Handle it locally."

## Example (Optional)
If code helps, show it - but as illustration of the principle, not copy-paste material.
```

**Key**: A skill is REUSABLE if Claude can apply it to NEW situations, not just identical ones.

## Related Commands

- /oh-my-claudecode:note - Save quick notes that survive compaction (less formal than skills)
- /oh-my-claudecode:ralph - Start a development loop with learning capture

Overview

This skill extracts a reusable engineering insight from a troubleshooting session and saves it as a durable, searchable lesson for future agents. It focuses on principles and decision heuristics rather than copy-paste fixes, so Claude learns how to approach a class of problems across this codebase. The skill enforces quality checks so only non-trivial, context-rich discoveries are recorded.

How this skill works

When invoked after resolving a tricky bug or uncovering an undocumented behavior, the skill collects a precise problem statement, the exact fix, failure triggers, and scope. It validates that the insight is non-Googleable, context-specific, and actionable. Finally, it saves the formatted skill to the project-level skills folder with required metadata and body structure.

When to use it

  • After solving a bug that required deep debugging or unusual investigation
  • When you find a workaround or behavior specific to this codebase not documented elsewhere
  • If the fix includes exact file paths, error messages, and exact code/config changes
  • When the insight changes how Claude should reason about a class of problems
  • Before saving any lesson that might be mistaken for generic programming advice

Best practices

  • Collect precise evidence: error messages, file paths, line numbers, and minimal repro steps
  • Record the exact code or configuration change that fixed the issue, not vague guidance
  • Provide trigger keywords or fragments that reliably surface the same problem later
  • Mark scope explicitly—default to project-level unless truly portable
  • Reject anything easily searchable, overly generic, or lacking precise instructions

Example use cases

  • Capture a race condition fix that required changing await placement in worker.ts
  • Save a workaround for an undocumented library quirk found in server.py:42
  • Document an ESM path resolution gotcha requiring fileURLToPath in this repo's build
  • Record a specific null-check and session regeneration needed to avoid a TypeError
  • Store a trigger set for a recurring CI failure tied to a particular config mismatch

FAQ

How do I know this is worth saving?

Ask: could someone Google this in 5 minutes? Is it specific to this repo? Did it take real debugging effort? If any answer is no, do not save it.

Where are saved skills stored?

Default is project-level (.omc/skills/). Only store to user-level (~/.claude/skills/omc-learned/) when the insight is truly portable.