update-skill-learnings
Non-negotiable rules:
- Only record learnings about skill structure, skill content, anti-patterns, or one skill's design.
- Reject application-code and agent-behavior learnings and route them to the right maintenance workflow.
- Update exactly one canonical learnings file instead of creating parallel copies.
- Check for duplicates or near-duplicates before writing.
- Get explicit user confirmation before modifying the learnings file.
Update Skill Learnings
Inputs
$request: Optional learning candidate, skill name, category hint, or reminder about what the session revealed
Goal
Add one validated skill-authoring learning to the central learnings store by:
- confirming the learning belongs in skill memory
- choosing the right category
- updating the canonical learnings file
- preserving file structure and avoiding duplicates
- reporting exactly what changed
Step 0: Confirm the learning belongs here
This skill is only for persistent guidance about creating, reviewing, or improving skills.
Valid examples:
- structural patterns for better skills
- content patterns that improve clarity or usability
- anti-patterns that repeatedly cause confusion
- one skill's specific design rule that should be remembered centrally
Invalid examples:
- application implementation rules
- agent-behavior rules for the main Claude conversation
- direct requests to rewrite a skill right now
- one-off notes that do not deserve durable memory
Load references/learning-scope.md for routing, category placement, and failure modes.
If the learning does not belong in the skill learnings system, stop and say where it should go instead.
Success criteria: The learning clearly belongs in persistent skill-authoring guidance.
Step 1: Extract one concrete learning
Review the session and identify the smallest useful rule.
Rules:
- prefer one precise learning over a long list of vague observations
- write it in imperative mood
- tie it to a concrete pattern, anti-pattern, or skill-specific rule
- avoid documenting advice that is already implied by stronger existing guidance
Good shape:
- "Keep heavy checklists in references instead of inline in
SKILL.md." - "Mark durable-memory maintenance skills as
disable-model-invocation: true."
Bad shape:
- "Skills should be better."
- "Use clearer instructions."
Success criteria: You have a single actionable learning candidate with a clear rationale.
Step 2: Resolve the canonical learnings file and choose placement
Locate the canonical central learnings file.
Path policy:
- if the repo already has a single existing skill learnings file, use it
- if both
.agentsand.claudevariants exist, update the canonical authoring surface and do not create a second source of truth - in this canonical
.agentstree, prefer.agents/learnings/skill-learnings.md - if the repo still uses
.claude/learnings/skill-learnings.mdas its only learnings store, use that instead
Choose the correct category:
Structural PatternsContent PatternsAnti-PatternsSkill-Specific Learnings
Before writing:
- search for duplicates or near-duplicates
- merge with existing wording if a similar rule already exists
- keep the new instruction small and local
Load:
references/learning-scope.mdfor routing, categories, and duplicate handlingreferences/skill-learnings-template.mdonly if the canonical learnings file does not exist yet
Success criteria: The target file and section are known and duplication risk has been checked.
Step 3: Confirm with the user
Before editing the learnings file, present:
- category
- final wording
- target file
- reason this learning was extracted
Use AskUserQuestion if confirmation or wording refinement is needed.
Do not write until the user explicitly approves the learning.
Success criteria: The user has approved the learning, placement, and target file.
Step 4: Update the learnings file
Apply the minimal correct edit:
- preserve file structure
- insert the learning in the chosen section
- avoid deleting unrelated content
- update the "Last updated" marker only if the file already uses one
Rules:
- if the canonical learnings file is missing, create it from
references/skill-learnings-template.md - if the section is missing, create the smallest compatible section rather than restructuring the whole file
- keep formatting consistent with the existing document
- do not sync or rewrite actual skill files as part of this workflow
Success criteria: The approved learning is present in the right section of the canonical learnings file.
Step 5: Verify and report
Verify:
- the learning was added exactly once
- the category placement is correct
- the file structure still makes sense
- the update did not drift into application-code or agent-behavior territory
Report:
- category
- target file
- section path
- final wording
- whether the file was created or updated
Success criteria: The user can see exactly what durable skill-authoring memory changed.
Guardrails
- Do not let the model invoke this skill proactively; it mutates durable learnings.
- Do not add
context: fork; this workflow edits the active repository. - Do not add
paths:; this is a generic maintenance skill. - Do not keep routing matrices, quality scorecards, or long failure catalogs inline in
SKILL.md. - Do not add a learning without explicit user approval.
- Do not create both
.agents/learnings/skill-learnings.mdand.claude/learnings/skill-learnings.md. - Do not rewrite actual skill files as part of this learnings update.
When To Load References
-
references/learning-scope.mdUse for deciding whether the learning belongs in skill memory, choosing the right category, handling duplicates, and checking common failure modes. -
references/skill-learnings-template.mdUse only when the canonical central learnings file is missing and a minimal compatible file must be created.
Output Contract
Report:
- whether the learning was accepted or redirected elsewhere
- the chosen category and target file
- the final approved wording
- whether the learnings file was created or updated
- any duplicate merge or canonical-path decisions