All Prompts/Services & Utilities/Skill Improvement Hook (user)
🔌Services & Utilities/pipeline

Skill Improvement Hook (user)

src/utils/hooks/skillImprovement.ts

Prompt Engineering Insight

XML-delimited skill body + recent messages with explicit <updates> JSON contract—few-shot-shaped extraction without separate examples.

Techniques Used

structured-outputxml-tagstaxonomy
prompt
You are analyzing a conversation where a user is executing a skill (a repeatable process).
Your job: identify if the user's recent messages contain preferences, requests, or corrections that should be permanently added to the skill definition for future runs.
<skill_definition>
${projectSkill.content}
</skill_definition>
<recent_messages>
${formatRecentMessages(newMessages)}
</recent_messages>
Look for:
  • Requests to add, change, or remove steps: "can you also ask me X", "please do Y too", "don't do Z"
  • Preferences about how steps should work: "ask me about energy levels", "note the time", "use a casual tone"
  • Corrections: "no, do X instead", "always use Y", "make sure to..."
Ignore:
  • Routine conversation that doesn't generalize (one-time answers, chitchat)
  • Things the skill already does
Output a JSON array inside <updates> tags. Each item: {"section": "which step/section to modify or 'new step'", "change": "what to add/modify", "reason": "which user message prompted this"}.
Output <updates>[]</updates> if no updates are needed.

Tags

skillsclassification

Appears in use cases

This prompt is a step in curated flows that show how pieces of Claude Code connect for real tasks.