{"id":"learn","name":"learn","summary":"ディレクトリ、URL、貼り付けたメモ、あるいは一緒にやったことなど、何からでも再利用可能なスキルを抽出したり、既存のスキルを新しい学びで洗練させたりする。","body":"# Learn — Distill a Skill from Anything\n\nTurn a source — a directory, a URL, pasted notes, or the work just done in this conversation — into a clean, reusable NanoClaw skill. The output is a new `.claude/skills/<name>/SKILL.md` (plus optional `scripts/`, `references/`, `templates/`) authored to the project's skill guidelines.\n\nThis skill is **instruction-only**: it uses the tools you already have (`Read`, `Grep`, `Glob`, `WebFetch`, `Write`) — there is no separate distillation engine and no reach-ins into core code.\n\n## When to use\n\nInvoke when the user wants to *capture* a workflow as a reusable skill:\n\n- `/learn <path>` — read a project/dir and build a skill for working with it\n- `/learn <url>` — read docs / an API page and build a usage skill\n- `/learn what we just did` — distill the current conversation's workflow\n- `/learn` + pasted notes — turn notes into a structured skill\n\nIf the user instead wants to *find and install* an existing community skill, that is a different task — this skill **creates** new skills, it does not import them.\n\n## Workflow\n\n### 1. Identify the source — and whether this is a new skill or a refine\n- A **path** → read the code/files.\n- A **URL** → fetch and read the page.\n- **\"what we just did\" / \"this\"** → use the current conversation as the source.\n- **Pasted text** → use it directly.\n\nThen check `.claude/skills/` for an existing skill that already covers this topic (the user may name it, e.g. *\"update the wow-on-steam-deck skill\"*, or the subject may obviously match one). **If one exists, this is a REFINE, not a fresh create** — go to step 4's \"Refining\" branch.\n\nIf it is ambiguous what the skill should *do*, ask one clarifying question before proceeding.\n\n### 2. Gather the material\n- **Path:** `Glob` the structure, `Read` the key files, `Grep` for the important entry points. Read enough to understand the *repeatable procedure*, not every line.\n- **URL:** `WebFetch` the page; pull out the concrete commands/steps, not the prose.\n- **Conversation:** re-read what was actually done — the commands, the gotchas, the decisions — and keep the parts that generalize.\n\n### 3. Distill — find the reusable procedure\nStrip the one-off specifics; keep the *repeatable* shape. A good skill answers: *\"Next time someone needs to do X, what are the exact steps, files, commands, and gotchas?\"* Capture:\n\n- the trigger / when-to-use,\n- the step-by-step procedure (commands, file paths, decision points),\n- the non-obvious **gotchas** that were hit — usually the most valuable part,\n- any scripts or templates worth shipping alongside.\n\n### 4. Author the SKILL.md\n\n**Refining an existing skill?** First `Read` the current `.claude/skills/<name>/SKILL.md`, then *update it in place* — do not blindly overwrite:\n- Keep what is still correct; weave the new learnings into the right sections.\n- **Dedupe** — don't append a near-duplicate step or a second gotcha that says the same thing.\n- Correct anything the new source proves stale (a changed path, command, or flag).\n- Preserve the existing `name`/folder and overall structure; the diff should read as a focused improvement, not a rewrite.\n\n**New skill?** Write `.claude/skills/<kebab-name>/SKILL.md`.\n\n**Frontmatter (required):**\n\n```yaml\n---\nname: <kebab-case, matches the folder>\ndescription: \"<what it does + when to use it + likely trigger phrases>\"\n---\n```\n\n`description` is what the agent reads to decide relevance — make it concrete and include the phrases a user would actually say.\n\n**Body:** open with one paragraph on what the skill does, then a `## When to use` section and a `## Workflow` of numbered steps (the actual procedure). Use tables for command/file references, and add a short examples or troubleshooting section when the gotchas warrant it.\n\n**House authoring rules (from `docs/skill-guidelines.md`):**\n\n- **Additive, minimal reach-ins** — prefer adding files; make the *smallest possible* edit to existing code, and only via single-line calls into skill-owned functions.\n- **Instruction-only when possible** — if Claude can do it by following prose plus existing tools, ship no code. These are the easiest skills to maintain and to merge.\n- If apply leaves anything behind, ship a **`REMOVE.md`** that fully reverses every change (no soft-disabled/commented-out removals).\n- If the skill adds an integration point in core code, add a **test that goes red if the wiring is deleted or drifts**.\n- Anti-patterns to avoid: separate `VERIFY.md` files, incomplete cleanup, raw SQL against core DBs, branch merges (use additive fetch), hand-maintained duplicate copies.\n\n### 5. Place and verify\n- Write into `.claude/skills/<name>/`; confirm the folder name matches the `name` frontmatter and the YAML parses.\n- If feasible, dry-run the procedure the skill describes to confirm it is correct.\n- Tell the user the skill exists and how to invoke it (`/<name>`).\n\n## Example\n\n`/learn what we just did` after a multi-step setup:\n\n1. Re-read the conversation's commands and gotchas.\n2. Distill the repeatable procedure.\n3. Write `.claude/skills/<topic>-setup/SKILL.md` with the steps, file paths, and the gotchas hit along the way.\n4. Report: *\"Created `/<topic>-setup` — invoke it next time to repeat this.\"*\n\n## Notes\n\n- Keep skills **focused** — one capability per skill (mirrors the project's \"one change per PR\" rule).\n- The most valuable content is the **gotchas**, not the happy path.\n- This skill is prose and safe to re-run — use it again to refine an existing skill.","author":"@nanocoai","ownerProfile":null,"authorContacts":null,"sourceUrl":"https://github.com/nanocoai/nanoclaw/tree/main/.claude/skills/learn","license":"MIT","category":"writing","lang":"en","tokens":1338,"stars":0,"calls30d":1,"claimed":false,"visibility":"public","origin":"crawler","version":"0.1.0","createdAt":"2026-08-22","updatedAt":"2026-08-22","files":[],"requires":{"mcp":[],"tools":[]},"safety":{"flags":[],"scannedAt":"2026-08-22","hasScripts":false,"networkEndpoints":[]}}