@sentry/warden 0.22.0 → 0.24.0

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 (310) hide show
  1. package/.oxlintrc.json +169 -0
  2. package/CHANGELOG.md +427 -0
  3. package/README.md +4 -1
  4. package/dist/cli/args.d.ts +6 -2
  5. package/dist/cli/args.d.ts.map +1 -1
  6. package/dist/cli/args.js +175 -207
  7. package/dist/cli/args.js.map +1 -1
  8. package/dist/cli/commands/add.d.ts.map +1 -1
  9. package/dist/cli/commands/add.js +16 -5
  10. package/dist/cli/commands/add.js.map +1 -1
  11. package/dist/cli/commands/build.d.ts +13 -0
  12. package/dist/cli/commands/build.d.ts.map +1 -0
  13. package/dist/cli/commands/build.js +384 -0
  14. package/dist/cli/commands/build.js.map +1 -0
  15. package/dist/cli/commands/init.d.ts.map +1 -1
  16. package/dist/cli/commands/init.js +13 -5
  17. package/dist/cli/commands/init.js.map +1 -1
  18. package/dist/cli/commands/runs.d.ts.map +1 -1
  19. package/dist/cli/commands/runs.js +12 -6
  20. package/dist/cli/commands/runs.js.map +1 -1
  21. package/dist/cli/commands/sync.d.ts.map +1 -1
  22. package/dist/cli/commands/sync.js +4 -1
  23. package/dist/cli/commands/sync.js.map +1 -1
  24. package/dist/cli/context.d.ts.map +1 -1
  25. package/dist/cli/context.js +8 -1
  26. package/dist/cli/context.js.map +1 -1
  27. package/dist/cli/files.d.ts.map +1 -1
  28. package/dist/cli/files.js +27 -9
  29. package/dist/cli/files.js.map +1 -1
  30. package/dist/cli/help.d.ts +4 -0
  31. package/dist/cli/help.d.ts.map +1 -0
  32. package/dist/cli/help.js +448 -0
  33. package/dist/cli/help.js.map +1 -0
  34. package/dist/cli/index.js +2 -13
  35. package/dist/cli/index.js.map +1 -1
  36. package/dist/cli/input.d.ts +12 -0
  37. package/dist/cli/input.d.ts.map +1 -1
  38. package/dist/cli/input.js +60 -0
  39. package/dist/cli/input.js.map +1 -1
  40. package/dist/cli/main.d.ts +41 -2
  41. package/dist/cli/main.d.ts.map +1 -1
  42. package/dist/cli/main.js +294 -75
  43. package/dist/cli/main.js.map +1 -1
  44. package/dist/cli/output/box.js +1 -1
  45. package/dist/cli/output/formatters.d.ts +10 -2
  46. package/dist/cli/output/formatters.d.ts.map +1 -1
  47. package/dist/cli/output/formatters.js +32 -9
  48. package/dist/cli/output/formatters.js.map +1 -1
  49. package/dist/cli/output/index.d.ts +1 -1
  50. package/dist/cli/output/index.d.ts.map +1 -1
  51. package/dist/cli/output/index.js +1 -1
  52. package/dist/cli/output/index.js.map +1 -1
  53. package/dist/cli/output/ink-runner.d.ts +3 -1
  54. package/dist/cli/output/ink-runner.d.ts.map +1 -1
  55. package/dist/cli/output/ink-runner.js +64 -28
  56. package/dist/cli/output/ink-runner.js.map +1 -1
  57. package/dist/cli/output/jsonl.d.ts +37 -0
  58. package/dist/cli/output/jsonl.d.ts.map +1 -1
  59. package/dist/cli/output/jsonl.js +6 -0
  60. package/dist/cli/output/jsonl.js.map +1 -1
  61. package/dist/cli/output/live-status.d.ts +48 -0
  62. package/dist/cli/output/live-status.d.ts.map +1 -0
  63. package/dist/cli/output/live-status.js +173 -0
  64. package/dist/cli/output/live-status.js.map +1 -0
  65. package/dist/cli/output/reporter.d.ts +4 -0
  66. package/dist/cli/output/reporter.d.ts.map +1 -1
  67. package/dist/cli/output/reporter.js +20 -3
  68. package/dist/cli/output/reporter.js.map +1 -1
  69. package/dist/cli/output/tasks.d.ts +8 -5
  70. package/dist/cli/output/tasks.d.ts.map +1 -1
  71. package/dist/cli/output/tasks.js +113 -71
  72. package/dist/cli/output/tasks.js.map +1 -1
  73. package/dist/cli/signals.d.ts +15 -0
  74. package/dist/cli/signals.d.ts.map +1 -0
  75. package/dist/cli/signals.js +26 -0
  76. package/dist/cli/signals.js.map +1 -0
  77. package/dist/config/loader.d.ts +48 -7
  78. package/dist/config/loader.d.ts.map +1 -1
  79. package/dist/config/loader.js +228 -32
  80. package/dist/config/loader.js.map +1 -1
  81. package/dist/config/schema.d.ts +55 -0
  82. package/dist/config/schema.d.ts.map +1 -1
  83. package/dist/config/schema.js +34 -2
  84. package/dist/config/schema.js.map +1 -1
  85. package/dist/diff/context.d.ts +9 -2
  86. package/dist/diff/context.d.ts.map +1 -1
  87. package/dist/diff/context.js +65 -17
  88. package/dist/diff/context.js.map +1 -1
  89. package/dist/evals/runner.d.ts.map +1 -1
  90. package/dist/evals/runner.js +16 -0
  91. package/dist/evals/runner.js.map +1 -1
  92. package/dist/event/context.d.ts.map +1 -1
  93. package/dist/event/context.js +1 -0
  94. package/dist/event/context.js.map +1 -1
  95. package/dist/event/schedule-context.d.ts.map +1 -1
  96. package/dist/event/schedule-context.js +1 -0
  97. package/dist/event/schedule-context.js.map +1 -1
  98. package/dist/index.d.ts +6 -6
  99. package/dist/index.d.ts.map +1 -1
  100. package/dist/index.js +3 -3
  101. package/dist/index.js.map +1 -1
  102. package/dist/output/dedup.d.ts +8 -11
  103. package/dist/output/dedup.d.ts.map +1 -1
  104. package/dist/output/dedup.js +39 -37
  105. package/dist/output/dedup.js.map +1 -1
  106. package/dist/output/github-checks.d.ts +1 -0
  107. package/dist/output/github-checks.d.ts.map +1 -1
  108. package/dist/output/github-checks.js +9 -7
  109. package/dist/output/github-checks.js.map +1 -1
  110. package/dist/sdk/analyze.d.ts.map +1 -1
  111. package/dist/sdk/analyze.js +147 -277
  112. package/dist/sdk/analyze.js.map +1 -1
  113. package/dist/sdk/circuit-breaker.d.ts +26 -0
  114. package/dist/sdk/circuit-breaker.d.ts.map +1 -0
  115. package/dist/sdk/circuit-breaker.js +53 -0
  116. package/dist/sdk/circuit-breaker.js.map +1 -0
  117. package/dist/sdk/errors.d.ts +5 -0
  118. package/dist/sdk/errors.d.ts.map +1 -1
  119. package/dist/sdk/errors.js +27 -0
  120. package/dist/sdk/errors.js.map +1 -1
  121. package/dist/sdk/extract.d.ts +18 -9
  122. package/dist/sdk/extract.d.ts.map +1 -1
  123. package/dist/sdk/extract.js +95 -87
  124. package/dist/sdk/extract.js.map +1 -1
  125. package/dist/sdk/fix-quality.d.ts +5 -0
  126. package/dist/sdk/fix-quality.d.ts.map +1 -1
  127. package/dist/sdk/fix-quality.js +42 -23
  128. package/dist/sdk/fix-quality.js.map +1 -1
  129. package/dist/sdk/haiku.d.ts +6 -0
  130. package/dist/sdk/haiku.d.ts.map +1 -1
  131. package/dist/sdk/haiku.js +75 -49
  132. package/dist/sdk/haiku.js.map +1 -1
  133. package/dist/sdk/json-output.d.ts +31 -0
  134. package/dist/sdk/json-output.d.ts.map +1 -0
  135. package/dist/sdk/json-output.js +98 -0
  136. package/dist/sdk/json-output.js.map +1 -0
  137. package/dist/sdk/model-pricing.json +56 -16
  138. package/dist/sdk/post-process.d.ts +29 -0
  139. package/dist/sdk/post-process.d.ts.map +1 -0
  140. package/dist/sdk/post-process.js +65 -0
  141. package/dist/sdk/post-process.js.map +1 -0
  142. package/dist/sdk/prepare.d.ts.map +1 -1
  143. package/dist/sdk/prepare.js +4 -1
  144. package/dist/sdk/prepare.js.map +1 -1
  145. package/dist/sdk/pricing.d.ts +18 -0
  146. package/dist/sdk/pricing.d.ts.map +1 -1
  147. package/dist/sdk/pricing.js +108 -3
  148. package/dist/sdk/pricing.js.map +1 -1
  149. package/dist/sdk/prompt-sections.d.ts +56 -0
  150. package/dist/sdk/prompt-sections.d.ts.map +1 -0
  151. package/dist/sdk/prompt-sections.js +118 -0
  152. package/dist/sdk/prompt-sections.js.map +1 -0
  153. package/dist/sdk/prompt.d.ts +2 -17
  154. package/dist/sdk/prompt.d.ts.map +1 -1
  155. package/dist/sdk/prompt.js +15 -37
  156. package/dist/sdk/prompt.js.map +1 -1
  157. package/dist/sdk/report-files.d.ts +15 -0
  158. package/dist/sdk/report-files.d.ts.map +1 -0
  159. package/dist/sdk/report-files.js +20 -0
  160. package/dist/sdk/report-files.js.map +1 -0
  161. package/dist/sdk/runner.d.ts +9 -1
  162. package/dist/sdk/runner.d.ts.map +1 -1
  163. package/dist/sdk/runner.js +6 -0
  164. package/dist/sdk/runner.js.map +1 -1
  165. package/dist/sdk/runtimes/claude.d.ts +3 -0
  166. package/dist/sdk/runtimes/claude.d.ts.map +1 -0
  167. package/dist/sdk/runtimes/claude.js +376 -0
  168. package/dist/sdk/runtimes/claude.js.map +1 -0
  169. package/dist/sdk/runtimes/index.d.ts +12 -0
  170. package/dist/sdk/runtimes/index.d.ts.map +1 -0
  171. package/dist/sdk/runtimes/index.js +22 -0
  172. package/dist/sdk/runtimes/index.js.map +1 -0
  173. package/dist/sdk/runtimes/types.d.ts +116 -0
  174. package/dist/sdk/runtimes/types.d.ts.map +1 -0
  175. package/dist/sdk/runtimes/types.js +17 -0
  176. package/dist/sdk/runtimes/types.js.map +1 -0
  177. package/dist/sdk/types.d.ts +23 -2
  178. package/dist/sdk/types.d.ts.map +1 -1
  179. package/dist/sdk/types.js.map +1 -1
  180. package/dist/sdk/usage.d.ts +21 -6
  181. package/dist/sdk/usage.d.ts.map +1 -1
  182. package/dist/sdk/usage.js +36 -23
  183. package/dist/sdk/usage.js.map +1 -1
  184. package/dist/sdk/verify.d.ts +25 -0
  185. package/dist/sdk/verify.d.ts.map +1 -0
  186. package/dist/sdk/verify.js +226 -0
  187. package/dist/sdk/verify.js.map +1 -0
  188. package/dist/skill-builder/agentic.d.ts +33 -0
  189. package/dist/skill-builder/agentic.d.ts.map +1 -0
  190. package/dist/skill-builder/agentic.js +240 -0
  191. package/dist/skill-builder/agentic.js.map +1 -0
  192. package/dist/skill-builder/authoring-provider.d.ts +5 -0
  193. package/dist/skill-builder/authoring-provider.d.ts.map +1 -0
  194. package/dist/skill-builder/authoring-provider.js +70 -0
  195. package/dist/skill-builder/authoring-provider.js.map +1 -0
  196. package/dist/skill-builder/definition.d.ts +46 -0
  197. package/dist/skill-builder/definition.d.ts.map +1 -0
  198. package/dist/skill-builder/definition.js +171 -0
  199. package/dist/skill-builder/definition.js.map +1 -0
  200. package/dist/skill-builder/outline-contract.d.ts +113 -0
  201. package/dist/skill-builder/outline-contract.d.ts.map +1 -0
  202. package/dist/skill-builder/outline-contract.js +73 -0
  203. package/dist/skill-builder/outline-contract.js.map +1 -0
  204. package/dist/skill-builder/outline-state.d.ts +158 -0
  205. package/dist/skill-builder/outline-state.d.ts.map +1 -0
  206. package/dist/skill-builder/outline-state.js +87 -0
  207. package/dist/skill-builder/outline-state.js.map +1 -0
  208. package/dist/skill-builder/outline.d.ts +36 -0
  209. package/dist/skill-builder/outline.d.ts.map +1 -0
  210. package/dist/skill-builder/outline.js +345 -0
  211. package/dist/skill-builder/outline.js.map +1 -0
  212. package/dist/skill-builder/skill-contract.d.ts +97 -0
  213. package/dist/skill-builder/skill-contract.d.ts.map +1 -0
  214. package/dist/skill-builder/skill-contract.js +58 -0
  215. package/dist/skill-builder/skill-contract.js.map +1 -0
  216. package/dist/skill-builder/skill-prompts.d.ts +61 -0
  217. package/dist/skill-builder/skill-prompts.d.ts.map +1 -0
  218. package/dist/skill-builder/skill-prompts.js +285 -0
  219. package/dist/skill-builder/skill-prompts.js.map +1 -0
  220. package/dist/skill-builder/skill.d.ts +23 -0
  221. package/dist/skill-builder/skill.d.ts.map +1 -0
  222. package/dist/skill-builder/skill.js +563 -0
  223. package/dist/skill-builder/skill.js.map +1 -0
  224. package/dist/skills/index.d.ts +2 -2
  225. package/dist/skills/index.d.ts.map +1 -1
  226. package/dist/skills/index.js +1 -1
  227. package/dist/skills/index.js.map +1 -1
  228. package/dist/skills/loader.d.ts +20 -6
  229. package/dist/skills/loader.d.ts.map +1 -1
  230. package/dist/skills/loader.js +88 -141
  231. package/dist/skills/loader.js.map +1 -1
  232. package/dist/skills/remote.d.ts +11 -7
  233. package/dist/skills/remote.d.ts.map +1 -1
  234. package/dist/skills/remote.js +62 -162
  235. package/dist/skills/remote.js.map +1 -1
  236. package/dist/triggers/matcher.d.ts.map +1 -1
  237. package/dist/triggers/matcher.js +28 -15
  238. package/dist/triggers/matcher.js.map +1 -1
  239. package/dist/types/index.d.ts +40 -0
  240. package/dist/types/index.d.ts.map +1 -1
  241. package/dist/types/index.js +11 -0
  242. package/dist/types/index.js.map +1 -1
  243. package/dist/utils/index.d.ts +1 -0
  244. package/dist/utils/index.d.ts.map +1 -1
  245. package/dist/utils/index.js +1 -0
  246. package/dist/utils/index.js.map +1 -1
  247. package/dist/utils/path.d.ts +17 -0
  248. package/dist/utils/path.d.ts.map +1 -0
  249. package/dist/utils/path.js +36 -0
  250. package/dist/utils/path.js.map +1 -0
  251. package/package.json +8 -8
  252. package/policies/README.md +22 -0
  253. package/policies/code-comments.md +20 -0
  254. package/policies/policy-template.md +14 -0
  255. package/skills/warden/SPEC.md +112 -0
  256. package/skills/warden/references/cli-reference.md +2 -2
  257. package/skills/warden/references/config-schema.md +29 -13
  258. package/skills/warden/references/configuration.md +20 -8
  259. package/skills/warden/references/creating-skills.md +3 -0
  260. package/skills/warden-sweep/SPEC.md +126 -0
  261. package/src/builtin-skills/security-review/SKILL.md +81 -0
  262. package/src/builtin-skills/security-review/SPEC.md +77 -0
  263. package/src/builtin-skills/security-review/references/github-workflows.md +186 -0
  264. package/src/builtin-skills/security-review/references/javascript-typescript.md +69 -0
  265. package/src/builtin-skills/security-review/references/python.md +70 -0
  266. package/src/internal-skills/skill-writer/EVAL.md +124 -0
  267. package/src/internal-skills/skill-writer/SKILL.md +159 -0
  268. package/src/internal-skills/skill-writer/SOURCES.md +94 -0
  269. package/src/internal-skills/skill-writer/SPEC.md +153 -0
  270. package/src/internal-skills/skill-writer/references/artifact-layouts/argument-driven-skill-layout.md +32 -0
  271. package/src/internal-skills/skill-writer/references/artifact-layouts/asset-template-skill-layout.md +30 -0
  272. package/src/internal-skills/skill-writer/references/artifact-layouts/inline-skill-layout.md +28 -0
  273. package/src/internal-skills/skill-writer/references/artifact-layouts/reference-backed-skill-layout.md +35 -0
  274. package/src/internal-skills/skill-writer/references/artifact-layouts/script-backed-skill-layout.md +31 -0
  275. package/src/internal-skills/skill-writer/references/authoring-path.md +91 -0
  276. package/src/internal-skills/skill-writer/references/claude-code/argument-substitutions.md +20 -0
  277. package/src/internal-skills/skill-writer/references/claude-code/dynamic-context.md +16 -0
  278. package/src/internal-skills/skill-writer/references/claude-code/frontmatter-and-invocation.md +33 -0
  279. package/src/internal-skills/skill-writer/references/claude-code/hook-backed-skills.md +28 -0
  280. package/src/internal-skills/skill-writer/references/claude-code/subagent-fork-skills.md +22 -0
  281. package/src/internal-skills/skill-writer/references/description-optimization.md +28 -0
  282. package/src/internal-skills/skill-writer/references/design-principles.md +74 -0
  283. package/src/internal-skills/skill-writer/references/evaluation-path.md +73 -0
  284. package/src/internal-skills/skill-writer/references/examples/documentation-skill.md +70 -0
  285. package/src/internal-skills/skill-writer/references/examples/evaluator-loop-skill.md +38 -0
  286. package/src/internal-skills/skill-writer/references/examples/hook-backed-skill.md +39 -0
  287. package/src/internal-skills/skill-writer/references/examples/router-skill.md +41 -0
  288. package/src/internal-skills/skill-writer/references/examples/security-review-skill.md +69 -0
  289. package/src/internal-skills/skill-writer/references/examples/subagent-fork-skill.md +39 -0
  290. package/src/internal-skills/skill-writer/references/examples/workflow-process-skill.md +65 -0
  291. package/src/internal-skills/skill-writer/references/execution-shapes.md +68 -0
  292. package/src/internal-skills/skill-writer/references/iteration-evidence.md +82 -0
  293. package/src/internal-skills/skill-writer/references/iteration-path.md +40 -0
  294. package/src/internal-skills/skill-writer/references/mode-selection.md +67 -0
  295. package/src/internal-skills/skill-writer/references/output-contracts.md +68 -0
  296. package/src/internal-skills/skill-writer/references/reference-architecture.md +71 -0
  297. package/src/internal-skills/skill-writer/references/registration-validation.md +67 -0
  298. package/src/internal-skills/skill-writer/references/source-discovery.md +60 -0
  299. package/src/internal-skills/skill-writer/references/spec-template.md +118 -0
  300. package/src/internal-skills/skill-writer/references/structure-troubleshooting.md +111 -0
  301. package/src/internal-skills/skill-writer/references/synthesis-path.md +119 -0
  302. package/src/internal-skills/skill-writer/references/workflow-mechanics/evaluator-loops.md +25 -0
  303. package/src/internal-skills/skill-writer/references/workflow-mechanics/orchestrator-workers.md +25 -0
  304. package/src/internal-skills/skill-writer/references/workflow-mechanics/parallel-workflows.md +21 -0
  305. package/src/internal-skills/skill-writer/references/workflow-mechanics/plan-validate-execute.md +26 -0
  306. package/src/internal-skills/skill-writer/references/workflow-mechanics/prompt-chaining.md +24 -0
  307. package/src/internal-skills/skill-writer/references/workflow-mechanics/routing-workflows.md +28 -0
  308. package/src/internal-skills/skill-writer/references/workflow-mechanics/validation-loops.md +26 -0
  309. package/src/internal-skills/skill-writer/scripts/quick_validate.py +158 -0
  310. package/src/internal-skills/skill-writer/scripts/quick_validate_test.py +79 -0
@@ -0,0 +1,35 @@
1
+ # Reference-Backed Skill Layout
2
+
3
+ Use this layout when the skill needs deep knowledge, but most runs only need one branch or subset of that knowledge.
4
+
5
+ ## Choose this layout when
6
+
7
+ - `SKILL.md` can act as a router
8
+ - bundled references can stay focused by lookup need
9
+ - the complexity is optional knowledge, not heavy automation
10
+
11
+ ## File layout
12
+
13
+ ```text
14
+ my-skill/
15
+ ├── SKILL.md
16
+ └── references/
17
+ ├── focused-topic-a.md
18
+ ├── focused-topic-b.md
19
+ └── troubleshooting.md
20
+ ```
21
+
22
+ Subfolders are acceptable when they make the lookup path clearer, for example `references/api/` or `references/examples/`.
23
+
24
+ ## Required contract
25
+
26
+ 1. `SKILL.md` tells the agent exactly when to open each reference.
27
+ 2. Reference filenames predict their contents.
28
+ 3. No reference mixes routing, troubleshooting, examples, and source notes without a clear reason.
29
+ 4. Large references include navigation or are split further.
30
+
31
+ ## Avoid this layout when
32
+
33
+ - the skill is small enough to stay inline
34
+ - scripts or validators are central to execution
35
+ - the references would only exist as vague topic buckets
@@ -0,0 +1,31 @@
1
+ # Script-Backed Skill Layout
2
+
3
+ Use this layout when parsing, validation, APIs, or repeatable transformations are fragile in plain shell or prose alone.
4
+
5
+ ## Choose this layout when
6
+
7
+ - the skill benefits from deterministic automation
8
+ - repeated shell snippets would be brittle
9
+ - validation or data extraction should be reusable
10
+
11
+ ## File layout
12
+
13
+ ```text
14
+ my-skill/
15
+ ├── SKILL.md
16
+ └── scripts/
17
+ ├── fetch.py
18
+ └── validate.py
19
+ ```
20
+
21
+ ## Required contract
22
+
23
+ 1. Every script is named in `SKILL.md` with arguments, outputs, and fallback behavior.
24
+ 2. Scripts are non-interactive.
25
+ 3. Standard output is structured when practical.
26
+ 4. The skill explains what to do if a script fails or is unavailable.
27
+
28
+ ## Avoid this layout when
29
+
30
+ - one simple shell command is enough
31
+ - the "script" would only wrap trivial shell for no reliability gain
@@ -0,0 +1,91 @@
1
+ # Authoring Path
2
+
3
+ Use this path to create or update skill files.
4
+
5
+ ## Runtime Writing Rules
6
+
7
+ 1. Frontmatter must be first line.
8
+ 2. `name` must match the directory.
9
+ 3. `description` must contain realistic trigger language.
10
+ 4. Keep runtime guidance imperative and compact.
11
+ 5. Prefer tables, checklists, templates, and examples over prose.
12
+ 6. Use `SKILL.md` as the runtime decision layer for complex skills.
13
+
14
+ ## Path Rules
15
+
16
+ 1. Treat the skill directory as the root for bundled files.
17
+ 2. Use `references/...`, `scripts/...`, and `assets/...` paths by default.
18
+ 3. Reserve repo-root paths for registration instructions only.
19
+ 4. Follow repo prior art if the workspace already standardizes on a provider-specific path variable.
20
+ 5. Avoid host-specific absolute filesystem paths.
21
+
22
+ ## Supporting Files
23
+
24
+ Create only what the skill needs:
25
+
26
+ | File or dir | Use |
27
+ |-------------|-----|
28
+ | `SPEC.md` | maintenance contract |
29
+ | `references/` | optional depth loaded by route |
30
+ | `references/evidence/` | persistent iteration examples |
31
+ | `scripts/` | repeatable automation or validation |
32
+ | `assets/` | reusable templates or static artifacts |
33
+
34
+ Subfolders inside `references/` are acceptable only when they make the lookup path clearer.
35
+
36
+ ## File Creation Rules
37
+
38
+ 1. Read `references/reference-architecture.md` before adding bundled files.
39
+ 2. Create a new reference only when it has a clear "open when..." reason.
40
+ 3. If you add a bundled reference, add a direct routing entry for it in `SKILL.md`.
41
+ 4. Do not create catch-all docs that mix workflow, source notes, examples, and eval results.
42
+ 5. Keep provenance in `SOURCES.md`, not in runtime files.
43
+ 6. Update `SPEC.md` when the skill contract changes materially.
44
+
45
+ ## Class-Specific Requirements
46
+
47
+ ### `integration-documentation`
48
+
49
+ Require focused coverage for:
50
+
51
+ 1. API surface and behavior contracts
52
+ 2. config/runtime options
53
+ 3. common downstream use cases
54
+ 4. known issues and workarounds
55
+ 5. version or migration variance
56
+
57
+ Default minimum depth:
58
+
59
+ 1. at least 6 concrete downstream use cases
60
+ 2. at least 8 issue/fix or failure/workaround entries
61
+
62
+ ## Shape-Specific Requirements
63
+
64
+ | Shape | Require |
65
+ |-------|---------|
66
+ | `router` | route criteria, fallback, per-route contract, misroute recovery |
67
+ | `script-backed-workflow` | documented scripts, non-interactive execution, structured output, fallback |
68
+ | `parallelization` / `orchestrator-workers` | unit of work, worker output schema, merge rule, stop condition |
69
+ | `evaluator-optimizer` | rubric, stop rule, acceptance condition, evidence handling |
70
+ | `subagent-fork` | actionable task, return contract, isolation reason, portability note |
71
+ | `hook-backed` | event scope, side-effect boundary, fallback, safety note |
72
+ | `asset-template` | asset routing, placeholder guidance, validation checklist when needed |
73
+ | `argument-driven` | expected arguments, empty-input behavior, manual-only use when risky |
74
+
75
+ ## Example Requirements
76
+
77
+ Authoring or generator skills should include:
78
+
79
+ 1. happy-path example
80
+ 2. secure or robust variant
81
+ 3. anti-pattern plus correction
82
+
83
+ Do not accept abstract-only guidance when a concrete example is needed.
84
+
85
+ ## Required Output
86
+
87
+ - updated `SKILL.md`
88
+ - updated `SPEC.md` when required
89
+ - updated or added supporting files
90
+ - explanation of major authoring decisions
91
+ - description-optimization handoff
@@ -0,0 +1,20 @@
1
+ # Claude Argument Substitutions
2
+
3
+ Load this when the skill uses Claude Code argument fields or substitution variables.
4
+
5
+ ## Supported substitutions
6
+
7
+ - `$ARGUMENTS`
8
+ - `$ARGUMENTS[N]`
9
+ - `$N`
10
+ - named arguments such as `$issue` when `arguments` is declared
11
+ - `${CLAUDE_SESSION_ID}`
12
+ - `${CLAUDE_EFFORT}`
13
+ - `${CLAUDE_SKILL_DIR}`
14
+
15
+ ## Required contract
16
+
17
+ 1. Document expected arguments and empty-input behavior.
18
+ 2. Add quoting-aware examples for multi-word input when ambiguity is likely.
19
+ 3. Use manual-only invocation for side-effect-heavy argument-driven skills.
20
+ 4. Add portability notes because this syntax is Claude Code-specific.
@@ -0,0 +1,16 @@
1
+ # Claude Dynamic Context Injection
2
+
3
+ Load this when the skill uses Claude Code shell preprocessing with ``!`command` `` or fenced ````!` blocks.
4
+
5
+ ## Use this file for
6
+
7
+ - stable, high-signal preprocessing
8
+ - small dynamic snippets that are cheaper than adding a full script
9
+
10
+ ## Use sparingly
11
+
12
+ 1. Only inject output that is stable, high-signal, and cheap.
13
+ 2. Never inject large or noisy output.
14
+ 3. Prefer a normal script or tool call when that is easier to reason about.
15
+
16
+ Treat this as preprocessing, not model behavior, and add portability notes because it is Claude Code-specific.
@@ -0,0 +1,33 @@
1
+ # Claude Frontmatter And Invocation
2
+
3
+ Load this when the skill needs Claude Code-specific frontmatter or invocation control.
4
+
5
+ ## Use this file for
6
+
7
+ - extra trigger metadata
8
+ - invocation visibility rules
9
+ - skill-scoped model or effort overrides
10
+ - path or shell activation controls
11
+
12
+ ## Relevant fields
13
+
14
+ | Field | Purpose | Notes |
15
+ |-------|---------|-------|
16
+ | `when_to_use` | extra trigger context for Claude | additive only; keep trigger-rich language in `description` |
17
+ | `disable-model-invocation` | only the user can invoke | good for side-effect-heavy workflows |
18
+ | `user-invocable` | hide from `/` menu and let Claude invoke | good for passive background knowledge |
19
+ | `allowed-tools` | pre-approve tools while skill is active | provider-specific |
20
+ | `model` | skill-scoped model override | provider-specific |
21
+ | `effort` | skill-scoped effort override | provider-specific |
22
+ | `paths` | glob-based activation limits | provider-specific |
23
+ | `shell` | shell for `!` preprocessing | provider-specific |
24
+
25
+ ## Invocation rules
26
+
27
+ 1. If Claude should not decide when to run the skill, set `disable-model-invocation: true`.
28
+ 2. If the skill is not a meaningful command for humans, consider `user-invocable: false`.
29
+ 3. Keep trigger-rich language in `description` even if `when_to_use` is present.
30
+
31
+ ## Portability rule
32
+
33
+ When using any Claude-specific field, say why it is necessary and note that it is not portable Agent Skills behavior.
@@ -0,0 +1,28 @@
1
+ # Claude Hook-Backed Skills
2
+
3
+ Load this when the skill uses Claude Code hooks for deterministic enforcement around tool or lifecycle events.
4
+
5
+ ## Use this file for
6
+
7
+ - pre-tool validation for risky commands
8
+ - post-edit formatting or linting
9
+ - scoped guardrails around specific tool events
10
+
11
+ ## Required contract
12
+
13
+ 1. Narrow event and matcher scope.
14
+ 2. Explicit side-effect boundaries.
15
+ 3. Fallback behavior when hooks are unavailable.
16
+ 4. Security note for shell execution, path handling, and sensitive files.
17
+
18
+ ## Security rules
19
+
20
+ 1. Command hooks run with full user permissions.
21
+ 2. Validate and sanitize inputs.
22
+ 3. Use absolute paths for scripts inside the hook definition.
23
+ 4. Avoid sensitive files such as `.env`, `.git/`, and keys.
24
+ 5. Test hooks before treating them as trusted enforcement.
25
+
26
+ ## Async note
27
+
28
+ Async hooks cannot block the action that triggered them; they are not a substitute for synchronous validation.
@@ -0,0 +1,22 @@
1
+ # Claude Subagent-Fork Skills
2
+
3
+ Load this when the skill should run in isolated context with `context: fork`.
4
+
5
+ ## Use this file for
6
+
7
+ - self-contained delegated investigations
8
+ - isolated context for focus or permission boundaries
9
+ - model or tool specialization where the main thread only needs a summary
10
+
11
+ ## Required contract
12
+
13
+ 1. An actionable task in the skill body.
14
+ 2. Expected return or summary contract.
15
+ 3. Explicit reason isolation is useful.
16
+ 4. Portability note because this is Claude Code-specific.
17
+
18
+ ## Avoid when
19
+
20
+ 1. The skill is passive conventions or reference material.
21
+ 2. The task depends heavily on the current conversation history.
22
+ 3. The main value comes from inline collaboration rather than delegation.
@@ -0,0 +1,28 @@
1
+ # Description Optimization
2
+
3
+ Use this path to improve skill triggering quality and reduce false matches.
4
+
5
+ ## Trigger quality loop
6
+
7
+ 1. Draft a description with realistic user language and concrete trigger phrases.
8
+ 2. Build two query sets:
9
+ - should-trigger queries
10
+ - should-not-trigger queries
11
+ 3. Evaluate the current description against both sets.
12
+ 4. Edit description wording to improve precision/recall.
13
+ 5. Repeat until false positives and false negatives are reduced to acceptable levels.
14
+
15
+ ## Authoring rules
16
+
17
+ 1. Keep the description in third person.
18
+ 2. Include what the skill does and when to use it.
19
+ 3. Avoid implementation details that do not help triggering.
20
+ 4. Avoid provider-specific phrasing unless the skill is intentionally provider-specific.
21
+ 5. For provider-agnostic skills, avoid naming Claude, Codex, or any provider in ways that would narrow portability expectations.
22
+
23
+ ## Required output
24
+
25
+ - Final description text
26
+ - should-trigger query set
27
+ - should-not-trigger query set
28
+ - Summary of edits made to improve trigger behavior
@@ -0,0 +1,74 @@
1
+ # Skill Design Principles
2
+
3
+ Use this guide to keep skill instructions dense, scannable, and worth their token cost.
4
+
5
+ ## Core Rule
6
+
7
+ - Every line should help the agent decide, do, or verify something.
8
+ - Prefer tables, checklists, templates, and input/output examples over explanatory prose.
9
+ - Keep rationale to one short sentence unless the agent is likely to make the wrong choice without it.
10
+
11
+ ## Add Vs Cut
12
+
13
+ | Keep | Cut |
14
+ |------|-----|
15
+ | project-specific conventions | generic background the agent already knows |
16
+ | non-obvious gotchas | motivational filler |
17
+ | exact commands, schemas, and templates | repeated restatements of the same rule |
18
+ | branch logic and defaults | long essays where a table would work |
19
+ | one strong example | multiple weak examples saying the same thing |
20
+
21
+ ## Match Structure To Fragility
22
+
23
+ | Fragility | Preferred structure | Avoid |
24
+ |-----------|---------------------|-------|
25
+ | high | exact steps, strict templates, validation gates | open-ended guidance |
26
+ | medium | short checklist plus examples | long rationale-heavy prose |
27
+ | low | brief goals and constraints | overspecified playbooks |
28
+
29
+ ## Preferred Instruction Shapes
30
+
31
+ | Need | Preferred shape |
32
+ |------|-----------------|
33
+ | choose a path | decision table |
34
+ | do a repeatable task | numbered checklist |
35
+ | enforce output structure | template or schema |
36
+ | show style or tone | input/output examples |
37
+ | diagnose failures | symptom/cause/fix matrix |
38
+ | communicate exact facts | compact reference table |
39
+
40
+ ## Description Rules
41
+
42
+ - Keep `description` in third person.
43
+ - Put trigger language in `description`, not the body.
44
+ - Front-load what the skill does and when to use it.
45
+ - Do not spend description space on internals unless they improve triggering.
46
+
47
+ ## Runtime Writing Rules
48
+
49
+ - Use imperative voice.
50
+ - State one default path before mentioning alternatives.
51
+ - Use one term per concept; do not rotate synonyms.
52
+ - Put universal rules in `SKILL.md`; put optional depth in routed refs.
53
+ - If a section is mostly explanation, cut it or replace it with a denser structure.
54
+
55
+ ## Reference Rules
56
+
57
+ - Reference filenames should predict their contents.
58
+ - Each reference should answer one lookup question.
59
+ - Subfolders are acceptable only when they make the lookup path clearer.
60
+ - Every bundled reference should have a direct "open when..." entry in `SKILL.md`.
61
+ - Do not create catch-all files for notes, context, or mixed patterns.
62
+
63
+ ## Independence And Portability
64
+
65
+ - Do not require another skill by name at runtime.
66
+ - Use skill-root-relative paths by default.
67
+ - Reuse established repo-specific path variables only when the repo already standardizes on them.
68
+ - Label provider-specific mechanics explicitly and add portability notes when they matter.
69
+
70
+ ## Long Files
71
+
72
+ - Keep `SKILL.md` short enough to scan as a router.
73
+ - For references over 100 lines, add `## Contents`.
74
+ - If a reference grows because it mixes multiple lookup needs, split it.
@@ -0,0 +1,73 @@
1
+ # Evaluation Path
2
+
3
+ Load this only when the user asks for evaluation, the change is high-risk, or you need to verify a non-obvious architectural choice.
4
+
5
+ ## Default approach (lightweight, guidance-only)
6
+
7
+ If you do run evaluation, start here:
8
+
9
+ 1. Define representative prompts for the target skill task.
10
+ 2. Compare observed behavior before/after edits in concise notes.
11
+ 3. For material skill changes, judge the architectural choice as well as the prose:
12
+ - class selection: pass/fail
13
+ - execution shape selection: pass/fail
14
+ - reference routing clarity: pass/fail
15
+ - advanced mechanics justification: pass/fail
16
+ - portability/fallback notes: pass/fail
17
+ 4. Mark outcomes as improved, unchanged, or regressed.
18
+ 5. Record unresolved weaknesses and next steps.
19
+
20
+ For `integration-documentation` and `skill-authoring` skills, include a concise depth rubric:
21
+
22
+ 1. API surface coverage: pass/fail.
23
+ 2. Known issues/workarounds coverage: pass/fail.
24
+ 3. Common use-case coverage: pass/fail.
25
+ 4. Gap handling quality (explicit next retrieval actions for partials): pass/fail.
26
+
27
+ ## Deeper eval playbook (optional)
28
+
29
+ Use this only when:
30
+
31
+ 1. The user requests rigorous evals.
32
+ 2. The skill is high-risk or high-cost if wrong.
33
+ 3. You need regression-tracking over time.
34
+
35
+ Suggested workflow:
36
+
37
+ 1. Build a prompt set with positives, implicit triggers, negatives, and wrong-shape temptations.
38
+ 2. Capture deterministic run traces (for example `codex exec --json`).
39
+ 3. Apply machine-checkable rubric/schema checks (for example `--output-schema` where applicable).
40
+ 4. Compare baseline vs updated behavior and report deltas.
41
+
42
+ For advanced shapes, add targeted checks:
43
+
44
+ 1. routers: should-route and should-not-route prompts
45
+ 2. evaluator loops: stop-condition and acceptance checks
46
+ 3. subagent-fork skills: task-oriented prompt vs passive-guidance negative
47
+ 4. hook-backed skills: fallback behavior and security-note presence
48
+
49
+ ## Optional quantitative benchmark
50
+
51
+ Run only when explicitly requested or when objective scoring is practical.
52
+
53
+ 1. Define baseline (without skill guidance).
54
+ 2. Define with-skill run.
55
+ 3. Use the same prompt set and scoring rubric for both.
56
+ 4. Report deltas and confidence in the result.
57
+
58
+ Do not block completion on deeper evals unless the user asks for them.
59
+
60
+ ## Canonical eval prompts
61
+
62
+ Keep reusable, copy/paste eval prompts in `../EVAL.md`.
63
+ Use those prompts when you need a repeatable depth check against `skill-writer`.
64
+
65
+ ## Agent-agnostic requirement
66
+
67
+ Keep evaluation instructions tool-agnostic so they work in both Codex and Claude environments.
68
+
69
+ ## Required Output
70
+
71
+ - Qualitative evaluation summary
72
+ - Deeper eval or quantitative summary (optional, if run)
73
+ - Final acceptance decision and residual risks
@@ -0,0 +1,70 @@
1
+ # Case Study: Documentation Skill Synthesis
2
+
3
+ ## Scenario
4
+
5
+ Goal: create a skill that helps an agent answer and author code for a library without repeatedly re-reading upstream docs.
6
+
7
+ ## Input collection approach
8
+
9
+ This case used breadth-first source collection and only stopped when new retrieval yielded mostly duplicates:
10
+
11
+ 1. Official docs landing pages and navigation trees.
12
+ 2. All API/class/module reference pages.
13
+ 3. Configuration and environment reference pages.
14
+ 4. Official examples/tutorials.
15
+ 5. Troubleshooting/error catalog pages.
16
+ 6. Migration/deprecation/changelog pages.
17
+ 7. Upstream repo README plus canonical examples.
18
+ 8. In-repo usage of the library (`rg` on imports and key APIs).
19
+
20
+ ## Coverage matrix used
21
+
22
+ Required dimensions tracked during synthesis:
23
+
24
+ 1. Setup and installation.
25
+ 2. Core primitives and API surface.
26
+ 3. Configuration and runtime options.
27
+ 4. Normal usage patterns.
28
+ 5. Edge cases and failure handling.
29
+ 6. Version-specific differences.
30
+ 7. Migration and deprecation guidance.
31
+ 8. Instructional templates/examples for direct reuse.
32
+
33
+ ## Synthesized artifacts produced
34
+
35
+ The resulting skill references included:
36
+
37
+ 1. Happy-path implementation template.
38
+ 2. Production-safe variant with defensive defaults.
39
+ 3. Anti-pattern and corrected implementation.
40
+ 4. Intent-to-reference routing guide (which section to load for which user request).
41
+ 5. Gap log with explicit next retrieval steps.
42
+
43
+ ## Source-to-decision trace (sample)
44
+
45
+ 1. Source class: migration/changelog docs.
46
+ Decision: add a version-compatibility checklist section to the skill.
47
+ Why: multiple API signatures existed across versions; without this, answers were inconsistent.
48
+ 2. Source class: troubleshooting/error catalog.
49
+ Decision: add an error-to-fix lookup table in references.
50
+ Why: user prompts often start from failures, not idealized setup.
51
+ 3. Source class: in-repo usage scan (`rg`).
52
+ Decision: prioritize examples matching local project patterns.
53
+ Why: produced outputs became directly usable with fewer edits.
54
+
55
+ ## Concrete artifacts (sample)
56
+
57
+ 1. Prompt and output skeleton:
58
+ Prompt: "Configure <library> client for retries and auth in production."
59
+ Output: a production-safe template with retry/backoff, timeout defaults, and auth placeholders.
60
+ 2. Anti-pattern transformation:
61
+ Before: single inline config with no timeout/error handling.
62
+ After: structured config with explicit timeout, retry policy, and failure handling notes.
63
+ 3. Reference routing snippet:
64
+ If request mentions "migration" -> load migration/changelog reference first, then API reference.
65
+
66
+ ## What made this high quality
67
+
68
+ 1. Input retrieval was exhaustive across all doc classes, not just top pages.
69
+ 2. The skill shipped transformed examples, not citation-only notes.
70
+ 3. Coverage and gaps were explicit, so iteration could continue safely.
@@ -0,0 +1,38 @@
1
+ # Case Study: Evaluator-Loop Skill Synthesis
2
+
3
+ ## Scenario
4
+
5
+ Goal: create a skill where one pass is not enough and quality improves through critique and revision.
6
+
7
+ ## Input collection approach
8
+
9
+ This case collected:
10
+
11
+ 1. examples of first-draft failures
12
+ 2. existing review rubrics or acceptance criteria
13
+ 3. evidence that critique materially improves output
14
+ 4. stopping rules to avoid endless loops
15
+
16
+ ## Coverage matrix used
17
+
18
+ Required dimensions tracked during synthesis:
19
+
20
+ 1. rubric quality
21
+ 2. feedback-to-edit mapping
22
+ 3. loop stop conditions
23
+ 4. evidence retention between rounds
24
+
25
+ ## Synthesized artifacts produced
26
+
27
+ The resulting skill references included:
28
+
29
+ 1. first-draft to critique to revision example
30
+ 2. rubric reference
31
+ 3. max-loop or plateau rule
32
+ 4. acceptance checklist
33
+
34
+ ## What made this high quality
35
+
36
+ 1. the rubric was explicit
37
+ 2. the loop had a clear stopping rule
38
+ 3. the revision process produced measurable improvement rather than vague repetition
@@ -0,0 +1,39 @@
1
+ # Case Study: Hook-Backed Skill Synthesis
2
+
3
+ ## Scenario
4
+
5
+ Goal: create a skill that enforces a deterministic check at a specific lifecycle or tool boundary.
6
+
7
+ ## Input collection approach
8
+
9
+ This case collected:
10
+
11
+ 1. official hook lifecycle and schema docs
12
+ 2. security guidance for shell-executed hooks
13
+ 3. examples of narrow matchers vs over-broad hooks
14
+ 4. fallback behavior for environments without hooks
15
+
16
+ ## Coverage matrix used
17
+
18
+ Required dimensions tracked during synthesis:
19
+
20
+ 1. event and matcher scope
21
+ 2. decision behavior
22
+ 3. security boundaries
23
+ 4. fallback behavior
24
+ 5. portability constraints
25
+
26
+ ## Synthesized artifacts produced
27
+
28
+ The resulting skill references included:
29
+
30
+ 1. hook configuration example
31
+ 2. safety checklist
32
+ 3. fallback path without hooks
33
+ 4. anti-pattern showing over-broad or unsafe hook scope
34
+
35
+ ## What made this high quality
36
+
37
+ 1. the hook scope was narrow and auditable
38
+ 2. security assumptions were explicit
39
+ 3. the skill still described what to do when hooks were unavailable
@@ -0,0 +1,41 @@
1
+ # Case Study: Router Skill Synthesis
2
+
3
+ ## Scenario
4
+
5
+ Goal: create a skill that classifies requests into distinct downstream paths without overloading one prompt.
6
+
7
+ ## Input collection approach
8
+
9
+ This case collected:
10
+
11
+ 1. examples of request categories
12
+ 2. known ambiguous cases
13
+ 3. downstream resources for each route
14
+ 4. historical misroutes and their fixes
15
+
16
+ Collection stopped only after route criteria and fallback behavior were explicit.
17
+
18
+ ## Coverage matrix used
19
+
20
+ Required dimensions tracked during synthesis:
21
+
22
+ 1. route categories and triggers
23
+ 2. ambiguous or overlapping cases
24
+ 3. downstream ownership per route
25
+ 4. default/fallback path
26
+ 5. misroute recovery behavior
27
+
28
+ ## Synthesized artifacts produced
29
+
30
+ The resulting skill references included:
31
+
32
+ 1. route-selection table
33
+ 2. one reference or script per route
34
+ 3. ambiguous-case examples
35
+ 4. fallback rule for unclear input
36
+
37
+ ## What made this high quality
38
+
39
+ 1. the route table was explicit
40
+ 2. every route had one clear downstream owner
41
+ 3. the skill knew what to do when classification was uncertain