(context)
| 92 | }, |
| 93 | |
| 94 | buildMessages(context) { |
| 95 | const projectSkill = findProjectSkill()! |
| 96 | // Only analyze messages since the last check — the skill definition |
| 97 | // provides enough context for the classifier to understand corrections |
| 98 | const newMessages = context.messages.slice(lastAnalyzedIndex) |
| 99 | lastAnalyzedIndex = context.messages.length |
| 100 | |
| 101 | return [ |
| 102 | createUserMessage({ |
| 103 | content: `You are analyzing a conversation where a user is executing a skill (a repeatable process). |
| 104 | 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. |
| 105 | |
| 106 | <skill_definition> |
| 107 | ${projectSkill.content} |
| 108 | </skill_definition> |
| 109 | |
| 110 | <recent_messages> |
| 111 | ${formatRecentMessages(newMessages)} |
| 112 | </recent_messages> |
| 113 | |
| 114 | Look for: |
| 115 | - Requests to add, change, or remove steps: "can you also ask me X", "please do Y too", "don't do Z" |
| 116 | - Preferences about how steps should work: "ask me about energy levels", "note the time", "use a casual tone" |
| 117 | - Corrections: "no, do X instead", "always use Y", "make sure to..." |
| 118 | |
| 119 | Ignore: |
| 120 | - Routine conversation that doesn't generalize (one-time answers, chitchat) |
| 121 | - Things the skill already does |
| 122 | |
| 123 | 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"}. |
| 124 | Output <updates>[]</updates> if no updates are needed.`, |
| 125 | }), |
| 126 | ] |
| 127 | }, |
| 128 | |
| 129 | systemPrompt: |
| 130 | 'You detect user preferences and process improvements during skill execution. Flag anything the user asks for that should be remembered for next time.', |
nothing calls this directly
no test coverage detected