Extract reusable patterns from the current session and save them as candidate skills or guidance.
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-ecc-1da596a85919 ,按照其中的说明把「learn」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Analyze the current session and extract any patterns worth saving as skills.
Run /learn at any point during a session when you've solved a non-trivial problem.
Look for:
Error Resolution Patterns
Debugging Techniques
Workarounds
Project-Specific Patterns
Create a skill at ~/.claude/skills/<pattern-name>/SKILL.md:
Before writing, apply these guarded-write requirements:
pattern-name as a lowercase hyphenated slug. Reject path
separators and path traversal, resolve the target, and confirm it remains
inside the approved skill root (~/.claude/skills/).---
name: pattern-name
description: "Use when <observable trigger condition> — <one-line summary of the pattern>"
metadata:
origin: auto-extracted
---
# [Descriptive Pattern Name]
**Extracted:** [Date]
**Context:** [Brief description of when this applies]
## Problem
[What problem this solves - be specific]
## Solution
[The pattern/technique/workaround]
## Example
[Code example if applicable]
## When to Use
[Trigger conditions - what should activate this skill]
~/.claude/skills/<pattern-name>/SKILL.mdSKILL.md, its
parent directory matches name:, the ----delimited frontmatter parses as
valid YAML, and it contains a non-empty description: beginning with an
observable Use when ... trigger. If any check fails, report the specific
failure, remove or quarantine the invalid file, and stop. To repair it,
prepare a corrected draft without writing, show the full path, obtain fresh
explicit approval, then write and rerun validation. Do not report success
until every check passes.The directory form and frontmatter matter because Claude Code discovers
personal skills from <name>/SKILL.md; a flat skills/learned/<name>.md file
is not a skill entrypoint. The trigger-first description helps Claude decide
when to load the skill automatically.