skill-learn
npx skills add https://github.com/rxdaozhang/skill-learn --skill skill-learn
Agent 安装分布
Skill 文档
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
- Resolve the target skill.
- Collect evidence from the current conversation only.
- Extract lessons in a strict schema.
- Propose incremental file updates.
- Show diff/patch before write.
- Apply changes only after explicit confirmation.
Resolve Target Skill
Follow this resolution order:
- Use explicit target path from user input if provided.
- Otherwise infer from the most recently used skill in the current context.
- 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:
- Never rewrite the entire file.
- Prefer updating an existing anchored section such as
## Lessons Learned. - If no suitable anchor exists, append a bounded new section at the end.
- Keep unrelated sections unchanged.
- Keep
SKILL.mdconcise; move long canonical detail toreferences/skill-learn-lessons.mdin the target skill and add a pointer fromSKILL.md.
Do not delete or reorder unrelated guidance unless explicitly requested.
Diff-First Confirmation
Before any write:
- Present a readable diff/patch for each target file.
- Summarize the expected behavioral improvement.
- Ask for explicit confirmation.
Write only after confirmation. If confirmation is not provided, stop after delivering the proposal.
Failure Handling
Handle these cases explicitly:
- Target skill not found: ask for path or exact skill name.
- Multiple candidate targets: request disambiguation.
- No clear lessons with evidence: return “no high-confidence lesson updates.”
- Requested change violates incremental policy: explain and offer an incremental alternative.
Output Format
Use this response structure:
Target SkillEvidence ExtractedProposed Lessons(Rule / Anti-pattern / Correction / Trigger / Example)Proposed File ChangesDiff PreviewConfirmation Request