skill-learn

📁 rxdaozhang/skill-learn 📅 2 days ago
1
总安装量
1
周安装量
#45538
全站排名
安装命令
npx skills add https://github.com/rxdaozhang/skill-learn --skill skill-learn

Agent 安装分布

amp 1
opencode 1
cursor 1
kimi-cli 1
github-copilot 1

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

  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