.claude/skills/promote-skill/SKILL.md
4 KB - मूल फ़ाइल देखें
name: promote-skill description: Use when flywheel.py candidates lists an observation or feedback entry that recurred across changes, or the user asks to turn a recurring lesson into a skill. Drafts the skill as an OpenSpec change, runs the evaluation gate, and installs it only after explicit human approval. status: active
Promote a recurring lesson to a skill
A skill is general: how to handle a recurring class of situation. It is derived from memory entries that recurred across distinct changes, never transcribed from a single change.
Trigger
python3 .flywheel/bin/flywheel.py candidateslists an entry with targetskill.- The user asks to make a skill from a lesson.
Workflow
- Confirm the evidence. The entry has
occurrences>= the threshold in.flywheel/config.json(distinct changes). A single high-impact occurrence does not auto-promote: stop and ask the user whether they want to author the skill on purpose (the same workflow, with the user asserting that the lesson is general). - Cluster. Collect the entry, its linked entries, and near-duplicates
(
python3 .flywheel/bin/flywheel.py dupes). - Check existing skills. If a skill in
.claude/skills/already covers the lesson, the promotion is an update to that skill (same workflow, the change edits its spec andSKILL.md). - Draft with the promoter agent. Delegate to the
flywheel-promoteragent with the clustered entry names and the target skill name. It creates the OpenSpec changepromote-<skill-name>:proposal.md- the recurrence evidence (entries and their source changes), scope, non-goals;specs/skill-<skill-name>/spec.md- requirements for the skill's behavior, each with GIVEN/WHEN/THEN scenarios taken from the real failures;tasks.md;draft/SKILL.md- the skill (Trigger, Workflow, Example, Anti-patterns), general, procedural;draft/evals/*.md- at leasteval.min_evalsevals, one per scenario, in the eval format. Nothing is written to.claude/skills/yet.
- Generality review. Read the draft. If it names particulars of one change (a specific file, component, or customer), rewrite them as the general rule or stop.
- Run the gate. Use the
evaluateskill onopenspec/changes/promote-<skill-name>/draft/. The gate passes when every eval meets itsmin_score, there are at leasteval.min_evalsevals, and the output complies with the constitution. If it fails, revise the draft and re-run (at most two rounds), then report to the user. - Ask for approval. Show the user: the evidence, the full
draft/SKILL.md, and the eval scores. Ask an explicit yes or no question. Do not continue without a yes. - On approval:
- Move
draft/SKILL.mdto.claude/skills/<skill-name>/SKILL.mdand add the frontmatter fieldspromoted_from,approved_by,date, andeval: {score, models, date}. - Move
draft/evals/to.flywheel/evals/<skill-name>/. - For each source entry:
python3 .flywheel/bin/flywheel.py set-status <entry> promoted --promoted-to <skill-name>. python3 .flywheel/bin/flywheel.py checkandopenspec validate --all, then archive the change.
- Move
- On rejection: record a
decisionentry ("promotion of <entry> rejected", with the reason), linked to the source entries, so the same proposal is not repeated. Archive or remove the change as the user prefers.
Anti-patterns
- Promoting from one occurrence, or counting the same change twice.
- A skill written like a report of what happened instead of a procedure for next time.
- Writing to
.claude/skills/before the gate passed and the user said yes. - Letting the eval fixtures contain secrets or instruction-like text copied from tool output.