@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,69 @@
1
+ # Case Study: Security Review Skill Synthesis
2
+
3
+ ## Scenario
4
+
5
+ Goal: build a skill that finds real vulnerabilities while minimizing false positives.
6
+
7
+ ## Input collection approach
8
+
9
+ This case required balanced collection across offensive and defensive material:
10
+
11
+ 1. Canonical standards and cheat sheets.
12
+ 2. Framework/language-specific secure coding docs.
13
+ 3. Real-world exploit writeups and postmortems.
14
+ 4. Fixed vulnerability diffs and secure rewrites.
15
+ 5. Benign patterns often misclassified as vulnerabilities.
16
+ 6. Existing in-repo security skills and review heuristics.
17
+
18
+ Collection continued until each vulnerability class had both exploit and mitigation evidence.
19
+
20
+ ## Coverage matrix used
21
+
22
+ Required dimensions tracked during synthesis:
23
+
24
+ 1. Vulnerability class definitions and prerequisites.
25
+ 2. Exploitable dataflow examples.
26
+ 3. False-positive controls.
27
+ 4. Severity/confidence calibration.
28
+ 5. Concrete remediation patterns.
29
+ 6. Framework-specific caveats and exceptions.
30
+
31
+ ## Synthesized artifacts produced
32
+
33
+ The resulting skill references included:
34
+
35
+ 1. True-positive case with exploitation path.
36
+ 2. False-positive case with proof of safety.
37
+ 3. Fix/remediation case with corrected code pattern.
38
+ 4. Severity and confidence decision rubric.
39
+ 5. Evidence checklist to prevent pattern-only claims.
40
+
41
+ ## Source-to-decision trace (sample)
42
+
43
+ 1. Source class: exploit writeups.
44
+ Decision: require attacker-controlled input path in every high-confidence finding.
45
+ Why: removed pattern-only false alarms.
46
+ 2. Source class: benign counterexamples.
47
+ Decision: add explicit safe-pattern checks before reporting.
48
+ Why: reduced repeated false positives on sanitized data paths.
49
+ 3. Source class: fixed vulnerability diffs.
50
+ Decision: include remediation examples as patch-shaped guidance.
51
+ Why: improved downstream fix quality and speed.
52
+
53
+ ## Concrete artifacts (sample)
54
+
55
+ 1. True-positive case:
56
+ Input pattern: untrusted data reaches shell/API call without escaping.
57
+ Output: finding includes source, sink, exploit path, and minimal patch recommendation.
58
+ 2. False-positive case:
59
+ Input pattern: potentially dangerous API with validated allowlist and strict escaping.
60
+ Output: no vulnerability finding; include reason for non-reporting.
61
+ 3. Remediation case:
62
+ Before: dynamic query construction from user input.
63
+ After: parameterized query plus validation guard.
64
+
65
+ ## What made this high quality
66
+
67
+ 1. It was trained on both attacks and safe counterexamples.
68
+ 2. Findings required evidence of exploitability, not keyword matching.
69
+ 3. Remediation guidance was concrete and immediately applicable.
@@ -0,0 +1,39 @@
1
+ # Case Study: Subagent-Fork Skill Synthesis
2
+
3
+ ## Scenario
4
+
5
+ Goal: create a skill that runs a self-contained task in isolated context and returns a concise summary.
6
+
7
+ ## Input collection approach
8
+
9
+ This case collected:
10
+
11
+ 1. official provider docs for skill execution in forked context
12
+ 2. examples of self-contained tasks that benefit from isolation
13
+ 3. failure cases where passive guidance was incorrectly put into subagents
14
+ 4. summary expectations for returning results to the main thread
15
+
16
+ ## Coverage matrix used
17
+
18
+ Required dimensions tracked during synthesis:
19
+
20
+ 1. why isolation helps
21
+ 2. task prompt clarity
22
+ 3. output/summary contract
23
+ 4. tool/model assumptions
24
+ 5. portability constraints
25
+
26
+ ## Synthesized artifacts produced
27
+
28
+ The resulting skill references included:
29
+
30
+ 1. actionable task body
31
+ 2. expected summary schema
32
+ 3. portability note
33
+ 4. anti-pattern showing passive guidance that should stay inline
34
+
35
+ ## What made this high quality
36
+
37
+ 1. the skill body was a task, not a convention list
38
+ 2. the isolation benefit was concrete
39
+ 3. the result expected back in the main thread was explicit
@@ -0,0 +1,65 @@
1
+ # Case Study: Workflow/Process Skill Synthesis
2
+
3
+ ## Scenario
4
+
5
+ Goal: create a skill for repeatable operational workflows (for example PR prep, CI triage, branching, settings audit).
6
+
7
+ ## Input collection approach
8
+
9
+ This case collected process truth from all authoritative locations:
10
+
11
+ 1. Official tool docs and syntax references.
12
+ 2. Repository workflow conventions and policy docs.
13
+ 3. Existing local skills with adjacent process logic.
14
+ 4. CI logs, failure patterns, and known operational pitfalls.
15
+ 5. Positive and negative historical examples from prior runs.
16
+
17
+ Collection stopped only after failure and recovery paths were well represented.
18
+
19
+ ## Coverage matrix used
20
+
21
+ Required dimensions tracked during synthesis:
22
+
23
+ 1. Preconditions and required context.
24
+ 2. Ordered execution flow.
25
+ 3. Safety/permission boundaries.
26
+ 4. Expected outputs and acceptance checks.
27
+ 5. Failure handling and retry behavior.
28
+ 6. Escalation and handoff behavior.
29
+
30
+ ## Synthesized artifacts produced
31
+
32
+ The resulting skill references included:
33
+
34
+ 1. Happy-path execution transcript.
35
+ 2. Guarded variant with stricter safety constraints.
36
+ 3. Failure-recovery transcript for a critical broken step.
37
+ 4. Output template for deterministic reporting.
38
+ 5. Changelog rules for iterative improvement from examples.
39
+
40
+ ## Source-to-decision trace (sample)
41
+
42
+ 1. Source class: repo policy docs.
43
+ Decision: add explicit precondition checks before running side-effecting steps.
44
+ Why: prevented invalid execution in partially configured environments.
45
+ 2. Source class: CI failure logs.
46
+ Decision: add a mandatory failure triage branch with retry vs escalate criteria.
47
+ Why: reduced dead-end loops during workflow execution.
48
+ 3. Source class: historical positive/negative examples.
49
+ Decision: standardize output format for easier review and iteration.
50
+ Why: made regressions and improvements comparable across runs.
51
+
52
+ ## Concrete artifacts (sample)
53
+
54
+ 1. Happy-path transcript snippet:
55
+ Preconditions pass -> execute steps 1..N -> emit structured summary with status per step.
56
+ 2. Failure-recovery transcript snippet:
57
+ Step fails -> classify transient/permanent -> retry once or escalate with captured evidence.
58
+ 3. Deterministic report template:
59
+ Sections: Preconditions, Actions Taken, Validation Results, Failures/Recoveries, Next Actions.
60
+
61
+ ## What made this high quality
62
+
63
+ 1. The workflow was executable without rediscovering steps.
64
+ 2. Non-happy paths were first-class, not afterthoughts.
65
+ 3. Outputs were structured for consistent review and iteration.
@@ -0,0 +1,68 @@
1
+ # Execution Shapes
2
+
3
+ Use this guide to choose the runtime shape of a skill before you decide its files.
4
+ Default rule: choose the simplest adequate shape, then add complexity only when it clearly improves outcomes.
5
+ Once you pick a shape, load only the concrete leaf references it needs.
6
+
7
+ ## Defaulting To The Simplest Shape
8
+
9
+ Start from these questions, in order:
10
+
11
+ 1. Can one coherent set of instructions handle most requests?
12
+ If yes, prefer `inline-guidance`.
13
+ 2. Is the main complexity optional knowledge rather than control flow?
14
+ If yes, prefer `reference-backed-expert`.
15
+ 3. Is the hard part data extraction, validation, or repeatable automation?
16
+ If yes, prefer `script-backed-workflow`.
17
+ 4. Does the user usually invoke the skill with explicit parameters?
18
+ If yes, add `argument-driven`.
19
+ 5. Only then consider routing, worker delegation, evaluator loops, subagent execution, hooks, or templates.
20
+
21
+ Do not jump to advanced mechanics because they sound powerful.
22
+
23
+ ## Shape Decision Table
24
+
25
+ | Shape | Use when | Open next | Portability notes |
26
+ |-------|----------|-----------|-------------------|
27
+ | `inline-guidance` | one coherent policy, checklist, or procedure is enough | `references/artifact-layouts/inline-skill-layout.md` | most portable default |
28
+ | `reference-backed-expert` | optional deep knowledge is the main complexity | `references/artifact-layouts/reference-backed-skill-layout.md` | portable if file references stay relative |
29
+ | `script-backed-workflow` | repeated parsing, validation, APIs, or transformations are fragile in plain shell | `references/artifact-layouts/script-backed-skill-layout.md` | portable if dependencies are explicit |
30
+ | `argument-driven` | the skill is usually invoked with issue numbers, paths, targets, or modes | `references/artifact-layouts/argument-driven-skill-layout.md` | often provider-specific beyond basic manual invocation |
31
+ | `router` | distinct categories need different downstream prompts, tools, or references | `references/workflow-mechanics/routing-workflows.md` | portable if routing stays in prompt logic |
32
+ | `parallelization` | independent subtasks or multiple votes improve speed or confidence | `references/workflow-mechanics/parallel-workflows.md` | often implemented with tools or agents |
33
+ | `orchestrator-workers` | the number or type of subtasks is discovered at runtime | `references/workflow-mechanics/orchestrator-workers.md` | usually higher-latency and provider-sensitive |
34
+ | `evaluator-optimizer` | critique-and-revise loops improve output quality materially | `references/workflow-mechanics/evaluator-loops.md` | portable in concept; costly if overused |
35
+ | `subagent-fork` | the skill needs isolated context, tools, or model defaults | `references/claude-code/subagent-fork-skills.md` | Claude Code-specific |
36
+ | `hook-backed` | deterministic enforcement is required beyond prompt guidance | `references/claude-code/hook-backed-skills.md` | highly provider-specific and security-sensitive |
37
+ | `asset-template` | reusable templates, schemas, or static artifacts carry most of the value | `references/artifact-layouts/asset-template-skill-layout.md` | portable if assets are generic files |
38
+
39
+ If the chosen shape also uses explicit arguments, Claude-specific frontmatter, or shell preprocessing, load the matching file from `references/claude-code/`.
40
+
41
+ ## Secondary Workflow Mechanics
42
+
43
+ These are not usually primary execution shapes, but they often refine one:
44
+
45
+ - fixed ordered steps -> `references/workflow-mechanics/prompt-chaining.md`
46
+ - validate-fix-repeat loops -> `references/workflow-mechanics/validation-loops.md`
47
+ - plan-before-execute flows -> `references/workflow-mechanics/plan-validate-execute.md`
48
+
49
+ ## Hybrid Shapes
50
+
51
+ Use a hybrid only when one primary shape is insufficient.
52
+
53
+ 1. Declare one primary shape.
54
+ 2. Add only the minimum secondary shapes needed.
55
+ 3. Keep each secondary shape scoped to one concrete need.
56
+ 4. Avoid stacking multiple advanced shapes without a clear base path.
57
+
58
+ ## Advanced-Shape Hard Stops
59
+
60
+ Do not finalize a skill when any of these are true:
61
+
62
+ 1. The chosen shape is implied but not named.
63
+ 2. A simpler shape was not considered.
64
+ 3. A router has no fallback or default path.
65
+ 4. An evaluator loop has no stopping rule.
66
+ 5. A subagent-fork skill contains only passive guidance.
67
+ 6. A hook-backed skill lacks a security note or fallback behavior.
68
+ 7. Provider-specific mechanics are used without portability notes.
@@ -0,0 +1,82 @@
1
+ # Iteration Evidence
2
+
3
+ Use this guide when improving a skill from positive examples, negative examples, review feedback, eval results, or observed agent behavior.
4
+
5
+ ## Storage Layout
6
+
7
+ Store persistent improvement evidence under:
8
+
9
+ ```text
10
+ references/evidence/
11
+ ├── findings-log.md
12
+ ├── working-set.md
13
+ └── holdout-set.md
14
+ ```
15
+
16
+ Use this directory only when examples should outlive the current task. For a one-off small fix, summarize the examples in `SOURCES.md` instead.
17
+
18
+ ## File Roles
19
+
20
+ `references/evidence/findings-log.md` records interpreted findings:
21
+
22
+ - repeated failure patterns
23
+ - preserved success patterns
24
+ - suspected root causes
25
+ - instruction changes made in response
26
+ - unresolved risks
27
+
28
+ `references/evidence/working-set.md` stores examples used while editing the skill.
29
+
30
+ `references/evidence/holdout-set.md` stores examples reserved for validation after edits. Do not tune directly against holdout examples unless the user explicitly moves them into the working set.
31
+
32
+ ## Example Record Schema
33
+
34
+ Use one record per example:
35
+
36
+ ```markdown
37
+ ## EX-001: Short label
38
+
39
+ - Label: positive | negative
40
+ - Kind: true-positive | false-positive | false-negative | fix | regression | edge-case
41
+ - Origin: human-verified | mixed | synthetic
42
+ - Source: issue/PR/commit/log/user note/local eval pointer
43
+ - Status: working | holdout | resolved | deferred
44
+ - Expected behavior: concise statement
45
+ - Observed behavior: concise statement
46
+ - Skill delta: instruction, reference, description, or eval change
47
+ - Anonymization: what was removed or generalized
48
+
49
+ ### Content
50
+
51
+ Summarized or redacted example content.
52
+ ```
53
+
54
+ Keep records concise. Preserve enough detail to reproduce the behavior, but redact secrets, customer data, private URLs, and unnecessary user content.
55
+
56
+ ## Positive And Negative Findings
57
+
58
+ Positive findings are not just success stories. Use them to protect behaviors that must not regress.
59
+
60
+ Negative findings should identify the smallest failing decision:
61
+
62
+ - wrong trigger behavior
63
+ - missing source type
64
+ - skipped reference file
65
+ - overloaded or hidden instruction
66
+ - weak output contract
67
+ - missing validation step
68
+ - unsafe or non-portable path assumption
69
+
70
+ Each negative finding should map to a concrete skill delta or an explicit deferred reason.
71
+
72
+ ## Promotion Rules
73
+
74
+ Promote evidence into the skill artifacts only when it changes future behavior:
75
+
76
+ - Put universal behavioral rules in `SKILL.md`.
77
+ - Put domain-specific examples in a focused reference.
78
+ - Put source provenance and decisions in `SOURCES.md`.
79
+ - Put reusable eval prompts in `EVAL.md`.
80
+ - Keep raw or semi-raw examples in `references/evidence/`.
81
+
82
+ Do not turn `references/evidence/` into a changelog. The changelog belongs in `SOURCES.md`.
@@ -0,0 +1,40 @@
1
+ # Iteration Path
2
+
3
+ Use this path when improving a skill based on outcomes and examples.
4
+
5
+ ## Example intake
6
+
7
+ Read `references/iteration-evidence.md` when examples should be persisted across future skill revisions.
8
+
9
+ Capture example records with:
10
+
11
+ - label (`positive` or `negative`)
12
+ - example kind (`true-positive`, `false-positive`, `fix`, `regression`, `edge-case`)
13
+ - evidence origin (`human-verified`, `mixed`, `synthetic`)
14
+ - anonymized content
15
+ - source provenance pointer (where the example came from)
16
+
17
+ ## Replay and evaluation
18
+
19
+ 1. Evaluate against working set.
20
+ 2. Evaluate against holdout set.
21
+ 3. Record improved/unchanged/regressed outcomes.
22
+ 4. Confirm both positive and negative behavior changed in the expected direction.
23
+
24
+ ## Improvement rules
25
+
26
+ 1. Prioritize fixes for repeated negative patterns.
27
+ 2. Preserve behavior that consistently succeeds on positives.
28
+ 3. Update transformed examples when guidance changes.
29
+ 4. Record deltas in `SOURCES.md` changelog.
30
+ 5. Expand input collection when failures indicate coverage gaps.
31
+ 6. Store durable positive/negative examples in `references/evidence/` instead of overloading `SKILL.md`, `SOURCES.md`, or a generic reference file.
32
+ 7. Keep holdout examples separate from working examples until validation is complete.
33
+ 8. Update `SPEC.md` when iteration changes the skill's intended scope, evidence model, evaluation gates, or known limitations.
34
+
35
+ ## Required output
36
+
37
+ - Example intake summary
38
+ - Behavior deltas
39
+ - Updated artifacts
40
+ - Replay summary
@@ -0,0 +1,67 @@
1
+ # Mode Selection
2
+
3
+ Choose the minimal set of paths needed for the request.
4
+ Regardless of path, prioritize input quality and coverage depth before finalizing outputs.
5
+ Do not add evaluation unless the user asks for it, the change is high-risk, or the architecture choice is genuinely uncertain.
6
+
7
+ ## Path mapping
8
+
9
+ | Request shape | Required paths |
10
+ |---------------|----------------|
11
+ | New skill from scratch | synthesis + authoring + description optimization + registration/validation |
12
+ | Update existing skill wording/structure | authoring + description optimization + registration/validation |
13
+ | Improve skill from outcomes/examples | iteration + authoring + description optimization + registration/validation |
14
+ | Research-first skill planning | synthesis only, then authoring if requested |
15
+ | Risky, disputed, or explicitly reviewed change | add `evaluation` to the selected path |
16
+
17
+ ## Skill class selection
18
+
19
+ Classify the target skill before synthesis. This determines the coverage dimensions that must be represented in sources, references, and validation.
20
+
21
+ | Skill class | Typical request shape | Required dimensions |
22
+ |-------------|-----------------------|---------------------|
23
+ | `workflow-process` | repeatable operations, CI/task orchestration | preconditions, ordered flow, failure handling, safety boundaries |
24
+ | `integration-documentation` | library/framework integration, SDK usage, API correctness | API surface, config/runtime options, common use cases, known issues/workarounds, version/migration variance |
25
+ | `security-review` | vulnerability finding, exploitability review | vulnerability classes, exploit paths, false-positive controls, remediations |
26
+ | `skill-authoring` | creating/updating/evaluating other skills | source provenance, depth gates, transformed examples, registration/validation |
27
+ | `generic` | does not match above | explicit dimensions chosen and justified in synthesis |
28
+
29
+ When the class is ambiguous, ask one direct clarification question before synthesis.
30
+
31
+ ## Execution shape selection
32
+
33
+ Choose the skill's primary execution shape separately from the skill class.
34
+ Class answers "what domain/problem is this skill for?"
35
+ Shape answers "how should this skill run?"
36
+
37
+ Use `references/execution-shapes.md` for the full decision table and the next leaf reference to load.
38
+
39
+ Record:
40
+
41
+ 1. primary execution shape
42
+ 2. simpler-shape rejection when the chosen shape is advanced
43
+ 3. exact leaf references opened because of that choice
44
+
45
+ ## Required outputs by path
46
+
47
+ - `synthesis`: source inventory, decisions, coverage matrix, gaps.
48
+ - `synthesis`: selected class, selected execution shape, and selected example profile path(s), including profile-requirement coverage.
49
+ - `synthesis`: simplicity rationale showing why the chosen shape is necessary and which simpler shapes were rejected.
50
+ - `synthesis`: portability note when provider-specific mechanics are used.
51
+ - `synthesis`: explicit retrieval stopping rationale showing why further collection is currently low-yield.
52
+ - `authoring`: updated `SKILL.md` and required supporting files.
53
+ - `description optimization`: should/should-not trigger sets and final description.
54
+ - `iteration`: example intake summary and behavior deltas.
55
+ - `evaluation`: qualitative summary and any deeper checks run.
56
+ - `registration/validation`: registration edits and validator results.
57
+
58
+ ## Hard stop rules
59
+
60
+ Do not claim completion when any required path output is missing.
61
+ Evaluation output is required only when `evaluation` was selected.
62
+
63
+ For authoring/generator skills, missing transformed example artifacts is a hard failure.
64
+ Missing selected-profile requirements is also a hard failure.
65
+ Missing required class dimensions is a hard failure.
66
+ Missing an explicit execution-shape choice for a material skill change is a hard failure.
67
+ Using advanced mechanics without justification or portability notes is a hard failure.
@@ -0,0 +1,68 @@
1
+ # Output Contracts
2
+
3
+ Use this guide when the skill needs a predictable response shape.
4
+
5
+ ## Choose The Contract
6
+
7
+ | Need | Use |
8
+ |------|-----|
9
+ | exact sections or headings | strict template |
10
+ | default structure with adaptation | flexible template |
11
+ | style is easier to imitate than describe | input/output examples |
12
+ | format depends on task type | decision table |
13
+ | scripts or tools parse the output | structured schema |
14
+
15
+ ## Strict Template
16
+
17
+ ```markdown
18
+ # [Title]
19
+
20
+ ## Summary
21
+ [Required summary]
22
+
23
+ ## Findings
24
+ - ...
25
+ ```
26
+
27
+ ## Flexible Template
28
+
29
+ ```markdown
30
+ # [Title]
31
+
32
+ ## Summary
33
+ [Default summary section; adapt if needed]
34
+
35
+ ## Findings
36
+ [Adapt based on context]
37
+ ```
38
+
39
+ ## Input/Output Example
40
+
41
+ ````markdown
42
+ Input: fix date formatting bug
43
+ Output:
44
+ ```text
45
+ fix(reports): correct timezone date formatting
46
+ ```
47
+ ````
48
+
49
+ ## Decision Table
50
+
51
+ ```markdown
52
+ | Input Type | Output Format |
53
+ |------------|---------------|
54
+ | single file | inline summary |
55
+ | many files | grouped report |
56
+ ```
57
+
58
+ ## Structured Schema
59
+
60
+ ````markdown
61
+ ```json
62
+ {
63
+ "status": "success",
64
+ "summary": "One-line result",
65
+ "findings": []
66
+ }
67
+ ```
68
+ ````
@@ -0,0 +1,71 @@
1
+ # Reference Architecture
2
+
3
+ Use this guide before adding bundled files or long sections to `SKILL.md`.
4
+
5
+ ## Router Rule
6
+
7
+ - `SKILL.md` is the router.
8
+ - References are lookup leaves.
9
+ - `SPEC.md` is the maintenance contract.
10
+ - `SOURCES.md` stores provenance and decisions.
11
+ - `EVAL.md` stores reusable eval prompts or runbooks.
12
+
13
+ ## Lookup Test
14
+
15
+ Before creating a reference, finish this sentence:
16
+
17
+ - "I need to decide X, so read `...`."
18
+ - "I need to do Y, so read `...`."
19
+ - "I need to diagnose Z, so read `...`."
20
+
21
+ If the sentence sounds like "I need context" or "I need patterns", the file is too vague.
22
+
23
+ ## Placement Table
24
+
25
+ | Put it in... | When it belongs there |
26
+ |--------------|-----------------------|
27
+ | `SKILL.md` | every run needs it |
28
+ | `references/` | only some branches need it |
29
+ | `SPEC.md` | it explains maintenance, scope, or evidence policy |
30
+ | `SOURCES.md` | it is provenance, a decision record, or a gap |
31
+ | `EVAL.md` | it is a reusable eval prompt or grading runbook |
32
+
33
+ ## Reference Types
34
+
35
+ | Need | Shape |
36
+ |------|-------|
37
+ | choose a path | decision guide |
38
+ | execute a procedure | task guide |
39
+ | look up exact facts | reference table |
40
+ | diagnose a failure | troubleshooting matrix |
41
+ | imitate quality | example set |
42
+ | judge completeness | evaluation rubric |
43
+
44
+ ## Naming Rules
45
+
46
+ - Name files for the question or action they answer.
47
+ - Good: `mode-selection.md`, `output-contracts.md`, `routing-workflows.md`
48
+ - Bad: `notes.md`, `context.md`, `patterns.md`, `research.md`
49
+ - Use subfolders only when the subtree name clarifies the lookup path.
50
+
51
+ ## Split Rules
52
+
53
+ Create a new reference when:
54
+
55
+ - the content is only needed after a branch decision
56
+ - the content has one dominant type
57
+ - the section would make `SKILL.md` harder to scan
58
+ - the file is approaching 100 lines and contains multiple lookup needs
59
+
60
+ Keep content in `SKILL.md` when:
61
+
62
+ - every invocation needs it
63
+ - it is short
64
+ - moving it would force unnecessary file loads
65
+
66
+ ## Final Checks
67
+
68
+ 1. Every runtime reference has a direct "open when..." reason in `SKILL.md`.
69
+ 2. The filename tells the agent why to open it.
70
+ 3. No required instruction is hidden only in an optional reference.
71
+ 4. No reference has become a second `SKILL.md`.
@@ -0,0 +1,67 @@
1
+ # Registration and Validation
2
+
3
+ Apply registration and quality checks before completion.
4
+
5
+ ## Registration checklist
6
+
7
+ 1. Inspect the workspace and identify the active skill layout before editing files.
8
+ 2. Create/update `<skill-root>/SKILL.md`, `<skill-root>/SPEC.md` when required by change scope, and any bundled `references/`, `scripts/`, or `assets/` beneath that root.
9
+ 3. Default to `.agents/skills/<name>/` when there is no stronger prior art.
10
+ 4. If the workspace clearly uses a different canonical layout, follow that layout instead of forcing `.agents/skills/`.
11
+ 5. Common established alternatives include:
12
+ - `skills/<name>/` when the workspace uses a canonical root skill tree
13
+ - `.claude/skills/<name>/` for project-scoped Claude skills
14
+ - `plugins/<plugin>/skills/<name>/` for plugin-scoped skills
15
+ - another repository-managed skill root that is already established by neighboring skills or docs
16
+ 6. If multiple plausible locations exist and inspection does not make the canonical target clear, ask the user before editing files.
17
+ 7. Only apply repository-specific registration steps when the workspace conventions explicitly require them.
18
+
19
+ When a repository does maintain its own skill catalog, verify and update any required registration files such as:
20
+
21
+ - public skill inventories or tables
22
+ - project or plugin settings files
23
+ - allowlists used by other skills or automation
24
+
25
+ ## Validation checklist
26
+
27
+ 1. Run:
28
+
29
+ ```bash
30
+ uv run scripts/quick_validate.py <path/to/skill-directory> --strict-depth
31
+ ```
32
+
33
+ Use the skill-root-relative form above when running from the `skill-writer` directory.
34
+ If you must run the validator from another working directory, convert both paths to the correct relative path from that directory instead of introducing absolute or host-specific paths into the skill docs.
35
+
36
+ 2. Confirm for authoring/generator skills:
37
+ - transformed examples exist in references (happy-path, secure/robust, anti-pattern+fix)
38
+ - synthesis depth gates are satisfied
39
+ - selected example profile requirements are satisfied and reported
40
+ - `SPEC.md` exists or was updated when the change creates a skill or materially changes intent, scope, evidence model, evaluation, or maintenance expectations
41
+ - every bundled reference file is directly discoverable from `SKILL.md`
42
+
43
+ 3. Confirm for integration/documentation skills:
44
+ - focused references cover API surface, common use cases, known issues/workarounds, and version variance
45
+ - reference file names fit the skill's domain rather than a fixed template
46
+ - `SKILL.md` and `references/*.md` avoid host-specific absolute filesystem paths
47
+
48
+ 4. Confirm portability for skills that are expected to be portable by default:
49
+ - bundled file references use skill-root-relative paths such as `references/...`, `scripts/...`, or `assets/...`
50
+ - provider-specific path variables (for example `${CLAUDE_SKILL_ROOT}`) either follow established repository prior art or are explicitly scoped, rather than being introduced ad hoc
51
+ - provider-specific behavior, if any, is labeled as compatibility guidance rather than the primary workflow
52
+
53
+ 5. If evaluation was run, include:
54
+ - lightweight qualitative summary
55
+ - concise depth rubric status for integration/documentation and skill-authoring skills
56
+ - deeper eval or quantitative summary only if user requested it or risk warranted it
57
+
58
+ 6. Review validator warnings for long reference files and split files when warnings indicate mixed concerns or poor navigation.
59
+ 7. Reject shallow handoffs that omit required artifacts.
60
+
61
+ ## Required output
62
+
63
+ - Registration changes summary
64
+ - Selected skill root and why it was chosen
65
+ - Validator output
66
+ - Evaluation summary, if run
67
+ - Any residual risks or open gaps