Extracting Learned Skills

VerifiedSafe

Extracts reusable problem-solving principles and decision-making heuristics from debugging sessions. Use after solving tricky bugs or discovering codebase-specific workarounds.

Sby Skills Guide Bot
DevelopmentIntermediate
3/10/2026
Claude Code
#skill-extraction#debugging#knowledge-management#heuristics#codebase-context

Recommended for

Automated summary

This skill turns a hard debugging session into a reusable skill written as principles and decision-making heuristics rather than copy-paste snippets.

Strengths

  • Enforces a clear split between recording a fix and extracting a transferable principle that changes how a whole class of problems is approached
  • Screens candidates with three demanding questions (Googleable in 5 minutes? specific to this codebase? genuinely hard-won?) and rejects the rest
  • Requires verifiable detail: exact error message, file path, line number, precise fix, and trigger keywords
  • Defines two explicit save locations: project-level (.omc/skills/, version-controlled) by default, user-level (~/.claude/skills/omc-learned/) for the rare truly portable insight

Limitations

  • Only works when non-trivial debugging actually happened; on a routine task the skill rejects itself and produces nothing
  • Output quality rests entirely on the model's judgement of what counts as non-Googleable or codebase-specific, with no automated validation
  • Provides no update or de-duplication mechanism for previously saved skills and is restricted to the Read and Write tools
When to use it

Use it right after solving a tricky bug or finding a codebase-specific workaround, to preserve the lesson as a reusable heuristic.

When not to use it

Skip it for standard patterns, documented library usage, or anything a quick search would already answer.

Security analysis

Safe
Quality score84/100

The skill only declares Read and Write tools and its instructions are purely about extracting documentation/knowledge from debugging sessions into markdown skill files. There are no destructive commands, no network or exfiltration behavior, no obfuscation, and no attempts to disable safety. Writing to ~/.claude/skills or .omc/skills is a benign, expected action. Minor note: it references an external /oh-my-claudecode namespace, but that poses no execution risk.

No concerns found

How this analysis is made

Examples

Save a hard-won fix as a skill
Save this as a skill: we just burned two hours on the aiohttp proxy in server.py:42 crashing with ClientDisconnectedError whenever the client drops mid-stream. The fix is wrapping StreamResponse writes in try/except per chunk. Capture the principle, not just the patch.
Learn from a debugging session
Learn from this debugging session: 'Cannot find module' errors kept appearing in dist/ until we set moduleResolution to node16 in tsconfig.json to match the type field in package.json. Extract a reusable skill from that.
Record a hidden codebase gotcha
We just found an undocumented gotcha: the session hook in src/hooks/session.ts:45 throws a TypeError when sessionId is undefined after a restart, fixed by a null check plus regenerating the session on 401. Turn this into a project-level skill with the right triggers.

name: extracting-learned-skills description: Extracts reusable skills and decision-making heuristics from debugging sessions. Use after solving tricky bugs, discovering non-obvious workarounds, or finding hidden gotchas specific to a codebase. Triggers include "save this as a skill", "learn from this", or after significant debugging effort. allowed-tools: Read, Write

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)

# [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

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/extracting-learned-skills-mmk3nhyn/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/extracting-learned-skills-mmk3nhyn' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/extracting-learned-skills-mmk3nhyn/download' --output '.skill-downloads/extracting-learned-skills-mmk3nhyn/SKILL.md.part' && mv '.skill-downloads/extracting-learned-skills-mmk3nhyn/SKILL.md.part' '.skill-downloads/extracting-learned-skills-mmk3nhyn/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Read, Write

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/extracting-learned-skills-mmk3nhyn/SKILL.md' && test -s '.skill-downloads/extracting-learned-skills-mmk3nhyn/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/extracting-learned-skills' && cp -R '.skill-downloads/extracting-learned-skills-mmk3nhyn' '.claude/skills/extracting-learned-skills'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/extracting-learned-skills-mmk3nhyn'

openskills read 'extracting-learned-skills-mmk3nhyn'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/extracting-learned-skills-mmk3nhyn/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills