self-evolving-workflow 0.0.0-stage → 0.1.4

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 (375) hide show
  1. package/LICENSE +27 -0
  2. package/README.md +195 -2
  3. package/dist/agent-memory-prompts.d.ts +13 -0
  4. package/dist/agent-memory-prompts.js +55 -0
  5. package/dist/cli.d.ts +2 -0
  6. package/dist/cli.js +6 -0
  7. package/dist/closeout.d.ts +105 -0
  8. package/dist/closeout.js +473 -0
  9. package/dist/code.d.ts +39 -0
  10. package/dist/code.js +124 -0
  11. package/dist/codex-memory.d.ts +24 -0
  12. package/dist/codex-memory.js +217 -0
  13. package/dist/common.d.ts +16 -0
  14. package/dist/common.js +52 -0
  15. package/dist/context-envelope.d.ts +59 -0
  16. package/dist/context-envelope.js +23 -0
  17. package/dist/host-adapters.d.ts +34 -0
  18. package/dist/host-adapters.js +151 -0
  19. package/dist/http.d.ts +3 -0
  20. package/dist/http.js +90 -0
  21. package/dist/index.d.ts +16 -0
  22. package/dist/index.js +13 -0
  23. package/dist/knowledge-cli.d.ts +198 -0
  24. package/dist/knowledge-cli.js +761 -0
  25. package/dist/knowledge-reads.d.ts +72 -0
  26. package/dist/knowledge-reads.js +201 -0
  27. package/dist/memory-config.d.ts +44 -0
  28. package/dist/memory-config.js +204 -0
  29. package/dist/memory-evidence.d.ts +13 -0
  30. package/dist/memory-evidence.js +40 -0
  31. package/dist/memory-history.d.ts +46 -0
  32. package/dist/memory-history.js +432 -0
  33. package/dist/memory.d.ts +96 -0
  34. package/dist/memory.js +362 -0
  35. package/dist/retrospective.d.ts +57 -0
  36. package/dist/retrospective.js +240 -0
  37. package/dist/search.d.ts +36 -0
  38. package/dist/search.js +112 -0
  39. package/dist/skill-addition.d.ts +25 -0
  40. package/dist/skill-addition.js +89 -0
  41. package/dist/skill-design.d.ts +96 -0
  42. package/dist/skill-design.js +226 -0
  43. package/dist/skill-replay.d.ts +55 -0
  44. package/dist/skill-replay.js +448 -0
  45. package/dist/skill-route.d.ts +30 -0
  46. package/dist/skill-route.js +75 -0
  47. package/dist/transcript-evidence.d.ts +3 -0
  48. package/dist/transcript-evidence.js +58 -0
  49. package/dist/upstream/chunker.d.ts +24 -0
  50. package/dist/upstream/chunker.js +96 -0
  51. package/dist/upstream/file-protocol.d.ts +45 -0
  52. package/dist/upstream/file-protocol.js +117 -0
  53. package/dist/upstream/frontmatter.d.ts +47 -0
  54. package/dist/upstream/frontmatter.js +86 -0
  55. package/dist/upstream/graph-search.d.ts +33 -0
  56. package/dist/upstream/graph-search.js +67 -0
  57. package/dist/upstream/l1-extraction.d.ts +26 -0
  58. package/dist/upstream/l1-extraction.js +405 -0
  59. package/dist/upstream/llm.d.ts +8 -0
  60. package/dist/upstream/llm.js +1 -0
  61. package/dist/upstream/merge.d.ts +50 -0
  62. package/dist/upstream/merge.js +153 -0
  63. package/dist/upstream/prompts.d.ts +53 -0
  64. package/dist/upstream/prompts.js +181 -0
  65. package/dist/upstream/search-utils.d.ts +34 -0
  66. package/dist/upstream/search-utils.js +55 -0
  67. package/dist/upstream/slug.d.ts +26 -0
  68. package/dist/upstream/slug.js +103 -0
  69. package/dist/upstream/template.d.ts +29 -0
  70. package/dist/upstream/template.js +80 -0
  71. package/dist/upstream/tokenize.d.ts +4 -0
  72. package/dist/upstream/tokenize.js +29 -0
  73. package/dist/wiki-change.d.ts +76 -0
  74. package/dist/wiki-change.js +299 -0
  75. package/dist/wiki-entry.d.ts +26 -0
  76. package/dist/wiki-entry.js +93 -0
  77. package/dist/wiki-ingest.d.ts +12 -0
  78. package/dist/wiki-ingest.js +126 -0
  79. package/dist/wiki-migration.d.ts +16 -0
  80. package/dist/wiki-migration.js +268 -0
  81. package/dist/wiki-tokens.d.ts +1 -0
  82. package/dist/wiki-tokens.js +46 -0
  83. package/dist/wiki.d.ts +103 -0
  84. package/dist/wiki.js +330 -0
  85. package/dist/workflow-cli.d.ts +2 -0
  86. package/dist/workflow-cli.js +319 -0
  87. package/dist/workflow-install.d.ts +37 -0
  88. package/dist/workflow-install.js +148 -0
  89. package/dist/workflow-knowledge.d.ts +18 -0
  90. package/dist/workflow-knowledge.js +32 -0
  91. package/dist/workflow-mcp.d.ts +2 -0
  92. package/dist/workflow-mcp.js +137 -0
  93. package/dist/workflow-names.d.ts +4 -0
  94. package/dist/workflow-names.js +31 -0
  95. package/dist/workflow-runtime.d.ts +735 -0
  96. package/dist/workflow-runtime.js +747 -0
  97. package/dist/workflow-skills.d.ts +48 -0
  98. package/dist/workflow-skills.js +141 -0
  99. package/docs/images/impeccable-skill.png +0 -0
  100. package/docs/images/workflow-overview.png +0 -0
  101. package/docs/images/workflow-skills.png +0 -0
  102. package/package.json +77 -4
  103. package/skills/ew-impeccable/LICENSE +191 -0
  104. package/skills/ew-impeccable/NOTICE.md +19 -0
  105. package/skills/ew-impeccable/SKILL.md +91 -0
  106. package/skills/ew-impeccable/UPSTREAM.md +23 -0
  107. package/skills/ew-impeccable/reference/adapt.md +314 -0
  108. package/skills/ew-impeccable/reference/adapt.native.md +60 -0
  109. package/skills/ew-impeccable/reference/android.md +46 -0
  110. package/skills/ew-impeccable/reference/animate.md +91 -0
  111. package/skills/ew-impeccable/reference/audit.md +138 -0
  112. package/skills/ew-impeccable/reference/audit.native.md +141 -0
  113. package/skills/ew-impeccable/reference/bolder.md +35 -0
  114. package/skills/ew-impeccable/reference/clarify.md +96 -0
  115. package/skills/ew-impeccable/reference/colorize.md +88 -0
  116. package/skills/ew-impeccable/reference/craft-floor.md +44 -0
  117. package/skills/ew-impeccable/reference/craft.md +5 -0
  118. package/skills/ew-impeccable/reference/critique.md +808 -0
  119. package/skills/ew-impeccable/reference/degraded/asset-producer.md +36 -0
  120. package/skills/ew-impeccable/reference/degraded/documenter.md +23 -0
  121. package/skills/ew-impeccable/reference/degraded/finish-reviewer.md +72 -0
  122. package/skills/ew-impeccable/reference/degraded/manual-edit-applier.md +91 -0
  123. package/skills/ew-impeccable/reference/delight.md +72 -0
  124. package/skills/ew-impeccable/reference/distill.md +113 -0
  125. package/skills/ew-impeccable/reference/doctor.md +56 -0
  126. package/skills/ew-impeccable/reference/document.md +418 -0
  127. package/skills/ew-impeccable/reference/extract.md +68 -0
  128. package/skills/ew-impeccable/reference/harden.md +338 -0
  129. package/skills/ew-impeccable/reference/hooks.md +113 -0
  130. package/skills/ew-impeccable/reference/init.md +133 -0
  131. package/skills/ew-impeccable/reference/ios.md +51 -0
  132. package/skills/ew-impeccable/reference/layout.md +86 -0
  133. package/skills/ew-impeccable/reference/live-setup.md +102 -0
  134. package/skills/ew-impeccable/reference/live.md +326 -0
  135. package/skills/ew-impeccable/reference/new-work.md +209 -0
  136. package/skills/ew-impeccable/reference/onboard.md +236 -0
  137. package/skills/ew-impeccable/reference/operate.md +61 -0
  138. package/skills/ew-impeccable/reference/optimize.md +260 -0
  139. package/skills/ew-impeccable/reference/overdrive.md +127 -0
  140. package/skills/ew-impeccable/reference/polish.md +105 -0
  141. package/skills/ew-impeccable/reference/quieter.md +101 -0
  142. package/skills/ew-impeccable/reference/routing.md +20 -0
  143. package/skills/ew-impeccable/reference/shape.md +59 -0
  144. package/skills/ew-impeccable/reference/typeset.md +82 -0
  145. package/skills/ew-impeccable/reference/visualize.md +46 -0
  146. package/skills/ew-impeccable/scripts/build-phase.mjs +1022 -0
  147. package/skills/ew-impeccable/scripts/command-metadata.json +94 -0
  148. package/skills/ew-impeccable/scripts/comp-diff.mjs +391 -0
  149. package/skills/ew-impeccable/scripts/comp-spec.mjs +513 -0
  150. package/skills/ew-impeccable/scripts/concept-seed.mjs +814 -0
  151. package/skills/ew-impeccable/scripts/context-signals.mjs +325 -0
  152. package/skills/ew-impeccable/scripts/context.mjs +1521 -0
  153. package/skills/ew-impeccable/scripts/critique-storage.mjs +473 -0
  154. package/skills/ew-impeccable/scripts/data/font-index-failures.json +121 -0
  155. package/skills/ew-impeccable/scripts/data/font-index.json +1 -0
  156. package/skills/ew-impeccable/scripts/detect-csp.mjs +246 -0
  157. package/skills/ew-impeccable/scripts/detect.mjs +30 -0
  158. package/skills/ew-impeccable/scripts/detector/browser/injected/index.mjs +2580 -0
  159. package/skills/ew-impeccable/scripts/detector/cli/main.mjs +498 -0
  160. package/skills/ew-impeccable/scripts/detector/design-system.mjs +1311 -0
  161. package/skills/ew-impeccable/scripts/detector/detect-antipatterns-browser.js +9486 -0
  162. package/skills/ew-impeccable/scripts/detector/detect-antipatterns.mjs +51 -0
  163. package/skills/ew-impeccable/scripts/detector/engines/browser/detect-url.mjs +434 -0
  164. package/skills/ew-impeccable/scripts/detector/engines/regex/detect-text.mjs +1439 -0
  165. package/skills/ew-impeccable/scripts/detector/engines/static-html/css-cascade.mjs +1242 -0
  166. package/skills/ew-impeccable/scripts/detector/engines/static-html/detect-html.mjs +263 -0
  167. package/skills/ew-impeccable/scripts/detector/engines/visual/screenshot-contrast.mjs +189 -0
  168. package/skills/ew-impeccable/scripts/detector/findings.mjs +23 -0
  169. package/skills/ew-impeccable/scripts/detector/node/file-system.mjs +225 -0
  170. package/skills/ew-impeccable/scripts/detector/profile/profiler.mjs +166 -0
  171. package/skills/ew-impeccable/scripts/detector/registry/antipatterns.mjs +636 -0
  172. package/skills/ew-impeccable/scripts/detector/rules/checks.mjs +5750 -0
  173. package/skills/ew-impeccable/scripts/detector/shared/color.mjs +596 -0
  174. package/skills/ew-impeccable/scripts/detector/shared/constants.mjs +127 -0
  175. package/skills/ew-impeccable/scripts/detector/shared/fonts.mjs +30 -0
  176. package/skills/ew-impeccable/scripts/detector/shared/inline-ignores.mjs +148 -0
  177. package/skills/ew-impeccable/scripts/detector/shared/page.mjs +7 -0
  178. package/skills/ew-impeccable/scripts/detector/vendor/MDN-DATA-LICENSE +116 -0
  179. package/skills/ew-impeccable/scripts/detector/vendor/THIRD_PARTY_LICENSES.md +227 -0
  180. package/skills/ew-impeccable/scripts/detector/vendor/static-html-parser.build-entry.txt +11 -0
  181. package/skills/ew-impeccable/scripts/detector/vendor/static-html-parser.bundle.mjs +9121 -0
  182. package/skills/ew-impeccable/scripts/doctor.mjs +330 -0
  183. package/skills/ew-impeccable/scripts/embed-prompt.mjs +166 -0
  184. package/skills/ew-impeccable/scripts/font-match.mjs +457 -0
  185. package/skills/ew-impeccable/scripts/generate-image.mjs +447 -0
  186. package/skills/ew-impeccable/scripts/hook-admin.mjs +829 -0
  187. package/skills/ew-impeccable/scripts/hook-before-edit.mjs +538 -0
  188. package/skills/ew-impeccable/scripts/hook-lib.mjs +2493 -0
  189. package/skills/ew-impeccable/scripts/hook.mjs +79 -0
  190. package/skills/ew-impeccable/scripts/lib/artifact-schema.mjs +93 -0
  191. package/skills/ew-impeccable/scripts/lib/composition-catalog.mjs +200 -0
  192. package/skills/ew-impeccable/scripts/lib/concept-catalog.mjs +395 -0
  193. package/skills/ew-impeccable/scripts/lib/design-parser.mjs +880 -0
  194. package/skills/ew-impeccable/scripts/lib/font-fingerprint.mjs +564 -0
  195. package/skills/ew-impeccable/scripts/lib/font-index.mjs +130 -0
  196. package/skills/ew-impeccable/scripts/lib/hero-checks.mjs +246 -0
  197. package/skills/ew-impeccable/scripts/lib/image-metrics.mjs +306 -0
  198. package/skills/ew-impeccable/scripts/lib/impeccable-config.mjs +640 -0
  199. package/skills/ew-impeccable/scripts/lib/impeccable-paths.mjs +137 -0
  200. package/skills/ew-impeccable/scripts/lib/is-generated.mjs +72 -0
  201. package/skills/ew-impeccable/scripts/lib/live-path-globs.mjs +37 -0
  202. package/skills/ew-impeccable/scripts/lib/open-system-browser.mjs +26 -0
  203. package/skills/ew-impeccable/scripts/lib/png.mjs +281 -0
  204. package/skills/ew-impeccable/scripts/lib/provider.mjs +5 -0
  205. package/skills/ew-impeccable/scripts/lib/raster.mjs +194 -0
  206. package/skills/ew-impeccable/scripts/lib/roll-selection.mjs +369 -0
  207. package/skills/ew-impeccable/scripts/lib/staleness-deep.mjs +491 -0
  208. package/skills/ew-impeccable/scripts/lib/staleness-notice.mjs +169 -0
  209. package/skills/ew-impeccable/scripts/lib/staleness.mjs +532 -0
  210. package/skills/ew-impeccable/scripts/lib/surface-briefs.mjs +149 -0
  211. package/skills/ew-impeccable/scripts/lib/target-args.mjs +42 -0
  212. package/skills/ew-impeccable/scripts/lib/target-slug.mjs +33 -0
  213. package/skills/ew-impeccable/scripts/lib/template-extensions.mjs +146 -0
  214. package/skills/ew-impeccable/scripts/live/accept-css.mjs +617 -0
  215. package/skills/ew-impeccable/scripts/live/accept-verify.mjs +60 -0
  216. package/skills/ew-impeccable/scripts/live/browser-script-parts.mjs +84 -0
  217. package/skills/ew-impeccable/scripts/live/completion.mjs +28 -0
  218. package/skills/ew-impeccable/scripts/live/event-validation.mjs +199 -0
  219. package/skills/ew-impeccable/scripts/live/frameworks/astro.mjs +47 -0
  220. package/skills/ew-impeccable/scripts/live/frameworks/detect-utils.mjs +73 -0
  221. package/skills/ew-impeccable/scripts/live/frameworks/index.mjs +143 -0
  222. package/skills/ew-impeccable/scripts/live/frameworks/journal.mjs +197 -0
  223. package/skills/ew-impeccable/scripts/live/frameworks/nextjs.mjs +49 -0
  224. package/skills/ew-impeccable/scripts/live/frameworks/nuxt.mjs +161 -0
  225. package/skills/ew-impeccable/scripts/live/frameworks/script-src.mjs +17 -0
  226. package/skills/ew-impeccable/scripts/live/frameworks/static-html.mjs +26 -0
  227. package/skills/ew-impeccable/scripts/live/frameworks/sveltekit.mjs +71 -0
  228. package/skills/ew-impeccable/scripts/live/frameworks/tag-strategy.mjs +247 -0
  229. package/skills/ew-impeccable/scripts/live/frameworks/tanstack-start.mjs +70 -0
  230. package/skills/ew-impeccable/scripts/live/frameworks/vite-generic.mjs +42 -0
  231. package/skills/ew-impeccable/scripts/live/generation-preflight.mjs +149 -0
  232. package/skills/ew-impeccable/scripts/live/insert-ui.mjs +458 -0
  233. package/skills/ew-impeccable/scripts/live/instructions.mjs +142 -0
  234. package/skills/ew-impeccable/scripts/live/manual-apply.mjs +939 -0
  235. package/skills/ew-impeccable/scripts/live/manual-edit-routes.mjs +357 -0
  236. package/skills/ew-impeccable/scripts/live/manual-edits-buffer.mjs +152 -0
  237. package/skills/ew-impeccable/scripts/live/poll-lanes.mjs +14 -0
  238. package/skills/ew-impeccable/scripts/live/project-ignores.mjs +139 -0
  239. package/skills/ew-impeccable/scripts/live/roots.mjs +508 -0
  240. package/skills/ew-impeccable/scripts/live/session-store.mjs +563 -0
  241. package/skills/ew-impeccable/scripts/live/source-lock.mjs +105 -0
  242. package/skills/ew-impeccable/scripts/live/source-search.mjs +105 -0
  243. package/skills/ew-impeccable/scripts/live/svelte-ast.mjs +969 -0
  244. package/skills/ew-impeccable/scripts/live/svelte-component.mjs +1366 -0
  245. package/skills/ew-impeccable/scripts/live/sveltekit-adapter.mjs +304 -0
  246. package/skills/ew-impeccable/scripts/live/tanstack-adapter.mjs +259 -0
  247. package/skills/ew-impeccable/scripts/live/ui-surfaces.mjs +75 -0
  248. package/skills/ew-impeccable/scripts/live/vocabulary.mjs +171 -0
  249. package/skills/ew-impeccable/scripts/live-accept.mjs +938 -0
  250. package/skills/ew-impeccable/scripts/live-browser-dom.js +167 -0
  251. package/skills/ew-impeccable/scripts/live-browser-ignores.js +242 -0
  252. package/skills/ew-impeccable/scripts/live-browser-session.js +144 -0
  253. package/skills/ew-impeccable/scripts/live-browser.js +12851 -0
  254. package/skills/ew-impeccable/scripts/live-commit-manual-edits.mjs +1200 -0
  255. package/skills/ew-impeccable/scripts/live-complete.mjs +107 -0
  256. package/skills/ew-impeccable/scripts/live-copy-edit-agent.mjs +800 -0
  257. package/skills/ew-impeccable/scripts/live-discard-manual-edits.mjs +51 -0
  258. package/skills/ew-impeccable/scripts/live-inject.mjs +463 -0
  259. package/skills/ew-impeccable/scripts/live-insert.mjs +292 -0
  260. package/skills/ew-impeccable/scripts/live-manual-edit-evidence.mjs +368 -0
  261. package/skills/ew-impeccable/scripts/live-poll.mjs +430 -0
  262. package/skills/ew-impeccable/scripts/live-resume.mjs +123 -0
  263. package/skills/ew-impeccable/scripts/live-server.mjs +1698 -0
  264. package/skills/ew-impeccable/scripts/live-status.mjs +71 -0
  265. package/skills/ew-impeccable/scripts/live-target.mjs +30 -0
  266. package/skills/ew-impeccable/scripts/live-wrap.mjs +927 -0
  267. package/skills/ew-impeccable/scripts/live.mjs +334 -0
  268. package/skills/ew-impeccable/scripts/modern-screenshot.umd.js +14 -0
  269. package/skills/ew-impeccable/scripts/palette.mjs +628 -0
  270. package/skills/ew-impeccable/scripts/pin.mjs +352 -0
  271. package/skills/ew-impeccable/scripts/serve-question.mjs +1783 -0
  272. package/skills/ew-impeccable/scripts/surface-brief.mjs +74 -0
  273. package/skills/ew-knowledge/SKILL.md +35 -0
  274. package/skills/ew-knowledge/references/closeout-protocol.md +68 -0
  275. package/skills/ew-knowledge/references/knowledge-route.md +73 -0
  276. package/skills/ew-knowledge/references/wiki-maintenance.md +27 -0
  277. package/skills/ew-odyssey/SKILL.md +106 -0
  278. package/skills/ew-odyssey/references/audit-artifacts.md +7 -0
  279. package/skills/ew-odyssey/references/odyssey-base.md +104 -0
  280. package/skills/ew-odyssey/references/odyssey-debug.md +264 -0
  281. package/skills/ew-odyssey/references/odyssey-defensive.md +351 -0
  282. package/skills/ew-odyssey/references/odyssey-improve.md +230 -0
  283. package/skills/ew-odyssey/references/odyssey-planex.md +294 -0
  284. package/skills/ew-odyssey/references/odyssey-review.md +233 -0
  285. package/skills/ew-odyssey/references/odyssey-security.md +231 -0
  286. package/skills/ew-odyssey/references/odyssey-ui.md +232 -0
  287. package/skills/ew-odyssey/references/prepare/odyssey-debug.md +102 -0
  288. package/skills/ew-odyssey/references/prepare/odyssey-defensive.md +117 -0
  289. package/skills/ew-odyssey/references/prepare/odyssey-improve.md +95 -0
  290. package/skills/ew-odyssey/references/prepare/odyssey-planex.md +105 -0
  291. package/skills/ew-odyssey/references/prepare/odyssey-review.md +105 -0
  292. package/skills/ew-odyssey/references/prepare/odyssey-security.md +91 -0
  293. package/skills/ew-odyssey/references/prepare/odyssey-ui.md +88 -0
  294. package/skills/ew-odyssey/references/runtime-adapters.md +31 -0
  295. package/skills/ew-orchestrate/SKILL.md +89 -0
  296. package/skills/ew-orchestrate/references/auto-policy.md +66 -0
  297. package/skills/ew-orchestrate/references/boundary-grill.md +51 -0
  298. package/skills/ew-orchestrate/references/companion-route.md +40 -0
  299. package/skills/ew-orchestrate/references/ew-orchestrate.md +44 -0
  300. package/skills/ew-orchestrate/references/goal.md +51 -0
  301. package/skills/ew-orchestrate/references/orchestrator-run-loop.md +33 -0
  302. package/skills/ew-orchestrate/references/planning.md +54 -0
  303. package/skills/ew-orchestrate/steps/ew-analyze/SKILL.md +70 -0
  304. package/skills/ew-orchestrate/steps/ew-analyze/references/issue-gaps-analyze.md +24 -0
  305. package/skills/ew-orchestrate/steps/ew-analyze/references/prepare.md +8 -0
  306. package/skills/ew-orchestrate/steps/ew-analyze/references/workflow.md +138 -0
  307. package/skills/ew-orchestrate/steps/ew-auto-test/SKILL.md +80 -0
  308. package/skills/ew-orchestrate/steps/ew-auto-test/references/prepare.md +23 -0
  309. package/skills/ew-orchestrate/steps/ew-auto-test/references/workflow.md +31 -0
  310. package/skills/ew-orchestrate/steps/ew-blueprint/SKILL.md +122 -0
  311. package/skills/ew-orchestrate/steps/ew-blueprint/references/prepare.md +21 -0
  312. package/skills/ew-orchestrate/steps/ew-blueprint/references/workflow.md +28 -0
  313. package/skills/ew-orchestrate/steps/ew-brainstorm/SKILL.md +49 -0
  314. package/skills/ew-orchestrate/steps/ew-companion/SKILL.md +50 -0
  315. package/skills/ew-orchestrate/steps/ew-debug/SKILL.md +85 -0
  316. package/skills/ew-orchestrate/steps/ew-debug/references/prepare.md +27 -0
  317. package/skills/ew-orchestrate/steps/ew-debug/references/workflow.md +31 -0
  318. package/skills/ew-orchestrate/steps/ew-execute/SKILL.md +74 -0
  319. package/skills/ew-orchestrate/steps/ew-execute/references/prepare.md +27 -0
  320. package/skills/ew-orchestrate/steps/ew-execute/references/workflow.md +87 -0
  321. package/skills/ew-orchestrate/steps/ew-grill/SKILL.md +62 -0
  322. package/skills/ew-orchestrate/steps/ew-grill/references/prepare.md +26 -0
  323. package/skills/ew-orchestrate/steps/ew-grill/references/workflow.md +31 -0
  324. package/skills/ew-orchestrate/steps/ew-init/SKILL.md +56 -0
  325. package/skills/ew-orchestrate/steps/ew-init/references/prepare.md +25 -0
  326. package/skills/ew-orchestrate/steps/ew-init/references/workflow.md +28 -0
  327. package/skills/ew-orchestrate/steps/ew-plan/SKILL.md +131 -0
  328. package/skills/ew-orchestrate/steps/ew-plan/references/prepare.md +8 -0
  329. package/skills/ew-orchestrate/steps/ew-plan/references/tdd.md +53 -0
  330. package/skills/ew-orchestrate/steps/ew-plan/references/workflow.md +100 -0
  331. package/skills/ew-orchestrate/steps/ew-retrospective/SKILL.md +68 -0
  332. package/skills/ew-orchestrate/steps/ew-retrospective/references/prepare.md +18 -0
  333. package/skills/ew-orchestrate/steps/ew-retrospective/references/workflow.md +34 -0
  334. package/skills/ew-orchestrate/steps/ew-review/SKILL.md +45 -0
  335. package/skills/ew-orchestrate/steps/ew-review/references/prepare.md +17 -0
  336. package/skills/ew-orchestrate/steps/ew-review/references/workflow.md +116 -0
  337. package/skills/ew-orchestrate/steps/ew-roadmap/SKILL.md +62 -0
  338. package/skills/ew-orchestrate/steps/ew-roadmap/references/prepare.md +27 -0
  339. package/skills/ew-orchestrate/steps/ew-roadmap/references/workflow.md +28 -0
  340. package/skills/ew-orchestrate/steps/ew-test/SKILL.md +99 -0
  341. package/skills/ew-orchestrate/steps/ew-test/references/prepare.md +23 -0
  342. package/skills/ew-orchestrate/steps/ew-test/references/workflow.md +23 -0
  343. package/skills/ew-orchestrate/steps/ew-verify/SKILL.md +73 -0
  344. package/skills/ew-orchestrate/steps/ew-verify/references/prepare.md +21 -0
  345. package/skills/ew-orchestrate/steps/ew-verify/references/workflow.md +29 -0
  346. package/skills/ew-skill-design/SKILL.md +30 -0
  347. package/skills/ew-skill-design/references/package-contract.md +40 -0
  348. package/skills/ew-skill-design/references/validation.md +21 -0
  349. package/skills/team-swarm/SKILL.md +68 -0
  350. package/skills/team-swarm/references/mcp-coordination.md +14 -0
  351. package/skills/team-swarm/roles/analyst/role.md +181 -0
  352. package/skills/team-swarm/roles/ant/role.md +149 -0
  353. package/skills/team-swarm/roles/coordinator/commands/converge.md +112 -0
  354. package/skills/team-swarm/roles/coordinator/commands/init-swarm.md +136 -0
  355. package/skills/team-swarm/roles/coordinator/commands/iterate.md +171 -0
  356. package/skills/team-swarm/roles/coordinator/role.md +170 -0
  357. package/skills/team-swarm/roles/scorer/role.md +150 -0
  358. package/skills/team-swarm/scripts/aco.py +646 -0
  359. package/skills/team-swarm/scripts/pheromone.py +144 -0
  360. package/skills/team-swarm/scripts/scoring.py +111 -0
  361. package/skills/team-swarm/scripts/test_aco.py +606 -0
  362. package/skills/team-swarm/specs/ant-output-schema.md +127 -0
  363. package/skills/team-swarm/specs/convergence-criteria.md +108 -0
  364. package/skills/team-swarm/specs/pheromone-schema.md +125 -0
  365. package/skills/team-swarm/specs/swarm-config-template.json +71 -0
  366. package/skills/team-swarm/specs/swarm-protocol.md +119 -0
  367. package/skills/workflow-evolve/SKILL.md +64 -0
  368. package/skills/workflow-evolve/references/agy-gate.md +27 -0
  369. package/skills/workflow-evolve/references/auto-loop.md +23 -0
  370. package/skills/workflow-evolve/references/history-review.md +15 -0
  371. package/skills/workflow-evolve/scripts/codex-memory-replay.mjs +86 -0
  372. package/skills/workflow-evolve/scripts/codex-replay.mjs +1 -0
  373. package/skills/workflow-evolve/scripts/evolve-loop.mjs +260 -0
  374. package/skills/workflow-evolve/scripts/memory-codex-mcp.mjs +124 -0
  375. package/workflows/index.json +33 -0
@@ -0,0 +1,473 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Critique persistence helper.
4
+ *
5
+ * Each critique run writes a per-target snapshot to
6
+ * .impeccable/critique/<timestamp>__<slug>.md
7
+ * with a small YAML frontmatter carrying the score + P0/P1 counts.
8
+ *
9
+ * The polish workflow reads the latest matching snapshot at start as its
10
+ * fix backlog. No other skill auto-reads critique output.
11
+ *
12
+ * The slug is derived mechanically from the *resolved* primary artifact
13
+ * (file path or URL), never from the user's natural-language phrasing.
14
+ * Slug stability across runs is what lets the trend display work.
15
+ *
16
+ * CLI entry points (called from skill instructions):
17
+ * node critique-storage.mjs slug <resolved-target>
18
+ * node critique-storage.mjs write <slug> <snapshot-body-file>
19
+ * node critique-storage.mjs latest <slug> [--json]
20
+ * node critique-storage.mjs trend <slug> [limit]
21
+ * node critique-storage.mjs close <resolved-target> <snapshot-file>
22
+ *
23
+ * Note: there is intentionally no `ignore` subcommand. ignore.md is a plain
24
+ * markdown file; the model reads it directly with its file-read tool. This
25
+ * helper only exists for operations the model can't trivially do inline
26
+ * (normalizing paths, generating filenames, globbing + parsing frontmatter).
27
+ */
28
+
29
+ import fs from 'node:fs';
30
+ import path from 'node:path';
31
+ import { createHash } from 'node:crypto';
32
+ import { fileURLToPath, pathToFileURL } from 'node:url';
33
+ import { getCritiqueDir } from './lib/impeccable-paths.mjs';
34
+ import { slugFromTarget } from './lib/target-slug.mjs';
35
+
36
+ export { slugFromTarget } from './lib/target-slug.mjs';
37
+
38
+ /**
39
+ * Mechanically derive a slug from a resolved target. Returns null if the
40
+ * input doesn't look like a stable identifier (empty, project root, etc).
41
+ *
42
+ * Accepts file paths and URLs. The model resolves "the homepage" to a
43
+ * concrete artifact before calling this — we never slug a natural-language
44
+ * phrase.
45
+ */
46
+ /**
47
+ * Filename-safe UTC ISO timestamp: hyphens for separators, trailing Z.
48
+ * Plain colons aren't allowed on Windows filesystems.
49
+ */
50
+ export function nowFilenameStamp(date = new Date()) {
51
+ const iso = date.toISOString(); // 2026-05-12T18:30:00.123Z
52
+ return iso.replace(/[:.]/g, '-').replace(/-\d+Z$/, 'Z');
53
+ }
54
+
55
+ /**
56
+ * Return an exact content fingerprint for a local file target. URLs and
57
+ * non-files return null because their content is not available here.
58
+ *
59
+ * The fingerprint deliberately describes bytes, not Git state or mtimes:
60
+ * critique often assesses an uncommitted file, and a later polish run should
61
+ * inherit that backlog when the bytes are unchanged regardless of staging.
62
+ */
63
+ function resolveLocalTargetPath(target, { cwd = process.cwd() } = {}) {
64
+ if (!target || /^https?:\/\//i.test(target)) return null;
65
+ return path.isAbsolute(target) ? path.resolve(target) : path.resolve(cwd, target);
66
+ }
67
+
68
+ function resolveTargetIdentity(target, { cwd = process.cwd() } = {}) {
69
+ if (!target || typeof target !== 'string') return null;
70
+ if (/^https?:\/\//i.test(target)) {
71
+ try {
72
+ const url = new URL(target);
73
+ const pathname = url.pathname.replace(/\/+$/, '') || '/';
74
+ return `url:${url.origin}${pathname}`;
75
+ } catch {
76
+ return null;
77
+ }
78
+ }
79
+ const filePath = resolveLocalTargetPath(target, { cwd });
80
+ return filePath ? `file:${filePath}` : null;
81
+ }
82
+
83
+ export function fingerprintTarget(target, { cwd = process.cwd() } = {}) {
84
+ const filePath = resolveLocalTargetPath(target, { cwd });
85
+ if (!filePath) return null;
86
+ try {
87
+ if (!fs.statSync(filePath).isFile()) return null;
88
+ return `sha256:${createHash('sha256').update(fs.readFileSync(filePath)).digest('hex')}`;
89
+ } catch {
90
+ return null;
91
+ }
92
+ }
93
+
94
+ /**
95
+ * Write a snapshot for `slug`. `meta` carries the small structured frontmatter
96
+ * keys read back by readTrend(). `body` is the human-readable critique
97
+ * report (everything below the frontmatter).
98
+ *
99
+ * Returns the absolute path written.
100
+ */
101
+ export function writeSnapshot({ slug, meta, body, cwd = process.cwd(), now = new Date() }) {
102
+ if (!slug) throw new Error('writeSnapshot requires a slug');
103
+ const dir = getCritiqueDir(cwd);
104
+ fs.mkdirSync(dir, { recursive: true });
105
+ const timestamp = nowFilenameStamp(now);
106
+ // Spread `meta` first so internally computed `timestamp` and `slug`
107
+ // always win. Otherwise a caller-supplied meta blob (parsed from the
108
+ // IMPECCABLE_CRITIQUE_META env var) could clobber them, leaving the
109
+ // filename in disagreement with its frontmatter and corrupting trends.
110
+ const front = serializeFrontmatter({ ...meta, timestamp, slug });
111
+ const contents = `${front}\n${body.trim()}\n`;
112
+
113
+ // A second critique can finish in the same UTC second. Use exclusive
114
+ // creation and a fixed-width suffix so concurrent writers cannot replace
115
+ // history and lexical ordering still keeps collision entries newest.
116
+ for (let collision = 0; collision <= 9999; collision += 1) {
117
+ const suffix = collision === 0 ? '' : `~${String(collision).padStart(4, '0')}`;
118
+ const filePath = path.join(dir, `${timestamp}${suffix}__${slug}.md`);
119
+ try {
120
+ fs.writeFileSync(filePath, contents, { encoding: 'utf-8', flag: 'wx' });
121
+ return filePath;
122
+ } catch (error) {
123
+ if (error?.code !== 'EEXIST') throw error;
124
+ }
125
+ }
126
+ throw new Error(`Too many critique snapshots for ${slug} at ${timestamp}`);
127
+ }
128
+
129
+ function serializeFrontmatter(obj) {
130
+ const lines = ['---'];
131
+ for (const [key, value] of Object.entries(obj)) {
132
+ if (value === undefined || value === null) continue;
133
+ const str = typeof value === 'string' ? value : String(value);
134
+ // Quote strings that contain : or # to keep parsing simple.
135
+ const needsQuotes = typeof value === 'string' && /[:#]/.test(str);
136
+ lines.push(`${key}: ${needsQuotes ? JSON.stringify(str) : str}`);
137
+ }
138
+ lines.push('---');
139
+ return lines.join('\n');
140
+ }
141
+
142
+ function parseFrontmatter(text) {
143
+ const match = text.match(/^---\r?\n([\s\S]*?)\r?\n---/);
144
+ if (!match) return {};
145
+ const out = {};
146
+ for (const line of match[1].split(/\r?\n/)) {
147
+ const colon = line.indexOf(':');
148
+ if (colon < 0) continue;
149
+ const key = line.slice(0, colon).trim();
150
+ let value = line.slice(colon + 1).trim();
151
+ if (/^".*"$/.test(value)) {
152
+ try { value = JSON.parse(value); } catch { /* leave as-is */ }
153
+ } else if (/^-?\d+$/.test(value)) {
154
+ value = Number(value);
155
+ } else if (value === 'true' || value === 'false') {
156
+ value = value === 'true';
157
+ }
158
+ out[key] = value;
159
+ }
160
+ return out;
161
+ }
162
+
163
+ /**
164
+ * Return snapshot files matching `suffix`, sorted oldest → newest.
165
+ */
166
+ const SNAPSHOT_FILENAME = /^\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2}Z(?:~\d{4})?__.+\.md$/;
167
+
168
+ function listSnapshots(suffix, cwd) {
169
+ const dir = getCritiqueDir(cwd);
170
+ if (!fs.existsSync(dir)) return [];
171
+ return fs.readdirSync(dir)
172
+ .filter((f) => SNAPSHOT_FILENAME.test(f) && f.endsWith(suffix))
173
+ .sort()
174
+ .map((f) => path.join(dir, f));
175
+ }
176
+
177
+ function readSnapshot(filePath) {
178
+ if (!filePath) return null;
179
+ const body = fs.readFileSync(filePath, 'utf-8');
180
+ return { path: filePath, body, meta: parseFrontmatter(body) };
181
+ }
182
+
183
+ function snapshotTargetIdentity(snapshot) {
184
+ const targetPath = snapshot?.meta.target_path;
185
+ return snapshot?.meta.target_identity
186
+ || (targetPath ? `file:${targetPath}` : null);
187
+ }
188
+
189
+ function readNewestSnapshot(slug, { cwd = process.cwd() } = {}) {
190
+ return readSnapshot(listSnapshots(`__${slug}.md`, cwd).at(-1));
191
+ }
192
+
193
+ function readNewestSnapshotForIdentity(
194
+ slug,
195
+ targetIdentity,
196
+ { cwd = process.cwd() } = {},
197
+ ) {
198
+ const matches = listSnapshots(`__${slug}.md`, cwd)
199
+ .map(readSnapshot)
200
+ .filter((snapshot) => snapshotTargetIdentity(snapshot) === targetIdentity);
201
+ return matches.at(-1) || null;
202
+ }
203
+
204
+ /**
205
+ * Return the most recent snapshot for `slug`, or null. Polish reads this
206
+ * to find its fix backlog when the slug matches.
207
+ */
208
+ export function readLatestSnapshot(slug, { cwd = process.cwd() } = {}) {
209
+ const latest = readNewestSnapshot(slug, { cwd });
210
+ return latest?.meta.closed === true ? null : latest;
211
+ }
212
+
213
+ /**
214
+ * Mark one exact snapshot closed without deleting the score history consumed
215
+ * by `trend`. Exact identity matters: a newer critique may land after polish
216
+ * reads its backlog, and that newer snapshot must remain live. `snapshotFile`
217
+ * may be the absolute path returned by readLatestSnapshot() or the basename
218
+ * emitted by `latest --json`. Returns the path marked closed, or null.
219
+ */
220
+ export function closeSnapshot(snapshotFile, { cwd = process.cwd() } = {}) {
221
+ if (!snapshotFile || typeof snapshotFile !== 'string') return null;
222
+ const dir = path.resolve(getCritiqueDir(cwd));
223
+ const snapshotPath = path.isAbsolute(snapshotFile)
224
+ ? path.resolve(snapshotFile)
225
+ : path.resolve(dir, snapshotFile);
226
+ const filename = path.basename(snapshotPath);
227
+ if (
228
+ path.dirname(snapshotPath) !== dir
229
+ || !SNAPSHOT_FILENAME.test(filename)
230
+ ) return null;
231
+
232
+ let snapshot;
233
+ try {
234
+ if (!fs.lstatSync(snapshotPath).isFile()) return null;
235
+ snapshot = readSnapshot(snapshotPath);
236
+ } catch {
237
+ return null;
238
+ }
239
+ if (!snapshot || snapshot.meta.closed === true) return null;
240
+ const closedBody = snapshot.body.replace(
241
+ /^(---\r?\n[\s\S]*?)(\r?\n---)/,
242
+ '$1\nclosed: true$2',
243
+ );
244
+ if (closedBody === snapshot.body) {
245
+ throw new Error(`Cannot close snapshot without frontmatter: ${snapshot.path}`);
246
+ }
247
+ fs.writeFileSync(snapshot.path, closedBody, 'utf-8');
248
+ return snapshot.path;
249
+ }
250
+
251
+ /** Return the most recent snapshot across all targets, or null. */
252
+ export function readLatestSnapshotAcrossTargets({ cwd = process.cwd() } = {}) {
253
+ const snapshots = listSnapshots('.md', cwd).map(readSnapshot);
254
+ const identifiedSlugs = new Set(
255
+ snapshots
256
+ .filter((snapshot) => snapshotTargetIdentity(snapshot))
257
+ .map((snapshot) => snapshot.meta.slug),
258
+ );
259
+ const latestByTarget = new Map();
260
+ for (const snapshot of snapshots) {
261
+ if (!snapshot?.meta.slug) continue;
262
+ // Slugs are lossy: distinct targets such as foo/bar and foo-bar can share
263
+ // one. Keep each known identity's latest open/closed state independent so
264
+ // closing one target cannot hide another target's live backlog. Once a
265
+ // slug has any identity-aware snapshot, its older legacy records are no
266
+ // longer independently routable and must not resurface as zombie work.
267
+ const targetIdentity = snapshotTargetIdentity(snapshot);
268
+ if (!targetIdentity && identifiedSlugs.has(snapshot.meta.slug)) continue;
269
+ const streamKey = targetIdentity || `slug:${snapshot.meta.slug}`;
270
+ latestByTarget.set(streamKey, snapshot);
271
+ }
272
+ return [...latestByTarget.values()]
273
+ .filter((snapshot) => snapshot.meta.closed !== true)
274
+ .sort((a, b) => a.path.localeCompare(b.path))
275
+ .at(-1) || null;
276
+ }
277
+
278
+ /**
279
+ * Return the last `limit` snapshots' frontmatter, oldest → newest.
280
+ * Critique appends a one-line trend to its output using this.
281
+ */
282
+ export function readTrend(slug, { limit = 5, cwd = process.cwd() } = {}) {
283
+ const all = listSnapshots(`__${slug}.md`, cwd);
284
+ const slice = all.slice(-limit);
285
+ return slice.map((file) => parseFrontmatter(fs.readFileSync(file, 'utf-8')));
286
+ }
287
+
288
+ // ---- CLI ---------------------------------------------------------------
289
+
290
+ // Accept either a ready slug or a concrete target (path/URL) everywhere, so
291
+ // callers never have to run the slug step separately. Anything containing a
292
+ // path or URL marker is resolved through slugFromTarget.
293
+ function isReadySlug(value) {
294
+ return /^[a-z0-9-]+$/.test(value || '') && !value.includes('/');
295
+ }
296
+
297
+ function coerceSlug(value) {
298
+ if (!value) return null;
299
+ if (isReadySlug(value)) return value;
300
+ return slugFromTarget(value);
301
+ }
302
+
303
+ function main(argv) {
304
+ const [cmd, ...args] = argv;
305
+ switch (cmd) {
306
+ case 'slug': {
307
+ const slug = slugFromTarget(args[0]);
308
+ if (!slug) { process.stderr.write('no stable slug for input\n'); process.exit(1); }
309
+ process.stdout.write(`${slug}\n`);
310
+ return;
311
+ }
312
+ case 'write': {
313
+ const [slugArg, bodyFile] = args;
314
+ const slug = coerceSlug(slugArg);
315
+ if (!slug || !bodyFile) { process.stderr.write('usage: write <slug-or-target> <body-file>\n'); process.exit(1); }
316
+ const raw = fs.readFileSync(bodyFile, 'utf-8');
317
+ // The body file may be a full report. The caller passes the meta as
318
+ // a JSON object on stdin if it wants structured frontmatter; otherwise
319
+ // we write with minimal metadata.
320
+ let meta = {};
321
+ const metaArg = process.env.IMPECCABLE_CRITIQUE_META;
322
+ if (metaArg) {
323
+ try { meta = JSON.parse(metaArg); } catch { /* ignore */ }
324
+ }
325
+ // The helper, not caller-provided metadata, owns the target fingerprint.
326
+ // This makes the snapshot describe the exact file bytes critique saw.
327
+ delete meta.target_fingerprint;
328
+ delete meta.target_path;
329
+ delete meta.target_identity;
330
+ const targetIdentity = resolveTargetIdentity(slugArg);
331
+ if (targetIdentity) meta.target_identity = targetIdentity;
332
+ const targetFingerprint = fingerprintTarget(slugArg);
333
+ if (targetFingerprint) {
334
+ meta.target_fingerprint = targetFingerprint;
335
+ meta.target_path = resolveLocalTargetPath(slugArg);
336
+ }
337
+ const out = writeSnapshot({ slug, meta, body: raw });
338
+ process.stdout.write(`${out}\n`);
339
+ return;
340
+ }
341
+ case 'latest': {
342
+ const target = args[0];
343
+ const format = args[1];
344
+ const slug = coerceSlug(target);
345
+ if (!slug || (format && format !== '--json')) {
346
+ process.stderr.write('usage: latest <slug-or-target> [--json]\n');
347
+ process.exit(1);
348
+ }
349
+ const targetFingerprint = fingerprintTarget(target);
350
+ const targetPath = resolveLocalTargetPath(target);
351
+ const targetIdentity = resolveTargetIdentity(target);
352
+ const readySlug = isReadySlug(target);
353
+ const newestForSlug = readNewestSnapshot(slug);
354
+ if (!newestForSlug) { process.exit(2); }
355
+
356
+ // Concrete targets select the newest snapshot for their exact identity,
357
+ // not merely the newest filename for a lossy slug. This keeps distinct
358
+ // targets such as foo/bar and foo-bar from hiding each other's backlog.
359
+ const exactSnapshot = readNewestSnapshotForIdentity(slug, targetIdentity);
360
+ let latest = exactSnapshot;
361
+ if (!latest && !readySlug) {
362
+ // Legacy snapshots have no identity. Preserve their old explicit
363
+ // path/URL behavior only when no known target identity was selected.
364
+ latest = readNewestSnapshotForIdentity(slug, null);
365
+ }
366
+ if (!latest) latest = newestForSlug;
367
+ if (latest.meta.closed === true) { process.exit(2); }
368
+
369
+ const recordedTargetPath = latest.meta.target_path;
370
+ const recordedTargetIdentity = snapshotTargetIdentity(latest);
371
+ const matchingIdentity = recordedTargetIdentity === targetIdentity;
372
+
373
+ // Bare slugs remain a supported lookup mode, including for URL
374
+ // snapshots. But when a same-named local file exists, the request is
375
+ // ambiguous unless that exact file owns the snapshot identity.
376
+ if (readySlug && !recordedTargetIdentity) {
377
+ process.stderr.write(
378
+ 'ambiguous legacy snapshot target; use an explicit ./path or full URL\n',
379
+ );
380
+ process.exit(2);
381
+ }
382
+ if (readySlug && targetPath && fs.existsSync(targetPath) && !matchingIdentity) {
383
+ process.stderr.write(
384
+ 'ambiguous snapshot slug; use an explicit ./path or remove the local name collision\n',
385
+ );
386
+ process.exit(2);
387
+ }
388
+
389
+ const concreteTarget = !readySlug || matchingIdentity;
390
+ if (concreteTarget && recordedTargetIdentity && !matchingIdentity) {
391
+ process.exit(2);
392
+ }
393
+ const concreteLocalTarget = concreteTarget && targetPath;
394
+ if (concreteLocalTarget && latest.meta.target_fingerprint !== targetFingerprint) {
395
+ closeSnapshot(latest.path);
396
+ process.exit(2);
397
+ }
398
+ if (format === '--json') {
399
+ process.stdout.write(JSON.stringify({
400
+ snapshot_file: path.basename(latest.path),
401
+ body: latest.body,
402
+ }, null, 2) + '\n');
403
+ } else {
404
+ process.stdout.write(latest.body);
405
+ }
406
+ return;
407
+ }
408
+ case 'close': {
409
+ const [slugArg, snapshotFile, ...extra] = args;
410
+ const slug = coerceSlug(slugArg);
411
+ if (!slug || !snapshotFile || extra.length > 0) {
412
+ process.stderr.write('usage: close <resolved-target> <snapshot-file>\n');
413
+ process.exit(1);
414
+ }
415
+ if (
416
+ path.basename(snapshotFile) !== snapshotFile
417
+ || !SNAPSHOT_FILENAME.test(snapshotFile)
418
+ || !snapshotFile.endsWith(`__${slug}.md`)
419
+ ) process.exit(2);
420
+
421
+ // A slug and filename are not enough to prove ownership because two
422
+ // distinct targets can normalize to the same slug. Modern snapshots
423
+ // carry a canonical identity, so require the supplied resolved target
424
+ // to match it before allowing the exact snapshot to be closed. Legacy
425
+ // snapshots without identity retain their historical close behavior.
426
+ const snapshotPath = path.join(getCritiqueDir(process.cwd()), snapshotFile);
427
+ let snapshot;
428
+ try {
429
+ if (!fs.lstatSync(snapshotPath).isFile()) process.exit(2);
430
+ snapshot = readSnapshot(snapshotPath);
431
+ } catch {
432
+ process.exit(2);
433
+ }
434
+ const recordedTargetIdentity = snapshotTargetIdentity(snapshot);
435
+ if (
436
+ recordedTargetIdentity
437
+ && recordedTargetIdentity !== resolveTargetIdentity(slugArg)
438
+ ) process.exit(2);
439
+
440
+ const closed = closeSnapshot(snapshotFile);
441
+ if (!closed) { process.exit(2); }
442
+ process.stdout.write(`${closed}\n`);
443
+ return;
444
+ }
445
+ case 'trend': {
446
+ const rows = readTrend(coerceSlug(args[0]), { limit: args[1] ? Number(args[1]) : 5 });
447
+ process.stdout.write(JSON.stringify(rows, null, 2) + '\n');
448
+ return;
449
+ }
450
+ default:
451
+ process.stderr.write('usage: critique-storage.mjs <slug|write|latest|trend|close> [args]\n');
452
+ process.exit(1);
453
+ }
454
+ }
455
+
456
+ function isMainModule() {
457
+ if (!process.argv[1]) return false;
458
+ try {
459
+ return fs.realpathSync(fileURLToPath(import.meta.url)) === fs.realpathSync(process.argv[1]);
460
+ } catch {
461
+ // pathToFileURL normalizes Windows paths; keep it as a fallback for any
462
+ // environment where realpath is unavailable.
463
+ return import.meta.url === pathToFileURL(process.argv[1]).href;
464
+ }
465
+ }
466
+
467
+ // Why the realpath check: generated skills are often reached through symlinked
468
+ // harness directories (for example a demo repo's `.agents` -> source `.agents`).
469
+ // Node resolves import.meta.url to the real file, while process.argv[1] keeps
470
+ // the symlink path. Comparing canonical paths prevents a silent exit-0 no-op.
471
+ if (isMainModule()) {
472
+ main(process.argv.slice(2));
473
+ }
@@ -0,0 +1,121 @@
1
+ [
2
+ {
3
+ "family": "Betania Patmos GDL",
4
+ "weight": 400,
5
+ "category": "handwriting",
6
+ "variable": false,
7
+ "reason": "not loaded or no lettering"
8
+ },
9
+ {
10
+ "family": "Betania Patmos In GDL",
11
+ "weight": 400,
12
+ "category": "handwriting",
13
+ "variable": false,
14
+ "reason": "not loaded or no lettering"
15
+ },
16
+ {
17
+ "family": "Doto",
18
+ "weight": 300,
19
+ "category": "sans",
20
+ "variable": true,
21
+ "reason": "not loaded or no lettering"
22
+ },
23
+ {
24
+ "family": "Doto",
25
+ "weight": 700,
26
+ "category": "sans",
27
+ "variable": true,
28
+ "reason": "not loaded or no lettering"
29
+ },
30
+ {
31
+ "family": "Jacquard 12 Charted",
32
+ "weight": 400,
33
+ "category": "display",
34
+ "variable": false,
35
+ "reason": "not loaded or no lettering"
36
+ },
37
+ {
38
+ "family": "Jacquard 24 Charted",
39
+ "weight": 400,
40
+ "category": "display",
41
+ "variable": false,
42
+ "reason": "not loaded or no lettering"
43
+ },
44
+ {
45
+ "family": "Jacquarda Bastarda 9 Charted",
46
+ "weight": 400,
47
+ "category": "display",
48
+ "variable": false,
49
+ "reason": "not loaded or no lettering"
50
+ },
51
+ {
52
+ "family": "Jersey 10 Charted",
53
+ "weight": 400,
54
+ "category": "display",
55
+ "variable": false,
56
+ "reason": "not loaded or no lettering"
57
+ },
58
+ {
59
+ "family": "Jersey 15 Charted",
60
+ "weight": 400,
61
+ "category": "display",
62
+ "variable": false,
63
+ "reason": "not loaded or no lettering"
64
+ },
65
+ {
66
+ "family": "Jersey 20 Charted",
67
+ "weight": 400,
68
+ "category": "display",
69
+ "variable": false,
70
+ "reason": "not loaded or no lettering"
71
+ },
72
+ {
73
+ "family": "Jersey 25 Charted",
74
+ "weight": 400,
75
+ "category": "display",
76
+ "variable": false,
77
+ "reason": "not loaded or no lettering"
78
+ },
79
+ {
80
+ "family": "Micro 5 Charted",
81
+ "weight": 400,
82
+ "category": "display",
83
+ "variable": false,
84
+ "reason": "not loaded or no lettering"
85
+ },
86
+ {
87
+ "family": "Montserrat Underline",
88
+ "weight": 400,
89
+ "category": "sans",
90
+ "variable": true,
91
+ "reason": "not loaded or no lettering"
92
+ },
93
+ {
94
+ "family": "Montserrat Underline",
95
+ "weight": 700,
96
+ "category": "sans",
97
+ "variable": true,
98
+ "reason": "not loaded or no lettering"
99
+ },
100
+ {
101
+ "family": "Redacted",
102
+ "weight": 400,
103
+ "category": "display",
104
+ "variable": false,
105
+ "reason": "not loaded or no lettering"
106
+ },
107
+ {
108
+ "family": "Yarndings 12 Charted",
109
+ "weight": 400,
110
+ "category": "display",
111
+ "variable": false,
112
+ "reason": "not loaded or no lettering"
113
+ },
114
+ {
115
+ "family": "Yarndings 20 Charted",
116
+ "weight": 400,
117
+ "category": "display",
118
+ "variable": false,
119
+ "reason": "not loaded or no lettering"
120
+ }
121
+ ]