tarsk 0.5.41 → 0.5.43

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 (106) hide show
  1. package/dist/bundled-skills/skill-creator/LICENSE.txt +202 -0
  2. package/dist/bundled-skills/skill-creator/SKILL.md +510 -0
  3. package/dist/bundled-skills/skill-creator/agents/analyzer.md +283 -0
  4. package/dist/bundled-skills/skill-creator/agents/comparator.md +203 -0
  5. package/dist/bundled-skills/skill-creator/agents/grader.md +227 -0
  6. package/dist/bundled-skills/skill-creator/assets/eval_review.html +292 -0
  7. package/dist/bundled-skills/skill-creator/eval-viewer/generate_review.js +544 -0
  8. package/dist/bundled-skills/skill-creator/eval-viewer/viewer.html +1478 -0
  9. package/dist/bundled-skills/skill-creator/package.json +3 -0
  10. package/dist/bundled-skills/skill-creator/references/schemas.md +423 -0
  11. package/dist/bundled-skills/skill-creator/scripts/aggregate_benchmark.js +377 -0
  12. package/dist/bundled-skills/skill-creator/scripts/generate_report.js +345 -0
  13. package/dist/bundled-skills/skill-creator/scripts/improve_description.js +263 -0
  14. package/dist/bundled-skills/skill-creator/scripts/package_skill.js +147 -0
  15. package/dist/bundled-skills/skill-creator/scripts/quick_validate.js +132 -0
  16. package/dist/bundled-skills/skill-creator/scripts/run_eval.js +345 -0
  17. package/dist/bundled-skills/skill-creator/scripts/run_loop.js +411 -0
  18. package/dist/bundled-skills/skill-creator/scripts/utils.js +60 -0
  19. package/dist/index.js +8817 -6340
  20. package/dist/public/assets/{account-view-D-dJ0y-D.js → account-view-xKotpUyx.js} +1 -1
  21. package/dist/public/assets/api-D6uLdHBQ.js +1 -0
  22. package/dist/public/assets/browser-tab-DxigYzoT.js +1 -0
  23. package/dist/public/assets/commit-dialog-CLQM9ah3.js +1 -0
  24. package/dist/public/assets/context-menu-rC7iWcty.js +1 -0
  25. package/dist/public/assets/create-repo-dialog-C6k5wZPW.js +1 -0
  26. package/dist/public/assets/{dialogs-config-B-LZ4nOb.js → dialogs-config-CjKh5Rl2.js} +14 -14
  27. package/dist/public/assets/diff-view-DWDWI5nl.js +3 -0
  28. package/dist/public/assets/explorer-tab-view-B0kT8Hl6.js +2 -0
  29. package/dist/public/assets/explorer-tree-BC4fBpxi.js +1 -0
  30. package/dist/public/assets/explorer-view-DIM08sdy.js +1 -0
  31. package/dist/public/assets/git-history-dialog-CuxOTngT.js +1 -0
  32. package/dist/public/assets/git-ops-button-C04zFAnF.js +2 -0
  33. package/dist/public/assets/history-view-ar7GLZ-R.js +9 -0
  34. package/dist/public/assets/index--HY4BbcM.js +90 -0
  35. package/dist/public/assets/index-DKOXV50p.css +1 -0
  36. package/dist/public/assets/mcp-server-card-Cy4RU2_Q.js +1 -0
  37. package/dist/public/assets/merged-pr-dialog-Bo07VouF.js +1 -0
  38. package/dist/public/assets/model-star-rating-BmkpdXfr.js +1 -0
  39. package/dist/public/assets/onboarding-ClZrOxX7.js +1 -0
  40. package/dist/public/assets/project-settings-view-Dm9pQAp_.js +1 -0
  41. package/dist/public/assets/providers-list-view-D5gHsjl_.js +1 -0
  42. package/dist/public/assets/pull-request-dialog-8AYlOUNX.js +1 -0
  43. package/dist/public/assets/pull-with-changes-dialog-CSa5OE-d.js +1 -0
  44. package/dist/public/assets/push-before-pr-dialog-D5W_xsqv.js +1 -0
  45. package/dist/public/assets/radio-group-CbatNaj1.js +1 -0
  46. package/dist/public/assets/react-vendor-DwQYi7es.js +16 -0
  47. package/dist/public/assets/settings-general-view-BP5ULy9A.js +1 -0
  48. package/dist/public/assets/settings-instructions-view-DMAjbi6E.js +1 -0
  49. package/dist/public/assets/settings-list-B8hiBkBz.js +1 -0
  50. package/dist/public/assets/settings-mcp-servers-view-OimQz-Rd.js +5 -0
  51. package/dist/public/assets/{settings-models-skeleton-ClrbJy_p.js → settings-models-skeleton-DPnYbg69.js} +1 -1
  52. package/dist/public/assets/settings-models-view-Fq3WtdKG.js +1 -0
  53. package/dist/public/assets/settings-rules-view-DBk7DzV2.js +8 -0
  54. package/dist/public/assets/settings-skills-view-CmOw-WMM.js +2 -0
  55. package/dist/public/assets/settings-slash-commands-view-FsrF5FkK.js +1 -0
  56. package/dist/public/assets/settings-subagents-view-D98Nxoly.js +2 -0
  57. package/dist/public/assets/{settings-system-prompt-view-Dl66VFaj.js → settings-system-prompt-view-B6Hy9ZyK.js} +1 -1
  58. package/dist/public/assets/settings-view-J-rjoRcU.js +2 -0
  59. package/dist/public/assets/skeleton-BHhGML7J.js +1 -0
  60. package/dist/public/assets/slug-utils-DyRUJ1NS.js +1 -0
  61. package/dist/public/assets/terminal-panel-DTOx74_o.js +1 -0
  62. package/dist/public/assets/{ui-components-C4RrfJEJ.js → ui-components-Jc6oi6bz.js} +1 -1
  63. package/dist/public/assets/use-deferred-search-B7EdyRbt.js +1 -0
  64. package/dist/public/assets/{utils-B7FQXlI6.js → utils-tgi5ym_d.js} +1 -1
  65. package/dist/public/assets/web-C3vJZ_3_.js +1 -0
  66. package/dist/public/assets/web-CUAWBWPy.js +1 -0
  67. package/dist/public/assets/{whisper-wasm-EGutPGND.js → whisper-wasm-CWcbC1MB.js} +1 -1
  68. package/dist/public/browser-preview-rpc.js +484 -0
  69. package/dist/public/index.html +8 -8
  70. package/package.json +4 -3
  71. package/dist/public/assets/api-DJaJqkc6.js +0 -1
  72. package/dist/public/assets/browser-tab-D7wEj-BD.js +0 -1
  73. package/dist/public/assets/commit-dialog-DdhGDH4F.js +0 -1
  74. package/dist/public/assets/context-menu-asf2g-KX.js +0 -1
  75. package/dist/public/assets/create-repo-dialog-Bltp6PKZ.js +0 -1
  76. package/dist/public/assets/diff-view-Bi545EPj.js +0 -3
  77. package/dist/public/assets/explorer-tab-view-B-P555GE.js +0 -2
  78. package/dist/public/assets/explorer-tree-CyXhVrI7.js +0 -1
  79. package/dist/public/assets/explorer-view-BAHDhIGN.js +0 -1
  80. package/dist/public/assets/git-history-dialog-Bci_iQmi.js +0 -1
  81. package/dist/public/assets/git-ops-button-1lum9QXI.js +0 -2
  82. package/dist/public/assets/history-view-CAkN8PCo.js +0 -9
  83. package/dist/public/assets/index-BLO68CQl.js +0 -69
  84. package/dist/public/assets/index-jIBJk8xl.css +0 -1
  85. package/dist/public/assets/mcp-server-card-DQUpkDFV.js +0 -1
  86. package/dist/public/assets/merged-pr-dialog-tHPrJ2CK.js +0 -1
  87. package/dist/public/assets/onboarding-Bbvb7kO4.js +0 -1
  88. package/dist/public/assets/project-settings-view-BRkHOq_q.js +0 -1
  89. package/dist/public/assets/providers-list-view-Dex879vv.js +0 -1
  90. package/dist/public/assets/pull-request-dialog-WHdmrW83.js +0 -1
  91. package/dist/public/assets/pull-with-changes-dialog-Ck3OwINV.js +0 -1
  92. package/dist/public/assets/push-before-pr-dialog-Bvqvz04U.js +0 -1
  93. package/dist/public/assets/radio-group-B0xvu5B9.js +0 -1
  94. package/dist/public/assets/react-vendor-D8PTA4EX.js +0 -16
  95. package/dist/public/assets/settings-general-view-lUxshNA9.js +0 -1
  96. package/dist/public/assets/settings-instructions-view-C57XGLha.js +0 -1
  97. package/dist/public/assets/settings-list-CHGKmGl_.js +0 -1
  98. package/dist/public/assets/settings-mcp-servers-view-DpqkhrgB.js +0 -5
  99. package/dist/public/assets/settings-models-view-QPEdnibD.js +0 -1
  100. package/dist/public/assets/settings-rules-view-WJU--cRq.js +0 -8
  101. package/dist/public/assets/settings-skills-view-mgHy4G_g.js +0 -2
  102. package/dist/public/assets/settings-slash-commands-view-LB5tVqy1.js +0 -1
  103. package/dist/public/assets/settings-subagents-view-QR2qlA_y.js +0 -2
  104. package/dist/public/assets/settings-view-BlVJv4Pz.js +0 -2
  105. package/dist/public/assets/skeleton-K-fVduHt.js +0 -1
  106. package/dist/public/assets/terminal-panel-BGQxckfH.js +0 -2
@@ -0,0 +1,227 @@
1
+ # Grader Agent
2
+
3
+ Evaluate expectations against an execution transcript and outputs.
4
+
5
+ ## Role
6
+
7
+ The Grader reviews a transcript and output files, then determines whether each expectation passes or fails. Provide clear evidence for each judgment.
8
+
9
+ You have two jobs: grade the outputs, and critique the evals themselves. A passing grade on a weak assertion is worse than useless — it creates false confidence. When you notice an assertion that's trivially satisfied, or an important outcome that no assertion checks, say so.
10
+
11
+ ## Inputs
12
+
13
+ You receive these parameters in your prompt:
14
+
15
+ - **expectations**: List of expectations to evaluate (strings)
16
+ - **transcript_path**: Path to the execution transcript (markdown file)
17
+ - **outputs_dir**: Directory containing output files from execution
18
+
19
+ ## Process
20
+
21
+ ### Step 1: Read the Transcript
22
+
23
+ 1. Read the transcript file completely
24
+ 2. Note the eval prompt, execution steps, and final result
25
+ 3. Identify any issues or errors documented
26
+
27
+ ### Step 2: Examine Output Files
28
+
29
+ 1. List files in outputs_dir
30
+ 2. Read/examine each file relevant to the expectations. If outputs aren't plain text, use the inspection tools provided in your prompt — don't rely solely on what the transcript says the executor produced.
31
+ 3. Note contents, structure, and quality
32
+
33
+ ### Step 3: Evaluate Each Assertion
34
+
35
+ For each expectation:
36
+
37
+ 1. **Search for evidence** in the transcript and outputs
38
+ 2. **Determine verdict**:
39
+ - **PASS**: Clear evidence the expectation is true AND the evidence reflects genuine task completion, not just surface-level compliance
40
+ - **FAIL**: No evidence, or evidence contradicts the expectation, or the evidence is superficial (e.g., correct filename but empty/wrong content)
41
+ 3. **Cite the evidence**: Quote the specific text or describe what you found
42
+
43
+ ### Step 4: Extract and Verify Claims
44
+
45
+ Beyond the predefined expectations, extract implicit claims from the outputs and verify them:
46
+
47
+ 1. **Extract claims** from the transcript and outputs:
48
+ - Factual statements ("The form has 12 fields")
49
+ - Process claims ("Used pypdf to fill the form")
50
+ - Quality claims ("All fields were filled correctly")
51
+
52
+ 2. **Verify each claim**:
53
+ - **Factual claims**: Can be checked against the outputs or external sources
54
+ - **Process claims**: Can be verified from the transcript
55
+ - **Quality claims**: Evaluate whether the claim is justified
56
+
57
+ 3. **Flag unverifiable claims**: Note claims that cannot be verified with available information
58
+
59
+ This catches issues that predefined expectations might miss.
60
+
61
+ ### Step 5: Read User Notes
62
+
63
+ If `{outputs_dir}/user_notes.md` exists:
64
+
65
+ 1. Read it and note any uncertainties or issues flagged by the executor
66
+ 2. Include relevant concerns in the grading output
67
+ 3. These may reveal problems even when expectations pass
68
+
69
+ ### Step 6: Critique the Evals
70
+
71
+ After grading, consider whether the evals themselves could be improved. Only surface suggestions when there's a clear gap.
72
+
73
+ Good suggestions test meaningful outcomes — assertions that are hard to satisfy without actually doing the work correctly. Think about what makes an assertion _discriminating_: it passes when the skill genuinely succeeds and fails when it doesn't.
74
+
75
+ Suggestions worth raising:
76
+
77
+ - An assertion that passed but would also pass for a clearly wrong output (e.g., checking filename existence but not file content)
78
+ - An important outcome you observed — good or bad — that no assertion covers at all
79
+ - An assertion that can't actually be verified from the available outputs
80
+
81
+ Keep the bar high. The goal is to flag things the eval author would say "good catch" about, not to nitpick every assertion.
82
+
83
+ ### Step 7: Write Grading Results
84
+
85
+ Save results to `{outputs_dir}/../grading.json` (sibling to outputs_dir).
86
+
87
+ ## Grading Criteria
88
+
89
+ **PASS when**:
90
+
91
+ - The transcript or outputs clearly demonstrate the expectation is true
92
+ - Specific evidence can be cited
93
+ - The evidence reflects genuine substance, not just surface compliance (e.g., a file exists AND contains correct content, not just the right filename)
94
+
95
+ **FAIL when**:
96
+
97
+ - No evidence found for the expectation
98
+ - Evidence contradicts the expectation
99
+ - The expectation cannot be verified from available information
100
+ - The evidence is superficial — the assertion is technically satisfied but the underlying task outcome is wrong or incomplete
101
+ - The output appears to meet the assertion by coincidence rather than by actually doing the work
102
+
103
+ **When uncertain**: The burden of proof to pass is on the expectation.
104
+
105
+ ### Step 8: Read Executor Metrics and Timing
106
+
107
+ 1. If `{outputs_dir}/metrics.json` exists, read it and include in grading output
108
+ 2. If `{outputs_dir}/../timing.json` exists, read it and include timing data
109
+
110
+ ## Output Format
111
+
112
+ Write a JSON file with this structure:
113
+
114
+ ```json
115
+ {
116
+ "expectations": [
117
+ {
118
+ "text": "The output includes the name 'John Smith'",
119
+ "passed": true,
120
+ "evidence": "Found in transcript Step 3: 'Extracted names: John Smith, Sarah Johnson'"
121
+ },
122
+ {
123
+ "text": "The spreadsheet has a SUM formula in cell B10",
124
+ "passed": false,
125
+ "evidence": "No spreadsheet was created. The output was a text file."
126
+ },
127
+ {
128
+ "text": "The assistant used the skill's OCR script",
129
+ "passed": true,
130
+ "evidence": "Transcript Step 2 shows: 'Tool: Bash - python ocr_script.py image.png'"
131
+ }
132
+ ],
133
+ "summary": {
134
+ "passed": 2,
135
+ "failed": 1,
136
+ "total": 3,
137
+ "pass_rate": 0.67
138
+ },
139
+ "execution_metrics": {
140
+ "tool_calls": {
141
+ "Read": 5,
142
+ "Write": 2,
143
+ "Bash": 8
144
+ },
145
+ "total_tool_calls": 15,
146
+ "total_steps": 6,
147
+ "errors_encountered": 0,
148
+ "output_chars": 12450,
149
+ "transcript_chars": 3200
150
+ },
151
+ "timing": {
152
+ "executor_duration_seconds": 165.0,
153
+ "grader_duration_seconds": 26.0,
154
+ "total_duration_seconds": 191.0
155
+ },
156
+ "claims": [
157
+ {
158
+ "claim": "The form has 12 fillable fields",
159
+ "type": "factual",
160
+ "verified": true,
161
+ "evidence": "Counted 12 fields in field_info.json"
162
+ },
163
+ {
164
+ "claim": "All required fields were populated",
165
+ "type": "quality",
166
+ "verified": false,
167
+ "evidence": "Reference section was left blank despite data being available"
168
+ }
169
+ ],
170
+ "user_notes_summary": {
171
+ "uncertainties": ["Used 2023 data, may be stale"],
172
+ "needs_review": [],
173
+ "workarounds": ["Fell back to text overlay for non-fillable fields"]
174
+ },
175
+ "eval_feedback": {
176
+ "suggestions": [
177
+ {
178
+ "assertion": "The output includes the name 'John Smith'",
179
+ "reason": "A hallucinated document that mentions the name would also pass — consider checking it appears as the primary contact with matching phone and email from the input"
180
+ },
181
+ {
182
+ "reason": "No assertion checks whether the extracted phone numbers match the input — I observed incorrect numbers in the output that went uncaught"
183
+ }
184
+ ],
185
+ "overall": "Assertions check presence but not correctness. Consider adding content verification."
186
+ }
187
+ }
188
+ ```
189
+
190
+ ## Field Descriptions
191
+
192
+ - **expectations**: Array of graded expectations
193
+ - **text**: The original expectation text
194
+ - **passed**: Boolean - true if expectation passes
195
+ - **evidence**: Specific quote or description supporting the verdict
196
+ - **summary**: Aggregate statistics
197
+ - **passed**: Count of passed expectations
198
+ - **failed**: Count of failed expectations
199
+ - **total**: Total expectations evaluated
200
+ - **pass_rate**: Fraction passed (0.0 to 1.0)
201
+ - **execution_metrics**: Copied from executor's metrics.json (if available)
202
+ - **output_chars**: Total character count of output files (proxy for tokens)
203
+ - **transcript_chars**: Character count of transcript
204
+ - **timing**: Wall clock timing from timing.json (if available)
205
+ - **executor_duration_seconds**: Time spent in executor subagent
206
+ - **total_duration_seconds**: Total elapsed time for the run
207
+ - **claims**: Extracted and verified claims from the output
208
+ - **claim**: The statement being verified
209
+ - **type**: "factual", "process", or "quality"
210
+ - **verified**: Boolean - whether the claim holds
211
+ - **evidence**: Supporting or contradicting evidence
212
+ - **user_notes_summary**: Issues flagged by the executor
213
+ - **uncertainties**: Things the executor wasn't sure about
214
+ - **needs_review**: Items requiring human attention
215
+ - **workarounds**: Places where the skill didn't work as expected
216
+ - **eval_feedback**: Improvement suggestions for the evals (only when warranted)
217
+ - **suggestions**: List of concrete suggestions, each with a `reason` and optionally an `assertion` it relates to
218
+ - **overall**: Brief assessment — can be "No suggestions, evals look solid" if nothing to flag
219
+
220
+ ## Guidelines
221
+
222
+ - **Be objective**: Base verdicts on evidence, not assumptions
223
+ - **Be specific**: Quote the exact text that supports your verdict
224
+ - **Be thorough**: Check both transcript and output files
225
+ - **Be consistent**: Apply the same standard to each expectation
226
+ - **Explain failures**: Make it clear why evidence was insufficient
227
+ - **No partial credit**: Each expectation is pass or fail, not partial
@@ -0,0 +1,292 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Eval Set Review - __SKILL_NAME_PLACEHOLDER__</title>
7
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
8
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9
+ <link
10
+ href="https://fonts.googleapis.com/css2?family=Poppins:wght@500;600&family=Lora:wght@400;500&display=swap"
11
+ rel="stylesheet"
12
+ />
13
+ <style>
14
+ * {
15
+ box-sizing: border-box;
16
+ margin: 0;
17
+ padding: 0;
18
+ }
19
+ body {
20
+ font-family: "Lora", Georgia, serif;
21
+ background: #faf9f5;
22
+ padding: 2rem;
23
+ color: #141413;
24
+ }
25
+ h1 {
26
+ font-family: "Poppins", sans-serif;
27
+ margin-bottom: 0.5rem;
28
+ font-size: 1.5rem;
29
+ }
30
+ .description {
31
+ color: #b0aea5;
32
+ margin-bottom: 1.5rem;
33
+ font-style: italic;
34
+ max-width: 900px;
35
+ }
36
+ .controls {
37
+ margin-bottom: 1rem;
38
+ display: flex;
39
+ gap: 0.5rem;
40
+ }
41
+ .btn {
42
+ font-family: "Poppins", sans-serif;
43
+ padding: 0.5rem 1rem;
44
+ border: none;
45
+ border-radius: 6px;
46
+ cursor: pointer;
47
+ font-size: 0.875rem;
48
+ font-weight: 500;
49
+ }
50
+ .btn-add {
51
+ background: #6a9bcc;
52
+ color: white;
53
+ }
54
+ .btn-add:hover {
55
+ background: #5889b8;
56
+ }
57
+ .btn-export {
58
+ background: #d97757;
59
+ color: white;
60
+ }
61
+ .btn-export:hover {
62
+ background: #c4613f;
63
+ }
64
+ table {
65
+ width: 100%;
66
+ max-width: 1100px;
67
+ border-collapse: collapse;
68
+ background: white;
69
+ border-radius: 6px;
70
+ overflow: hidden;
71
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
72
+ }
73
+ th {
74
+ font-family: "Poppins", sans-serif;
75
+ background: #141413;
76
+ color: #faf9f5;
77
+ padding: 0.75rem 1rem;
78
+ text-align: left;
79
+ font-size: 0.875rem;
80
+ }
81
+ td {
82
+ padding: 0.75rem 1rem;
83
+ border-bottom: 1px solid #e8e6dc;
84
+ vertical-align: top;
85
+ }
86
+ tr:nth-child(even) td {
87
+ background: #faf9f5;
88
+ }
89
+ tr:hover td {
90
+ background: #f3f1ea;
91
+ }
92
+ .section-header td {
93
+ background: #e8e6dc;
94
+ font-family: "Poppins", sans-serif;
95
+ font-weight: 500;
96
+ font-size: 0.8rem;
97
+ color: #141413;
98
+ text-transform: uppercase;
99
+ letter-spacing: 0.05em;
100
+ }
101
+ .query-input {
102
+ width: 100%;
103
+ padding: 0.4rem;
104
+ border: 1px solid #e8e6dc;
105
+ border-radius: 4px;
106
+ font-size: 0.875rem;
107
+ font-family: "Lora", Georgia, serif;
108
+ resize: vertical;
109
+ min-height: 60px;
110
+ }
111
+ .query-input:focus {
112
+ outline: none;
113
+ border-color: #d97757;
114
+ box-shadow: 0 0 0 2px rgba(217, 119, 87, 0.15);
115
+ }
116
+ .toggle {
117
+ position: relative;
118
+ display: inline-block;
119
+ width: 44px;
120
+ height: 24px;
121
+ }
122
+ .toggle input {
123
+ opacity: 0;
124
+ width: 0;
125
+ height: 0;
126
+ }
127
+ .toggle .slider {
128
+ position: absolute;
129
+ inset: 0;
130
+ background: #b0aea5;
131
+ border-radius: 24px;
132
+ cursor: pointer;
133
+ transition: 0.2s;
134
+ }
135
+ .toggle .slider::before {
136
+ content: "";
137
+ position: absolute;
138
+ width: 18px;
139
+ height: 18px;
140
+ left: 3px;
141
+ bottom: 3px;
142
+ background: white;
143
+ border-radius: 50%;
144
+ transition: 0.2s;
145
+ }
146
+ .toggle input:checked + .slider {
147
+ background: #d97757;
148
+ }
149
+ .toggle input:checked + .slider::before {
150
+ transform: translateX(20px);
151
+ }
152
+ .btn-delete {
153
+ background: #c44;
154
+ color: white;
155
+ padding: 0.3rem 0.6rem;
156
+ border: none;
157
+ border-radius: 4px;
158
+ cursor: pointer;
159
+ font-size: 0.75rem;
160
+ font-family: "Poppins", sans-serif;
161
+ }
162
+ .btn-delete:hover {
163
+ background: #a33;
164
+ }
165
+ .summary {
166
+ margin-top: 1rem;
167
+ color: #b0aea5;
168
+ font-size: 0.875rem;
169
+ }
170
+ </style>
171
+ </head>
172
+ <body>
173
+ <h1>Eval Set Review: <span id="skill-name">__SKILL_NAME_PLACEHOLDER__</span></h1>
174
+ <p class="description">
175
+ Current description: <span id="skill-desc">__SKILL_DESCRIPTION_PLACEHOLDER__</span>
176
+ </p>
177
+
178
+ <div class="controls">
179
+ <button class="btn btn-add" onclick="addRow()">+ Add Query</button>
180
+ <button class="btn btn-export" onclick="exportEvalSet()">Export Eval Set</button>
181
+ </div>
182
+
183
+ <table>
184
+ <thead>
185
+ <tr>
186
+ <th style="width: 65%">Query</th>
187
+ <th style="width: 18%">Should Trigger</th>
188
+ <th style="width: 10%">Actions</th>
189
+ </tr>
190
+ </thead>
191
+ <tbody id="eval-body"></tbody>
192
+ </table>
193
+
194
+ <p class="summary" id="summary"></p>
195
+
196
+ <script>
197
+ const EVAL_DATA = __EVAL_DATA_PLACEHOLDER__;
198
+
199
+ let evalItems = [...EVAL_DATA];
200
+
201
+ function render() {
202
+ const tbody = document.getElementById("eval-body");
203
+ tbody.innerHTML = "";
204
+
205
+ // Sort: should-trigger first, then should-not-trigger
206
+ const sorted = evalItems
207
+ .map((item, origIdx) => ({ ...item, origIdx }))
208
+ .sort((a, b) => (b.should_trigger ? 1 : 0) - (a.should_trigger ? 1 : 0));
209
+
210
+ let lastGroup = null;
211
+ sorted.forEach((item) => {
212
+ const group = item.should_trigger ? "trigger" : "no-trigger";
213
+ if (group !== lastGroup) {
214
+ const headerRow = document.createElement("tr");
215
+ headerRow.className = "section-header";
216
+ headerRow.innerHTML = `<td colspan="3">${item.should_trigger ? "Should Trigger" : "Should NOT Trigger"}</td>`;
217
+ tbody.appendChild(headerRow);
218
+ lastGroup = group;
219
+ }
220
+
221
+ const idx = item.origIdx;
222
+ const tr = document.createElement("tr");
223
+ tr.innerHTML = `
224
+ <td><textarea class="query-input" onchange="updateQuery(${idx}, this.value)">${escapeHtml(item.query)}</textarea></td>
225
+ <td>
226
+ <label class="toggle">
227
+ <input type="checkbox" ${item.should_trigger ? "checked" : ""} onchange="updateTrigger(${idx}, this.checked)">
228
+ <span class="slider"></span>
229
+ </label>
230
+ <span style="margin-left:8px;font-size:0.8rem;color:#b0aea5">${item.should_trigger ? "Yes" : "No"}</span>
231
+ </td>
232
+ <td><button class="btn-delete" onclick="deleteRow(${idx})">Delete</button></td>
233
+ `;
234
+ tbody.appendChild(tr);
235
+ });
236
+ updateSummary();
237
+ }
238
+
239
+ function escapeHtml(text) {
240
+ const div = document.createElement("div");
241
+ div.textContent = text;
242
+ return div.innerHTML;
243
+ }
244
+
245
+ function updateQuery(idx, value) {
246
+ evalItems[idx].query = value;
247
+ updateSummary();
248
+ }
249
+ function updateTrigger(idx, value) {
250
+ evalItems[idx].should_trigger = value;
251
+ render();
252
+ }
253
+ function deleteRow(idx) {
254
+ evalItems.splice(idx, 1);
255
+ render();
256
+ }
257
+
258
+ function addRow() {
259
+ evalItems.push({ query: "", should_trigger: true });
260
+ render();
261
+ const inputs = document.querySelectorAll(".query-input");
262
+ inputs[inputs.length - 1].focus();
263
+ }
264
+
265
+ function updateSummary() {
266
+ const trigger = evalItems.filter((i) => i.should_trigger).length;
267
+ const noTrigger = evalItems.filter((i) => !i.should_trigger).length;
268
+ document.getElementById("summary").textContent =
269
+ `${evalItems.length} queries total: ${trigger} should trigger, ${noTrigger} should not trigger`;
270
+ }
271
+
272
+ function exportEvalSet() {
273
+ const valid = evalItems.filter((i) => i.query.trim() !== "");
274
+ const data = valid.map((i) => ({
275
+ query: i.query.trim(),
276
+ should_trigger: i.should_trigger,
277
+ }));
278
+ const blob = new Blob([JSON.stringify(data, null, 2)], { type: "application/json" });
279
+ const url = URL.createObjectURL(blob);
280
+ const a = document.createElement("a");
281
+ a.href = url;
282
+ a.download = "eval_set.json";
283
+ document.body.appendChild(a);
284
+ a.click();
285
+ document.body.removeChild(a);
286
+ URL.revokeObjectURL(url);
287
+ }
288
+
289
+ render();
290
+ </script>
291
+ </body>
292
+ </html>