Extract skill for Claude

Turn a fix or pattern that keeps coming up into a reusable skill with SKILL.md, reference docs and examples.

When Claude uses it

Use whenever the user runs /si:extract or wants to package a recurring solution or lesson as a skill.

Extract SKILL.md

The full skill file from alirezarezvani/claude-skills (MIT).

/si:extract — Create Skills from Patterns

Transforms a recurring pattern or debugging solution into a standalone, portable skill that can be installed in any project.

Usage

/si:extract <pattern description>                  # Interactive extraction
/si:extract <pattern> --name docker-m1-fixes       # Specify skill name
/si:extract <pattern> --output ./skills/            # Custom output directory
/si:extract <pattern> --dry-run                     # Preview without creating files

When to Extract

A learning qualifies for skill extraction when ANY of these are true:

CriterionSignal
RecurringSame issue across 2+ projects
Non-obviousRequired real debugging to discover
Broadly applicableNot tied to one specific codebase
Complex solutionMulti-step fix that's easy to forget
User-flagged"Save this as a skill", "I want to reuse this"

Workflow

Step 1: Identify the pattern

Read the user's description. Search auto-memory for related entries:

MEMORY_DIR="$HOME/.claude/projects/$(pwd | sed 's|/|%2F|g; s|%2F|/|; s|^/||')/memory"
grep -rni "<keywords>" "$MEMORY_DIR/"

If found in auto-memory, use those entries as source material. If not, use the user's description directly.

Step 2: Determine skill scope

Ask (max 2 questions):

  • "What problem does this solve?" (if not clear)
  • "Should this include code examples?" (if applicable)

Step 3: Generate skill name

Rules for naming:

  • Lowercase, hyphens between words
  • Descriptive but concise (2-4 words)
  • Examples: docker-m1-fixes, api-timeout-patterns, pnpm-workspace-setup

Reserved fragments — must NOT appear in the skill name:

  • claude
  • anthropic

For skills about Claude Code itself, use the cc- prefix instead:

  • ❌ claude-code-settings → ✅ cc-settings
  • ❌ claude-code-maintenance → ✅ cc-maintenance
  • ❌ claude-mcp-tools → ✅ cc-mcp-tools
  • ❌ claude-plugin-development → ✅ cc-plugin-development

Before writing the skill directory, check the proposed name against this list. If a reserved fragment is present, transform it (drop the fragment or replace the claude*/anthropic* prefix with cc-) and confirm with the user.

Step 4: Create the skill files

Spawn the skill-extractor agent for the actual file generation.

The agent creates:

<skill-name>/
├── SKILL.md            # Main skill file with frontmatter
├── README.md           # Human-readable overview
└── reference/          # (optional) Supporting documentation
    └── examples.md     # Concrete examples and edge cases

Step 5: SKILL.md structure

The generated SKILL.md must follow this format:

---
name: "skill-name"
description: "<one-line description>. Use when: <trigger conditions>."
---

# <Skill Title>

> One-line summary of what this skill solves.

## Quick Reference

| Problem | Solution |
|---------|----------|
| {{problem 1}} | {{solution 1}} |
| {{problem 2}} | {{solution 2}} |

## The Problem

{{2-3 sentences explaining what goes wrong and why it's non-obvious.}}

## Solutions

### Option 1: {{Name}} (Recommended)

{{Step-by-step with code examples.}}

### Option 2: {{Alternative}}

{{For when Option 1 doesn't apply.}}

## Trade-offs

| Approach | Pros | Cons |
|----------|------|------|
| Option 1 | {{pros}} | {{cons}} |
| Option 2 | {{pros}} | {{cons}} |

## Edge Cases

- {{edge case 1 and how to handle it}}
- {{edge case 2 and how to handle it}}

Step 6: Quality gates

Before finalizing, verify:

  • SKILL.md has valid YAML frontmatter with name and description
  • name matches the folder name (lowercase, hyphens)
  • name does NOT contain reserved fragments claude or anthropic (use cc- prefix for Claude Code skills)
  • Description includes "Use when:" trigger conditions
  • Solutions are self-contained (no external context needed)
  • Code examples are complete and copy-pasteable
  • No project-specific hardcoded values (paths, URLs, credentials)
  • No unnecessary dependencies

Step 7: Report

✅ Skill extracted: {{skill-name}}

Files created:
  {{path}}/SKILL.md          ({{lines}} lines)
  {{path}}/README.md         ({{lines}} lines)
  {{path}}/reference/examples.md  ({{lines}} lines)

Install: /plugin install (copy to your skills directory)
Publish: clawhub publish {{path}}

Source: MEMORY.md entries at lines {{n, m, ...}} (retained — the skill is portable, the memory is project-specific)

Examples

Extracting a debugging pattern

/si:extract "Fix for Docker builds failing on Apple Silicon with platform mismatch"

Creates docker-m1-fixes/SKILL.md with:

  • The platform mismatch error message
  • Three solutions (build flag, Dockerfile, docker-compose)
  • Trade-offs table
  • Performance note about Rosetta 2 emulation

Extracting a workflow pattern

/si:extract "Always regenerate TypeScript API client after modifying OpenAPI spec"

Creates api-client-regen/SKILL.md with:

  • Why manual regen is needed
  • The exact command sequence
  • CI integration snippet
  • Common failure modes

Tips

  • Extract patterns that would save time in a different project
  • Keep skills focused — one problem per skill
  • Include the error messages people would search for
  • Test the skill by reading it without the original context — does it make sense?

How to install Extract

Claude Code

Copy the skill into your personal skills folder (or into .claude/skills/ inside a project):

npx degit alirezarezvani/claude-skills/engineering-team/self-improving-agent/skills/extract#main ~/.claude/skills/extract

Codex

npx degit alirezarezvani/claude-skills/engineering-team/self-improving-agent/skills/extract#main ~/.codex/skills/extract

Claude.ai and Claude Desktop

Download the skill folder from GitHub, zip it, and upload it under Settings → Capabilities → Skills.

Frequently asked questions

+What does the Extract skill do?

Turn a fix or pattern that keeps coming up into a reusable skill with SKILL.md, reference docs and examples. Use whenever the user runs /si:extract or wants to package a recurring solution or lesson as a skill.

+How do I install Extract in Claude Code?

Copy the skill folder into ~/.claude/skills/extract, for example with "npx degit alirezarezvani/claude-skills/engineering-team/self-improving-agent/skills/extract#main ~/.claude/skills/extract". Claude Code loads it automatically and uses it when a task matches.

+Does Extract work with ChatGPT or Codex?

Yes. Extract uses the open SKILL.md format. In Codex, put the folder in ~/.codex/skills/extract. In Claude.ai, zip the folder and upload it under Settings → Capabilities → Skills.

+Is Extract free?

Extract is published on GitHub by alirezarezvani under the MIT license, which allows free use.

Related software development skills

  1. Code Review

    Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's…

    mattpocock/skills★ 327k
  2. Using Agent Skills

    Discovers and invokes agent skills. Use when starting a session, or when you need to decide which skill or workflow applies to the piece of…

    addyosmani/agent-skills★ 119k
  3. Build

    Fully automate a coding task with make-plan, do, and babysit.

    thedotmack/claude-mem★ 118k
  4. Focused Fix

    Use when a whole feature or module is broken and needs fixing end to end ('make X work', 'the Y module is broken').

    alirezarezvani/claude-skills★ 30k
  5. Full Page Screenshot

    Use when asked for a full-page or long screenshot of a web page.

    alirezarezvani/claude-skills★ 30k
  6. Git Worktree Manager

    Use when running several branches or agents in parallel on one repo.

    alirezarezvani/claude-skills★ 30k
  7. Hivemind

    Use when delegating grunt work to free opencode workers instead of spending Claude tokens: one worker or a scout, coder and tester swarm in…

    alirezarezvani/claude-skills★ 30k
  8. Hub Run

    Use for /hub-run, or to run a whole AgentHub competition end to end: init, baseline, spawn, eval and merge.

    alirezarezvani/claude-skills★ 30k
  9. Hub Status

    Use for /hub-status, or to check AgentHub agent progress, branches and DAG state.

    alirezarezvani/claude-skills★ 30k

See all software development skills →

More skills from alirezarezvani

  1. Fable Goal

    Use when the user wants a /goal prompt rather than the build itself ('/fable-goal', 'turn this into a goal prompt', 'write the prompt that…

    alirezarezvani/claude-skills★ 30k
  2. Fda Consultant Specialist

    Use for FDA medical device questions: 510(k) vs De Novo vs PMA, predicates and substantial equivalence, QMSR (21 CFR 820), HIPAA or device…

    alirezarezvani/claude-skills★ 30k
  3. Fda Qsr Audit Prep

    Use for /compliance-os:fda-qsr-audit-prep, or before an FDA inspection, QMSR internal audit or Form 483 response.

    alirezarezvani/claude-skills★ 30k

All skills by alirezarezvani →

Give your whole team an AI agent with skills

Cody runs managed AI agents your team can message in Slack, Teams, WhatsApp and the web, with 50+ business integrations, scheduled tasks and memory. No terminal required.