# Skill Learn

> Consolidate actionable lessons after another skill is used and required multiple correction rounds. Use this skill at task closure to extract concrete failures from the current conversation, propose safe incremental updates to the original skill files, show a diff first, and only apply changes after explicit user confirmation. Works for Claude and Codex skill workflows.

- Skill: `rxdaozhang/skill-learn` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add rxdaozhang/skill-learn`
- Raw SKILL.md: https://api.skillmd.com/api/skills/rxdaozhang/skill-learn/raw
- Safety review: pending (external: skill-scanner PASS, skillspector CAUTION)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: rxdaozhang (https://skillmd.com/u/rxdaozhang)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/rxdaozhang/skill-learn

---


# Skill Learn

## Overview

Use this skill at the end of a task to improve the original skill that was just used. Extract concrete, evidence-based lessons from the current conversation and convert them into executable guidance for the target skill.

## Workflow

1. Resolve the target skill.
2. Collect evidence from the current conversation only.
3. Extract lessons in a strict schema.
4. Propose incremental file updates.
5. Show diff/patch before write.
6. Apply changes only after explicit confirmation.

## Resolve Target Skill

Follow this resolution order:

1. Use explicit target path from user input if provided.
2. Otherwise infer from the most recently used skill in the current context.
3. If still ambiguous, ask one clarifying question and stop before proposing any write.

Never guess a target when two or more plausible skills exist.

## Extract Lessons from Chat History

Use only the current conversation as evidence.

For each lesson, output this schema:

- `Rule`: What to do next time.
- `Anti-pattern`: What failed or caused rework.
- `Correction`: Concrete action to prevent recurrence.
- `Trigger`: When this rule should be applied.
- `Example` (optional): A short concrete example.

Quality gate:

- Reject vague lessons such as "be better" or "be careful."
- Require concrete evidence from an observed iteration or correction.
- Prefer procedural wording that another agent can execute directly.

If evidence is insufficient, report that and do not propose a file write.

For reusable patterns and examples, consult:

- `references/lesson-patterns.md`

## Update Rules (Incremental Only)

When proposing updates to the target skill:

1. Never rewrite the entire file.
2. Prefer updating an existing anchored section such as `## Lessons Learned`.
3. If no suitable anchor exists, append a bounded new section at the end.
4. Keep unrelated sections unchanged.
5. Keep `SKILL.md` concise; move long canonical detail to `references/skill-learn-lessons.md` in the target skill and add a pointer from `SKILL.md`.

Do not delete or reorder unrelated guidance unless explicitly requested.

## Diff-First Confirmation

Before any write:

1. Present a readable diff/patch for each target file.
2. Summarize the expected behavioral improvement.
3. Ask for explicit confirmation.

Write only after confirmation. If confirmation is not provided, stop after delivering the proposal.

## Failure Handling

Handle these cases explicitly:

1. Target skill not found: ask for path or exact skill name.
2. Multiple candidate targets: request disambiguation.
3. No clear lessons with evidence: return "no high-confidence lesson updates."
4. Requested change violates incremental policy: explain and offer an incremental alternative.

## Output Format

Use this response structure:

1. `Target Skill`
2. `Evidence Extracted`
3. `Proposed Lessons` (Rule / Anti-pattern / Correction / Trigger / Example)
4. `Proposed File Changes`
5. `Diff Preview`
6. `Confirmation Request`

