@sentry/warden 0.22.0 → 0.23.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 (308) hide show
  1. package/.oxlintrc.json +169 -0
  2. package/CHANGELOG.md +210 -0
  3. package/README.md +1 -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 +10 -2
  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 +39 -2
  41. package/dist/cli/main.d.ts.map +1 -1
  42. package/dist/cli/main.js +264 -74
  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/config-schema.md +29 -13
  257. package/skills/warden/references/configuration.md +20 -8
  258. package/skills/warden-sweep/SPEC.md +126 -0
  259. package/src/builtin-skills/security-review/SKILL.md +81 -0
  260. package/src/builtin-skills/security-review/SPEC.md +77 -0
  261. package/src/builtin-skills/security-review/references/github-workflows.md +186 -0
  262. package/src/builtin-skills/security-review/references/javascript-typescript.md +69 -0
  263. package/src/builtin-skills/security-review/references/python.md +70 -0
  264. package/src/internal-skills/skill-writer/EVAL.md +124 -0
  265. package/src/internal-skills/skill-writer/SKILL.md +159 -0
  266. package/src/internal-skills/skill-writer/SOURCES.md +94 -0
  267. package/src/internal-skills/skill-writer/SPEC.md +153 -0
  268. package/src/internal-skills/skill-writer/references/artifact-layouts/argument-driven-skill-layout.md +32 -0
  269. package/src/internal-skills/skill-writer/references/artifact-layouts/asset-template-skill-layout.md +30 -0
  270. package/src/internal-skills/skill-writer/references/artifact-layouts/inline-skill-layout.md +28 -0
  271. package/src/internal-skills/skill-writer/references/artifact-layouts/reference-backed-skill-layout.md +35 -0
  272. package/src/internal-skills/skill-writer/references/artifact-layouts/script-backed-skill-layout.md +31 -0
  273. package/src/internal-skills/skill-writer/references/authoring-path.md +91 -0
  274. package/src/internal-skills/skill-writer/references/claude-code/argument-substitutions.md +20 -0
  275. package/src/internal-skills/skill-writer/references/claude-code/dynamic-context.md +16 -0
  276. package/src/internal-skills/skill-writer/references/claude-code/frontmatter-and-invocation.md +33 -0
  277. package/src/internal-skills/skill-writer/references/claude-code/hook-backed-skills.md +28 -0
  278. package/src/internal-skills/skill-writer/references/claude-code/subagent-fork-skills.md +22 -0
  279. package/src/internal-skills/skill-writer/references/description-optimization.md +28 -0
  280. package/src/internal-skills/skill-writer/references/design-principles.md +74 -0
  281. package/src/internal-skills/skill-writer/references/evaluation-path.md +73 -0
  282. package/src/internal-skills/skill-writer/references/examples/documentation-skill.md +70 -0
  283. package/src/internal-skills/skill-writer/references/examples/evaluator-loop-skill.md +38 -0
  284. package/src/internal-skills/skill-writer/references/examples/hook-backed-skill.md +39 -0
  285. package/src/internal-skills/skill-writer/references/examples/router-skill.md +41 -0
  286. package/src/internal-skills/skill-writer/references/examples/security-review-skill.md +69 -0
  287. package/src/internal-skills/skill-writer/references/examples/subagent-fork-skill.md +39 -0
  288. package/src/internal-skills/skill-writer/references/examples/workflow-process-skill.md +65 -0
  289. package/src/internal-skills/skill-writer/references/execution-shapes.md +68 -0
  290. package/src/internal-skills/skill-writer/references/iteration-evidence.md +82 -0
  291. package/src/internal-skills/skill-writer/references/iteration-path.md +40 -0
  292. package/src/internal-skills/skill-writer/references/mode-selection.md +67 -0
  293. package/src/internal-skills/skill-writer/references/output-contracts.md +68 -0
  294. package/src/internal-skills/skill-writer/references/reference-architecture.md +71 -0
  295. package/src/internal-skills/skill-writer/references/registration-validation.md +67 -0
  296. package/src/internal-skills/skill-writer/references/source-discovery.md +60 -0
  297. package/src/internal-skills/skill-writer/references/spec-template.md +118 -0
  298. package/src/internal-skills/skill-writer/references/structure-troubleshooting.md +111 -0
  299. package/src/internal-skills/skill-writer/references/synthesis-path.md +119 -0
  300. package/src/internal-skills/skill-writer/references/workflow-mechanics/evaluator-loops.md +25 -0
  301. package/src/internal-skills/skill-writer/references/workflow-mechanics/orchestrator-workers.md +25 -0
  302. package/src/internal-skills/skill-writer/references/workflow-mechanics/parallel-workflows.md +21 -0
  303. package/src/internal-skills/skill-writer/references/workflow-mechanics/plan-validate-execute.md +26 -0
  304. package/src/internal-skills/skill-writer/references/workflow-mechanics/prompt-chaining.md +24 -0
  305. package/src/internal-skills/skill-writer/references/workflow-mechanics/routing-workflows.md +28 -0
  306. package/src/internal-skills/skill-writer/references/workflow-mechanics/validation-loops.md +26 -0
  307. package/src/internal-skills/skill-writer/scripts/quick_validate.py +158 -0
  308. package/src/internal-skills/skill-writer/scripts/quick_validate_test.py +79 -0
@@ -0,0 +1,118 @@
1
+ # SPEC.md Template
2
+
3
+ Use this guide to create or update a root-level `SPEC.md`.
4
+
5
+ ## Use `SPEC.md` For
6
+
7
+ - intent
8
+ - scope
9
+ - trigger context
10
+ - evidence model
11
+ - evaluation expectations
12
+ - limitations
13
+ - maintenance rules
14
+
15
+ Do not put runtime instructions or full provenance tables here.
16
+
17
+ ## Update `SPEC.md` When
18
+
19
+ - intent or scope changes
20
+ - trigger strategy changes
21
+ - evidence sources or storage policy changes
22
+ - reference architecture changes
23
+ - evaluation gates change
24
+ - privacy, security, or data-handling assumptions change
25
+
26
+ For tiny wording-only fixes, update `SOURCES.md` changelog instead.
27
+
28
+ ## Relationship To Other Files
29
+
30
+ | File | Purpose |
31
+ |------|---------|
32
+ | `SKILL.md` | runtime activation and execution |
33
+ | `SPEC.md` | maintenance contract |
34
+ | `SOURCES.md` | source inventory, decisions, gaps, changelog |
35
+ | `EVAL.md` | reusable eval prompts or runbooks |
36
+ | `references/` | runtime-loadable depth |
37
+ | `references/evidence/` | persistent iteration examples |
38
+
39
+ ## Template
40
+
41
+ ```markdown
42
+ # <Skill Name> Specification
43
+
44
+ ## Intent
45
+
46
+ <1-2 short paragraphs>
47
+
48
+ ## Scope
49
+
50
+ In scope:
51
+ - ...
52
+
53
+ Out of scope:
54
+ - ...
55
+
56
+ ## Users And Trigger Context
57
+
58
+ - Primary users:
59
+ - Common user requests:
60
+ - Should not trigger for:
61
+
62
+ ## Runtime Contract
63
+
64
+ - Required first actions:
65
+ - Required outputs:
66
+ - Non-negotiable constraints:
67
+ - Expected bundled files loaded at runtime:
68
+
69
+ ## Source And Evidence Model
70
+
71
+ Authoritative sources:
72
+ - ...
73
+
74
+ Useful improvement sources:
75
+ - positive examples:
76
+ - negative examples:
77
+ - commit logs/changelogs:
78
+ - issue or PR feedback:
79
+ - eval results:
80
+
81
+ Data that must not be stored:
82
+ - secrets
83
+ - customer data
84
+ - private URLs or identifiers not needed for reproduction
85
+
86
+ ## Reference Architecture
87
+
88
+ - `SKILL.md` contains:
89
+ - `references/` contains:
90
+ - `references/evidence/` contains:
91
+ - `scripts/` contains:
92
+ - `assets/` contains:
93
+
94
+ ## Evaluation
95
+
96
+ - Lightweight validation:
97
+ - Deeper evaluation:
98
+ - Holdout examples:
99
+ - Acceptance gates:
100
+
101
+ ## Known Limitations
102
+
103
+ - ...
104
+
105
+ ## Maintenance Notes
106
+
107
+ - When to update `SKILL.md`:
108
+ - When to update `SOURCES.md`:
109
+ - When to update `EVAL.md`:
110
+ - When to update `references/evidence/`:
111
+ ```
112
+
113
+ ## Design Rules
114
+
115
+ 1. Keep `SPEC.md` concise.
116
+ 2. Link to `SOURCES.md` or refs instead of duplicating them.
117
+ 3. Keep raw examples in `references/evidence/`.
118
+ 4. Keep sensitive data redacted.
@@ -0,0 +1,111 @@
1
+ # Structure Troubleshooting
2
+
3
+ Load this when the skill layout is unclear, overloaded, or drifting away from focused routing.
4
+
5
+ ## Over-long SKILL.md
6
+
7
+ Problem: `SKILL.md` exceeds 500 lines and becomes a second encyclopedia.
8
+
9
+ Fix: extract detailed material into focused `references/` files and keep `SKILL.md` as the router.
10
+
11
+ ## Missing Trigger Keywords
12
+
13
+ Problem: the description is too vague to match user language.
14
+
15
+ Fix: include the phrases users actually say.
16
+
17
+ ## Trigger Info In Body Instead Of Description
18
+
19
+ Problem: "when to use" guidance appears only in the body, after triggering has already happened.
20
+
21
+ Fix: move trigger language into `description`.
22
+
23
+ ## Duplicating CLAUDE.md Or AGENTS.md
24
+
25
+ Problem: the skill repeats repo-wide conventions instead of adding net-new value.
26
+
27
+ Fix: reference existing project docs and keep the skill focused on domain-specific behavior.
28
+
29
+ ## Unconditional Reference Loading
30
+
31
+ Problem: the skill tells the agent to read every reference up front.
32
+
33
+ Fix: add a decision table so references load only when needed.
34
+
35
+ ## Large References Without Navigation
36
+
37
+ Problem: long reference files are hard to preview and easy to misuse.
38
+
39
+ Fix: add a table of contents or split by lookup need.
40
+
41
+ ## Extraneous Files
42
+
43
+ Problem: the skill directory accumulates user-facing docs or miscellaneous notes that do not help runtime, evaluation, or maintenance.
44
+
45
+ Fix: keep only `SKILL.md`, `SPEC.md`, `SOURCES.md`, `EVAL.md`, `references/`, `scripts/`, `assets/`, and `LICENSE` when needed.
46
+
47
+ ## Scripts Without Documentation
48
+
49
+ Problem: `SKILL.md` names a script but does not document arguments, output, or fallback behavior.
50
+
51
+ Fix: document the script interface and expected output shape in `SKILL.md`.
52
+
53
+ ## Hardcoded Paths
54
+
55
+ Problem: the skill embeds host-specific or repo-hardcoded paths.
56
+
57
+ Fix: use skill-root-relative paths or established portable placeholders.
58
+
59
+ ## First/Second Person Descriptions
60
+
61
+ Problem: the description says "I can..." or "You can use this..."
62
+
63
+ Fix: write in third person so skill discovery stays consistent.
64
+
65
+ ## Time-Sensitive Information
66
+
67
+ Problem: the skill bakes in dates or transitional logic that will quietly rot.
68
+
69
+ Fix: move legacy behavior into a clearly labeled deprecated section or remove it.
70
+
71
+ ## Advanced Mechanics Without Justification
72
+
73
+ Problem: the skill uses routing, `context: fork`, hooks, or evaluator loops because they seem sophisticated.
74
+
75
+ Fix: name the shape, explain why simpler shapes were rejected, and add portability/safety notes.
76
+
77
+ ## Router Without Fallback
78
+
79
+ Problem: the skill has multiple downstream paths but no default route or clarification step.
80
+
81
+ Fix: add a fallback branch that asks one clarifying question or picks a documented safe default.
82
+
83
+ ## Evaluator Loop Without Stop Condition
84
+
85
+ Problem: the skill says "iterate until good" with no rubric or cap.
86
+
87
+ Fix: add a rubric plus a max-loop or plateau rule.
88
+
89
+ ## Passive Guidance In Forked Context
90
+
91
+ Problem: `context: fork` is used for conventions or reference material instead of a concrete delegated task.
92
+
93
+ Fix: keep passive guidance inline; use forked execution only for actionable isolated tasks.
94
+
95
+ ## Hook-Backed Enforcement Without Safety Notes
96
+
97
+ Problem: the skill uses hooks but does not explain event scope, fallback behavior, or shell risk.
98
+
99
+ Fix: add hook event scope, fallback path, and explicit security notes.
100
+
101
+ ## Hidden Reference File
102
+
103
+ Problem: a bundled reference exists, but `SKILL.md` never tells the agent when to open it.
104
+
105
+ Fix: add the file to the main router with a one-line "open when..." reason, or remove/split the file if no clear reason exists.
106
+
107
+ ## Generic Bucket Reference
108
+
109
+ Problem: a file groups unrelated techniques under a vague name such as "patterns", "notes", or "context".
110
+
111
+ Fix: split the file by lookup need and rename each leaf so the filename predicts why it should be opened.
@@ -0,0 +1,119 @@
1
+ # Synthesis Path
2
+
3
+ Use this path when creating or materially changing a skill.
4
+
5
+ ## Output Style
6
+
7
+ - Keep synthesis notes terse.
8
+ - Prefer tables, status lists, and gap lists over narrative summaries.
9
+ - Record decisions as `adopted`, `rejected`, or `deferred`.
10
+
11
+ ## Step 0: Classify
12
+
13
+ Record:
14
+
15
+ 1. skill class
16
+ 2. primary execution shape
17
+ 3. secondary shapes, if any
18
+ 4. why simpler shapes were not enough
19
+
20
+ For `integration-documentation`, cover:
21
+
22
+ 1. API surface and behavior contracts
23
+ 2. config/runtime options
24
+ 3. downstream use cases
25
+ 4. issues/failure modes with workarounds
26
+ 5. version or migration variance
27
+
28
+ ## Step 1: Collect Sources
29
+
30
+ Collect from:
31
+
32
+ 1. Agent Skills spec and best practices
33
+ 2. similar in-repo skills
34
+ 3. upstream implementations and orchestration docs
35
+ 4. domain or library docs
36
+ 5. repo conventions and validators
37
+ 6. tests, fixtures, changelogs, and issue or PR history
38
+ 7. commit history and blame for regressions or edge cases
39
+ 8. prior `SPEC.md`, `SOURCES.md`, `EVAL.md`, and `references/evidence/`
40
+
41
+ If the shape uses provider-specific mechanics, include current provider docs.
42
+
43
+ ## Baseline Source Pack For Skill-Authoring
44
+
45
+ Require at minimum:
46
+
47
+ 1. local `skill-writer` runtime files
48
+ 2. Agent Skills spec and repo conventions
49
+ 3. provider docs for any provider-specific mechanic being recommended
50
+
51
+ ## Step 1.5: Load Example Profiles
52
+
53
+ Load only the profiles you need from `references/examples/`.
54
+
55
+ ## Step 1.6: Expand Coverage
56
+
57
+ Run targeted passes for:
58
+
59
+ | Pass | Retrieve |
60
+ |------|----------|
61
+ | core behavior | happy path and main workflow |
62
+ | edge behavior | failures, retries, permissions, cleanup |
63
+ | negative behavior | false positives, reviewer concerns, bad outputs |
64
+ | repair patterns | fixes and corrected outputs |
65
+ | version variance | platform or release differences |
66
+ | shape mechanics | routing, delegation, loop stops, hook constraints |
67
+
68
+ Extra retrieval for advanced shapes:
69
+
70
+ 1. route or delegation criteria
71
+ 2. worker or handoff contracts
72
+ 3. loop stopping rules
73
+ 4. provider-specific lifecycle or security constraints
74
+
75
+ ## Step 2: Capture Provenance
76
+
77
+ For each source, record:
78
+
79
+ - source URL or path
80
+ - trust tier
81
+ - confidence
82
+ - contribution
83
+ - usage constraints
84
+
85
+ Store provenance in `SOURCES.md`, not long runtime prose.
86
+
87
+ ## Step 3: Synthesize Decisions
88
+
89
+ Map each major decision to source evidence, including:
90
+
91
+ - class choice
92
+ - shape choice
93
+ - provider-specific mechanics
94
+ - deferred gaps
95
+
96
+ ## Step 4: Enforce Depth Gates
97
+
98
+ All of these must pass:
99
+
100
+ 1. no missing high-impact coverage dimensions
101
+ 2. partial dimensions have explicit next retrieval actions
102
+ 3. authoring or generator skills include transformed examples
103
+ 4. selected profile requirements are satisfied
104
+ 5. coverage passes are reflected in the coverage matrix
105
+ 6. stopping rationale is explicit
106
+ 7. supporting refs stay focused and directly discoverable from `SKILL.md`
107
+ 8. `SPEC.md` exists or is updated when the contract changed
108
+ 9. advanced mechanics include required contracts and justification
109
+ 10. provider-specific mechanics include portability notes
110
+
111
+ ## Required Output
112
+
113
+ - synthesis summary
114
+ - source inventory in `SOURCES.md`
115
+ - decisions and rationale
116
+ - coverage matrix
117
+ - gaps and next retrieval actions
118
+ - selected class and shape
119
+ - `SPEC.md` update summary when applicable
@@ -0,0 +1,25 @@
1
+ # Evaluator Loops
2
+
3
+ Use this workflow when a first draft benefits from critique and revision against a clear rubric.
4
+
5
+ ## Choose this workflow when
6
+
7
+ - the skill can score output against explicit criteria
8
+ - revision improves quality materially
9
+ - the loop has a bounded stopping rule
10
+
11
+ ## Required contract
12
+
13
+ 1. Rubric or acceptance criteria.
14
+ 2. Maximum loop count or plateau rule.
15
+ 3. What evidence or diffs must be preserved between rounds.
16
+
17
+ ## Example
18
+
19
+ ```markdown
20
+ 1. Produce a first draft
21
+ 2. Score it against the rubric
22
+ 3. Turn failures into concrete edits
23
+ 4. Revise
24
+ 5. Stop when the rubric passes or the loop plateaus
25
+ ```
@@ -0,0 +1,25 @@
1
+ # Orchestrator-Workers
2
+
3
+ Use this workflow when the subtasks are not known ahead of time and must be discovered from the input.
4
+
5
+ ## Choose this workflow when
6
+
7
+ - the orchestrator must discover work units dynamically
8
+ - each unit can be delegated to a stable worker contract
9
+ - a final synthesis step can merge the results
10
+
11
+ ## Required contract
12
+
13
+ 1. Worker-task schema.
14
+ 2. Worker output schema.
15
+ 3. Expansion limit or stopping rule.
16
+ 4. Final synthesis rule.
17
+
18
+ ## Example
19
+
20
+ ```markdown
21
+ 1. Inspect the request and identify work units dynamically
22
+ 2. Assign each work unit to a worker path
23
+ 3. Collect worker summaries in a fixed schema
24
+ 4. Synthesize the result
25
+ ```
@@ -0,0 +1,21 @@
1
+ # Parallel Workflows
2
+
3
+ Use this workflow when independent subtasks can run side-by-side, or when multiple judgments improve confidence.
4
+
5
+ ## Choose this workflow when
6
+
7
+ - work units are independent
8
+ - latency or coverage improves with parallel execution
9
+ - aggregation can be described clearly
10
+
11
+ ## Common forms
12
+
13
+ 1. `sectioning`: split a task into independent work units.
14
+ 2. `voting`: run multiple judgments and aggregate them.
15
+
16
+ ## Required contract
17
+
18
+ 1. Unit of parallel work.
19
+ 2. Merge or vote rule.
20
+ 3. Conflict handling.
21
+ 4. Cost or latency cap.
@@ -0,0 +1,26 @@
1
+ # Plan-Validate-Execute
2
+
3
+ Use this workflow when a destructive or high-stakes action should be preceded by a machine-checkable plan.
4
+
5
+ ## Choose this workflow when
6
+
7
+ - validating the plan is safer than validating the final action
8
+ - the task changes many files or records
9
+ - rollback would be expensive
10
+
11
+ ## Required contract
12
+
13
+ 1. The plan artifact and schema.
14
+ 2. The validation step and source of truth.
15
+ 3. Rework rules when validation fails.
16
+ 4. Final execution and verification steps.
17
+
18
+ ## Example
19
+
20
+ ```markdown
21
+ 1. Analyze the input and generate `changes.json`
22
+ 2. Validate the plan against source of truth
23
+ 3. Revise until validation passes
24
+ 4. Execute the plan
25
+ 5. Verify the result
26
+ ```
@@ -0,0 +1,24 @@
1
+ # Prompt Chaining
2
+
3
+ Use this workflow when the task should move through fixed ordered steps and each step makes the next one easier.
4
+
5
+ ## Choose this workflow when
6
+
7
+ - the decomposition is known in advance
8
+ - step order matters
9
+ - validation between steps improves quality
10
+
11
+ ## Required contract
12
+
13
+ 1. Step order.
14
+ 2. Inputs and outputs for each step.
15
+ 3. Validation or gate points between steps.
16
+
17
+ ## Example
18
+
19
+ ```markdown
20
+ 1. Summarize the current state
21
+ 2. Propose the target state
22
+ 3. Validate the proposal against constraints
23
+ 4. Write the final document
24
+ ```
@@ -0,0 +1,28 @@
1
+ # Routing Workflows
2
+
3
+ Use this workflow when the incoming request must be classified and sent to different downstream prompts, references, scripts, or tools.
4
+
5
+ ## Choose this workflow when
6
+
7
+ - distinct request classes benefit from specialized downstream handling
8
+ - one broad prompt would create conflicts or false positives
9
+ - misroutes can be detected and recovered
10
+
11
+ ## Required contract
12
+
13
+ 1. Route-selection criteria.
14
+ 2. Default route or clarification fallback.
15
+ 3. Misroute recovery.
16
+ 4. Downstream contract for each route.
17
+
18
+ ## Example
19
+
20
+ ```markdown
21
+ 1. Classify the request:
22
+
23
+ **Billing question?** -> Load `references/billing.md`
24
+ **Refund request?** -> Run `scripts/refund_intake.py`
25
+ **Technical bug?** -> Load `references/triage.md`
26
+
27
+ 2. If classification is uncertain, ask one clarification question before continuing.
28
+ ```
@@ -0,0 +1,26 @@
1
+ # Validation Loops
2
+
3
+ Use this workflow when a validator can reliably catch mistakes before the skill should claim completion.
4
+
5
+ ## Choose this workflow when
6
+
7
+ - a script, schema, test, or parser can catch important failures
8
+ - the agent should fix issues immediately after each change
9
+ - the main risk is silent drift or invalid output
10
+
11
+ ## Required contract
12
+
13
+ 1. The validator or check to run.
14
+ 2. When it runs in the workflow.
15
+ 3. What to fix before retrying.
16
+ 4. What counts as a passing state.
17
+
18
+ ## Example
19
+
20
+ ```markdown
21
+ 1. Make the change
22
+ 2. Validate immediately
23
+ 3. If validation fails, fix the issue
24
+ 4. Re-run validation
25
+ 5. Only proceed when validation passes
26
+ ```
@@ -0,0 +1,158 @@
1
+ # /// script
2
+ # requires-python = ">=3.12"
3
+ # dependencies = ["pyyaml"]
4
+ # ///
5
+ """
6
+ Quick validation script for Agent Skills.
7
+
8
+ Validates only mechanical SKILL.md frontmatter and identity requirements.
9
+ Qualitative content, reference depth, routing, and prose structure belong to
10
+ human/agent review, not this script.
11
+
12
+ Usage:
13
+ uv run quick_validate.py <skill_directory> [--skill-class <class>] [--strict-depth]
14
+
15
+ Returns exit code 0 on success, 1 on failure. Outputs JSON with validation results.
16
+ """
17
+
18
+ import argparse
19
+ import json
20
+ import re
21
+ import sys
22
+ from pathlib import Path
23
+
24
+ import yaml
25
+
26
+ MAX_NAME_LENGTH = 64
27
+ MAX_DESCRIPTION_LENGTH = 1024
28
+
29
+ SKILL_CLASSES = {
30
+ "auto",
31
+ "workflow-process",
32
+ "integration-documentation",
33
+ "security-review",
34
+ "skill-authoring",
35
+ "generic",
36
+ }
37
+
38
+
39
+ def parse_args(argv: list[str]) -> argparse.Namespace:
40
+ parser = argparse.ArgumentParser(
41
+ description="Validate agent skill frontmatter and identity fields.",
42
+ )
43
+ parser.add_argument("skill_directory")
44
+ parser.add_argument("--skill-class", choices=sorted(SKILL_CLASSES), default="auto")
45
+ parser.add_argument("--strict-depth", action="store_true")
46
+ return parser.parse_args(argv)
47
+
48
+
49
+ def validate_skill(
50
+ skill_path: Path,
51
+ selected_skill_class: str = "auto",
52
+ strict_depth: bool = False,
53
+ ) -> tuple[bool, list[str], list[str], str]:
54
+ """Validate a skill directory. Returns (valid, errors, warnings, resolved_skill_class)."""
55
+ # Keep the flag for CLI compatibility; depth/content checks belong to review.
56
+ _ = strict_depth
57
+ errors: list[str] = []
58
+ warnings: list[str] = []
59
+
60
+ # Check SKILL.md exists.
61
+ skill_md = skill_path / "SKILL.md"
62
+ if not skill_md.exists():
63
+ return False, ["SKILL.md not found"], [], "generic"
64
+
65
+ content = skill_md.read_text()
66
+
67
+ # Check frontmatter exists and is first.
68
+ if not content.startswith("---"):
69
+ errors.append("No YAML frontmatter found (file must start with ---)")
70
+ return False, errors, warnings, "generic"
71
+
72
+ match = re.match(r"^---\n(.*?)\n---", content, re.DOTALL)
73
+ if not match:
74
+ errors.append("Invalid frontmatter format (missing closing ---)")
75
+ return False, errors, warnings, "generic"
76
+
77
+ # Parse frontmatter.
78
+ frontmatter_text = match.group(1)
79
+ try:
80
+ frontmatter = yaml.safe_load(frontmatter_text)
81
+ if not isinstance(frontmatter, dict):
82
+ errors.append("Frontmatter must be a YAML mapping")
83
+ return False, errors, warnings, "generic"
84
+ except yaml.YAMLError as exc:
85
+ errors.append(f"Invalid YAML in frontmatter: {exc}")
86
+ return False, errors, warnings, "generic"
87
+
88
+ # Validate frontmatter keys without hardcoding provider-specific optional fields.
89
+ invalid_keys = [key for key in frontmatter.keys() if not isinstance(key, str) or not key.strip()]
90
+ if invalid_keys:
91
+ errors.append("Frontmatter keys must be non-empty strings")
92
+
93
+ # Validate name.
94
+ if "name" not in frontmatter:
95
+ errors.append("Missing required field: name")
96
+ else:
97
+ name = frontmatter["name"]
98
+ if not isinstance(name, str):
99
+ errors.append(f"name must be a string, got {type(name).__name__}")
100
+ else:
101
+ name = name.strip()
102
+ if not name:
103
+ errors.append("name must not be empty")
104
+ elif len(name) > MAX_NAME_LENGTH:
105
+ errors.append(f"name is too long ({len(name)} chars, max {MAX_NAME_LENGTH})")
106
+ elif not re.match(r"^[a-z0-9-]+$", name):
107
+ errors.append(f"name '{name}' must contain only lowercase letters, digits, and hyphens")
108
+ elif name.startswith("-") or name.endswith("-"):
109
+ errors.append(f"name '{name}' must not start or end with a hyphen")
110
+ elif "--" in name:
111
+ errors.append(f"name '{name}' must not contain consecutive hyphens")
112
+ elif name != skill_path.name:
113
+ errors.append(f"name '{name}' does not match directory name '{skill_path.name}'")
114
+
115
+ # Validate description.
116
+ if "description" not in frontmatter:
117
+ errors.append("Missing required field: description")
118
+ else:
119
+ description = frontmatter["description"]
120
+ if not isinstance(description, str):
121
+ errors.append(f"description must be a string, got {type(description).__name__}")
122
+ else:
123
+ description = description.strip()
124
+ if not description:
125
+ errors.append("description must not be empty")
126
+ elif len(description) > MAX_DESCRIPTION_LENGTH:
127
+ errors.append(f"description is too long ({len(description)} chars, max {MAX_DESCRIPTION_LENGTH})")
128
+
129
+ resolved_skill_class = selected_skill_class if selected_skill_class != "auto" else "generic"
130
+
131
+ return len(errors) == 0, errors, warnings, resolved_skill_class
132
+
133
+
134
+ def main() -> None:
135
+ args = parse_args(sys.argv[1:])
136
+ skill_path = Path(args.skill_directory).resolve()
137
+ if not skill_path.is_dir():
138
+ print(json.dumps({"valid": False, "errors": [f"Not a directory: {skill_path}"]}))
139
+ sys.exit(1)
140
+
141
+ valid, errors, warnings, resolved_skill_class = validate_skill(
142
+ skill_path,
143
+ selected_skill_class=args.skill_class,
144
+ strict_depth=args.strict_depth,
145
+ )
146
+ result = {
147
+ "valid": valid,
148
+ "skill_class": resolved_skill_class,
149
+ "strict_depth": args.strict_depth,
150
+ "errors": errors,
151
+ "warnings": warnings,
152
+ }
153
+ print(json.dumps(result, indent=2))
154
+ sys.exit(0 if valid else 1)
155
+
156
+
157
+ if __name__ == "__main__":
158
+ main()