# Learn

Extract reusable knowledge from the current session into a persistent skill.

- Repository: https://github.com/pedrohcgs/claude-code-my-workflow (1676 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-09-27
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add pedrohcgs/claude-code-my-workflow --skill learn -g -a claude-code -y`
Codex: `npx skills add pedrohcgs/claude-code-my-workflow --skill learn -g -a codex -y`
Cursor: `npx skills add pedrohcgs/claude-code-my-workflow --skill learn -g -a cursor -y`
Gemini CLI: `npx skills add pedrohcgs/claude-code-my-workflow --skill learn -g -a gemini-cli -y`

## Description

Extract reusable knowledge from the current session into a persistent skill. Use when you discover something non-obvious, create a workaround, or develop a multi-step workflow that future sessions would benefit from.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# /learn, Skill Extraction Workflow

Extract non-obvious discoveries into reusable skills that persist across sessions.

## When to Use This Skill

Invoke `/learn` when you encounter:

- **Non-obvious debugging**, Investigation that took significant effort, not in docs
- **Misleading errors**, Error message was wrong, found the real cause
- **Workarounds**, Found a limitation with a creative solution
- **Tool integration**, Undocumented API usage or configuration
- **Trial-and-error**, Multiple attempts before success
- **Repeatable workflows**, Multi-step task you'd do again
- **User-facing automation**, Reports, checks, or processes users will request

## Workflow Phases

### PHASE 1: Evaluate (Self-Assessment)

Before creating a skill, answer these questions:

1. "What did I just learn that wasn't obvious before starting?"
2. "Would future-me benefit from this being documented?"
3. "Was the solution non-obvious from documentation alone?"
4. "Is this a multi-step workflow I'd repeat?"

**Continue only if YES to at least one question.**

### PHASE 2: Check Existing Skills

Search for related skills to avoid duplication:

```bash
# Check project skills
ls .claude/skills/ 2>/dev/null

# Search for keywords
grep -r -i "KEYWORD" .claude/skills/ 2>/dev/null
```

**Outcomes:**
- Nothing related → Create new skill (continue to Phase 3)
- Same trigger & fix → Update existing skill (bump version)
- Partial overlap → Update with new variant

### PHASE 3: Create Skill

Create the skill file at `.claude/skills/[skill-name]/SKILL.md`:

The rest: https://github.com/pedrohcgs/claude-code-my-workflow/blob/HEAD/.claude/skills/learn/SKILL.md
