@event4u/agent-config 14.10.0 → 14.11.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 (399) hide show
  1. package/.augment-plugin/marketplace.json +3 -3
  2. package/.augment-plugin/plugin.json +1 -1
  3. package/.claude-plugin/marketplace.json +1 -1
  4. package/CHANGELOG.md +335 -0
  5. package/README.md +1 -1
  6. package/dist/agent-src/commands/design.md +88 -0
  7. package/dist/agent-src/commands/project/analyze.md +47 -0
  8. package/dist/agent-src/commands/review/changes.md +67 -6
  9. package/dist/agent-src/commands/roadmap/create.md +49 -0
  10. package/dist/agent-src/commands/roadmap/next.md +27 -11
  11. package/dist/agent-src/commands/roadmap/process-full.md +14 -0
  12. package/dist/agent-src/commands/video/from-script.md +60 -3
  13. package/dist/agent-src/commands/video/stitch.md +14 -0
  14. package/dist/agent-src/contexts/communication/rules-auto/guidelines-mechanics.md +1 -0
  15. package/dist/agent-src/contexts/execution/roadmap-process-loop.md +154 -2
  16. package/dist/agent-src/rules/active-remediation.md +3 -3
  17. package/dist/agent-src/rules/code-provenance.md +2 -2
  18. package/dist/agent-src/rules/context-hygiene.md +13 -33
  19. package/dist/agent-src/rules/council-availability.md +2 -2
  20. package/dist/agent-src/rules/decision-revisit-gate.md +3 -1
  21. package/dist/agent-src/rules/design-fidelity.md +18 -0
  22. package/dist/agent-src/rules/design-review-after-ui-write.md +2 -2
  23. package/dist/agent-src/rules/evaluator-independence.md +56 -44
  24. package/dist/agent-src/rules/fix-what-you-see.md +9 -1
  25. package/dist/agent-src/rules/framework-neutrality-in-generic-skills.md +1 -1
  26. package/dist/agent-src/rules/minimal-safe-diff.md +14 -20
  27. package/dist/agent-src/rules/missing-skill-recovery.md +13 -1
  28. package/dist/agent-src/rules/playbook-precedence.md +105 -0
  29. package/dist/agent-src/rules/recurring-criticism.md +3 -1
  30. package/dist/agent-src/rules/roadmap-progress-sync.md +14 -13
  31. package/dist/agent-src/rules/scale-discipline.md +24 -0
  32. package/dist/agent-src/rules/security-sensitive-stop.md +2 -2
  33. package/dist/agent-src/rules/settings-ask-protocol.md +2 -2
  34. package/dist/agent-src/rules/ui-audit-gate.md +27 -15
  35. package/dist/agent-src/rules/untrusted-input-defense.md +2 -2
  36. package/dist/agent-src/skills/accessibility-auditor/SKILL.md +19 -0
  37. package/dist/agent-src/skills/adr-create/SKILL.md +7 -0
  38. package/dist/agent-src/skills/agents-md-thin-root/SKILL.md +33 -0
  39. package/dist/agent-src/skills/ai-council/references/advanced-modes.md +17 -3
  40. package/dist/agent-src/skills/ai-council/references/output-and-synthesis.md +31 -0
  41. package/dist/agent-src/skills/ai-council/references/procedure.md +19 -0
  42. package/dist/agent-src/skills/alerting-doctrine/SKILL.md +225 -0
  43. package/dist/agent-src/skills/alerting-doctrine/evals/triggers.json +17 -0
  44. package/dist/agent-src/skills/authz-review/SKILL.md +0 -1
  45. package/dist/agent-src/skills/blast-radius-analyzer/SKILL.md +32 -0
  46. package/dist/agent-src/skills/brand/SKILL.md +3 -0
  47. package/dist/agent-src/skills/brand-asset-generation/SKILL.md +3 -0
  48. package/dist/agent-src/skills/brand-audit/SKILL.md +3 -0
  49. package/dist/agent-src/skills/brand-identity/SKILL.md +3 -0
  50. package/dist/agent-src/skills/brand-strategy/SKILL.md +3 -0
  51. package/dist/agent-src/skills/brand-to-tokens/SKILL.md +3 -0
  52. package/dist/agent-src/skills/check-refs/SKILL.md +3 -0
  53. package/dist/agent-src/skills/code-review/SKILL.md +11 -0
  54. package/dist/agent-src/skills/command-routing/SKILL.md +6 -0
  55. package/dist/agent-src/skills/condense-memory/SKILL.md +3 -0
  56. package/dist/agent-src/skills/context-authoring/SKILL.md +1 -1
  57. package/dist/agent-src/skills/conventional-commits-writing/SKILL.md +3 -0
  58. package/dist/agent-src/skills/copilot-agents-optimization/SKILL.md +10 -0
  59. package/dist/agent-src/skills/corpus-grounding/SKILL.md +3 -0
  60. package/dist/agent-src/skills/design-intelligence/SKILL.md +3 -0
  61. package/dist/agent-src/skills/design-intelligence/data/landing.csv +36 -35
  62. package/dist/agent-src/skills/design-intelligence/data/stacks/threejs.csv +1 -0
  63. package/dist/agent-src/skills/design-review/SKILL.md +79 -1
  64. package/dist/agent-src/skills/design-review/references/verification-automation.md +41 -0
  65. package/dist/agent-src/skills/design-system-capture/SKILL.md +35 -40
  66. package/dist/agent-src/skills/design-system-capture/references/import-procedure.md +50 -0
  67. package/dist/agent-src/skills/design-tokens/SKILL.md +3 -0
  68. package/dist/agent-src/skills/design-variations/SKILL.md +3 -0
  69. package/dist/agent-src/skills/developer-like-execution/SKILL.md +3 -0
  70. package/dist/agent-src/skills/estimate-ticket/SKILL.md +3 -0
  71. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +20 -3
  72. package/dist/agent-src/skills/fe-design/SKILL.md +74 -41
  73. package/dist/agent-src/skills/fe-design/evals/triggers.json +65 -53
  74. package/dist/agent-src/skills/fe-design/references/craft-floor.md +52 -0
  75. package/dist/agent-src/skills/fe-design/references/source-led-port.md +36 -0
  76. package/dist/agent-src/skills/file-editor/SKILL.md +5 -0
  77. package/dist/agent-src/skills/finishing-a-development-branch/SKILL.md +2 -2
  78. package/dist/agent-src/skills/git-workflow/SKILL.md +3 -0
  79. package/dist/agent-src/skills/html-deck/SKILL.md +3 -0
  80. package/dist/agent-src/skills/iconography/SKILL.md +3 -0
  81. package/dist/agent-src/skills/image-editing/SKILL.md +3 -0
  82. package/dist/agent-src/skills/image-generation/SKILL.md +3 -0
  83. package/dist/agent-src/skills/image-provider-routing/SKILL.md +3 -0
  84. package/dist/agent-src/skills/incident-commander/SKILL.md +10 -0
  85. package/dist/agent-src/skills/js-library-packaging/SKILL.md +173 -0
  86. package/dist/agent-src/skills/js-library-packaging/evals/triggers.json +17 -0
  87. package/dist/agent-src/skills/js-library-packaging/scripts/check_package_surface.ts +270 -0
  88. package/dist/agent-src/skills/laravel-migration/SKILL.md +3 -0
  89. package/dist/agent-src/skills/learning-to-rule-or-skill/SKILL.md +3 -0
  90. package/dist/agent-src/skills/lint-skills/SKILL.md +3 -0
  91. package/dist/agent-src/skills/llm-provider-knowledge/SKILL.md +3 -0
  92. package/dist/agent-src/skills/logging-monitoring/SKILL.md +234 -51
  93. package/dist/agent-src/skills/logo-generation/SKILL.md +3 -0
  94. package/dist/agent-src/skills/md-language-check/SKILL.md +3 -0
  95. package/dist/agent-src/skills/monorepo-workspace/SKILL.md +149 -0
  96. package/dist/agent-src/skills/monorepo-workspace/evals/triggers.json +17 -0
  97. package/dist/agent-src/skills/motion-choreographer/SKILL.md +6 -0
  98. package/dist/agent-src/skills/multi-tenancy/SKILL.md +4 -0
  99. package/dist/agent-src/skills/operational-readiness/SKILL.md +184 -0
  100. package/dist/agent-src/skills/operational-readiness/evals/triggers.json +17 -0
  101. package/dist/agent-src/skills/override-management/SKILL.md +3 -0
  102. package/dist/agent-src/skills/persona-improvement/SKILL.md +3 -0
  103. package/dist/agent-src/skills/pest-testing/SKILL.md +3 -0
  104. package/dist/agent-src/skills/playbook-authoring/SKILL.md +162 -0
  105. package/dist/agent-src/skills/playwright-testing/SKILL.md +3 -0
  106. package/dist/agent-src/skills/privacy-review/SKILL.md +3 -0
  107. package/dist/agent-src/skills/prompt-engineering-image/SKILL.md +3 -0
  108. package/dist/agent-src/skills/quality-tools/SKILL.md +5 -0
  109. package/dist/agent-src/skills/react-shadcn-ui/SKILL.md +52 -21
  110. package/dist/agent-src/skills/readme-reviewer/SKILL.md +3 -0
  111. package/dist/agent-src/skills/readme-writing/SKILL.md +3 -0
  112. package/dist/agent-src/skills/readme-writing-package/SKILL.md +3 -0
  113. package/dist/agent-src/skills/receiving-code-review/SKILL.md +2 -2
  114. package/dist/agent-src/skills/refine-prompt/SKILL.md +3 -0
  115. package/dist/agent-src/skills/refine-ticket/SKILL.md +3 -0
  116. package/dist/agent-src/skills/requesting-code-review/SKILL.md +2 -2
  117. package/dist/agent-src/skills/review-routing/SKILL.md +2 -2
  118. package/dist/agent-src/skills/roadmap-writing/SKILL.md +23 -41
  119. package/dist/agent-src/skills/roadmap-writing/references/follow-up-roadmap-shape.md +47 -0
  120. package/dist/agent-src/skills/rtk-output-filtering/SKILL.md +22 -6
  121. package/dist/agent-src/skills/runway-cognition/SKILL.md +3 -0
  122. package/dist/agent-src/skills/scene-expander/scene-blueprint.schema.yaml +26 -0
  123. package/dist/agent-src/skills/secrets-management/SKILL.md +4 -0
  124. package/dist/agent-src/skills/server-hardening/SKILL.md +159 -0
  125. package/dist/agent-src/skills/server-hardening/evals/triggers.json +17 -0
  126. package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +3 -0
  127. package/dist/agent-src/skills/skill-management/SKILL.md +3 -0
  128. package/dist/agent-src/skills/skill-reviewer/SKILL.md +3 -0
  129. package/dist/agent-src/skills/skill-writing/SKILL.md +6 -0
  130. package/dist/agent-src/skills/spreadsheet-authoring/SKILL.md +3 -0
  131. package/dist/agent-src/skills/storybook-workshop/SKILL.md +194 -0
  132. package/dist/agent-src/skills/storybook-workshop/evals/triggers.json +17 -0
  133. package/dist/agent-src/skills/storybook-workshop/scripts/story_contrast_floor.ts +134 -0
  134. package/dist/agent-src/skills/subagent-orchestration/SKILL.md +1 -1
  135. package/dist/agent-src/skills/subagent-orchestration/prompts/README.md +25 -0
  136. package/dist/agent-src/skills/supply-chain-intake/SKILL.md +12 -0
  137. package/dist/agent-src/skills/systematic-debugging/SKILL.md +1 -1
  138. package/dist/agent-src/skills/terraform/SKILL.md +3 -0
  139. package/dist/agent-src/skills/test-driven-development/SKILL.md +1 -1
  140. package/dist/agent-src/skills/threat-modeling/SKILL.md +0 -3
  141. package/dist/agent-src/skills/token-optimizer/SKILL.md +3 -0
  142. package/dist/agent-src/skills/typography-system/SKILL.md +3 -0
  143. package/dist/agent-src/skills/ui-component-architect/SKILL.md +9 -1
  144. package/dist/agent-src/skills/upstream-contribute/SKILL.md +3 -0
  145. package/dist/agent-src/skills/validate-feature-fit/SKILL.md +3 -0
  146. package/dist/agent-src/skills/verify-completion-evidence/SKILL.md +2 -2
  147. package/dist/agent-src/skills/wireframe/SKILL.md +3 -0
  148. package/dist/agent-src/skills/wireframe/references/story-beat-ledger.schema.json +115 -0
  149. package/dist/agent-src/skills/workspace-link/SKILL.md +131 -0
  150. package/dist/agent-src/skills/workspace-link/evals/triggers.json +17 -0
  151. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  152. package/dist/agent-src/templates/playbook.md +75 -0
  153. package/dist/agent-src/templates/roadmaps.md +37 -0
  154. package/dist/agent-src/templates/scripts/check_playbook_invokes.ts +231 -0
  155. package/dist/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +24 -0
  156. package/dist/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +2 -0
  157. package/dist/agent-src/templates/scripts/work_engine/directives/ui/review.ts +216 -0
  158. package/dist/agent-src/templates/scripts/work_engine/directives/ui/scaffold.ts +159 -0
  159. package/dist/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +73 -4
  160. package/dist/agent-src/templates/scripts/work_engine/stack/detect.ts +325 -40
  161. package/dist/cli/commands/uiAudit.js +221 -0
  162. package/dist/cli/commands/uiAudit.js.map +1 -0
  163. package/dist/cli/commands/uiRender.js +206 -0
  164. package/dist/cli/commands/uiRender.js.map +1 -0
  165. package/dist/cli/main.js +22 -1
  166. package/dist/cli/main.js.map +1 -1
  167. package/dist/cli/mcp/content.js +64 -1
  168. package/dist/cli/mcp/content.js.map +1 -1
  169. package/dist/cli/mcp/dispatch.js +175 -10
  170. package/dist/cli/mcp/dispatch.js.map +1 -1
  171. package/dist/cli/registry.js +3 -0
  172. package/dist/cli/registry.js.map +1 -1
  173. package/dist/cli-delegate/{chunk-H4VIVD4C.js → chunk-236PNQZK.js} +413 -391
  174. package/dist/cli-delegate/{chunk-G23AT6GD.js → chunk-DMSZHXZS.js} +57 -1
  175. package/dist/cli-delegate/{chunk-77GR3VD4.js → chunk-FF7WAFMR.js} +58 -3
  176. package/dist/cli-delegate/{chunk-PLSG6UL5.js → chunk-K4FFODTS.js} +341 -204
  177. package/dist/cli-delegate/{chunk-YM4GZDJG.js → chunk-L43NCYPB.js} +5 -0
  178. package/dist/cli-delegate/{chunk-B2ERU2VA.js → chunk-WOKWX5PL.js} +1 -1
  179. package/dist/cli-delegate/cmd_brand_status.js +8 -6
  180. package/dist/cli-delegate/cmd_conformance.js +3 -3
  181. package/dist/cli-delegate/cmd_doctor.js +3 -3
  182. package/dist/cli-delegate/cmd_export.js +4 -4
  183. package/dist/cli-delegate/cmd_handoff.js +1 -1
  184. package/dist/cli-delegate/cmd_preflight.js +2 -2
  185. package/dist/cli-delegate/cmd_prune.js +4 -4
  186. package/dist/cli-delegate/cmd_session_recycle.js +70 -9
  187. package/dist/cli-delegate/cmd_settings_migrate.js +4 -4
  188. package/dist/cli-delegate/cmd_settings_set.js +1 -1
  189. package/dist/cli-delegate/cmd_sync.js +4 -4
  190. package/dist/cli-delegate/cmd_uninstall.js +4 -4
  191. package/dist/cli-delegate/cmd_validate.js +4 -4
  192. package/dist/discovery/deprecation-report.md +1 -1
  193. package/dist/discovery/discovery-manifest.json +359 -124
  194. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  195. package/dist/discovery/discovery-manifest.summary.md +4 -4
  196. package/dist/discovery/dormancy-report.md +1 -1
  197. package/dist/discovery/orphan-report.md +1 -1
  198. package/dist/discovery/packs.json +18 -8
  199. package/dist/discovery/trust-report.md +3 -3
  200. package/dist/discovery/workspaces.json +16 -6
  201. package/dist/hooks/dispatch.js +2337 -1436
  202. package/dist/install/install.mjs +795 -708
  203. package/dist/mcp/registry-manifest.json +3 -3
  204. package/dist/mcp/server.json +2 -2
  205. package/dist/mcp/server.mjs +1685 -1250
  206. package/dist/router.json +1 -1
  207. package/dist/scripts/_lib/lean_projection_mode.js +40 -0
  208. package/dist/scripts/_lib/lean_projection_mode.js.map +1 -0
  209. package/dist/scripts/_lib/scoped_projection.js +84 -0
  210. package/dist/scripts/_lib/scoped_projection.js.map +1 -1
  211. package/dist/scripts/_lib/ui_surface.js +89 -0
  212. package/dist/scripts/_lib/ui_surface.js.map +1 -0
  213. package/dist/scripts/condense.js +6 -10
  214. package/dist/scripts/condense.js.map +1 -1
  215. package/dist/scripts/project_thin_rules.js +40 -2
  216. package/dist/scripts/project_thin_rules.js.map +1 -1
  217. package/dist/server/schemas/settings.js +3 -0
  218. package/dist/server/schemas/settings.js.map +1 -1
  219. package/dist/shared/skillRanking.js +159 -0
  220. package/dist/shared/skillRanking.js.map +1 -0
  221. package/docs/contracts/provider-lifecycle.md +47 -18
  222. package/docs/contracts/settings-classes.md +14 -4
  223. package/docs/guidelines/agent-infra/context-hygiene-mechanics.md +49 -0
  224. package/docs/guidelines/agent-infra/evaluator-independence-mechanics.md +92 -0
  225. package/docs/guidelines/agent-infra/minimal-safe-diff-mechanics.md +45 -1
  226. package/docs/guidelines/agent-infra/roadmap-deferred-resolution-provenance.md +54 -0
  227. package/docs/guidelines/design-antipatterns.md +4 -2
  228. package/docs/guidelines/design-asset-discipline.md +38 -0
  229. package/docs/guidelines/design-fidelity-mechanics.md +45 -29
  230. package/docs/guidelines/design-handover-extraction.md +35 -5
  231. package/docs/guidelines/design-modes.md +41 -1
  232. package/docs/guidelines/monorepo-antipatterns.md +141 -0
  233. package/llms.txt +50 -39
  234. package/package.json +1 -1
  235. package/src/agent-src/templates/scripts/check_playbook_invokes.ts +231 -0
  236. package/src/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +24 -0
  237. package/src/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +2 -0
  238. package/src/agent-src/templates/scripts/work_engine/directives/ui/review.ts +216 -0
  239. package/src/agent-src/templates/scripts/work_engine/directives/ui/scaffold.ts +159 -0
  240. package/src/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +73 -4
  241. package/src/agent-src/templates/scripts/work_engine/stack/detect.ts +325 -40
  242. package/src/config/agent-settings.template.yml +28 -0
  243. package/src/config/assurance-capability-registry.json +223 -0
  244. package/src/config/assurance-threshold-budget.json +65 -0
  245. package/src/config/ci-local-parity.yml +14 -0
  246. package/src/config/discovery/unassigned-artefacts.yml +2 -0
  247. package/src/config/dispatch-economy-metrics.json +4 -2
  248. package/src/config/evaluator-budgets.json +14 -14
  249. package/src/config/gate-coverage.yml +207 -8
  250. package/src/config/gate-violation-baselines.json +76 -72
  251. package/src/config/hook-latency-budget.json +1 -0
  252. package/src/config/hook-token-budget.json +137 -125
  253. package/src/config/pack-size-budget.json +4 -2
  254. package/src/config/quorum-attendance-budget.json +12 -4
  255. package/src/config/rule-activation-census.json +7 -3
  256. package/src/config/rule-enforcement-baseline.json +0 -1
  257. package/src/config/rule-stub-ceilings.json +112 -91
  258. package/src/scripts/_cli/cmd_doctor.ts +15 -16
  259. package/src/scripts/_cli/doctor_install_mode.ts +49 -0
  260. package/src/scripts/_cli/doctor_overrides.ts +154 -0
  261. package/src/scripts/_dispatch.bash +17 -0
  262. package/src/scripts/_lib/as_of.ts +412 -0
  263. package/src/scripts/_lib/exec_evidence.ts +7 -0
  264. package/src/scripts/_lib/hook_settings.ts +33 -0
  265. package/src/scripts/_lib/host_listing_model.ts +192 -0
  266. package/src/scripts/_lib/lean_projection_mode.ts +44 -0
  267. package/src/scripts/_lib/mcp_bridge.ts +199 -0
  268. package/src/scripts/_lib/review_independence.ts +62 -10
  269. package/src/scripts/_lib/rule_injection.ts +239 -0
  270. package/src/scripts/_lib/run_checkpoint.ts +54 -1
  271. package/src/scripts/_lib/scoped_projection.ts +96 -0
  272. package/src/scripts/_lib/session_register.ts +44 -2
  273. package/src/scripts/_lib/skill_catalogue.ts +38 -2
  274. package/src/scripts/_lib/transcript_reads.ts +207 -0
  275. package/src/scripts/_lib/ui_authority.test.ts +251 -0
  276. package/src/scripts/_lib/ui_authority.ts +343 -0
  277. package/src/scripts/ai-video/adapters/fal.sh +8 -3
  278. package/src/scripts/ai-video/adapters/gemini-veo.sh +10 -0
  279. package/src/scripts/ai-video/adapters/higgsfield.sh +10 -2
  280. package/src/scripts/ai-video/adapters/kling.sh +10 -0
  281. package/src/scripts/ai-video/adapters/sora.sh +10 -0
  282. package/src/scripts/ai-video/lib/calibrate-cost.sh +145 -0
  283. package/src/scripts/ai-video/lib/model-capabilities/README.md +53 -7
  284. package/src/scripts/ai-video/lib/model-capabilities/comfyui.json +15 -3
  285. package/src/scripts/ai-video/lib/model-capabilities/fal.json +36 -6
  286. package/src/scripts/ai-video/lib/model-capabilities/gemini-veo.json +23 -0
  287. package/src/scripts/ai-video/lib/model-capabilities/higgsfield.json +23 -0
  288. package/src/scripts/ai-video/lib/model-capabilities/kling.json +23 -0
  289. package/src/scripts/ai-video/lib/model-capabilities/musetalk.json +8 -2
  290. package/src/scripts/ai-video/lib/model-capabilities/replicate.json +36 -6
  291. package/src/scripts/ai-video/lib/model-capabilities/sora.json +45 -0
  292. package/src/scripts/ai-video/lib/model-capabilities/syncso.json +8 -2
  293. package/src/scripts/ai-video/lib/parse-blueprint.sh +52 -5
  294. package/src/scripts/ai-video/lib/resume-scan.sh +92 -3
  295. package/src/scripts/ai-video/lib/seam-plan.sh +212 -0
  296. package/src/scripts/ai-video/smoke-trace.sh +450 -2
  297. package/src/scripts/ai-video/stitch.sh +191 -10
  298. package/src/scripts/ai-video/test-pipeline.sh +84 -6
  299. package/src/scripts/ai_council/cli_agency_bounds.ts +139 -0
  300. package/src/scripts/ai_council/cli_least_agency_canary.ts +347 -0
  301. package/src/scripts/ai_council/clients.ts +3 -2
  302. package/src/scripts/ai_council/consensus.ts +63 -6
  303. package/src/scripts/ai_council/events_log.ts +46 -1
  304. package/src/scripts/ai_council/orchestrator.ts +103 -108
  305. package/src/scripts/ai_council/orchestrator_results.ts +166 -0
  306. package/src/scripts/ai_council/prompts.ts +12 -5
  307. package/src/scripts/ai_council/quorum.ts +82 -1
  308. package/src/scripts/ai_council/quorum_wiring.ts +82 -5
  309. package/src/scripts/ai_council/stance_tally.ts +22 -0
  310. package/src/scripts/bench_hook_latency.ts +62 -0
  311. package/src/scripts/build_proof.ts +12 -1
  312. package/src/scripts/capture_skill_catalogue.ts +21 -0
  313. package/src/scripts/check_always_budget.ts +2 -1
  314. package/src/scripts/check_augmentignore.ts +2 -1
  315. package/src/scripts/check_beta_review_markers.ts +2 -1
  316. package/src/scripts/check_composite_arming.ts +364 -0
  317. package/src/scripts/check_corpus_staleness.ts +2 -1
  318. package/src/scripts/check_council_pin_staleness.ts +3 -1
  319. package/src/scripts/check_enforcement_coverage.ts +116 -3
  320. package/src/scripts/check_enforcement_denominator.ts +365 -0
  321. package/src/scripts/check_gate_coverage.ts +2 -1
  322. package/src/scripts/check_hook_bundle_freshness.ts +13 -1
  323. package/src/scripts/check_knowledge_cards.ts +2 -1
  324. package/src/scripts/check_knowledge_pages.ts +3 -2
  325. package/src/scripts/check_memory.ts +2 -1
  326. package/src/scripts/check_no_automerge_key.ts +287 -0
  327. package/src/scripts/check_pack_conformance_fixture.ts +565 -0
  328. package/src/scripts/check_proposal.ts +2 -1
  329. package/src/scripts/check_reach_staleness.ts +2 -1
  330. package/src/scripts/check_release_adjacent_health.ts +2 -1
  331. package/src/scripts/check_release_pr_shape.ts +5 -0
  332. package/src/scripts/check_review_schema.ts +34 -1
  333. package/src/scripts/check_roadmap_trackable.ts +48 -3
  334. package/src/scripts/check_source_size_budget.ts +2 -1
  335. package/src/scripts/check_standing_payload_delta.ts +505 -0
  336. package/src/scripts/check_trigger_evals.ts +2 -1
  337. package/src/scripts/classify_change_risk.ts +281 -0
  338. package/src/scripts/compute_skill_tiers.ts +186 -0
  339. package/src/scripts/condense.ts +8 -13
  340. package/src/scripts/council_attendance_metrics.ts +183 -0
  341. package/src/scripts/council_cli.ts +10 -8
  342. package/src/scripts/council_parse_rate.ts +116 -0
  343. package/src/scripts/derive_playbooks.ts +406 -0
  344. package/src/scripts/design_slop_rules.test.ts +7 -0
  345. package/src/scripts/design_slop_rules.ts +56 -2
  346. package/src/scripts/dispatch_r2_reviewer.ts +16 -0
  347. package/src/scripts/frontend_corpus_hash.ts +116 -0
  348. package/src/scripts/grade_target_readiness.ts +478 -0
  349. package/src/scripts/hook_manifest.json +1 -1
  350. package/src/scripts/hook_manifest.yaml +97 -16
  351. package/src/scripts/hooks/concern_registry.ts +4 -0
  352. package/src/scripts/hooks/design_pass_hook.ts +356 -0
  353. package/src/scripts/hooks/rtk_wrap_hook.ts +30 -7
  354. package/src/scripts/hooks/rule_inject_hook.ts +318 -0
  355. package/src/scripts/hot_context_hook.ts +74 -7
  356. package/src/scripts/install.ts +40 -89
  357. package/src/scripts/lint_adapter_tier.ts +663 -0
  358. package/src/scripts/lint_archived_skills.ts +93 -0
  359. package/src/scripts/lint_budget_ownership.ts +2 -1
  360. package/src/scripts/lint_deterministic_time.ts +470 -0
  361. package/src/scripts/lint_framework_leakage.ts +5 -0
  362. package/src/scripts/lint_handoffs.ts +525 -1
  363. package/src/scripts/lint_judge_prompt_expectation.ts +155 -0
  364. package/src/scripts/lint_marketplace.ts +88 -0
  365. package/src/scripts/lint_media_policy_linkage.ts +140 -1
  366. package/src/scripts/lint_one_off_age.ts +6 -1
  367. package/src/scripts/lint_override_kernel_guard.ts +87 -5
  368. package/src/scripts/lint_roadmap_complexity.ts +56 -0
  369. package/src/scripts/lint_rule_enforcement_declaration.ts +24 -7
  370. package/src/scripts/lint_rule_norm_pin.ts +321 -0
  371. package/src/scripts/lint_spawn_payload.ts +42 -5
  372. package/src/scripts/lint_symptom_intake.ts +2 -1
  373. package/src/scripts/mcp_parity_smoke.ts +30 -4
  374. package/src/scripts/mcp_render.ts +66 -1
  375. package/src/scripts/mcp_tool_fingerprint.ts +241 -0
  376. package/src/scripts/measure_risk_class_drift.ts +140 -0
  377. package/src/scripts/measure_skill_ranker_baseline.ts +212 -0
  378. package/src/scripts/media/lib/adapter-common.sh +211 -1
  379. package/src/scripts/media/lib/adapter-contract.md +74 -6
  380. package/src/scripts/model_rule_injection.ts +907 -0
  381. package/src/scripts/project_thin_rules.ts +45 -2
  382. package/src/scripts/release.ts +66 -860
  383. package/src/scripts/release_drill.ts +59 -3
  384. package/src/scripts/release_env.ts +298 -0
  385. package/src/scripts/release_publication.ts +720 -0
  386. package/src/scripts/roadmap_context.ts +778 -0
  387. package/src/scripts/schemas/fidelity-measurement-sheet.schema.json +169 -0
  388. package/src/scripts/schemas/rule.schema.json +24 -2
  389. package/src/scripts/schemas/skill.schema.json +39 -0
  390. package/src/scripts/schemas/ui-authority.schema.json +114 -0
  391. package/src/scripts/session_register_hook.ts +29 -3
  392. package/src/scripts/sessions_cli.ts +67 -3
  393. package/src/scripts/skill_tools/score_skill_relevance.ts +36 -53
  394. package/src/scripts/token_sink_report.ts +239 -0
  395. package/src/scripts/trigger_coverage.ts +122 -3
  396. package/src/scripts/update_counts.ts +7 -3
  397. package/src/scripts/validate_frontmatter.ts +66 -0
  398. package/src/server/schemas/settings.ts +5 -0
  399. package/src/shared/skillRanking.ts +183 -0
@@ -0,0 +1,173 @@
1
+ ---
2
+ model_tier: medium
3
+ name: js-library-packaging
4
+ description: "Use when a JavaScript/TypeScript package is consumed by another package — exports map, peer vs. direct dependencies, files allow-list, and whether it should be built at all."
5
+ domain: engineering
6
+ workspaces:
7
+ - engineering
8
+ packs:
9
+ - engineering-base
10
+ ---
11
+
12
+ # js-library-packaging
13
+
14
+ > **Pack placement.** `engineering-base`. The step asked for it to be *suggested by* the
15
+ > `react` and `typescript` packs, and the skill schema carries no `suggested_by` key — so the
16
+ > intent is recorded here rather than expressed in frontmatter that would fail validation.
17
+ > A React or TypeScript consumer receives this skill through `engineering-base`, which both
18
+ > of those packs require.
19
+
20
+ The JavaScript twin of [`composer-packages`](../composer-packages/SKILL.md). A component is
21
+ a file; a **library** is a package with a public surface, and that surface is declared in
22
+ `package.json` rather than inferred. Most of the failures below are silent at author time
23
+ and loud at the consumer's — which is why the surface is read, not assumed.
24
+
25
+ ## The Iron Law
26
+
27
+ ```
28
+ `react` AND `react-dom` ARE peerDependencies. NEVER dependencies.
29
+ `types` IS THE FIRST KEY OF EVERY CONDITIONS OBJECT.
30
+ DECIDE buildable-VS-source-consumed BEFORE WRITING THE EXPORTS MAP.
31
+ NEVER HAND-BUMP A VERSION.
32
+ ```
33
+
34
+ ## When to use
35
+
36
+ A package in the repository is imported by another package, or is about to be published:
37
+ an `exports` map is being written or changed, a hook fails at runtime with *"invalid hook
38
+ call"*, an install fails on a `workspace:` range, a release needs cutting, or the
39
+ buildable-vs-source question has not been answered yet.
40
+
41
+ ## Procedure
42
+
43
+ 1. **Answer buildable-vs-source-consumed FIRST.** It determines the exports map, the `files`
44
+ list, and whether a build step exists at all — deciding it after writing the map means
45
+ rewriting the map.
46
+ - **Source of truth:** is the package published to a registry, or only consumed inside
47
+ this workspace?
48
+ - **Verify:** the exports targets all point into one of the two worlds (`src/` or the
49
+ build directory), never a mix.
50
+ 2. **Read the surface rather than asserting it.** Run the check below over the package root.
51
+ - **Source of truth:** `package.json` — `exports`, `dependencies`, `peerDependencies`,
52
+ `files`, `private`, `publishConfig`.
53
+ - **Verify:** zero `error`-severity findings.
54
+ 3. **Fix peer placement before anything else.** A library carrying `react` in
55
+ `dependencies` gives the consumer a second copy of React.
56
+ - **Verify:** `react` and `react-dom` appear under `peerDependencies` only.
57
+ 4. **Order the conditions.** `types` first, then `import` / `require`.
58
+ - **Verify:** the check reports no `types-not-first`.
59
+ 5. **Cut the release through the repository's own mechanism** — never by editing a version
60
+ field. See § Release.
61
+ - **Verify:** the version change is produced by the tool the repository already carries.
62
+
63
+ ## Read the surface
64
+
65
+ ```
66
+ check_package_surface <library-root> [<library-root> …]
67
+ ```
68
+
69
+ `scripts/check_package_surface.ts` beside this skill. Deterministic, JSON on stdout, no
70
+ network and no subprocess. It reports:
71
+
72
+ | Code | Severity | Why |
73
+ |---|---|---|
74
+ | `peer-as-dependency` | error | two copies of React in one tree break hooks at runtime, with a message that names neither package |
75
+ | `export-target-missing` | error | the manifest promises a file the package does not ship |
76
+ | `no-exports-map` | warn | `main`/`module` without `exports` — the entry point resolves by bundler convention, not by declaration |
77
+ | `types-not-first` | warn | conditions match in declaration order, so a later `types` is never seen and the package silently ships untyped |
78
+ | `workspace-range-publishable` | warn | a `workspace:` range does not resolve outside the workspace; published, the consumer's install fails |
79
+
80
+ **It classifies from the declared export targets, never from a directory name.** A package
81
+ directory called `ui-lib-vite` is not evidence about Vite, and one called `buildable` is not
82
+ evidence that anything builds. A **mixed** declaration is reported as `undeclared` rather
83
+ than resolved to a guess — declaring both is the ambiguity worth surfacing.
84
+
85
+ **What it does not do:** it never compiles and never runs a bundler, so it cannot tell you
86
+ the declared layout is producible. A checker that grew a parser would report compile errors
87
+ as packaging errors, and the two have different fixes.
88
+
89
+ ## Buildable vs. source-consumed
90
+
91
+ | | source-consumed | buildable |
92
+ |---|---|---|
93
+ | exports point at | `src/` | the build directory |
94
+ | build step | none | one, and it must run before publish |
95
+ | `files` | not needed (nothing published) | the build directory, as an allow-list |
96
+ | `private` | `true` on a workspace-only package | absent; `publishConfig.access` set instead |
97
+ | cost | consumer compiles it | a build to maintain, and output that can go stale |
98
+
99
+ **Default to source-consumed inside a workspace.** A build step exists to serve publication;
100
+ adding one for a package nobody publishes is a maintenance cost with no consumer.
101
+
102
+ ## Release
103
+
104
+ Read the repository, then take exactly one branch — **Class A**, per
105
+ [`standards-from-config`](../standards-from-config/SKILL.md): the config *is* the answer.
106
+
107
+ 1. **`.changeset/` present → changesets.** Add a changeset describing the change and let the
108
+ release job bump and publish. Never edit `version` by hand.
109
+ 2. **A task runner with a release command (e.g. `nx release`) → that command.** It owns
110
+ version, tag, and changelog together; splitting them by hand desynchronises them.
111
+ 3. **Neither present → none configured.** **Propose** a mechanism and stop. Do not hand-bump:
112
+ a manually edited version has no changelog entry and no tag, so the next release cannot
113
+ tell what shipped.
114
+
115
+ A breaking change carries the `!` marker and the footer — see
116
+ [`conventional-commits-writing`](../conventional-commits-writing/SKILL.md). The marker is
117
+ what a release tool reads to decide the major bump, so omitting it publishes a breaking
118
+ change as a patch.
119
+
120
+ ## Output format
121
+
122
+ 1. State the classification (source-consumed / built surface / undeclared) and where it was
123
+ read from.
124
+ 2. List every `error` finding with its fix, then the warnings.
125
+ 3. Name the release branch taken and the evidence in the repository for it.
126
+ 4. Say explicitly what was not checked — buildability, types, runtime behaviour.
127
+
128
+ ## Gotchas
129
+
130
+ - **"Invalid hook call" names neither package.** The developer sees a React error and looks
131
+ at their component; the cause is a library shipping its own React. This is why peer
132
+ placement is an error and not a warning.
133
+ - **Condition order is silent.** `{ "import": …, "types": … }` type-checks fine at author
134
+ time and ships untyped to the consumer.
135
+ - **A stale build directory passes every metadata check.** The manifest points at files that
136
+ exist; nothing says they match `src/`. Only a real build proves that.
137
+ - **`files` is an allow-list, not a deny-list.** Adding a directory to the package means
138
+ adding it here, and forgetting is invisible until a consumer imports a missing path.
139
+ - **A `workspace:` range is not a version.** It resolves in the workspace and nowhere else.
140
+
141
+ ## Do NOT
142
+
143
+ - Do NOT put `react` or `react-dom` in `dependencies`.
144
+ - Do NOT write an exports map before answering buildable-vs-source-consumed.
145
+ - Do NOT place `types` after `import` or `require`.
146
+ - Do NOT edit a `version` field by hand, in any of the three release branches.
147
+ - Do NOT claim the package builds because the check passed — it never ran a build.
148
+
149
+ ## Security constraints
150
+
151
+ `scripts/check_package_surface.ts` is **read-only and offline by construction**, and the
152
+ constraint is worth stating because a packaging tool is a tempting place to lose it:
153
+
154
+ - **No network.** It never resolves a version, queries a registry, or checks whether a name
155
+ is taken. Every verdict comes from the manifest in front of it.
156
+ - **No subprocess.** No package manager, no bundler, no compiler. It cannot install, build,
157
+ or publish, so running it on an untrusted repository executes none of that repository's code
158
+ — which a package manager's lifecycle scripts would.
159
+ - **No writes.** It reads `package.json` and tests path existence. It never edits a manifest,
160
+ so it can never "fix" a version field, which is the one thing § Release forbids.
161
+ - **Paths come from the caller, targets from the manifest.** Export targets are resolved
162
+ relative to the given root and used only for an existence test; nothing is read from them.
163
+
164
+ Widening any of these turns a metadata reader into something that runs a third party's code.
165
+ If a future check needs a build, it belongs in a separate integration test with its own
166
+ declared cost — never here.
167
+
168
+ ## See also
169
+
170
+ - [`composer-packages`](../composer-packages/SKILL.md) — the PHP twin; same surface discipline, different manifest.
171
+ - [`standards-from-config`](../standards-from-config/SKILL.md) — the Class-A rule the § Release branch follows.
172
+ - [`conventional-commits-writing`](../conventional-commits-writing/SKILL.md) — the `!` marker a release tool reads.
173
+ - [`ui-component-architect`](../ui-component-architect/SKILL.md) — the component inside the library; this skill is the package around it.
@@ -0,0 +1,17 @@
1
+ {
2
+ "skill": "js-library-packaging",
3
+ "last_eval": "2026-08-23",
4
+ "description": "5 should-trigger + 5 should-not-trigger. Should-trigger covers the publish ask, the runtime symptom whose cause is packaging (invalid hook call), the exports-map question, the workspace-range install failure, and a DE phrasing. Should-not-trigger covers the near-miss neighbours this skill is one word away from: authoring the component itself (ui-component-architect), the PHP twin (composer-packages), a commit-message question (conventional-commits-writing), a monorepo task-graph question, and a bundler performance question — none of which are package-surface work.",
5
+ "queries": [
6
+ { "q": "publish our ui package", "trigger": true },
7
+ { "q": "why does my hook say invalid hook call", "trigger": true },
8
+ { "q": "what should the exports map for this library look like?", "trigger": true },
9
+ { "q": "the install fails on a workspace: range after publishing", "trigger": true },
10
+ { "q": "wie veröffentliche ich unser Komponenten-Paket richtig?", "trigger": true },
11
+ { "q": "build me a Button component with a loading state", "trigger": false },
12
+ { "q": "how do I publish a composer package?", "trigger": false },
13
+ { "q": "write the commit message for this breaking change", "trigger": false },
14
+ { "q": "why is turbo rebuilding everything on every commit?", "trigger": false },
15
+ { "q": "our bundle is 400kb, what should I lazy-load?", "trigger": false }
16
+ ]
17
+ }
@@ -0,0 +1,270 @@
1
+ /**
2
+ * check_package_surface — read a JavaScript library's PACKAGE SURFACE and report what its
3
+ * own `package.json` says, without compiling anything.
4
+ *
5
+ * Scope, stated because the boundary is what keeps this useful: the subject is
6
+ * `package.json` **semantics** — the exports map, peer-dependency placement, the files
7
+ * allow-list, publish intent. It is NOT a build, not a type-check, and not proof that any
8
+ * bundler can produce the declared layout. A checker that grew a parser would start
9
+ * reporting compile errors as packaging errors, and the two have different fixes.
10
+ *
11
+ * The classification (`source-consumed` vs `built-surface`) is read from the DECLARED
12
+ * EXPORT TARGETS, never from the directory name. A fixture called `ui-lib-vite` is not
13
+ * evidence about Vite, and a directory called `buildable` is not evidence that anything
14
+ * builds — both council reviewers named that inference as the thing to avoid.
15
+ *
16
+ * Output is JSON on stdout. No network, no subprocess.
17
+ *
18
+ * Usage:
19
+ * check_package_surface <library-root> [<library-root> …]
20
+ * check_package_surface --self-test
21
+ */
22
+
23
+ import * as fs from 'node:fs';
24
+ import * as path from 'node:path';
25
+
26
+ export type Severity = 'error' | 'warn';
27
+
28
+ export interface Finding {
29
+ readonly code: string;
30
+ readonly severity: Severity;
31
+ readonly message: string;
32
+ }
33
+
34
+ export type Classification = 'source-consumed' | 'built-surface' | 'undeclared';
35
+
36
+ export interface SurfaceReport {
37
+ readonly root: string;
38
+ readonly name: string | null;
39
+ readonly classification: Classification;
40
+ readonly findings: readonly Finding[];
41
+ }
42
+
43
+ /** Peer-only packages: a library that bundles these ships a second copy of them. */
44
+ const PEER_ONLY = ['react', 'react-dom'] as const;
45
+
46
+ const asRecord = (v: unknown): Record<string, unknown> =>
47
+ v !== null && typeof v === 'object' && !Array.isArray(v) ? (v as Record<string, unknown>) : {};
48
+
49
+ /** Every string target reachable in an exports map, at any nesting depth. */
50
+ export const exportTargets = (exportsField: unknown): string[] => {
51
+ const out: string[] = [];
52
+ const walk = (node: unknown): void => {
53
+ if (typeof node === 'string') {
54
+ out.push(node);
55
+ return;
56
+ }
57
+ if (Array.isArray(node)) {
58
+ for (const n of node) walk(n);
59
+ return;
60
+ }
61
+ for (const v of Object.values(asRecord(node))) walk(v);
62
+ };
63
+ walk(exportsField);
64
+ return out;
65
+ };
66
+
67
+ /**
68
+ * Classify from the declared targets.
69
+ *
70
+ * A package whose targets all point into a source directory is source-consumed; one whose
71
+ * targets point at build output is a built surface. **Mixed is `undeclared`, not a guess** —
72
+ * a package that declares both is making a statement this check cannot resolve, and picking
73
+ * one silently would hide exactly the ambiguity worth reporting.
74
+ */
75
+ export const classify = (targets: readonly string[]): Classification => {
76
+ if (targets.length === 0) return 'undeclared';
77
+ const built = targets.filter((t) => /(^|\/)(dist|build|lib|out)\//.test(t));
78
+ if (built.length === targets.length) return 'built-surface';
79
+ if (built.length === 0) return 'source-consumed';
80
+ return 'undeclared';
81
+ };
82
+
83
+ export const checkPackage = (root: string): SurfaceReport => {
84
+ const manifestPath = path.join(root, 'package.json');
85
+ let manifest: Record<string, unknown> = {};
86
+ try {
87
+ manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8')) as Record<string, unknown>;
88
+ } catch {
89
+ return {
90
+ root,
91
+ name: null,
92
+ classification: 'undeclared',
93
+ findings: [{ code: 'no-manifest', severity: 'error', message: `no readable package.json at ${manifestPath}` }],
94
+ };
95
+ }
96
+
97
+ const findings: Finding[] = [];
98
+ const deps = asRecord(manifest['dependencies']);
99
+ const peers = asRecord(manifest['peerDependencies']);
100
+ const exportsField = manifest['exports'];
101
+ const targets = exportTargets(exportsField);
102
+
103
+ // (a) — the "invalid hook call" failure. Two copies of React in one tree break hooks at
104
+ // runtime with an error that names neither package, which is why this is an error and
105
+ // not a warning.
106
+ for (const p of PEER_ONLY) {
107
+ if (Object.prototype.hasOwnProperty.call(deps, p)) {
108
+ findings.push({
109
+ code: 'peer-as-dependency',
110
+ severity: 'error',
111
+ message: `\`${p}\` is in dependencies; a library must declare it as a peerDependency or the consumer gets two copies (the "invalid hook call" failure)`,
112
+ });
113
+ }
114
+ }
115
+
116
+ // (b) — legacy entry fields with no exports map: the resolution the consumer gets then
117
+ // depends on their bundler rather than on this manifest.
118
+ const hasLegacy = ['main', 'module', 'browser'].some((k) => typeof manifest[k] === 'string');
119
+ if (exportsField === undefined && hasLegacy) {
120
+ findings.push({
121
+ code: 'no-exports-map',
122
+ severity: 'warn',
123
+ message: 'main/module present without an exports map — the entry point resolves by bundler convention, not by declaration',
124
+ });
125
+ }
126
+
127
+ // (c) — `types` must be the FIRST key of a conditions object. Conditional exports are
128
+ // matched in declaration order, so a `types` key placed after `import` is skipped by
129
+ // resolvers that match `import` first, and the package silently ships untyped.
130
+ const walkConditions = (node: unknown, at: string): void => {
131
+ const rec = asRecord(node);
132
+ const keys = Object.keys(rec);
133
+ if (keys.includes('types') && keys[0] !== 'types') {
134
+ findings.push({
135
+ code: 'types-not-first',
136
+ severity: 'warn',
137
+ message: `\`types\` is not the first condition at \`${at}\` (order matters: a resolver matching \`${keys[0] ?? ''}\` first never sees it)`,
138
+ });
139
+ }
140
+ for (const [k, v] of Object.entries(rec)) {
141
+ if (typeof v === 'object' && v !== null) walkConditions(v, `${at}${k}/`);
142
+ }
143
+ };
144
+ if (exportsField !== undefined) walkConditions(exportsField, 'exports.');
145
+
146
+ // (d) — a `workspace:` range only resolves inside the workspace. Published with no
147
+ // `private: true` and no publishConfig, the consumer's install fails on a protocol
148
+ // their registry has never heard of.
149
+ const allDeps = { ...deps, ...asRecord(manifest['devDependencies']), ...peers };
150
+ const workspaceRanges = Object.entries(allDeps).filter(([, v]) => typeof v === 'string' && v.startsWith('workspace:'));
151
+ if (
152
+ workspaceRanges.length > 0 &&
153
+ manifest['private'] !== true &&
154
+ manifest['publishConfig'] === undefined
155
+ ) {
156
+ findings.push({
157
+ code: 'workspace-range-publishable',
158
+ severity: 'warn',
159
+ message: `${String(workspaceRanges.length)} \`workspace:\` range(s) in a package that is neither private nor carrying publishConfig — the protocol does not resolve outside the workspace`,
160
+ });
161
+ }
162
+
163
+ // A declared target that is not in the tree is the drift the whole surface rests on.
164
+ for (const t of targets) {
165
+ if (!t.startsWith('.')) continue;
166
+ if (!fs.existsSync(path.join(root, t))) {
167
+ findings.push({
168
+ code: 'export-target-missing',
169
+ severity: 'error',
170
+ message: `exports target \`${t}\` does not exist in the package`,
171
+ });
172
+ }
173
+ }
174
+
175
+ const name = typeof manifest['name'] === 'string' ? manifest['name'] : null;
176
+ return { root, name, classification: classify(targets), findings };
177
+ };
178
+
179
+ /** Registry item types deprecated in v4 — writing one produces an item the CLI cannot read. */
180
+ const DEPRECATED_ITEM_TYPES = ['registry:build', 'registry:mcp'] as const;
181
+
182
+ /**
183
+ * Check a `registry.json` (or a single `registry-item.json`) published by a library.
184
+ *
185
+ * Same subject as the manifest checks: what the file DECLARES. A registry item that lists
186
+ * `react` in `dependencies` reproduces the two-copies-of-React failure one layer up — the
187
+ * consumer's app already has React, and the item installs a second.
188
+ */
189
+ export const checkRegistry = (file: string): Finding[] => {
190
+ let doc: Record<string, unknown> = {};
191
+ try {
192
+ doc = JSON.parse(fs.readFileSync(file, 'utf8')) as Record<string, unknown>;
193
+ } catch {
194
+ return [{ code: 'no-registry', severity: 'error', message: `no readable registry JSON at ${file}` }];
195
+ }
196
+ // Both shapes are legal: an index with `items`, or a single item.
197
+ const items = Array.isArray(doc['items']) ? (doc['items'] as unknown[]) : [doc];
198
+ const findings: Finding[] = [];
199
+ for (const raw of items) {
200
+ const item = asRecord(raw);
201
+ const name = typeof item['name'] === 'string' ? item['name'] : '(unnamed)';
202
+ const deps = Array.isArray(item['dependencies']) ? (item['dependencies'] as unknown[]) : [];
203
+ for (const d of deps) {
204
+ const dep = String(d).split('@')[0];
205
+ if (PEER_ONLY.includes(dep as (typeof PEER_ONLY)[number])) {
206
+ findings.push({
207
+ code: 'registry-item-bundles-peer',
208
+ severity: 'error',
209
+ message: `registry item \`${name}\` lists \`${dep}\` in dependencies; the consuming app already has it, and installing a second copy is the same "invalid hook call" failure one layer up`,
210
+ });
211
+ }
212
+ }
213
+ const type = typeof item['type'] === 'string' ? item['type'] : '';
214
+ if (DEPRECATED_ITEM_TYPES.includes(type as (typeof DEPRECATED_ITEM_TYPES)[number])) {
215
+ findings.push({
216
+ code: 'registry-item-deprecated-type',
217
+ severity: 'error',
218
+ message: `registry item \`${name}\` uses \`${type}\`, deprecated in v4 — use \`registry:base\` or \`registry:font\``,
219
+ });
220
+ }
221
+ }
222
+ return findings;
223
+ };
224
+
225
+ const selfTest = (): number => {
226
+ let failed = 0;
227
+ const check = (label: string, cond: boolean): void => {
228
+ if (!cond) {
229
+ process.stderr.write(`❌ ${label}\n`);
230
+ failed += 1;
231
+ }
232
+ };
233
+
234
+ check('a source target classifies as source-consumed', classify(['./src/index.ts']) === 'source-consumed');
235
+ check('a dist target classifies as built-surface', classify(['./dist/index.js']) === 'built-surface');
236
+ check('a MIXED declaration is undeclared, never guessed', classify(['./src/index.ts', './dist/index.js']) === 'undeclared');
237
+ check('no targets is undeclared', classify([]) === 'undeclared');
238
+ check(
239
+ 'nested conditions are all collected',
240
+ exportTargets({ '.': { types: './a.d.ts', import: './b.js' } }).length === 2,
241
+ );
242
+
243
+ process.stdout.write(
244
+ failed === 0 ? '✅ check_package_surface: self-test passed\n' : `❌ ${String(failed)} failure(s)\n`,
245
+ );
246
+ return failed === 0 ? 0 : 1;
247
+ };
248
+
249
+ const main = (): number => {
250
+ const argv = process.argv.slice(2);
251
+ if (argv.includes('--self-test')) return selfTest();
252
+ const roots = argv.filter((a) => !a.startsWith('--'));
253
+ if (roots.length === 0) {
254
+ process.stderr.write('usage: check_package_surface <library-root> [...]\n');
255
+ return 2;
256
+ }
257
+ // A path ending in a registry file is checked as a registry, not as a package root —
258
+ // otherwise the caller has to know which of two checkers to reach for.
259
+ const reports = roots.map((r) =>
260
+ /registry(-item)?\.json$/.test(r)
261
+ ? { root: r, name: null, classification: 'undeclared' as Classification, findings: checkRegistry(r) }
262
+ : checkPackage(r),
263
+ );
264
+ process.stdout.write(`${JSON.stringify({ reports }, null, 2)}\n`);
265
+ return reports.some((r) => r.findings.some((f) => f.severity === 'error')) ? 1 : 0;
266
+ };
267
+
268
+ if (process.argv[1] !== undefined && process.argv[1].includes('check_package_surface')) {
269
+ process.exit(main());
270
+ }
@@ -13,6 +13,9 @@ trust:
13
13
  install:
14
14
  default: false
15
15
  removable: true
16
+ triggers:
17
+ - phrase: "make:migration"
18
+ - phrase: "laravel migration"
16
19
  ---
17
20
 
18
21
  # laravel-migration
@@ -4,6 +4,9 @@ name: learning-to-rule-or-skill
4
4
  description: "Use when a repeated learning, mistake, or successful pattern should be turned into a new rule or skill. Also use after completing a task to capture learnings from the work."
5
5
  source: project
6
6
  domain: process
7
+ scope:
8
+ write: []
9
+ verification_reason: "execution.handler is internal, so this skill spawns no subprocess — writes happen through the agent's declared allowed_tools. No command can prove a scope the skill never executes."
7
10
  execution:
8
11
  type: assisted
9
12
  handler: internal
@@ -3,6 +3,9 @@ model_tier: medium
3
3
  name: lint-skills
4
4
  description: "Use when running the package's skill linter against all skills and rules to validate frontmatter, required sections, and execution metadata."
5
5
  domain: process
6
+ scope:
7
+ write: []
8
+ verification_reason: "the declared command is a read-only linter: grep -c 'writeFileSync|mkdirSync|appendFileSync' src/scripts/skill_linter.ts returns 0. Absence of a write is not something a command can prove."
6
9
  execution:
7
10
  type: assisted
8
11
  handler: shell
@@ -18,6 +18,9 @@ trust:
18
18
  level: experimental
19
19
  install:
20
20
  removable: true
21
+ scope:
22
+ write: []
23
+ verification_reason: "execution declares no handler, so this skill runs nothing of its own — every write is the calling agent's, under the rules that govern it. No command can prove a scope the skill never executes."
21
24
  execution:
22
25
  type: manual
23
26
  ---