@rudderhq/agent-runtime-claude-local 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/cli/format-event.d.ts.map +1 -1
  2. package/dist/cli/format-event.js +2 -1
  3. package/dist/cli/format-event.js.map +1 -1
  4. package/dist/server/execute.d.ts.map +1 -1
  5. package/dist/server/execute.js +3 -1
  6. package/dist/server/execute.js.map +1 -1
  7. package/dist/server/parse.d.ts.map +1 -1
  8. package/dist/server/parse.js +3 -1
  9. package/dist/server/parse.js.map +1 -1
  10. package/dist/server/parse.test.d.ts +2 -0
  11. package/dist/server/parse.test.d.ts.map +1 -0
  12. package/dist/server/parse.test.js +26 -0
  13. package/dist/server/parse.test.js.map +1 -0
  14. package/dist/ui/parse-stdout.js +1 -1
  15. package/dist/ui/parse-stdout.js.map +1 -1
  16. package/package.json +2 -2
  17. package/skills/conversation-to-skill/LICENSE.txt +202 -0
  18. package/skills/conversation-to-skill/SKILL.md +428 -0
  19. package/skills/conversation-to-skill/agents/analyzer.md +274 -0
  20. package/skills/conversation-to-skill/agents/comparator.md +202 -0
  21. package/skills/conversation-to-skill/agents/grader.md +223 -0
  22. package/skills/conversation-to-skill/assets/eval_review.html +146 -0
  23. package/skills/conversation-to-skill/eval-viewer/generate_review.py +471 -0
  24. package/skills/conversation-to-skill/eval-viewer/viewer.html +1325 -0
  25. package/skills/conversation-to-skill/references/compatibility.md +36 -0
  26. package/skills/conversation-to-skill/references/description-optimization.md +113 -0
  27. package/skills/conversation-to-skill/references/evaluation-suite.md +410 -0
  28. package/skills/conversation-to-skill/references/schemas.md +431 -0
  29. package/skills/conversation-to-skill/scripts/__init__.py +0 -0
  30. package/skills/conversation-to-skill/scripts/aggregate_benchmark.py +401 -0
  31. package/skills/conversation-to-skill/scripts/generate_report.py +335 -0
  32. package/skills/conversation-to-skill/scripts/improve_description.py +197 -0
  33. package/skills/conversation-to-skill/scripts/model_backends.py +115 -0
  34. package/skills/conversation-to-skill/scripts/package_skill.py +136 -0
  35. package/skills/conversation-to-skill/scripts/quick_validate.py +103 -0
  36. package/skills/conversation-to-skill/scripts/run_eval.py +363 -0
  37. package/skills/conversation-to-skill/scripts/run_loop.py +319 -0
  38. package/skills/conversation-to-skill/scripts/utils.py +223 -0
  39. package/skills/rudder/references/organization-skills.md +1 -1
  40. package/skills/skill-creator/SKILL.md +9 -0
  41. package/skills/skill-optimizer/CHANGELOG.md +29 -0
  42. package/skills/skill-optimizer/SKILL.md +205 -0
  43. package/skills/skill-optimizer/references/adapters/creative-brand-content.md +30 -0
  44. package/skills/skill-optimizer/references/adapters/customer-support-sales.md +30 -0
  45. package/skills/skill-optimizer/references/adapters/document-data-processing.md +31 -0
  46. package/skills/skill-optimizer/references/adapters/education-training.md +31 -0
  47. package/skills/skill-optimizer/references/adapters/finance-accounting.md +31 -0
  48. package/skills/skill-optimizer/references/adapters/healthcare-operations.md +30 -0
  49. package/skills/skill-optimizer/references/adapters/hr-people-ops.md +31 -0
  50. package/skills/skill-optimizer/references/adapters/legal-compliance.md +31 -0
  51. package/skills/skill-optimizer/references/adapters/operations-supply-chain.md +31 -0
  52. package/skills/skill-optimizer/references/adapters/personal-productivity.md +29 -0
  53. package/skills/skill-optimizer/references/adapters/research-knowledge.md +31 -0
  54. package/skills/skill-optimizer/references/adapters/software-ai.md +31 -0
  55. package/skills/skill-optimizer/references/domain-adapter-patterns.md +66 -0
  56. package/skills/skill-optimizer/references/eval-method.md +17 -0
  57. package/skills/skill-optimizer/references/universal-optimization-lens.md +73 -0
@@ -0,0 +1,428 @@
1
+ ---
2
+ name: conversation-to-skill
3
+ description: >
4
+ Turn the current conversation's workflow into a reusable agent skill. Use this
5
+ whenever the user wants to make a workflow reusable, standardize a successful
6
+ thread, package an agent capability, or convert an ad hoc process into a
7
+ repeatable skill. Read the thread first, extract the stable pattern, decide
8
+ whether the skill should live in `~/.agents/skills/<name>` or
9
+ `<project-path>/.agents/skills/<name>`, write the skill, and when quality
10
+ matters add lightweight evals and iteration instead of just transcribing the
11
+ chat.
12
+ ---
13
+
14
+ # Conversation To Skill
15
+
16
+ This skill turns the work happening in the current conversation into a reusable
17
+ agent skill.
18
+
19
+ Its job is not just to write `SKILL.md`.
20
+ Its job is to identify the durable workflow, separate it from one-off thread
21
+ noise, decide the right packaging and placement, and produce a skill that will
22
+ actually help a future agent perform better.
23
+
24
+ When useful, this skill should borrow the practical methods of `skill-creator`:
25
+ good descriptions, clean skill structure, eval-friendly organization, and an
26
+ improve-via-feedback loop. When this skill owns evaluation, bundle the relevant
27
+ toolchain locally under `agents/`, `assets/`, `eval-viewer/`, `scripts/`, and
28
+ `references/` so it stays self-contained instead of depending on another skill
29
+ directory at runtime.
30
+
31
+ ## Use This Skill For
32
+
33
+ Use this skill when the user is trying to:
34
+
35
+ - turn the current task or workflow into a reusable skill
36
+ - capture a successful collaboration pattern for future runs
37
+ - standardize how a class of tasks should be handled
38
+ - extract a repeatable agent workflow from the current thread
39
+ - package a reasoning framework, execution sequence, or artifact pattern into a skill
40
+ - upgrade an existing draft skill so it is general, usable, and easier to trigger
41
+
42
+ Typical prompts:
43
+
44
+ - "Turn what we're doing into a skill."
45
+ - "I want this conversation to become an agent capability."
46
+ - "Make this reusable for next time."
47
+ - "Abstract this workflow into a Codex skill."
48
+ - "This should be a standard operating pattern, not a one-off chat."
49
+ - "Clean up this skill and make it actually reusable."
50
+
51
+ ## Do Not Use This Skill For
52
+
53
+ Do not use this skill when the user mainly wants:
54
+
55
+ - a summary of the conversation without creating a reusable skill
56
+ - immediate execution of the task with no abstraction step
57
+ - a skill generated from multiple unseen threads you cannot inspect
58
+ - a rigid template that blindly copies file paths, project names, or temporary constraints
59
+ - a generic skill factory that ignores what was actually valuable in the conversation
60
+
61
+ If the conversation does not yet reveal a stable workflow, say that plainly and
62
+ help the user clarify the reusable part first.
63
+
64
+ ## Core Principles
65
+
66
+ ### Capture The Repeatable Value
67
+
68
+ The skill should capture the repeatable value, not the accidental details.
69
+
70
+ A good abstraction preserves:
71
+
72
+ - the job to be done
73
+ - the trigger conditions
74
+ - the critical inputs and outputs
75
+ - the sequence of reasoning or execution
76
+ - the judgment criteria that make the workflow valuable
77
+ - the boundaries and non-goals
78
+
79
+ A bad abstraction copies:
80
+
81
+ - temporary filenames
82
+ - irrelevant project-specific paths
83
+ - incidental tools that happened to be used once
84
+ - order-of-operations that are not actually essential
85
+ - user wording that does not generalize
86
+
87
+ ### Explain Why, Not Just What
88
+
89
+ Prefer instructions that explain why a step matters.
90
+ Avoid brittle mandates unless the workflow truly requires them.
91
+
92
+ If you find yourself writing a long list of rigid commands with no reasoning,
93
+ you are probably transcribing the thread instead of building a skill.
94
+
95
+ ### Choose The Smallest Useful Shape
96
+
97
+ Do not overbuild the skill.
98
+ Use the smallest structure that preserves the capability:
99
+
100
+ - `SKILL.md` only, when the workflow is mostly reasoning and sequencing
101
+ - `SKILL.md` plus `references/`, when the skill needs domain guidance
102
+ - `SKILL.md` plus `scripts/`, when deterministic repeated work should be bundled
103
+ - `SKILL.md` plus `evals/`, when the skill benefits from repeatable testing
104
+
105
+ ### Decide Placement Before Writing Files
106
+
107
+ Pick the skill location before creating files so the paths stay stable:
108
+
109
+ - **Global**: `~/.agents/skills/<skill-name>`
110
+ - **Project-based**: `<project-path>/.agents/skills/<skill-name>`
111
+
112
+ If the user wants a global skill to be discoverable by Codex immediately, also
113
+ create:
114
+
115
+ - `~/.codex/skills/<skill-name>` as a symlink to the global skill directory
116
+
117
+ If you plan to run evals, place the workspace next to the skill directory as:
118
+
119
+ - `<skill-name>-workspace/`
120
+
121
+ ## Default Workflow
122
+
123
+ Follow this sequence unless the user already provided enough structure.
124
+
125
+ ### 1. Extract The Candidate Skill From The Current Thread
126
+
127
+ Read the current conversation first.
128
+ Pull out the real workflow before asking the user to restate everything.
129
+
130
+ Capture:
131
+
132
+ - what the user was trying to achieve
133
+ - what sequence of steps the agent followed or should follow
134
+ - which tools or artifacts mattered
135
+ - what corrections or preferences the user introduced
136
+ - what output the user actually wanted
137
+ - what makes this reusable instead of one-off
138
+
139
+ ### 2. Separate Stable Pattern From Incidental Context
140
+
141
+ Classify each detail into one of three buckets:
142
+
143
+ - **Core**: must stay because the skill breaks without it
144
+ - **Contextual**: useful examples or defaults, but not universal
145
+ - **Incidental**: this-thread noise that should not be baked into the skill
146
+
147
+ Useful heuristic:
148
+
149
+ - if the detail would still matter in six months on a different project, it is probably core
150
+ - if it only mattered because of this repository, filename, or user phrasing, it is probably contextual or incidental
151
+
152
+ ### 3. Fill Gaps With Minimal Interview Or Research
153
+
154
+ Do not ask the user to restate the whole workflow if the thread already tells
155
+ you most of it.
156
+ Only ask for the missing pieces that affect the resulting skill:
157
+
158
+ - what this skill should enable the agent to do
159
+ - when the skill should trigger
160
+ - what output format or artifact the user expects
161
+ - whether lightweight test prompts would help validate the result
162
+
163
+ If examples, edge cases, dependencies, or adjacent skills matter, gather that
164
+ context before writing the final version.
165
+
166
+ ### 4. Produce An Abstraction Brief Before Writing Files
167
+
168
+ Before generating the final skill, write a short abstraction brief for the user
169
+ to review unless they already said to just build it.
170
+
171
+ Use this structure:
172
+
173
+ ```markdown
174
+ ## Skill Intent
175
+ - Name:
176
+ - Goal:
177
+ - Why this should exist:
178
+
179
+ ## Trigger
180
+ - Use when:
181
+ - Do not use when:
182
+
183
+ ## Inputs
184
+ - Required inputs:
185
+ - Optional inputs:
186
+
187
+ ## Outputs
188
+ - Main deliverable:
189
+ - Secondary artifacts:
190
+
191
+ ## Workflow
192
+ 1. ...
193
+ 2. ...
194
+ 3. ...
195
+
196
+ ## Judgment Rules
197
+ - What must stay true:
198
+ - What to avoid:
199
+
200
+ ## Open Questions
201
+ - ...
202
+ ```
203
+
204
+ If the conversation already settles these points, keep the brief short and move
205
+ on.
206
+
207
+ ### 5. Challenge Weak Abstractions
208
+
209
+ Do not act like a passive stenographer.
210
+ If the proposed skill is overfit, under-scoped, or missing the real judgment
211
+ logic, say so and correct it.
212
+
213
+ Common failure modes to call out:
214
+
215
+ - "This is a transcript, not a skill."
216
+ - "These instructions depend on this exact repo, but the user asked for a global skill."
217
+ - "The workflow says what to do, but not how to decide when a step is necessary."
218
+ - "The description would under-trigger because it only names one phrasing."
219
+ - "This skill repeats manual work that should be moved into a bundled script."
220
+
221
+ ### 6. Decide Location, Shape, And Scope
222
+
223
+ Make these decisions before writing:
224
+
225
+ - whether the skill is global or project-based
226
+ - whether to preserve an existing name and directory
227
+ - whether `SKILL.md` alone is enough
228
+ - whether the skill needs `references/`, `scripts/`, `assets/`, or `evals/`
229
+ - whether a sibling workspace should be created for testing
230
+
231
+ Default location rules:
232
+
233
+ - **Global skill**: `~/.agents/skills/<skill-name>`
234
+ - **Project-based skill**: `<project-path>/.agents/skills/<skill-name>`
235
+
236
+ If updating an existing skill, preserve the directory name and frontmatter name
237
+ unless the user asked for a rename.
238
+
239
+ ### 7. Write The Skill Like A Real Skill
240
+
241
+ When writing `SKILL.md`, include:
242
+
243
+ - frontmatter with `name` and a trigger-oriented `description`
244
+ - what the skill is for
245
+ - when to use it and when not to use it
246
+ - the default workflow
247
+ - output expectations
248
+ - edge cases and boundaries when they materially affect quality
249
+
250
+ Bring in the `skill-creator` quality bar here:
251
+
252
+ - make the description a little aggressive so hosts do not under-trigger it
253
+ - include both what the skill does and the contexts that should trigger it
254
+ - prefer imperative instructions
255
+ - explain the reasoning behind important steps
256
+ - keep the file readable; if it grows too large, move detail into references
257
+
258
+ ### 8. Use Clean Skill Structure
259
+
260
+ Prefer this structure when it helps:
261
+
262
+ ```text
263
+ skill-name/
264
+ ├── SKILL.md
265
+ ├── references/
266
+ ├── scripts/
267
+ ├── assets/
268
+ └── evals/
269
+ ```
270
+
271
+ Use progressive disclosure:
272
+
273
+ 1. metadata in frontmatter should be enough to trigger the skill
274
+ 2. `SKILL.md` should explain the workflow clearly
275
+ 3. large reference material should be loaded only when relevant
276
+
277
+ When the skill supports multiple variants or domains, organize references by
278
+ variant and tell the future agent which file to read for which case.
279
+
280
+ If the user wants more than a draft, or explicitly asks for testing,
281
+ benchmarking, or trigger tuning, add local references that capture the
282
+ evaluation workflow instead of leaving that logic implicit.
283
+
284
+ If the workflow needs actual tooling, prefer bundling it inside this skill
285
+ rather than pointing at another repo's copy.
286
+
287
+ ### 9. Bundle Repeated Deterministic Work
288
+
289
+ If multiple runs of the workflow would obviously repeat the same deterministic
290
+ steps, package that work into `scripts/` instead of forcing future agents to
291
+ reinvent it every time.
292
+
293
+ Good candidates:
294
+
295
+ - file conversions
296
+ - formatting helpers
297
+ - benchmark aggregation
298
+ - schema validation
299
+ - packaging helpers
300
+
301
+ Do not add scripts just because you can.
302
+ Only bundle work that is repeated, stable, and cheaper to reuse than to re-derive.
303
+
304
+ ### 10. Add Evals With The Full Suite When The Skill Warrants Them
305
+
306
+ Not every conversation-derived skill needs evals.
307
+ But if the skill produces objectively testable outputs, if the user asks for
308
+ benchmarking, or if you are iterating on quality instead of just drafting, do
309
+ not stop at a hand-wavy "light eval."
310
+
311
+ When you choose to evaluate, use the full evaluation suite:
312
+
313
+ - create 2-3 realistic test prompts and store them in `evals/evals.json`
314
+ - create a sibling `<skill-name>-workspace/` for iteration outputs
315
+ - compare `with_skill` against `without_skill` or an old snapshot
316
+ - draft assertions while runs are executing
317
+ - capture timing and grading artifacts per run
318
+ - aggregate results into a benchmark
319
+ - generate a reviewable viewer artifact for the human
320
+ - read feedback, improve the skill, and rerun into the next iteration
321
+
322
+ The detailed procedure lives in:
323
+
324
+ - `references/evaluation-suite.md` for test execution, grading, benchmark aggregation, feedback, and iteration
325
+ - `references/description-optimization.md` for trigger-query generation and description tuning
326
+ - `references/compatibility.md` and `references/schemas.md` for host differences and file formats
327
+
328
+ The local support toolchain lives in:
329
+
330
+ - `agents/` for grader, comparator, and analyst instructions
331
+ - `assets/` for review UI assets
332
+ - `eval-viewer/` for viewer generation
333
+ - `scripts/` for aggregation, optimization, validation, and packaging
334
+
335
+ If you decide evals are needed, read those reference files before proceeding.
336
+
337
+ Prefer qualitative review for subjective skills.
338
+ Prefer assertions and benchmarks for objective skills.
339
+
340
+ ### 11. Iterate Instead Of Fossilizing Bad Drafts
341
+
342
+ If the first draft feels narrow, ambiguous, or weakly triggered, improve it.
343
+ Useful improvement passes include:
344
+
345
+ - description tuning for better triggering
346
+ - removing overfit instructions
347
+ - generalizing from user feedback
348
+ - turning repeated ad hoc steps into bundled resources
349
+ - simplifying sections that make the model do busywork
350
+
351
+ Do not force a full benchmark loop if the user only wants a draft.
352
+ But do not pretend the first draft is final if it clearly is not.
353
+
354
+ ### 12. Close With A Clear Hand-off
355
+
356
+ After creating or revising the skill, report:
357
+
358
+ - the chosen skill name
359
+ - whether it is global or project-based
360
+ - the final path
361
+ - whether a Codex symlink was created
362
+ - whether eval files or a workspace were created
363
+ - what still needs evaluation, if anything
364
+
365
+ ## Naming Guidance
366
+
367
+ Choose names that are short, clear, and capability-oriented.
368
+
369
+ Prefer names like:
370
+
371
+ - `conversation-to-skill`
372
+ - `workflow-standardizer`
373
+ - `task-to-playbook`
374
+
375
+ Avoid names that depend on this thread's temporary wording unless the user
376
+ explicitly wants that.
377
+
378
+ If updating an existing skill, preserve the existing directory name and
379
+ frontmatter name unless the user asked for a rename.
380
+
381
+ ## Output Format
382
+
383
+ Unless the user wants files written immediately, start with:
384
+
385
+ 1. a compact abstraction brief
386
+ 2. the proposed skill name and placement
387
+ 3. any risks of overfitting or under-specification
388
+
389
+ If the user asks to proceed, then write the files.
390
+
391
+ When the user already said "build it" or "just make it", go straight from the
392
+ brief into file creation in the same turn.
393
+
394
+ If you also set up evals, mention:
395
+
396
+ - the test prompts
397
+ - what is being compared
398
+ - where the reviewable output lives
399
+
400
+ ## Quality Bar
401
+
402
+ The resulting skill should make a future agent meaningfully better at the task.
403
+
404
+ That usually means it captures at least one of these:
405
+
406
+ - a reusable workflow
407
+ - a reusable decision framework
408
+ - a reusable artifact format
409
+ - a reusable boundary or escalation rule
410
+
411
+ Strong skills often also have at least one of these:
412
+
413
+ - a well-targeted description that triggers reliably
414
+ - a clean placement and file layout
415
+ - a bundled helper for repeated deterministic work
416
+ - a full eval loop that makes improvements testable
417
+
418
+ If it captures none of those, it is probably not a real skill yet.
419
+
420
+ ## Safety And Boundaries
421
+
422
+ Do not create misleading, hostile, or surprise-heavy skills.
423
+ The skill should do what its description honestly suggests.
424
+
425
+ Do not package instructions that facilitate unauthorized access, harmful
426
+ automation, or disguised exfiltration.
427
+
428
+ Roleplay, stylistic framing, and benign workflow abstraction are fine.
@@ -0,0 +1,274 @@
1
+ # Post-hoc Analyzer Agent
2
+
3
+ Analyze blind comparison results to understand WHY the winner won and generate improvement suggestions.
4
+
5
+ ## Role
6
+
7
+ After the blind comparator determines a winner, the Post-hoc Analyzer "unblids" the results by examining the skills and transcripts. The goal is to extract actionable insights: what made the winner better, and how can the loser be improved?
8
+
9
+ ## Inputs
10
+
11
+ You receive these parameters in your prompt:
12
+
13
+ - **winner**: "A" or "B" (from blind comparison)
14
+ - **winner_skill_path**: Path to the skill that produced the winning output
15
+ - **winner_transcript_path**: Path to the execution transcript for the winner
16
+ - **loser_skill_path**: Path to the skill that produced the losing output
17
+ - **loser_transcript_path**: Path to the execution transcript for the loser
18
+ - **comparison_result_path**: Path to the blind comparator's output JSON
19
+ - **output_path**: Where to save the analysis results
20
+
21
+ ## Process
22
+
23
+ ### Step 1: Read Comparison Result
24
+
25
+ 1. Read the blind comparator's output at comparison_result_path
26
+ 2. Note the winning side (A or B), the reasoning, and any scores
27
+ 3. Understand what the comparator valued in the winning output
28
+
29
+ ### Step 2: Read Both Skills
30
+
31
+ 1. Read the winner skill's SKILL.md and key referenced files
32
+ 2. Read the loser skill's SKILL.md and key referenced files
33
+ 3. Identify structural differences:
34
+ - Instructions clarity and specificity
35
+ - Script/tool usage patterns
36
+ - Example coverage
37
+ - Edge case handling
38
+
39
+ ### Step 3: Read Both Transcripts
40
+
41
+ 1. Read the winner's transcript
42
+ 2. Read the loser's transcript
43
+ 3. Compare execution patterns:
44
+ - How closely did each follow their skill's instructions?
45
+ - What tools were used differently?
46
+ - Where did the loser diverge from optimal behavior?
47
+ - Did either encounter errors or make recovery attempts?
48
+
49
+ ### Step 4: Analyze Instruction Following
50
+
51
+ For each transcript, evaluate:
52
+ - Did the agent follow the skill's explicit instructions?
53
+ - Did the agent use the skill's provided tools/scripts?
54
+ - Were there missed opportunities to leverage skill content?
55
+ - Did the agent add unnecessary steps not in the skill?
56
+
57
+ Score instruction following 1-10 and note specific issues.
58
+
59
+ ### Step 5: Identify Winner Strengths
60
+
61
+ Determine what made the winner better:
62
+ - Clearer instructions that led to better behavior?
63
+ - Better scripts/tools that produced better output?
64
+ - More comprehensive examples that guided edge cases?
65
+ - Better error handling guidance?
66
+
67
+ Be specific. Quote from skills/transcripts where relevant.
68
+
69
+ ### Step 6: Identify Loser Weaknesses
70
+
71
+ Determine what held the loser back:
72
+ - Ambiguous instructions that led to suboptimal choices?
73
+ - Missing tools/scripts that forced workarounds?
74
+ - Gaps in edge case coverage?
75
+ - Poor error handling that caused failures?
76
+
77
+ ### Step 7: Generate Improvement Suggestions
78
+
79
+ Based on the analysis, produce actionable suggestions for improving the loser skill:
80
+ - Specific instruction changes to make
81
+ - Tools/scripts to add or modify
82
+ - Examples to include
83
+ - Edge cases to address
84
+
85
+ Prioritize by impact. Focus on changes that would have changed the outcome.
86
+
87
+ ### Step 8: Write Analysis Results
88
+
89
+ Save structured analysis to `{output_path}`.
90
+
91
+ ## Output Format
92
+
93
+ Write a JSON file with this structure:
94
+
95
+ ```json
96
+ {
97
+ "comparison_summary": {
98
+ "winner": "A",
99
+ "winner_skill": "path/to/winner/skill",
100
+ "loser_skill": "path/to/loser/skill",
101
+ "comparator_reasoning": "Brief summary of why comparator chose winner"
102
+ },
103
+ "winner_strengths": [
104
+ "Clear step-by-step instructions for handling multi-page documents",
105
+ "Included validation script that caught formatting errors",
106
+ "Explicit guidance on fallback behavior when OCR fails"
107
+ ],
108
+ "loser_weaknesses": [
109
+ "Vague instruction 'process the document appropriately' led to inconsistent behavior",
110
+ "No script for validation, agent had to improvise and made errors",
111
+ "No guidance on OCR failure, agent gave up instead of trying alternatives"
112
+ ],
113
+ "instruction_following": {
114
+ "winner": {
115
+ "score": 9,
116
+ "issues": [
117
+ "Minor: skipped optional logging step"
118
+ ]
119
+ },
120
+ "loser": {
121
+ "score": 6,
122
+ "issues": [
123
+ "Did not use the skill's formatting template",
124
+ "Invented own approach instead of following step 3",
125
+ "Missed the 'always validate output' instruction"
126
+ ]
127
+ }
128
+ },
129
+ "improvement_suggestions": [
130
+ {
131
+ "priority": "high",
132
+ "category": "instructions",
133
+ "suggestion": "Replace 'process the document appropriately' with explicit steps: 1) Extract text, 2) Identify sections, 3) Format per template",
134
+ "expected_impact": "Would eliminate ambiguity that caused inconsistent behavior"
135
+ },
136
+ {
137
+ "priority": "high",
138
+ "category": "tools",
139
+ "suggestion": "Add validate_output.py script similar to winner skill's validation approach",
140
+ "expected_impact": "Would catch formatting errors before final output"
141
+ },
142
+ {
143
+ "priority": "medium",
144
+ "category": "error_handling",
145
+ "suggestion": "Add fallback instructions: 'If OCR fails, try: 1) different resolution, 2) image preprocessing, 3) manual extraction'",
146
+ "expected_impact": "Would prevent early failure on difficult documents"
147
+ }
148
+ ],
149
+ "transcript_insights": {
150
+ "winner_execution_pattern": "Read skill -> Followed 5-step process -> Used validation script -> Fixed 2 issues -> Produced output",
151
+ "loser_execution_pattern": "Read skill -> Unclear on approach -> Tried 3 different methods -> No validation -> Output had errors"
152
+ }
153
+ }
154
+ ```
155
+
156
+ ## Guidelines
157
+
158
+ - **Be specific**: Quote from skills and transcripts, don't just say "instructions were unclear"
159
+ - **Be actionable**: Suggestions should be concrete changes, not vague advice
160
+ - **Focus on skill improvements**: The goal is to improve the losing skill, not critique the agent
161
+ - **Prioritize by impact**: Which changes would most likely have changed the outcome?
162
+ - **Consider causation**: Did the skill weakness actually cause the worse output, or is it incidental?
163
+ - **Stay objective**: Analyze what happened, don't editorialize
164
+ - **Think about generalization**: Would this improvement help on other evals too?
165
+
166
+ ## Categories for Suggestions
167
+
168
+ Use these categories to organize improvement suggestions:
169
+
170
+ | Category | Description |
171
+ |----------|-------------|
172
+ | `instructions` | Changes to the skill's prose instructions |
173
+ | `tools` | Scripts, templates, or utilities to add/modify |
174
+ | `examples` | Example inputs/outputs to include |
175
+ | `error_handling` | Guidance for handling failures |
176
+ | `structure` | Reorganization of skill content |
177
+ | `references` | External docs or resources to add |
178
+
179
+ ## Priority Levels
180
+
181
+ - **high**: Would likely change the outcome of this comparison
182
+ - **medium**: Would improve quality but may not change win/loss
183
+ - **low**: Nice to have, marginal improvement
184
+
185
+ ---
186
+
187
+ # Analyzing Benchmark Results
188
+
189
+ When analyzing benchmark results, the analyzer's purpose is to **surface patterns and anomalies** across multiple runs, not suggest skill improvements.
190
+
191
+ ## Role
192
+
193
+ Review all benchmark run results and generate freeform notes that help the user understand skill performance. Focus on patterns that wouldn't be visible from aggregate metrics alone.
194
+
195
+ ## Inputs
196
+
197
+ You receive these parameters in your prompt:
198
+
199
+ - **benchmark_data_path**: Path to the in-progress benchmark.json with all run results
200
+ - **skill_path**: Path to the skill being benchmarked
201
+ - **output_path**: Where to save the notes (as JSON array of strings)
202
+
203
+ ## Process
204
+
205
+ ### Step 1: Read Benchmark Data
206
+
207
+ 1. Read the benchmark.json containing all run results
208
+ 2. Note the configurations tested (with_skill, without_skill)
209
+ 3. Understand the run_summary aggregates already calculated
210
+
211
+ ### Step 2: Analyze Per-Assertion Patterns
212
+
213
+ For each expectation across all runs:
214
+ - Does it **always pass** in both configurations? (may not differentiate skill value)
215
+ - Does it **always fail** in both configurations? (may be broken or beyond capability)
216
+ - Does it **always pass with skill but fail without**? (skill clearly adds value here)
217
+ - Does it **always fail with skill but pass without**? (skill may be hurting)
218
+ - Is it **highly variable**? (flaky expectation or non-deterministic behavior)
219
+
220
+ ### Step 3: Analyze Cross-Eval Patterns
221
+
222
+ Look for patterns across evals:
223
+ - Are certain eval types consistently harder/easier?
224
+ - Do some evals show high variance while others are stable?
225
+ - Are there surprising results that contradict expectations?
226
+
227
+ ### Step 4: Analyze Metrics Patterns
228
+
229
+ Look at time_seconds, tokens, tool_calls:
230
+ - Does the skill significantly increase execution time?
231
+ - Is there high variance in resource usage?
232
+ - Are there outlier runs that skew the aggregates?
233
+
234
+ ### Step 5: Generate Notes
235
+
236
+ Write freeform observations as a list of strings. Each note should:
237
+ - State a specific observation
238
+ - Be grounded in the data (not speculation)
239
+ - Help the user understand something the aggregate metrics don't show
240
+
241
+ Examples:
242
+ - "Assertion 'Output is a PDF file' passes 100% in both configurations - may not differentiate skill value"
243
+ - "Eval 3 shows high variance (50% ± 40%) - run 2 had an unusual failure that may be flaky"
244
+ - "Without-skill runs consistently fail on table extraction expectations (0% pass rate)"
245
+ - "Skill adds 13s average execution time but improves pass rate by 50%"
246
+ - "Token usage is 80% higher with skill, primarily due to script output parsing"
247
+ - "All 3 without-skill runs for eval 1 produced empty output"
248
+
249
+ ### Step 6: Write Notes
250
+
251
+ Save notes to `{output_path}` as a JSON array of strings:
252
+
253
+ ```json
254
+ [
255
+ "Assertion 'Output is a PDF file' passes 100% in both configurations - may not differentiate skill value",
256
+ "Eval 3 shows high variance (50% ± 40%) - run 2 had an unusual failure",
257
+ "Without-skill runs consistently fail on table extraction expectations",
258
+ "Skill adds 13s average execution time but improves pass rate by 50%"
259
+ ]
260
+ ```
261
+
262
+ ## Guidelines
263
+
264
+ **DO:**
265
+ - Report what you observe in the data
266
+ - Be specific about which evals, expectations, or runs you're referring to
267
+ - Note patterns that aggregate metrics would hide
268
+ - Provide context that helps interpret the numbers
269
+
270
+ **DO NOT:**
271
+ - Suggest improvements to the skill (that's for the improvement step, not benchmarking)
272
+ - Make subjective quality judgments ("the output was good/bad")
273
+ - Speculate about causes without evidence
274
+ - Repeat information already in the run_summary aggregates