@prismer/runtime 2.0.8 → 2.2.55

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 (119) hide show
  1. package/CHANGELOG.md +3430 -0
  2. package/README.md +34 -12
  3. package/apc/skills/FIELD-DICTIONARY.md +111 -0
  4. package/apc/skills/bug-reproduce/SKILL.md +150 -0
  5. package/apc/skills/bug-reproduce/skill.json +96 -0
  6. package/apc/skills/code-review/SKILL.md +198 -0
  7. package/apc/skills/code-review/skill.json +124 -0
  8. package/apc/skills/design-review/SKILL.md +122 -0
  9. package/apc/skills/design-review/skill.json +88 -0
  10. package/apc/skills/doc-sync/SKILL.md +168 -0
  11. package/apc/skills/doc-sync/skill.json +81 -0
  12. package/apc/skills/env-doctor/SKILL.md +194 -0
  13. package/apc/skills/env-doctor/skill.json +209 -0
  14. package/apc/skills/git-ops/SKILL.md +189 -0
  15. package/apc/skills/git-ops/skill.json +94 -0
  16. package/apc/skills/impact-trace/SKILL.md +168 -0
  17. package/apc/skills/impact-trace/skill.json +104 -0
  18. package/apc/skills/observability/SKILL.md +195 -0
  19. package/apc/skills/observability/skill.json +116 -0
  20. package/apc/skills/release-db-config-sync/SKILL.md +186 -0
  21. package/apc/skills/release-db-config-sync/skill.json +109 -0
  22. package/apc/skills/release-ota-promote/SKILL.md +195 -0
  23. package/apc/skills/release-ota-promote/skill.json +176 -0
  24. package/apc/skills/release-preflight/SKILL.md +174 -0
  25. package/apc/skills/release-preflight/skill.json +175 -0
  26. package/apc/skills/release-rollback/SKILL.md +214 -0
  27. package/apc/skills/release-rollback/skill.json +230 -0
  28. package/apc/skills/release-tag/SKILL.md +194 -0
  29. package/apc/skills/release-tag/skill.json +94 -0
  30. package/apc/skills/releasing-prod/SKILL.md +49 -0
  31. package/apc/skills/releasing-test/SKILL.md +135 -0
  32. package/apc/skills/sdk-release/SKILL.md +200 -0
  33. package/apc/skills/spec-intake/SKILL.md +169 -0
  34. package/apc/skills/spec-intake/skill.json +93 -0
  35. package/apc/skills/test-result-feedback/SKILL.md +239 -0
  36. package/apc/skills/test-result-feedback/skill.json +193 -0
  37. package/apc/skills/test-runner/SKILL.md +169 -0
  38. package/apc/skills/test-runner/skill.json +103 -0
  39. package/apc/skills/ui-align/SKILL.md +209 -0
  40. package/apc/skills/ui-align/skill.json +114 -0
  41. package/apc/skills/ui-canvas/SKILL.md +148 -0
  42. package/apc/skills/ui-canvas/skill.json +127 -0
  43. package/built-in-skills/agent-coordination/SKILL.md +59 -37
  44. package/built-in-skills/agent-meta/SKILL.md +1 -0
  45. package/built-in-skills/assets/SKILL.md +8 -6
  46. package/built-in-skills/browser-use/SKILL.md +93 -0
  47. package/built-in-skills/canvas-design/SKILL.md +1 -0
  48. package/built-in-skills/claim-agent-ownership/SKILL.md +3 -2
  49. package/built-in-skills/claude-api/SKILL.md +1 -0
  50. package/built-in-skills/codebase-design/DEEPENING.md +37 -0
  51. package/built-in-skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  52. package/built-in-skills/codebase-design/LICENSE +21 -0
  53. package/built-in-skills/codebase-design/SKILL.md +116 -0
  54. package/built-in-skills/conversation-compaction/SKILL.md +114 -0
  55. package/built-in-skills/council-creator/SKILL.md +426 -0
  56. package/built-in-skills/diagnosing-bugs/LICENSE +21 -0
  57. package/built-in-skills/diagnosing-bugs/SKILL.md +136 -0
  58. package/built-in-skills/diagnosing-bugs/scripts/hitl-loop.template.sh +41 -0
  59. package/built-in-skills/doc-coauthoring/SKILL.md +1 -0
  60. package/built-in-skills/document-generation/SKILL.md +105 -0
  61. package/built-in-skills/domain-modeling/ADR-FORMAT.md +47 -0
  62. package/built-in-skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  63. package/built-in-skills/domain-modeling/LICENSE +21 -0
  64. package/built-in-skills/domain-modeling/SKILL.md +76 -0
  65. package/built-in-skills/frontend-design/SKILL.md +1 -0
  66. package/built-in-skills/human-approval/SKILL.md +17 -2
  67. package/built-in-skills/image-generate/SKILL.md +103 -302
  68. package/built-in-skills/image-generate/scripts/generate-and-deliver.mjs +289 -0
  69. package/built-in-skills/ingest/SKILL.md +13 -45
  70. package/built-in-skills/internal-comms/SKILL.md +1 -0
  71. package/built-in-skills/liteparse/SKILL.md +130 -110
  72. package/built-in-skills/mcp-builder/SKILL.md +1 -0
  73. package/built-in-skills/memory/SKILL.md +420 -55
  74. package/built-in-skills/memory-dream/SKILL.md +339 -0
  75. package/built-in-skills/office-artifacts/SKILL.md +17 -4
  76. package/built-in-skills/okr/SKILL.md +154 -0
  77. package/built-in-skills/persona/SKILL.md +81 -0
  78. package/built-in-skills/persona-generator/SKILL.md +296 -0
  79. package/built-in-skills/pkf-svg/SKILL.md +253 -0
  80. package/built-in-skills/pkf-writing/SKILL.md +236 -0
  81. package/built-in-skills/prismer-im-collab/SKILL.md +26 -6
  82. package/built-in-skills/proactivity/SKILL.md +84 -0
  83. package/built-in-skills/remotion/SKILL.md +431 -0
  84. package/built-in-skills/role-builder/SKILL.md +203 -0
  85. package/built-in-skills/role-builder/scripts/author-role.mjs +334 -0
  86. package/built-in-skills/role-builder/scripts/ingest-role.mjs +223 -0
  87. package/built-in-skills/role-builder/scripts/instantiate-and-run.mjs +290 -0
  88. package/built-in-skills/role-builder/scripts/operation-harness.mjs +267 -0
  89. package/built-in-skills/skill-authoring/SKILL.md +110 -100
  90. package/built-in-skills/skill-authoring/skill.json +3 -3
  91. package/built-in-skills/skill-builder/SKILL.md +171 -0
  92. package/built-in-skills/skill-builder/scripts/ingest.mjs +265 -0
  93. package/built-in-skills/skill-creator/SKILL.md +165 -423
  94. package/built-in-skills/skill-creator/references/external-library-import.md +110 -0
  95. package/built-in-skills/skill-creator/scripts/import-library.mjs +475 -0
  96. package/built-in-skills/slack-gif-creator/SKILL.md +20 -0
  97. package/built-in-skills/tasks/SKILL.md +38 -23
  98. package/built-in-skills/tdd/LICENSE +21 -0
  99. package/built-in-skills/tdd/SKILL.md +110 -0
  100. package/built-in-skills/tdd/mocking.md +59 -0
  101. package/built-in-skills/tdd/refactoring.md +10 -0
  102. package/built-in-skills/tdd/tests.md +61 -0
  103. package/built-in-skills/team/SKILL.md +2 -1
  104. package/built-in-skills/web-artifacts-builder/SKILL.md +1 -0
  105. package/built-in-skills/webapp-testing/SKILL.md +1 -0
  106. package/built-in-skills/wechat-pay/SKILL.md +59 -0
  107. package/dist/cli.cjs +71872 -19960
  108. package/dist/cli.js +71803 -19846
  109. package/dist/index.cjs +72010 -19966
  110. package/dist/index.d.cts +4258 -712
  111. package/dist/index.d.ts +4258 -712
  112. package/dist/index.js +72156 -20118
  113. package/package.json +37 -6
  114. package/plugins/memory/prismer/__init__.py +1211 -0
  115. package/plugins/memory/prismer/plugin.yaml +8 -0
  116. package/plugins/memory/prismer/tool-schemas.generated.json +249 -0
  117. package/plugins/tools/prismer-recall/__init__.py +282 -0
  118. package/plugins/tools/prismer-recall/plugin.yaml +15 -0
  119. package/built-in-skills/memory-curation/SKILL.md +0 -135
@@ -1,485 +1,227 @@
1
1
  ---
2
2
  name: skill-creator
3
- description: Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
3
+ scope: common
4
+ category: authoring
5
+ description: Create, import, edit, validate, test, or publish a Prismer SS-01 Skill. Use whenever a user asks to turn a repeatable capability or external Skill repository into platform Skills, improve an existing Skill, or make Skills available in Studio, a workspace, or Marketplace. Follow the fixed author-to-readback workflow and use bundled scripts for deterministic repeated work; do not explore raw endpoints or compose ad-hoc CLI chains.
6
+ license: MIT
7
+ compatibility:
8
+ - prismer-sdk
9
+ - hermes
10
+ - claude-code
11
+ - codex
12
+ - openclaw
13
+ metadata:
14
+ category: authoring
15
+ allowed-tools:
16
+ - Read
17
+ - Write
18
+ - Bash
19
+ - WebFetch
4
20
  ---
5
21
 
6
22
  # Skill Creator
7
23
 
8
- A skill for creating new skills and iteratively improving them.
24
+ Choose one route and execute it directly. Do not inspect `cloud --help`, create
25
+ probe catalog objects, or call raw Skill endpoints first.
9
26
 
10
- At a high level, the process of creating a skill goes like this:
27
+ | Requested result | Route |
28
+ | ---------------------------------------------- | ------------------------------------------------------------ |
29
+ | one new or edited Skill | [Single bundle](#single-bundle) |
30
+ | repository/directory containing several Skills | read `references/external-library-import.md`, then follow it |
31
+ | improve or benchmark a Skill | [Improve](#improve-an-existing-skill) |
32
+ | create a role/persona/job template | stop and use `role-builder` |
11
33
 
12
- - Decide what you want the skill to do and roughly how it should do it
13
- - Write a draft of the skill
14
- - Create a few test prompts and run claude-with-access-to-the-skill on them
15
- - Help the user evaluate the results both qualitatively and quantitatively
16
- - While the runs happen in the background, draft some quantitative evals if there aren't any (if there are some, you can either use as is or modify if you feel something needs to change about them). Then explain them to the user (or if they already existed, explain the ones that already exist)
17
- - Use the `eval-viewer/generate_review.py` script to show the user the results for them to look at, and also let them look at the quantitative metrics
18
- - Rewrite the skill based on feedback from the user's evaluation of the results (and also if there are any glaring flaws that become apparent from the quantitative benchmarks)
19
- - Repeat until you're satisfied
20
- - Expand the test set and try again at larger scale
34
+ ## Ownership boundary
21
35
 
22
- Your job when using this skill is to figure out where the user is in this process and then jump in and help them progress through these stages. So for instance, maybe they're like "I want to make a skill for X". You can help narrow down what they mean, write a draft, write the test cases, figure out how they want to evaluate, run all the prompts, and repeat.
36
+ Keep each concern in its proper layer:
23
37
 
24
- On the other hand, maybe they already have a draft of the skill. In this case you can go straight to the eval/iterate part of the loop.
38
+ - Product resource operations belong in the service/SDK/CLI.
39
+ - A stable, repeated transformation or multi-step workflow belongs in a
40
+ bundled `scripts/` harness.
41
+ - SKILL.md routes intent, declares configuration, invokes the script, and
42
+ explains the result. It should not make every future Agent rediscover the
43
+ same command sequence.
25
44
 
26
- Of course, you should always be flexible and if the user is like "I don't need to run a bunch of evaluations, just vibe with me", you can do that instead.
45
+ Promote a script into the CLI only when several independent clients need the
46
+ operation as a reusable product primitive. Do not add a CLI verb merely to
47
+ shorten one Skill workflow.
27
48
 
28
- Then after the skill is done (but again, the order is flexible), you can also run the skill description improver, which we have a whole separate script for, to optimize the triggering of the skill.
49
+ ## Single bundle
29
50
 
30
- Cool? Cool.
51
+ Create or edit this shape:
31
52
 
32
- ## Communicating with the user
33
-
34
- The skill creator is liable to be used by people across a wide range of familiarity with coding jargon. If you haven't heard (and how could you, it's only very recently that it started), there's a trend now where the power of Claude is inspiring plumbers to open up their terminals, parents and grandparents to google "how to install npm". On the other hand, the bulk of users are probably fairly computer-literate.
35
-
36
- So please pay attention to context cues to understand how to phrase your communication! In the default case, just to give you some idea:
37
-
38
- - "evaluation" and "benchmark" are borderline, but OK
39
- - for "JSON" and "assertion" you want to see serious cues from the user that they know what those things are before using them without explaining them
40
-
41
- It's OK to briefly explain terms if you're in doubt, and feel free to clarify terms with a short definition if you're unsure if the user will get it.
42
-
43
- ---
44
-
45
- ## Creating a skill
46
-
47
- ### Capture Intent
48
-
49
- Start by understanding the user's intent. The current conversation might already contain a workflow the user wants to capture (e.g., they say "turn this into a skill"). If so, extract answers from the conversation history first — the tools used, the sequence of steps, corrections the user made, input/output formats observed. The user may need to fill the gaps, and should confirm before proceeding to the next step.
50
-
51
- 1. What should this skill enable Claude to do?
52
- 2. When should this skill trigger? (what user phrases/contexts)
53
- 3. What's the expected output format?
54
- 4. Should we set up test cases to verify the skill works? Skills with objectively verifiable outputs (file transforms, data extraction, code generation, fixed workflow steps) benefit from test cases. Skills with subjective outputs (writing style, art) often don't need them. Suggest the appropriate default based on the skill type, but let the user decide.
55
-
56
- ### Interview and Research
57
-
58
- Proactively ask questions about edge cases, input/output formats, example files, success criteria, and dependencies. Wait to write test prompts until you've got this part ironed out.
59
-
60
- Check available MCPs - if useful for research (searching docs, finding similar skills, looking up best practices), research in parallel via subagents if available, otherwise inline. Come prepared with context to reduce burden on the user.
61
-
62
- ### Write the SKILL.md
63
-
64
- Based on the user interview, fill in these components:
65
-
66
- - **name**: Skill identifier
67
- - **description**: When to trigger, what it does. This is the primary triggering mechanism - include both what the skill does AND specific contexts for when to use it. All "when to use" info goes here, not in the body. Note: currently Claude has a tendency to "undertrigger" skills -- to not use them when they'd be useful. To combat this, please make the skill descriptions a little bit "pushy". So for instance, instead of "How to build a simple fast dashboard to display internal Anthropic data.", you might write "How to build a simple fast dashboard to display internal Anthropic data. Make sure to use this skill whenever the user mentions dashboards, data visualization, internal metrics, or wants to display any kind of company data, even if they don't explicitly ask for a 'dashboard.'"
68
- - **compatibility**: Required tools, dependencies (optional, rarely needed)
69
- - **the rest of the skill :)**
70
-
71
- ### Skill Writing Guide
72
-
73
- #### Anatomy of a Skill
74
-
75
- ```
76
- skill-name/
77
- ├── SKILL.md (required)
78
- │ ├── YAML frontmatter (name, description required)
79
- │ └── Markdown instructions
80
- └── Bundled Resources (optional)
81
- ├── scripts/ - Executable code for deterministic/repetitive tasks
82
- ├── references/ - Docs loaded into context as needed
83
- └── assets/ - Files used in output (templates, icons, fonts)
53
+ ```text
54
+ <skill-slug>/
55
+ ├── SKILL.md
56
+ ├── skill.json # only when samples/security metadata are needed
57
+ ├── scripts/ # deterministic or repeated work
58
+ ├── references/ # details read only when needed
59
+ └── assets/ # output templates/resources
84
60
  ```
85
61
 
86
- #### Progressive Disclosure
87
-
88
- Skills use a three-level loading system:
89
- 1. **Metadata** (name + description) - Always in context (~100 words)
90
- 2. **SKILL.md body** - In context whenever skill triggers (<500 lines ideal)
91
- 3. **Bundled resources** - As needed (unlimited, scripts can execute without loading)
92
-
93
- These word counts are approximate and you can feel free to go longer if needed.
94
-
95
- **Key patterns:**
96
- - Keep SKILL.md under 500 lines; if you're approaching this limit, add an additional layer of hierarchy along with clear pointers about where the model using the skill should go next to follow up.
97
- - Reference files clearly from SKILL.md with guidance on when to read them
98
- - For large reference files (>300 lines), include a table of contents
99
-
100
- **Domain organization**: When a skill supports multiple domains/frameworks, organize by variant:
101
- ```
102
- cloud-deploy/
103
- ├── SKILL.md (workflow + selection)
104
- └── references/
105
- ├── aws.md
106
- ├── gcp.md
107
- └── azure.md
108
- ```
109
- Claude reads only the relevant reference file.
62
+ Minimum SKILL.md:
110
63
 
111
- #### Principle of Lack of Surprise
112
-
113
- This goes without saying, but skills must not contain malware, exploit code, or any content that could compromise system security. A skill's contents should not surprise the user in their intent if described. Don't go along with requests to create misleading skills or skills designed to facilitate unauthorized access, data exfiltration, or other malicious activities. Things like a "roleplay as an XYZ" are OK though.
114
-
115
- #### Writing Patterns
116
-
117
- Prefer using the imperative form in instructions.
118
-
119
- **Defining output formats** - You can do it like this:
120
64
  ```markdown
121
- ## Report structure
122
- ALWAYS use this exact template:
123
- # [Title]
124
- ## Executive summary
125
- ## Key findings
126
- ## Recommendations
127
- ```
128
-
129
- **Examples pattern** - It's useful to include examples. You can format them like this (but if "Input" and "Output" are in the examples you might want to deviate a little):
130
- ```markdown
131
- ## Commit message format
132
- **Example 1:**
133
- Input: Added user authentication with JWT tokens
134
- Output: feat(auth): implement JWT-based authentication
135
- ```
136
-
137
- ### Writing Style
138
-
139
- Try to explain to the model why things are important in lieu of heavy-handed musty MUSTs. Use theory of mind and try to make the skill general and not super-narrow to specific examples. Start by writing a draft and then look at it with fresh eyes and improve it.
140
-
141
- ### Test Cases
142
-
143
- After writing the skill draft, come up with 2-3 realistic test prompts — the kind of thing a real user would actually say. Share them with the user: [you don't have to use this exact language] "Here are a few test cases I'd like to try. Do these look right, or do you want to add more?" Then run them.
144
-
145
- Save test cases to `evals/evals.json`. Don't write assertions yet — just the prompts. You'll draft assertions in the next step while the runs are in progress.
146
-
147
- ```json
148
- {
149
- "skill_name": "example-skill",
150
- "evals": [
151
- {
152
- "id": 1,
153
- "prompt": "User's task prompt",
154
- "expected_output": "Description of expected result",
155
- "files": []
156
- }
157
- ]
158
- }
159
- ```
160
-
161
- See `references/schemas.md` for the full schema (including the `assertions` field, which you'll add later).
162
-
163
- ## Running and evaluating test cases
164
-
165
- This section is one continuous sequence — don't stop partway through. Do NOT use `/skill-test` or any other testing skill.
166
-
167
- Put results in `<skill-name>-workspace/` as a sibling to the skill directory. Within the workspace, organize results by iteration (`iteration-1/`, `iteration-2/`, etc.) and within that, each test case gets a directory (`eval-0/`, `eval-1/`, etc.). Don't create all of this upfront — just create directories as you go.
168
-
169
- ### Step 1: Spawn all runs (with-skill AND baseline) in the same turn
170
-
171
- For each test case, spawn two subagents in the same turn — one with the skill, one without. This is important: don't spawn the with-skill runs first and then come back for baselines later. Launch everything at once so it all finishes around the same time.
172
-
173
- **With-skill run:**
174
-
175
- ```
176
- Execute this task:
177
- - Skill path: <path-to-skill>
178
- - Task: <eval prompt>
179
- - Input files: <eval files if any, or "none">
180
- - Save outputs to: <workspace>/iteration-<N>/eval-<ID>/with_skill/outputs/
181
- - Outputs to save: <what the user cares about — e.g., "the .docx file", "the final CSV">
182
- ```
183
-
184
- **Baseline run** (same prompt, but the baseline depends on context):
185
- - **Creating a new skill**: no skill at all. Same prompt, no skill path, save to `without_skill/outputs/`.
186
- - **Improving an existing skill**: the old version. Before editing, snapshot the skill (`cp -r <skill-path> <workspace>/skill-snapshot/`), then point the baseline subagent at the snapshot. Save to `old_skill/outputs/`.
187
-
188
- Write an `eval_metadata.json` for each test case (assertions can be empty for now). Give each eval a descriptive name based on what it's testing — not just "eval-0". Use this name for the directory too. If this iteration uses new or modified eval prompts, create these files for each new eval directory — don't assume they carry over from previous iterations.
189
-
190
- ```json
191
- {
192
- "eval_id": 0,
193
- "eval_name": "descriptive-name-here",
194
- "prompt": "The user's task prompt",
195
- "assertions": []
196
- }
197
- ```
198
-
199
- ### Step 2: While runs are in progress, draft assertions
200
-
201
- Don't just wait for the runs to finish — you can use this time productively. Draft quantitative assertions for each test case and explain them to the user. If assertions already exist in `evals/evals.json`, review them and explain what they check.
202
-
203
- Good assertions are objectively verifiable and have descriptive names — they should read clearly in the benchmark viewer so someone glancing at the results immediately understands what each one checks. Subjective skills (writing style, design quality) are better evaluated qualitatively — don't force assertions onto things that need human judgment.
204
-
205
- Update the `eval_metadata.json` files and `evals/evals.json` with the assertions once drafted. Also explain to the user what they'll see in the viewer — both the qualitative outputs and the quantitative benchmark.
206
-
207
- ### Step 3: As runs complete, capture timing data
208
-
209
- When each subagent task completes, you receive a notification containing `total_tokens` and `duration_ms`. Save this data immediately to `timing.json` in the run directory:
210
-
211
- ```json
212
- {
213
- "total_tokens": 84852,
214
- "duration_ms": 23332,
215
- "total_duration_seconds": 23.3
216
- }
217
- ```
218
-
219
- This is the only opportunity to capture this data — it comes through the task notification and isn't persisted elsewhere. Process each notification as it arrives rather than trying to batch them.
220
-
221
- ### Step 4: Grade, aggregate, and launch the viewer
222
-
223
- Once all runs are done:
224
-
225
- 1. **Grade each run** — spawn a grader subagent (or grade inline) that reads `agents/grader.md` and evaluates each assertion against the outputs. Save results to `grading.json` in each run directory. The grading.json expectations array must use the fields `text`, `passed`, and `evidence` (not `name`/`met`/`details` or other variants) — the viewer depends on these exact field names. For assertions that can be checked programmatically, write and run a script rather than eyeballing it — scripts are faster, more reliable, and can be reused across iterations.
226
-
227
- 2. **Aggregate into benchmark** — run the aggregation script from the skill-creator directory:
228
- ```bash
229
- python -m scripts.aggregate_benchmark <workspace>/iteration-N --skill-name <name>
230
- ```
231
- This produces `benchmark.json` and `benchmark.md` with pass_rate, time, and tokens for each configuration, with mean ± stddev and the delta. If generating benchmark.json manually, see `references/schemas.md` for the exact schema the viewer expects.
232
- Put each with_skill version before its baseline counterpart.
233
-
234
- 3. **Do an analyst pass** — read the benchmark data and surface patterns the aggregate stats might hide. See `agents/analyzer.md` (the "Analyzing Benchmark Results" section) for what to look for — things like assertions that always pass regardless of skill (non-discriminating), high-variance evals (possibly flaky), and time/token tradeoffs.
235
-
236
- 4. **Launch the viewer** with both qualitative outputs and quantitative data:
237
- ```bash
238
- nohup python <skill-creator-path>/eval-viewer/generate_review.py \
239
- <workspace>/iteration-N \
240
- --skill-name "my-skill" \
241
- --benchmark <workspace>/iteration-N/benchmark.json \
242
- > /dev/null 2>&1 &
243
- VIEWER_PID=$!
244
- ```
245
- For iteration 2+, also pass `--previous-workspace <workspace>/iteration-<N-1>`.
246
-
247
- **Cowork / headless environments:** If `webbrowser.open()` is not available or the environment has no display, use `--static <output_path>` to write a standalone HTML file instead of starting a server. Feedback will be downloaded as a `feedback.json` file when the user clicks "Submit All Reviews". After download, copy `feedback.json` into the workspace directory for the next iteration to pick up.
248
-
249
- Note: please use generate_review.py to create the viewer; there's no need to write custom HTML.
250
-
251
- 5. **Tell the user** something like: "I've opened the results in your browser. There are two tabs — 'Outputs' lets you click through each test case and leave feedback, 'Benchmark' shows the quantitative comparison. When you're done, come back here and let me know."
252
-
253
- ### What the user sees in the viewer
254
-
255
- The "Outputs" tab shows one test case at a time:
256
- - **Prompt**: the task that was given
257
- - **Output**: the files the skill produced, rendered inline where possible
258
- - **Previous Output** (iteration 2+): collapsed section showing last iteration's output
259
- - **Formal Grades** (if grading was run): collapsed section showing assertion pass/fail
260
- - **Feedback**: a textbox that auto-saves as they type
261
- - **Previous Feedback** (iteration 2+): their comments from last time, shown below the textbox
262
-
263
- The "Benchmark" tab shows the stats summary: pass rates, timing, and token usage for each configuration, with per-eval breakdowns and analyst observations.
264
-
265
- Navigation is via prev/next buttons or arrow keys. When done, they click "Submit All Reviews" which saves all feedback to `feedback.json`.
266
-
267
- ### Step 5: Read the feedback
268
-
269
- When the user tells you they're done, read `feedback.json`:
270
-
271
- ```json
272
- {
273
- "reviews": [
274
- {"run_id": "eval-0-with_skill", "feedback": "the chart is missing axis labels", "timestamp": "..."},
275
- {"run_id": "eval-1-with_skill", "feedback": "", "timestamp": "..."},
276
- {"run_id": "eval-2-with_skill", "feedback": "perfect, love this", "timestamp": "..."}
277
- ],
278
- "status": "complete"
279
- }
280
- ```
281
-
282
- Empty feedback means the user thought it was fine. Focus your improvements on the test cases where the user had specific complaints.
283
-
284
- Kill the viewer server when you're done with it:
285
-
286
- ```bash
287
- kill $VIEWER_PID 2>/dev/null
288
- ```
289
-
290
- ---
291
-
292
- ## Improving the skill
293
-
294
- This is the heart of the loop. You've run the test cases, the user has reviewed the results, and now you need to make the skill better based on their feedback.
295
-
296
- ### How to think about improvements
297
-
298
- 1. **Generalize from the feedback.** The big picture thing that's happening here is that we're trying to create skills that can be used a million times (maybe literally, maybe even more who knows) across many different prompts. Here you and the user are iterating on only a few examples over and over again because it helps move faster. The user knows these examples in and out and it's quick for them to assess new outputs. But if the skill you and the user are codeveloping works only for those examples, it's useless. Rather than put in fiddly overfitty changes, or oppressively constrictive MUSTs, if there's some stubborn issue, you might try branching out and using different metaphors, or recommending different patterns of working. It's relatively cheap to try and maybe you'll land on something great.
299
-
300
- 2. **Keep the prompt lean.** Remove things that aren't pulling their weight. Make sure to read the transcripts, not just the final outputs — if it looks like the skill is making the model waste a bunch of time doing things that are unproductive, you can try getting rid of the parts of the skill that are making it do that and seeing what happens.
301
-
302
- 3. **Explain the why.** Try hard to explain the **why** behind everything you're asking the model to do. Today's LLMs are *smart*. They have good theory of mind and when given a good harness can go beyond rote instructions and really make things happen. Even if the feedback from the user is terse or frustrated, try to actually understand the task and why the user is writing what they wrote, and what they actually wrote, and then transmit this understanding into the instructions. If you find yourself writing ALWAYS or NEVER in all caps, or using super rigid structures, that's a yellow flag — if possible, reframe and explain the reasoning so that the model understands why the thing you're asking for is important. That's a more humane, powerful, and effective approach.
303
-
304
- 4. **Look for repeated work across test cases.** Read the transcripts from the test runs and notice if the subagents all independently wrote similar helper scripts or took the same multi-step approach to something. If all 3 test cases resulted in the subagent writing a `create_docx.py` or a `build_chart.py`, that's a strong signal the skill should bundle that script. Write it once, put it in `scripts/`, and tell the skill to use it. This saves every future invocation from reinventing the wheel.
305
-
306
- This task is pretty important (we are trying to create billions a year in economic value here!) and your thinking time is not the blocker; take your time and really mull things over. I'd suggest writing a draft revision and then looking at it anew and making improvements. Really do your best to get into the head of the user and understand what they want and need.
307
-
308
- ### The iteration loop
309
-
310
- After improving the skill:
311
-
312
- 1. Apply your improvements to the skill
313
- 2. Rerun all test cases into a new `iteration-<N+1>/` directory, including baseline runs. If you're creating a new skill, the baseline is always `without_skill` (no skill) — that stays the same across iterations. If you're improving an existing skill, use your judgment on what makes sense as the baseline: the original version the user came in with, or the previous iteration.
314
- 3. Launch the reviewer with `--previous-workspace` pointing at the previous iteration
315
- 4. Wait for the user to review and tell you they're done
316
- 5. Read the new feedback, improve again, repeat
317
-
318
- Keep going until:
319
- - The user says they're happy
320
- - The feedback is all empty (everything looks good)
321
- - You're not making meaningful progress
322
-
323
65
  ---
324
-
325
- ## Advanced: Blind comparison
326
-
327
- For situations where you want a more rigorous comparison between two versions of a skill (e.g., the user asks "is the new version actually better?"), there's a blind comparison system. Read `agents/comparator.md` and `agents/analyzer.md` for the details. The basic idea is: give two outputs to an independent agent without telling it which is which, and let it judge quality. Then analyze why the winner won.
328
-
329
- This is optional, requires subagents, and most users won't need it. The human review loop is usually sufficient.
330
-
66
+ name: example-skill
67
+ description: Describe what it does and concrete situations that should trigger it.
68
+ license: MIT
331
69
  ---
332
70
 
333
- ## Description Optimization
71
+ # Example Skill
334
72
 
335
- The description field in SKILL.md frontmatter is the primary mechanism that determines whether Claude invokes a skill. After creating or improving a skill, offer to optimize the description for better triggering accuracy.
336
-
337
- ### Step 1: Generate trigger eval queries
338
-
339
- Create 20 eval queries — a mix of should-trigger and should-not-trigger. Save as JSON:
340
-
341
- ```json
342
- [
343
- {"query": "the user prompt", "should_trigger": true},
344
- {"query": "another prompt", "should_trigger": false}
345
- ]
73
+ State the shortest reliable workflow, required inputs, output contract, and
74
+ failure behavior.
346
75
  ```
347
76
 
348
- The queries must be realistic and something a Claude Code or Claude.ai user would actually type. Not abstract requests, but requests that are concrete and specific and have a good amount of detail. For instance, file paths, personal context about the user's job or situation, column names and values, company names, URLs. A little bit of backstory. Some might be in lowercase or contain abbreviations or typos or casual speech. Use a mix of different lengths, and focus on edge cases rather than making them clear-cut (the user will get a chance to sign off on them).
349
-
350
- Bad: `"Format this data"`, `"Extract text from PDF"`, `"Create a chart"`
77
+ Keep the directory name and frontmatter `name` equal. Preserve the name when
78
+ editing an installed Skill. Put detailed variants in `references/`; keep the
79
+ triggered body short enough to scan once.
351
80
 
352
- Good: `"ok so my boss just sent me this xlsx file (its in my downloads, called something like 'Q4 sales final FINAL v2.xlsx') and she wants me to add a column that shows the profit margin as a percentage. The revenue is in column C and costs are in column D i think"`
81
+ ### Configuration
353
82
 
354
- For the **should-trigger** queries (8-10), think about coverage. You want different phrasings of the same intent — some formal, some casual. Include cases where the user doesn't explicitly name the skill or file type but clearly needs it. Throw in some uncommon use cases and cases where this skill competes with another but should win.
83
+ Declare reusable Skill configuration in frontmatter and read values only from
84
+ the script subprocess environment:
355
85
 
356
- For the **should-not-trigger** queries (8-10), the most valuable ones are the near-misses — queries that share keywords or concepts with the skill but actually need something different. Think adjacent domains, ambiguous phrasing where a naive keyword match would trigger but shouldn't, and cases where the query touches on something the skill does but in a context where another tool is more appropriate.
86
+ ```yaml
87
+ config:
88
+ - key: SERVICE_API_KEY
89
+ type: secret
90
+ required: true
91
+ default: null
92
+ bindable: [global, role, agent]
93
+ description: Credential used by the service client.
94
+ ```
357
95
 
358
- The key thing to avoid: don't make should-not-trigger queries obviously irrelevant. "Write a fibonacci function" as a negative test for a PDF skill is too easy — it doesn't test anything. The negative cases should be genuinely tricky.
96
+ Valid types are `string`, `secret`, `url`, and `enum`. Numeric knobs are
97
+ strings parsed by the script. Never put a value in SKILL.md, a role, a command
98
+ argument, a ledger, or model-visible output.
359
99
 
360
- ### Step 2: Review with user
100
+ Configuration ownership is strict:
361
101
 
362
- Present the eval set to the user for review using the HTML template:
102
+ | Need | Owner | Delivery |
103
+ | ------------------------- | ---------------------------- | ---------------------- |
104
+ | reusable Skill config | Skill `config:` | Skill subprocess env |
105
+ | role default/behavior | role `parameters[]` | structured role params |
106
+ | per-account secret | `kind:"user", type:"secret"` | sealed env-only params |
107
+ | role default for a Skill | role `skillConfig[slug]` | resolved Skill env |
108
+ | workspace identity/policy | workspace APIs | runtime bootstrap |
109
+ | deployment secret | daemon/deployment env | child process env |
363
110
 
364
- 1. Read the template from `assets/eval_review.html`
365
- 2. Replace the placeholders:
366
- - `__EVAL_DATA_PLACEHOLDER__` → the JSON array of eval items (no quotes around it — it's a JS variable assignment)
367
- - `__SKILL_NAME_PLACEHOLDER__` → the skill's name
368
- - `__SKILL_DESCRIPTION_PLACEHOLDER__` → the skill's current description
369
- 3. Write to a temp file (e.g., `/tmp/eval_review_<skill-name>.html`) and open it: `open /tmp/eval_review_<skill-name>.html`
370
- 4. The user can edit queries, toggle should-trigger, add/remove entries, then click "Export Eval Set"
371
- 5. The file downloads to `~/Downloads/eval_set.json` — check the Downloads folder for the most recent version in case there are multiple (e.g., `eval_set (1).json`)
111
+ ### Script harness negative controls
372
112
 
373
- This step matters bad eval queries lead to bad descriptions.
113
+ When a script writes remotely, it must carry enough harness weight to reject a
114
+ bad request before the first network call:
374
115
 
375
- ### Step 3: Run the optimization loop
116
+ 1. Validate required input, types, target, and environment locally.
117
+ 2. Reject secret-bearing flags, including `--token=value`; do not echo the
118
+ untrusted token or value in an error.
119
+ 3. Read credentials and remote-write authority only from trusted environment
120
+ variables. A flag must not self-authorize a remote write.
121
+ 4. Run a read-only server preflight before mutation when one exists.
122
+ 5. Establish a stable idempotency key for recovery and write a secret-free,
123
+ atomic ledger before the first mutation.
124
+ 6. Emit structured stage/code/retryability output. Retain incomplete cleanup
125
+ state instead of claiming success.
126
+ 7. Test at least one negative control proving invalid local input performs zero
127
+ fetches/writes.
376
128
 
377
- Tell the user: "This will take some time — I'll run the optimization loop in the background and check on it periodically."
129
+ ## Fixed authoring closure
378
130
 
379
- Save the eval set to the workspace, then run in the background:
131
+ Run in this order:
380
132
 
381
133
  ```bash
382
- python -m scripts.run_loop \
383
- --eval-set <path-to-trigger-eval.json> \
384
- --skill-path <path-to-skill> \
385
- --model <model-id-powering-this-session> \
386
- --max-iterations 5 \
387
- --verbose
134
+ cloud skill validate ./<skill-slug> --json
135
+ cloud skill test ./<skill-slug> --agent <agentImUserId> --json
388
136
  ```
389
137
 
390
- Use the model ID from your system prompt (the one powering the current session) so the triggering test matches what the user actually experiences.
391
-
392
- While it runs, periodically tail the output to give the user updates on which iteration it's on and what the scores look like.
393
-
394
- This handles the full optimization loop automatically. It splits the eval set into 60% train and 40% held-out test, evaluates the current description (running each query 3 times to get a reliable trigger rate), then calls Claude to propose improvements based on what failed. It re-evaluates each new description on both train and test, iterating up to 5 times. When it's done, it opens an HTML report in the browser showing the results per iteration and returns JSON with `best_description` — selected by test score rather than train score to avoid overfitting.
395
-
396
- ### How skill triggering works
138
+ `validate` is local and mandatory. Run `test` when `skill.json` declares
139
+ `sampleTasks[]`; otherwise it may report a clear skip. Fix failures before any
140
+ create or publish request.
397
141
 
398
- Understanding the triggering mechanism helps design better eval queries. Skills appear in Claude's `available_skills` list with their name + description, and Claude decides whether to consult a skill based on that description. The important thing to know is that Claude only consults skills for tasks it can't easily handle on its own — simple, one-step queries like "read this PDF" may not trigger a skill even if the description matches perfectly, because Claude can handle them directly with basic tools. Complex, multi-step, or specialized queries reliably trigger skills when the description matches.
142
+ Choose exactly one destination:
399
143
 
400
- This means your eval queries should be substantive enough that Claude would actually benefit from consulting a skill. Simple queries like "read file X" are poor test cases — they won't trigger skills regardless of description quality.
401
-
402
- ### Step 4: Apply the result
403
-
404
- Take `best_description` from the JSON output and update the skill's SKILL.md frontmatter. Show the user before/after and report the scores.
144
+ ```bash
145
+ # Private, active, immediately installable in this workspace
146
+ cloud skill create ./<skill-slug> --json
405
147
 
406
- ---
148
+ # Private draft for Studio human review
149
+ cloud skill draft create ./<skill-slug> --json
407
150
 
408
- ### Package and Present (only if `present_files` tool is available)
151
+ # Public Marketplace: first create private, then publish returned slug
152
+ cloud skill create ./<skill-slug> --json
153
+ cloud skill publish <returned-slug> --license <license> --json
154
+ ```
409
155
 
410
- Check whether you have access to the `present_files` tool. If you don't, skip this step. If you do, package the skill and present the .skill file to the user:
156
+ Use the server-returned canonical slug. Community Skills may receive a prefix;
157
+ never reconstruct it from the directory name. Verify private objects through
158
+ the owner domain, not public search:
411
159
 
412
160
  ```bash
413
- python -m scripts.package_skill <path/to/skill-folder>
161
+ cloud skill mine --json
162
+ cloud skill show <returned-slug-or-id> --content --json
414
163
  ```
415
164
 
416
- After packaging, direct the user to the resulting `.skill` file path so they can install it.
417
-
418
- ---
419
-
420
- ## Claude.ai-specific instructions
421
-
422
- In Claude.ai, the core workflow is the same (draft → test → review → improve → repeat), but because Claude.ai doesn't have subagents, some mechanics change. Here's what to adapt:
423
-
424
- **Running test cases**: No subagents means no parallel execution. For each test case, read the skill's SKILL.md, then follow its instructions to accomplish the test prompt yourself. Do them one at a time. This is less rigorous than independent subagents (you wrote the skill and you're also running it, so you have full context), but it's a useful sanity check — and the human review step compensates. Skip the baseline runs — just use the skill to complete the task as requested.
425
-
426
- **Reviewing results**: If you can't open a browser (e.g., Claude.ai's VM has no display, or you're on a remote server), skip the browser reviewer entirely. Instead, present results directly in the conversation. For each test case, show the prompt and the output. If the output is a file the user needs to see (like a .docx or .xlsx), save it to the filesystem and tell them where it is so they can download and inspect it. Ask for feedback inline: "How does this look? Anything you'd change?"
427
-
428
- **Benchmarking**: Skip the quantitative benchmarking — it relies on baseline comparisons which aren't meaningful without subagents. Focus on qualitative feedback from the user.
165
+ A `409` is not proof that the intended Skill already exists. Read the owned
166
+ object and compare it before resuming or choosing a new name. If a documented
167
+ command is absent, report CLI version skew and use the repository's current
168
+ Cloud build; do not silently bypass gates with raw HTTP.
429
169
 
430
- **The iteration loop**: Same as before — improve the skill, rerun the test cases, ask for feedback — just without the browser reviewer in the middle. You can still organize results into iteration directories on the filesystem if you have one.
170
+ ## External Skill libraries
431
171
 
432
- **Description optimization**: This section requires the `claude` CLI tool (specifically `claude -p`) which is only available in Claude Code. Skip it if you're on Claude.ai.
172
+ For more than one source Skill, read
173
+ `references/external-library-import.md`, set its small environment contract, and
174
+ run `node scripts/import-library.mjs --json`. The harness validates the complete
175
+ selected tree before writes, rejects mirror slug collisions, resumes through a
176
+ secret-free ledger, owner-readbacks every canonical slug, and emits the exact
177
+ `requiredSkills` array for `role-builder`. Never replace it with a hand-written
178
+ shell loop, publish a probe object, or apply a role to the currently executing
179
+ Agent for verification.
433
180
 
434
- **Blind comparison**: Requires subagents. Skip it.
181
+ ## Improve an existing Skill
435
182
 
436
- **Packaging**: The `package_skill.py` script works anywhere with Python and a filesystem. On Claude.ai, you can run it and the user can download the resulting `.skill` file.
183
+ Default to a small evidence loop, not a large benchmark ceremony:
437
184
 
438
- **Updating an existing skill**: The user might be asking you to update an existing skill, not create a new one. In this case:
439
- - **Preserve the original name.** Note the skill's directory name and `name` frontmatter field -- use them unchanged. E.g., if the installed skill is `research-helper`, output `research-helper.skill` (not `research-helper-v2`).
440
- - **Copy to a writeable location before editing.** The installed skill path may be read-only. Copy to `/tmp/skill-name/`, edit there, and package from the copy.
441
- - **If packaging manually, stage in `/tmp/` first**, then copy to the output directory -- direct writes may fail due to permissions.
185
+ 1. Preserve the original bundle and name.
186
+ 2. Choose 2–3 representative prompts and explicit success checks.
187
+ 3. Validate, run, inspect outputs, and revise only observed failure causes.
188
+ 4. Re-run the same checks and ask for user review when output quality is
189
+ subjective.
442
190
 
443
- ---
444
-
445
- ## Cowork-Specific Instructions
446
-
447
- If you're in Cowork, the main things to know are:
448
-
449
- - You have subagents, so the main workflow (spawn test cases in parallel, run baselines, grade, etc.) all works. (However, if you run into severe problems with timeouts, it's OK to run the test prompts in series rather than parallel.)
450
- - You don't have a browser or display, so when generating the eval viewer, use `--static <output_path>` to write a standalone HTML file instead of starting a server. Then proffer a link that the user can click to open the HTML in their browser.
451
- - For whatever reason, the Cowork setup seems to disincline Claude from generating the eval viewer after running the tests, so just to reiterate: whether you're in Cowork or in Claude Code, after running tests, you should always generate the eval viewer for the human to look at examples before revising the skill yourself and trying to make corrections, using `generate_review.py` (not writing your own boutique html code). Sorry in advance but I'm gonna go all caps here: GENERATE THE EVAL VIEWER *BEFORE* evaluating inputs yourself. You want to get them in front of the human ASAP!
452
- - Feedback works differently: since there's no running server, the viewer's "Submit All Reviews" button will download `feedback.json` as a file. You can then read it from there (you may have to request access first).
453
- - Packaging works — `package_skill.py` just needs Python and a filesystem.
454
- - Description optimization (`run_loop.py` / `run_eval.py`) should work in Cowork just fine since it uses `claude -p` via subprocess, not a browser, but please save it until you've fully finished making the skill and the user agrees it's in good shape.
455
- - **Updating an existing skill**: The user might be asking you to update an existing skill, not create a new one. Follow the update guidance in the claude.ai section above.
191
+ Only when the user requests a formal benchmark or trigger optimization, use
192
+ the bundled resources:
456
193
 
457
- ---
458
-
459
- ## Reference files
194
+ - `references/schemas.md` for eval/result schemas.
195
+ - `scripts/run_eval.py`, `scripts/aggregate_benchmark.py`, and
196
+ `eval-viewer/generate_review.py` for comparison/review.
197
+ - `scripts/run_loop.py` and `scripts/improve_description.py` for explicit
198
+ description optimization.
199
+ - `agents/grader.md`, `agents/analyzer.md`, and `agents/comparator.md` only for
200
+ the corresponding advanced evaluation step.
460
201
 
461
- The agents/ directory contains instructions for specialized subagents. Read them when you need to spawn the relevant subagent.
202
+ Do not load all advanced resources for ordinary creation or import.
462
203
 
463
- - `agents/grader.md` — How to evaluate assertions against outputs
464
- - `agents/comparator.md` — How to do blind A/B comparison between two outputs
465
- - `agents/analyzer.md` — How to analyze why one version beat another
204
+ ## Built-in baseline boundary
466
205
 
467
- The references/ directory has additional documentation:
468
- - `references/schemas.md` JSON structures for evals.json, grading.json, etc.
469
-
470
- ---
206
+ Skill authors define a capability; they do not decide that every Agent must
207
+ receive it. A community/private Skill cannot self-enrol into the mandatory
208
+ baseline. A platform Built-in is eligible only through the platform tier
209
+ registry, and Admin selects/version-controls the active common and orchestration
210
+ sets in `/admin/skills`.
471
211
 
472
- Repeating one more time the core loop here for emphasis:
212
+ Role authors declare only business Skills. Role creation injects the active
213
+ baseline and exposes `requiredSkills`, `injectedSkills`, `effectiveSkills`, and
214
+ `baselinePolicyVersion`. If a proposed baseline Skill requires an unresolved
215
+ user secret, report it as ineligible; never weaken preflight or embed the value.
473
216
 
474
- - Figure out what the skill is about
475
- - Draft or edit the skill
476
- - Run claude-with-access-to-the-skill on test prompts
477
- - With the user, evaluate the outputs:
478
- - Create benchmark.json and run `eval-viewer/generate_review.py` to help the user review them
479
- - Run quantitative evals
480
- - Repeat until you and the user are satisfied
481
- - Package the final skill and return it to the user.
217
+ ## Completion report
482
218
 
483
- Please add steps to your TodoList, if you have such a thing, to make sure you don't forget. If you're in Cowork, please specifically put "Create evals JSON and run `eval-viewer/generate_review.py` so human can review test cases" in your TodoList to make sure it happens.
219
+ Report only evidence the user can act on:
484
220
 
485
- Good luck!
221
+ - validation/test result;
222
+ - selected destination and returned canonical slug/version/status/scope;
223
+ - readback result;
224
+ - for batch import, selected/excluded source trees and created/failed ledger
225
+ counts;
226
+ - any missing configuration by variable name only;
227
+ - whether a role handoff or live Agent mutation was explicitly requested.