@punks/cli 3.1.3 → 3.1.5

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 (778) hide show
  1. package/dist/BASELINE_CHANGELOG.md +52 -0
  2. package/dist/CHANGELOG.md +83 -0
  3. package/dist/data/hooks/format-edited-file.mjs +97 -28
  4. package/dist/data/subagents/manifest.mjs +3 -1
  5. package/dist/index.js +148 -185
  6. package/dist/skills/agnostic/docs/docs-onboarding/SKILL.md +4 -3
  7. package/dist/skills/agnostic/docs/docs-onboarding/agents/openai.yaml +1 -1
  8. package/dist/skills/agnostic/docs/docs-onboarding/references/artifact-contract.md +3 -1
  9. package/dist/skills/agnostic/docs/writing-for-agents/SKILL-MECHANICS.md +22 -0
  10. package/dist/skills/agnostic/docs/writing-for-agents/SKILL.md +81 -0
  11. package/dist/skills/agnostic/docs/writing-for-agents/UPSTREAM.md +9 -0
  12. package/dist/skills/agnostic/planning/create-plan/SKILL.md +27 -15
  13. package/dist/skills/agnostic/planning/create-plan/references/backlog-sync.md +19 -32
  14. package/dist/skills/agnostic/planning/create-plan/references/plan-schema.md +14 -0
  15. package/dist/skills/agnostic/planning/create-plan/references/planner-task-graph.md +5 -1
  16. package/dist/skills/agnostic/planning/create-plan/references/stop-conditions.md +2 -1
  17. package/dist/skills/agnostic/planning/create-spec/SKILL.md +51 -105
  18. package/dist/skills/agnostic/planning/create-spec/assets/SPEC-TEMPLATE.md +26 -57
  19. package/dist/skills/agnostic/planning/create-spec/references/folder-naming.md +6 -3
  20. package/dist/skills/agnostic/planning/create-spec/references/readiness.md +41 -0
  21. package/dist/skills/agnostic/planning/create-spec/references/spec-quality-bar.md +15 -6
  22. package/dist/skills/agnostic/planning/create-spec/references/wiki-bookkeeping.md +3 -3
  23. package/dist/skills/agnostic/planning/implement-spec/SKILL.md +21 -54
  24. package/dist/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +0 -4
  25. package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +13 -15
  26. package/dist/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +7 -4
  27. package/dist/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +4 -2
  28. package/dist/skills/agnostic/planning/implement-spec/references/parallel.md +9 -35
  29. package/dist/skills/agnostic/planning/wayfinder/SKILL.md +11 -8
  30. package/dist/skills/agnostic/requirements/requirements-grill/SKILL.md +4 -3
  31. package/dist/skills/agnostic/requirements/write-backlog/EXAMPLES.md +25 -73
  32. package/dist/skills/agnostic/requirements/write-backlog/REFERENCE.md +54 -305
  33. package/dist/skills/agnostic/requirements/write-backlog/SKILL.md +46 -55
  34. package/dist/skills/agnostic/requirements/write-backlog/assets/concepts/backlog-model.md +33 -119
  35. package/dist/skills/agnostic/requirements/write-backlog/assets/concepts/story-shape.md +24 -14
  36. package/dist/skills/agnostic/requirements/write-backlog/assets/providers/azure-devops-create-payload.md +53 -11
  37. package/dist/skills/agnostic/requirements/write-backlog/assets/providers/github-projects-create-payload.md +48 -26
  38. package/dist/skills/agnostic/requirements/write-backlog/assets/providers/linear-create-payload.md +53 -12
  39. package/dist/skills/agnostic/requirements/write-backlog/assets/providers/monday-create-payload.md +49 -33
  40. package/dist/skills/agnostic/research/parallel-research/DURABLE-REPORT.md +33 -0
  41. package/dist/skills/agnostic/research/parallel-research/SKILL.md +13 -3
  42. package/dist/{baseline/scaffold-baseline/skills/frameworks/effect/effect → skills/agnostic/research/prototype}/LICENSE +1 -1
  43. package/dist/skills/agnostic/research/prototype/LOGIC.md +57 -21
  44. package/dist/skills/agnostic/research/prototype/SKILL.md +17 -15
  45. package/dist/skills/agnostic/research/prototype/UI.md +12 -5
  46. package/dist/skills/agnostic/research/prototype/UPSTREAM.md +11 -0
  47. package/dist/skills/frameworks/effect/effect/SKILL.md +5 -12
  48. package/dist/skills/frameworks/effect/effect/references/CONFIG.md +10 -19
  49. package/dist/skills/frameworks/effect/effect/references/SERVICES_LAYERS.md +3 -63
  50. package/dist/skills/frameworks/effect/effect/references/TESTING.md +2 -72
  51. package/dist/skills/frameworks/effect/effect-backend-structure/SKILL.md +12 -29
  52. package/dist/skills/frameworks/effect/effect-backend-structure/agents/openai.yaml +1 -1
  53. package/dist/skills/frameworks/effect/effect-backend-structure/references/layout.md +9 -9
  54. package/dist/{baseline/scaffold-baseline/skills/agnostic/docs/upstream/mattpocock-writing-skills.md → skills/frameworks/effect/effect-service-design/LICENSE} +0 -20
  55. package/dist/skills/frameworks/effect/effect-service-design/SKILL.md +124 -0
  56. package/dist/skills/frameworks/effect/effect-service-design/references/AUDIT.md +98 -0
  57. package/dist/skills/misc/wait-what/LICENSE +21 -0
  58. package/dist/skills/misc/wait-what/SKILL.md +7 -0
  59. package/dist/skills/misc/wait-what/UPSTREAM.md +9 -0
  60. package/dist/skills/phases/delivery-phase/SKILL.md +4 -3
  61. package/dist/skills/phases/delivery-phase/phases/backlog.md +31 -0
  62. package/dist/skills/phases/delivery-phase/phases/implement.md +5 -4
  63. package/dist/skills/phases/delivery-phase/phases/plan.md +6 -4
  64. package/dist/skills/phases/delivery-phase/phases/router.md +16 -14
  65. package/dist/skills/phases/delivery-phase/phases/spec.md +9 -5
  66. package/dist/skills/phases/delivery-phase/references/artifact-state.md +9 -2
  67. package/dist/skills/phases/design-phase/phases/backlog.md +4 -4
  68. package/dist/skills/phases/design-phase/phases/prototype.md +1 -1
  69. package/dist/skills/phases/docs-ingest-phase/phases/private-internal.md +3 -1
  70. package/dist/skills/phases/docs-ingest-phase/references/learning-artifacts.md +8 -1
  71. package/dist/skills/phases/finder-phase/SKILL.md +24 -24
  72. package/dist/skills/phases/finder-phase/agents/openai.yaml +1 -1
  73. package/dist/skills/phases/finder-phase/references/convergence.md +39 -0
  74. package/dist/skills/phases/finder-phase/references/frontier-lifecycle.md +22 -16
  75. package/dist/skills/phases/finder-phase/references/root-routing.md +3 -2
  76. package/dist/skills/phases/prototype-phase/SKILL.md +34 -0
  77. package/dist/skills/phases/prototype-phase/VERDICT-TEMPLATE.md +16 -0
  78. package/dist/skills/phases/requirements-phase/SKILL.md +14 -57
  79. package/dist/tsconfig.tsbuildinfo +1 -1
  80. package/package.json +50 -9
  81. package/dist/baseline/scaffold-baseline/baseline.json +0 -12
  82. package/dist/baseline/scaffold-baseline/data/catalog/hooks.json +0 -16
  83. package/dist/baseline/scaffold-baseline/data/catalog/lint-assets.json +0 -208
  84. package/dist/baseline/scaffold-baseline/data/catalog/packs.json +0 -617
  85. package/dist/baseline/scaffold-baseline/data/catalog/skills.json +0 -756
  86. package/dist/baseline/scaffold-baseline/data/catalog/tools.json +0 -91
  87. package/dist/baseline/scaffold-baseline/data/hooks/format-edited-file.mjs +0 -732
  88. package/dist/baseline/scaffold-baseline/data/hooks/scaffold-update-check.mjs +0 -234
  89. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/claude.d.mts +0 -3
  90. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/claude.mjs +0 -124
  91. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/claude.test.ts +0 -130
  92. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/codex.d.mts +0 -3
  93. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/codex.mjs +0 -137
  94. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/codex.test.ts +0 -135
  95. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/cursor.d.mts +0 -5
  96. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/cursor.mjs +0 -106
  97. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/cursor.test.ts +0 -138
  98. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/opencode.d.mts +0 -5
  99. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/opencode.mjs +0 -100
  100. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/opencode.test.ts +0 -123
  101. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/apply.d.mts +0 -12
  102. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/apply.mjs +0 -96
  103. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/contract.test.ts +0 -875
  104. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/contract.ts +0 -206
  105. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/core.d.mts +0 -8
  106. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/core.mjs +0 -239
  107. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/application-context-plan.json +0 -27
  108. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/claude/actions.json +0 -109
  109. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/claude/context-plan.json +0 -150
  110. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/claude/matrix.json +0 -23
  111. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/claude/traces.json +0 -15
  112. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/codex/actions.json +0 -124
  113. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/codex/context-plan.json +0 -150
  114. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/codex/matrix.json +0 -23
  115. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/codex/traces.json +0 -15
  116. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/cursor/compiler-input.json +0 -93
  117. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/cursor/context-plan.json +0 -108
  118. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/cursor/matrix.json +0 -19
  119. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/cursor/projection.json +0 -54
  120. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/mixed-context-plan.json +0 -35
  121. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/opencode/compiler-input.json +0 -93
  122. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/opencode/context-plan.json +0 -108
  123. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/opencode/matrix.json +0 -19
  124. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/test-fixtures/opencode/projection.json +0 -51
  125. package/dist/baseline/scaffold-baseline/data/scripts/sync-subagents.mjs +0 -2478
  126. package/dist/baseline/scaffold-baseline/data/scripts/sync-subagents.test.ts +0 -3150
  127. package/dist/baseline/scaffold-baseline/data/subagents/manifest.mjs +0 -487
  128. package/dist/baseline/scaffold-baseline/data/subagents/manifest.test.ts +0 -56
  129. package/dist/baseline/scaffold-baseline/skills/agnostic/backend/backend-domain-structure/SKILL.md +0 -62
  130. package/dist/baseline/scaffold-baseline/skills/agnostic/backend/backend-domain-structure/agents/openai.yaml +0 -4
  131. package/dist/baseline/scaffold-baseline/skills/agnostic/backend/backend-domain-structure/references/layout.md +0 -225
  132. package/dist/baseline/scaffold-baseline/skills/agnostic/backend/backend-recoverable-actions/SKILL.md +0 -49
  133. package/dist/baseline/scaffold-baseline/skills/agnostic/backend/backend-recoverable-actions/agents/openai.yaml +0 -4
  134. package/dist/baseline/scaffold-baseline/skills/agnostic/backend/backend-recoverable-actions/references/strategy-matrix.md +0 -34
  135. package/dist/baseline/scaffold-baseline/skills/agnostic/backend/backend-recoverable-actions/references/test-matrix.md +0 -34
  136. package/dist/baseline/scaffold-baseline/skills/agnostic/backend/logging-best-practices/SKILL.md +0 -127
  137. package/dist/baseline/scaffold-baseline/skills/agnostic/backend/logging-best-practices/rules/context.md +0 -157
  138. package/dist/baseline/scaffold-baseline/skills/agnostic/backend/logging-best-practices/rules/pitfalls.md +0 -118
  139. package/dist/baseline/scaffold-baseline/skills/agnostic/backend/logging-best-practices/rules/structure.md +0 -193
  140. package/dist/baseline/scaffold-baseline/skills/agnostic/backend/logging-best-practices/rules/wide-events.md +0 -113
  141. package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/SKILL.md +0 -37
  142. package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/commands.md +0 -77
  143. package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/post-command-flow.md +0 -127
  144. package/dist/baseline/scaffold-baseline/skills/agnostic/debug/debug-agent/SKILL.md +0 -184
  145. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/docs-onboarding/SKILL.md +0 -46
  146. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/docs-onboarding/agents/openai.yaml +0 -4
  147. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/docs-onboarding/references/artifact-contract.md +0 -67
  148. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-beats/SKILL.md +0 -69
  149. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-fragments/SKILL.md +0 -76
  150. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-great-skills/GLOSSARY.md +0 -69
  151. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-great-skills/SKILL.md +0 -61
  152. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/writing-shape/SKILL.md +0 -75
  153. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/agent-browser/.clawdhub/origin.json +0 -7
  154. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/agent-browser/SKILL.md +0 -229
  155. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/agent-browser/references/authentication.md +0 -202
  156. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/agent-browser/references/commands.md +0 -259
  157. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/agent-browser/references/proxy-support.md +0 -188
  158. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/agent-browser/references/session-management.md +0 -193
  159. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/agent-browser/references/snapshot-refs.md +0 -194
  160. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/agent-browser/references/video-recording.md +0 -173
  161. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/agent-browser/templates/authenticated-session.sh +0 -97
  162. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/agent-browser/templates/capture-workflow.sh +0 -69
  163. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/agent-browser/templates/form-automation.sh +0 -62
  164. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/design-taste-frontend/SKILL.md +0 -1206
  165. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/frontend-domain-structure/SKILL.md +0 -55
  166. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/frontend-domain-structure/agents/openai.yaml +0 -4
  167. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/frontend-domain-structure/references/react/structure.md +0 -102
  168. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/frontend-domain-structure/references/structure.md +0 -257
  169. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/gpt-taste/SKILL.md +0 -74
  170. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/imagegen-frontend-mobile/SKILL.md +0 -1465
  171. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/imagegen-frontend-web/SKILL.md +0 -987
  172. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/redesign-existing-projects/SKILL.md +0 -178
  173. package/dist/baseline/scaffold-baseline/skills/agnostic/generic/handoff/SKILL.md +0 -15
  174. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/REFERENCE.md +0 -39
  175. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/SKILL.md +0 -92
  176. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/backlog-sync.md +0 -44
  177. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/grill-ambiguity.md +0 -66
  178. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/plan-schema.md +0 -112
  179. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/planner-task-graph.md +0 -42
  180. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/stop-conditions.md +0 -18
  181. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/tdd-shaping.md +0 -49
  182. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/SKILL.md +0 -109
  183. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/assets/SPEC-TEMPLATE.md +0 -92
  184. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/backlog-sync.md +0 -49
  185. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/discovery.md +0 -54
  186. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/folder-naming.md +0 -33
  187. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/grill-phase.md +0 -42
  188. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/questioning.md +0 -51
  189. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/spec-quality-bar.md +0 -59
  190. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/wiki-bookkeeping.md +0 -50
  191. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/SKILL.md +0 -105
  192. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +0 -71
  193. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/lifecycle.md +0 -220
  194. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +0 -107
  195. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +0 -86
  196. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel.md +0 -56
  197. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/runtime-product-validation.md +0 -50
  198. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/sequential.md +0 -48
  199. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/ui-screenshot-evidence.md +0 -61
  200. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/stack/SKILL.md +0 -89
  201. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/swarm-planner/SKILL.md +0 -179
  202. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/wayfinder/SKILL.md +0 -42
  203. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/autoreview/SKILL.md +0 -191
  204. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/autoreview/scripts/autoreview +0 -1176
  205. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/autoreview/scripts/test-review-harness +0 -176
  206. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/codebase-design/DEEPENING.md +0 -34
  207. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/codebase-design/DESIGN-IT-TWICE.md +0 -43
  208. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/codebase-design/SKILL.md +0 -60
  209. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/review/SKILL.md +0 -89
  210. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/simplify/SKILL.md +0 -14
  211. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/tdd/SKILL.md +0 -139
  212. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/tdd/deep-modules.md +0 -33
  213. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/tdd/high-signal-tests.md +0 -39
  214. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/tdd/interface-design.md +0 -31
  215. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/tdd/mocking.md +0 -59
  216. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/tdd/refactoring.md +0 -10
  217. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/tdd/tests.md +0 -61
  218. package/dist/baseline/scaffold-baseline/skills/agnostic/repo-asset-management/SKILL.md +0 -28
  219. package/dist/baseline/scaffold-baseline/skills/agnostic/repo-asset-management/references/acceptance.md +0 -6
  220. package/dist/baseline/scaffold-baseline/skills/agnostic/repo-asset-management/references/azure.md +0 -11
  221. package/dist/baseline/scaffold-baseline/skills/agnostic/repo-asset-management/references/bitbucket.md +0 -8
  222. package/dist/baseline/scaffold-baseline/skills/agnostic/repo-asset-management/references/github.md +0 -11
  223. package/dist/baseline/scaffold-baseline/skills/agnostic/repo-asset-management/references/gitlab.md +0 -11
  224. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/grilling/SKILL.md +0 -14
  225. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/grilling/UPSTREAM.md +0 -16
  226. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/SKILL.md +0 -44
  227. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/references/artifact-output.md +0 -181
  228. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/references/grilling-flow.md +0 -58
  229. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/references/wiki-output.md +0 -101
  230. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/EXAMPLES.md +0 -89
  231. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/REFERENCE.md +0 -357
  232. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/SKILL.md +0 -103
  233. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/concepts/backlog-model.md +0 -155
  234. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/concepts/story-shape.md +0 -172
  235. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/azure-devops-create-payload.md +0 -129
  236. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/github-projects-create-payload.md +0 -280
  237. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/linear-create-payload.md +0 -114
  238. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/monday-create-payload.md +0 -220
  239. package/dist/baseline/scaffold-baseline/skills/agnostic/research/improve-codebase-architecture/REFERENCE.md +0 -78
  240. package/dist/baseline/scaffold-baseline/skills/agnostic/research/improve-codebase-architecture/SKILL.md +0 -80
  241. package/dist/baseline/scaffold-baseline/skills/agnostic/research/parallel-research/SKILL.md +0 -71
  242. package/dist/baseline/scaffold-baseline/skills/agnostic/research/parallel-research/agents/openai.yaml +0 -4
  243. package/dist/baseline/scaffold-baseline/skills/agnostic/research/prototype/LOGIC.md +0 -31
  244. package/dist/baseline/scaffold-baseline/skills/agnostic/research/prototype/SKILL.md +0 -31
  245. package/dist/baseline/scaffold-baseline/skills/agnostic/research/prototype/UI.md +0 -29
  246. package/dist/baseline/scaffold-baseline/skills/agnostic/security/audit-cicd-security/SKILL.md +0 -58
  247. package/dist/baseline/scaffold-baseline/skills/agnostic/security/audit-cicd-security/agents/openai.yaml +0 -4
  248. package/dist/baseline/scaffold-baseline/skills/agnostic/security/audit-cicd-security/references/argo-workflows.md +0 -25
  249. package/dist/baseline/scaffold-baseline/skills/agnostic/security/audit-cicd-security/references/azure-pipelines.md +0 -27
  250. package/dist/baseline/scaffold-baseline/skills/agnostic/security/audit-cicd-security/references/bitbucket-pipelines.md +0 -26
  251. package/dist/baseline/scaffold-baseline/skills/agnostic/security/audit-cicd-security/references/buildkite.md +0 -26
  252. package/dist/baseline/scaffold-baseline/skills/agnostic/security/audit-cicd-security/references/circleci.md +0 -25
  253. package/dist/baseline/scaffold-baseline/skills/agnostic/security/audit-cicd-security/references/github-actions.md +0 -24
  254. package/dist/baseline/scaffold-baseline/skills/agnostic/security/audit-cicd-security/references/gitlab-cicd.md +0 -27
  255. package/dist/baseline/scaffold-baseline/skills/agnostic/security/audit-cicd-security/references/jenkins.md +0 -26
  256. package/dist/baseline/scaffold-baseline/skills/agnostic/security/audit-cicd-security/references/tekton.md +0 -24
  257. package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/LICENSE.txt +0 -201
  258. package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/SKILL.md +0 -86
  259. package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/agents/openai.yaml +0 -4
  260. package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/references/golang-general-backend-security.md +0 -826
  261. package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/references/javascript-express-web-server-security.md +0 -1158
  262. package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/references/javascript-general-web-frontend-security.md +0 -747
  263. package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/references/javascript-jquery-web-frontend-security.md +0 -678
  264. package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/references/javascript-typescript-nextjs-web-server-security.md +0 -1144
  265. package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/references/javascript-typescript-react-web-frontend-security.md +0 -990
  266. package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/references/javascript-typescript-vue-web-frontend-security.md +0 -791
  267. package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/references/python-django-web-server-security.md +0 -882
  268. package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/references/python-fastapi-web-server-security.md +0 -1036
  269. package/dist/baseline/scaffold-baseline/skills/agnostic/security/security-best-practices/references/python-flask-web-server-security.md +0 -705
  270. package/dist/baseline/scaffold-baseline/skills/agnostic/subagents/swarm-planner/SKILL.md +0 -179
  271. package/dist/baseline/scaffold-baseline/skills/frameworks/better-auth/better-auth-best-practices/SKILL.md +0 -166
  272. package/dist/baseline/scaffold-baseline/skills/frameworks/better-auth/better-auth-security-best-practices/SKILL.MD +0 -432
  273. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/SKILL.md +0 -100
  274. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/UPSTREAM.md +0 -11
  275. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/CACHING.md +0 -76
  276. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/CONFIG.md +0 -67
  277. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/EFFECT_ATOM.md +0 -257
  278. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/HTTP_CLIENTS.md +0 -101
  279. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/OBSERVABILITY.md +0 -88
  280. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/SCHEDULING.md +0 -135
  281. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/SCHEMA.md +0 -130
  282. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/SERVICES_LAYERS.md +0 -168
  283. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/STREAMS.md +0 -135
  284. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect/references/TESTING.md +0 -118
  285. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-backend-structure/SKILL.md +0 -95
  286. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-backend-structure/agents/openai.yaml +0 -4
  287. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-backend-structure/references/layout.md +0 -68
  288. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-recoverable-actions/SKILL.md +0 -65
  289. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-recoverable-actions/agents/openai.yaml +0 -4
  290. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-recoverable-actions/references/flow-examples.md +0 -154
  291. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-recoverable-actions/references/source-backed-primitives.md +0 -104
  292. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-recoverable-actions/references/strategy-matrix.md +0 -34
  293. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-recoverable-actions/references/test-matrix.md +0 -36
  294. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/SKILL.md +0 -475
  295. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/basic.ts +0 -9
  296. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/body-parser.ts +0 -33
  297. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/complex.ts +0 -112
  298. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/cookie.ts +0 -45
  299. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/error.ts +0 -38
  300. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/file.ts +0 -10
  301. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/guard.ts +0 -34
  302. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/map-response.ts +0 -15
  303. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/redirect.ts +0 -6
  304. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/rename.ts +0 -32
  305. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/schema.ts +0 -61
  306. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/state.ts +0 -6
  307. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/upload-file.ts +0 -20
  308. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/examples/websocket.ts +0 -25
  309. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/ai-sdk.md +0 -92
  310. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/astro.md +0 -59
  311. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/better-auth.md +0 -117
  312. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/cloudflare-worker.md +0 -95
  313. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/deno.md +0 -34
  314. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/drizzle.md +0 -258
  315. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/expo.md +0 -95
  316. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/nextjs.md +0 -103
  317. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/nodejs.md +0 -64
  318. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/nuxt.md +0 -67
  319. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/prisma.md +0 -93
  320. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/react-email.md +0 -134
  321. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/sveltekit.md +0 -53
  322. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/tanstack-start.md +0 -87
  323. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/integrations/vercel.md +0 -55
  324. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/patterns/mvc.md +0 -380
  325. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/plugins/bearer.md +0 -30
  326. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/plugins/cors.md +0 -141
  327. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/plugins/cron.md +0 -265
  328. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/plugins/graphql-apollo.md +0 -90
  329. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/plugins/graphql-yoga.md +0 -87
  330. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/plugins/html.md +0 -188
  331. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/plugins/jwt.md +0 -197
  332. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/plugins/openapi.md +0 -246
  333. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/plugins/opentelemetry.md +0 -167
  334. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/plugins/server-timing.md +0 -71
  335. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/plugins/static.md +0 -84
  336. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/references/bun-fullstack-dev-server.md +0 -129
  337. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/references/cookie.md +0 -187
  338. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/references/deployment.md +0 -413
  339. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/references/eden.md +0 -158
  340. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/references/lifecycle.md +0 -198
  341. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/references/macro.md +0 -83
  342. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/references/plugin.md +0 -207
  343. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/references/route.md +0 -331
  344. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/references/testing.md +0 -385
  345. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/references/validation.md +0 -491
  346. package/dist/baseline/scaffold-baseline/skills/frameworks/elysia/elysiajs/references/websocket.md +0 -250
  347. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/add-app-clip/SKILL.md +0 -280
  348. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/add-app-clip/agents/openai.yaml +0 -4
  349. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/add-app-clip/references/native-module.md +0 -96
  350. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/SKILL.md +0 -377
  351. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/agents/openai.yaml +0 -4
  352. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/animations.md +0 -220
  353. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/controls.md +0 -270
  354. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/form-sheet.md +0 -253
  355. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/gradients.md +0 -106
  356. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/icons.md +0 -213
  357. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/media.md +0 -198
  358. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/route-structure.md +0 -229
  359. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/search.md +0 -248
  360. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/storage.md +0 -121
  361. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/tabs.md +0 -433
  362. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/toolbar-and-headers.md +0 -284
  363. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/visual-effects.md +0 -197
  364. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/webgpu-three.md +0 -605
  365. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/building-native-ui/references/zoom-transitions.md +0 -158
  366. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/eas-simulator/SKILL.md +0 -154
  367. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/eas-simulator/references/controllers.md +0 -67
  368. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/eas-simulator/references/run-your-app.md +0 -185
  369. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/eas-simulator/references/troubleshooting.md +0 -38
  370. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/eas-update-insights/SKILL.md +0 -228
  371. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/eas-update-insights/agents/openai.yaml +0 -4
  372. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/eas-update-insights/references/channel-insights-schema.md +0 -47
  373. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/eas-update-insights/references/update-insights-schema.md +0 -69
  374. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-api-routes/SKILL.md +0 -368
  375. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-api-routes/agents/openai.yaml +0 -4
  376. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-brownfield/SKILL.md +0 -54
  377. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-brownfield/agents/openai.yaml +0 -4
  378. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-brownfield/references/brownfield-integrated.md +0 -526
  379. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-brownfield/references/brownfield-isolated.md +0 -402
  380. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-brownfield/references/comparison.md +0 -63
  381. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-brownfield/references/troubleshooting.md +0 -88
  382. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-cicd-workflows/SKILL.md +0 -92
  383. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-cicd-workflows/agents/openai.yaml +0 -4
  384. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-cicd-workflows/scripts/fetch.js +0 -109
  385. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-cicd-workflows/scripts/package.json +0 -11
  386. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-cicd-workflows/scripts/validate.js +0 -84
  387. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-deployment/SKILL.md +0 -167
  388. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-deployment/agents/openai.yaml +0 -4
  389. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-deployment/references/app-store-metadata.md +0 -497
  390. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-deployment/references/ios-app-store.md +0 -371
  391. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-deployment/references/play-store.md +0 -246
  392. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-deployment/references/testflight.md +0 -58
  393. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-deployment/references/workflows.md +0 -160
  394. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-dev-client/SKILL.md +0 -172
  395. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-dev-client/agents/openai.yaml +0 -4
  396. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-examples/SKILL.md +0 -97
  397. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-examples/references/catalog.md +0 -105
  398. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-module/SKILL.md +0 -141
  399. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-module/agents/openai.yaml +0 -4
  400. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-module/references/config-plugin.md +0 -90
  401. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-module/references/create-expo-module.md +0 -206
  402. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-module/references/lifecycle.md +0 -127
  403. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-module/references/module-config.md +0 -48
  404. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-module/references/native-module.md +0 -286
  405. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-module/references/native-view.md +0 -171
  406. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-observe/SKILL.md +0 -29
  407. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-observe/references/metrics.md +0 -47
  408. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-observe/references/queries.md +0 -342
  409. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-observe/references/setup.md +0 -255
  410. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/SKILL.md +0 -314
  411. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/agents/visual-grader.md +0 -52
  412. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/references/design-rubric.md +0 -45
  413. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/references/runtime-matrix.md +0 -33
  414. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/scripts/check-static.sh +0 -64
  415. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/scripts/clean-fixture.sh +0 -56
  416. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/scripts/generate_viewer.py +0 -450
  417. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/scripts/latest-sdk.sh +0 -46
  418. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/scripts/make-fixture.sh +0 -95
  419. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/scripts/make-workspace.sh +0 -31
  420. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/scripts/snapshot-android.sh +0 -284
  421. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/scripts/snapshot-ios.sh +0 -132
  422. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-skill-eval/scripts/snapshot-web.sh +0 -61
  423. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-tailwind-setup/SKILL.md +0 -480
  424. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-tailwind-setup/agents/openai.yaml +0 -4
  425. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-ui/SKILL.md +0 -47
  426. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-ui/agents/openai.yaml +0 -4
  427. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-ui/references/drop-in-replacements.md +0 -27
  428. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-ui/references/jetpack-compose.md +0 -73
  429. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-ui/references/swift-ui.md +0 -73
  430. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-ui/references/universal.md +0 -73
  431. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/expo-ui/scripts/list-components.js +0 -193
  432. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/native-data-fetching/SKILL.md +0 -505
  433. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/native-data-fetching/agents/openai.yaml +0 -4
  434. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/native-data-fetching/references/expo-router-loaders.md +0 -341
  435. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/upgrading-expo/SKILL.md +0 -134
  436. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/upgrading-expo/agents/openai.yaml +0 -4
  437. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/upgrading-expo/references/expo-av-to-audio.md +0 -132
  438. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/upgrading-expo/references/expo-av-to-video.md +0 -160
  439. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/upgrading-expo/references/native-tabs.md +0 -124
  440. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/upgrading-expo/references/new-architecture.md +0 -79
  441. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/upgrading-expo/references/react-19.md +0 -79
  442. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/upgrading-expo/references/react-compiler.md +0 -59
  443. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/upgrading-expo/references/react-navigation-to-expo-router.md +0 -61
  444. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/use-dom/SKILL.md +0 -417
  445. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/use-dom/agents/openai.yaml +0 -4
  446. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/web-to-native/SKILL.md +0 -83
  447. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/web-to-native/references/false-friends.md +0 -119
  448. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/web-to-native/references/native-patterns.md +0 -39
  449. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/web-to-native/references/run-as-goal.md +0 -48
  450. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/web-to-native/references/verify-on-device.md +0 -45
  451. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/.github/workflows/branch-protection.yml +0 -24
  452. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/.github/workflows/deploy.yml +0 -61
  453. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/AGENTS.md +0 -5958
  454. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/SKILL.md +0 -130
  455. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/api-use-dto-serialization.md +0 -182
  456. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/api-use-interceptors.md +0 -202
  457. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/api-use-pipes.md +0 -205
  458. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/api-versioning.md +0 -191
  459. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/arch-avoid-circular-deps.md +0 -80
  460. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/arch-feature-modules.md +0 -82
  461. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/arch-module-sharing.md +0 -141
  462. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/arch-single-responsibility.md +0 -106
  463. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/arch-use-events.md +0 -108
  464. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/arch-use-repository-pattern.md +0 -97
  465. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/db-avoid-n-plus-one.md +0 -139
  466. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/db-use-migrations.md +0 -129
  467. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/db-use-transactions.md +0 -140
  468. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/devops-graceful-shutdown.md +0 -222
  469. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/devops-use-config-module.md +0 -167
  470. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/devops-use-logging.md +0 -232
  471. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/di-avoid-service-locator.md +0 -104
  472. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/di-interface-segregation.md +0 -165
  473. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/di-liskov-substitution.md +0 -221
  474. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/di-prefer-constructor-injection.md +0 -86
  475. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/di-scope-awareness.md +0 -94
  476. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/di-use-interfaces-tokens.md +0 -101
  477. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/error-handle-async-errors.md +0 -125
  478. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/error-throw-http-exceptions.md +0 -114
  479. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/error-use-exception-filters.md +0 -140
  480. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/micro-use-health-checks.md +0 -226
  481. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/micro-use-patterns.md +0 -167
  482. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/micro-use-queues.md +0 -252
  483. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/perf-async-hooks.md +0 -109
  484. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/perf-lazy-loading.md +0 -121
  485. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/perf-optimize-database.md +0 -131
  486. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/perf-use-caching.md +0 -128
  487. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/security-auth-jwt.md +0 -146
  488. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/security-rate-limiting.md +0 -125
  489. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/security-sanitize-output.md +0 -139
  490. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/security-use-guards.md +0 -135
  491. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/security-validate-all-input.md +0 -150
  492. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/test-e2e-supertest.md +0 -178
  493. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/test-mock-external-services.md +0 -179
  494. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/rules/test-use-testing-module.md +0 -153
  495. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/scripts/build-agents.ts +0 -299
  496. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/scripts/build.sh +0 -16
  497. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/scripts/package-lock.json +0 -237
  498. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-best-practices/scripts/package.json +0 -15
  499. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-expert/SKILL.md +0 -208
  500. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-expert/references/authentication.md +0 -166
  501. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-expert/references/controllers-routing.md +0 -111
  502. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-expert/references/dtos-validation.md +0 -153
  503. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-expert/references/migration-from-express.md +0 -1237
  504. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-expert/references/services-di.md +0 -140
  505. package/dist/baseline/scaffold-baseline/skills/frameworks/nestjs/nestjs-expert/references/testing-patterns.md +0 -186
  506. package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/SKILL.md +0 -153
  507. package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/async-patterns.md +0 -87
  508. package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/bundling.md +0 -180
  509. package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/data-patterns.md +0 -297
  510. package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/debug-tricks.md +0 -105
  511. package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/directives.md +0 -73
  512. package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/error-handling.md +0 -227
  513. package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/file-conventions.md +0 -140
  514. package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/font.md +0 -245
  515. package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/functions.md +0 -108
  516. package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/hydration-error.md +0 -91
  517. package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/image.md +0 -173
  518. package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/metadata.md +0 -301
  519. package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/parallel-routes.md +0 -287
  520. package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/route-handlers.md +0 -146
  521. package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/rsc-boundaries.md +0 -159
  522. package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/runtime-selection.md +0 -39
  523. package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/scripts.md +0 -141
  524. package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/self-hosting.md +0 -371
  525. package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-best-practices/suspense-boundaries.md +0 -67
  526. package/dist/baseline/scaffold-baseline/skills/frameworks/nextjs/next-cache-components/SKILL.md +0 -360
  527. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/package-usage/SKILL.md +0 -49
  528. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/package-usage/agents/openai.yaml +0 -4
  529. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/package-usage/use_cases.yaml +0 -15
  530. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/provider-upgrade/SKILL.md +0 -332
  531. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/provider-upgrade/agents/openai.yaml +0 -4
  532. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/provider-upgrade/references/diagnostic-toolbox.md +0 -131
  533. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/provider-upgrade/use_cases.yaml +0 -28
  534. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-automation-api/SKILL.md +0 -320
  535. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-automation-api/agents/openai.yaml +0 -4
  536. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-automation-api/use_cases.yaml +0 -7
  537. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-best-practices/SKILL.md +0 -501
  538. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-best-practices/agents/openai.yaml +0 -4
  539. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-best-practices/use_cases.yaml +0 -7
  540. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-component/SKILL.md +0 -830
  541. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-component/agents/openai.yaml +0 -4
  542. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-component/use_cases.yaml +0 -19
  543. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-esc/SKILL.md +0 -281
  544. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-esc/agents/openai.yaml +0 -4
  545. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-esc/use_cases.yaml +0 -30
  546. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-overview/SKILL.md +0 -289
  547. package/dist/baseline/scaffold-baseline/skills/frameworks/pulumi/pulumi-overview/use_cases.yaml +0 -50
  548. package/dist/baseline/scaffold-baseline/skills/frameworks/react/async-react-patterns/SKILL.md +0 -78
  549. package/dist/baseline/scaffold-baseline/skills/frameworks/react/react-doctor/SKILL.md +0 -64
  550. package/dist/baseline/scaffold-baseline/skills/frameworks/react/react-doctor/references/explain.md +0 -71
  551. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-composition-patterns/AGENTS.md +0 -946
  552. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-composition-patterns/SKILL.md +0 -89
  553. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-composition-patterns/rules/architecture-avoid-boolean-props.md +0 -100
  554. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-composition-patterns/rules/architecture-compound-components.md +0 -112
  555. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-composition-patterns/rules/patterns-children-over-render-props.md +0 -87
  556. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-composition-patterns/rules/patterns-explicit-variants.md +0 -100
  557. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-composition-patterns/rules/react19-no-forwardref.md +0 -42
  558. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-composition-patterns/rules/state-context-interface.md +0 -191
  559. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-composition-patterns/rules/state-decouple-implementation.md +0 -113
  560. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-composition-patterns/rules/state-lift-state.md +0 -125
  561. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/AGENTS.md +0 -3750
  562. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/SKILL.md +0 -148
  563. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/advanced-effect-event-deps.md +0 -56
  564. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/advanced-event-handler-refs.md +0 -55
  565. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/advanced-init-once.md +0 -42
  566. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/advanced-use-latest.md +0 -39
  567. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/async-api-routes.md +0 -38
  568. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/async-cheap-condition-before-await.md +0 -37
  569. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/async-defer-await.md +0 -82
  570. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/async-dependencies.md +0 -51
  571. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/async-parallel.md +0 -28
  572. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/async-suspense-boundaries.md +0 -99
  573. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/bundle-barrel-imports.md +0 -60
  574. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/bundle-conditional.md +0 -31
  575. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/bundle-defer-third-party.md +0 -49
  576. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/bundle-dynamic-imports.md +0 -35
  577. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/bundle-preload.md +0 -50
  578. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/client-event-listeners.md +0 -74
  579. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/client-localstorage-schema.md +0 -71
  580. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/client-passive-event-listeners.md +0 -48
  581. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/client-swr-dedup.md +0 -56
  582. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-batch-dom-css.md +0 -107
  583. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-cache-function-results.md +0 -80
  584. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-cache-property-access.md +0 -28
  585. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-cache-storage.md +0 -70
  586. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-combine-iterations.md +0 -32
  587. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-early-exit.md +0 -50
  588. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-flatmap-filter.md +0 -60
  589. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-hoist-regexp.md +0 -45
  590. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-index-maps.md +0 -37
  591. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-length-check-first.md +0 -49
  592. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-min-max-loop.md +0 -82
  593. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-request-idle-callback.md +0 -105
  594. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-set-map-lookups.md +0 -24
  595. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/js-tosorted-immutable.md +0 -57
  596. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rendering-activity.md +0 -26
  597. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +0 -47
  598. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rendering-conditional-render.md +0 -40
  599. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rendering-content-visibility.md +0 -38
  600. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rendering-hoist-jsx.md +0 -46
  601. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +0 -82
  602. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +0 -30
  603. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rendering-resource-hints.md +0 -85
  604. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rendering-script-defer-async.md +0 -68
  605. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rendering-svg-precision.md +0 -28
  606. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rendering-usetransition-loading.md +0 -75
  607. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-defer-reads.md +0 -39
  608. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-dependencies.md +0 -45
  609. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +0 -40
  610. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-derived-state.md +0 -29
  611. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-functional-setstate.md +0 -74
  612. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-lazy-state-init.md +0 -58
  613. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +0 -38
  614. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-memo.md +0 -44
  615. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +0 -45
  616. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-no-inline-components.md +0 -82
  617. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +0 -35
  618. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-split-combined-hooks.md +0 -64
  619. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-transitions.md +0 -40
  620. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-use-deferred-value.md +0 -59
  621. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +0 -73
  622. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/server-after-nonblocking.md +0 -73
  623. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/server-auth-actions.md +0 -96
  624. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/server-cache-lru.md +0 -41
  625. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/server-cache-react.md +0 -76
  626. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/server-dedup-props.md +0 -65
  627. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/server-hoist-static-io.md +0 -149
  628. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/server-no-shared-module-state.md +0 -50
  629. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/server-parallel-fetching.md +0 -83
  630. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/server-parallel-nested-fetching.md +0 -34
  631. package/dist/baseline/scaffold-baseline/skills/frameworks/react/vercel-react-best-practices/rules/server-serialization.md +0 -38
  632. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/.claude-plugin/plugin.json +0 -12
  633. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/SKILL.md +0 -849
  634. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/assets/example-template.txt +0 -14
  635. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/references/best-practices.md +0 -304
  636. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/references/common-patterns.md +0 -271
  637. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/references/example-reference.md +0 -26
  638. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/references/testing.md +0 -282
  639. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/references/top-errors.md +0 -332
  640. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/references/typescript-patterns.md +0 -291
  641. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/references/v4-to-v5-migration.md +0 -231
  642. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/rules/tanstack-query.md +0 -126
  643. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/scripts/example-script.sh +0 -15
  644. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/templates/custom-hooks-pattern.tsx +0 -281
  645. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/templates/devtools-setup.tsx +0 -248
  646. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/templates/error-boundary.tsx +0 -243
  647. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/templates/package.json +0 -31
  648. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/templates/provider-setup.tsx +0 -50
  649. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/templates/query-client-config.ts +0 -72
  650. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/templates/use-infinite-query.tsx +0 -214
  651. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/templates/use-mutation-basic.tsx +0 -201
  652. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/templates/use-mutation-optimistic.tsx +0 -234
  653. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-query/tanstack-query/templates/use-query-basic.tsx +0 -119
  654. package/dist/baseline/scaffold-baseline/skills/frameworks/tanstack-start/tanstack-start/SKILL.md +0 -250
  655. package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/.claude-plugin/plugin.json +0 -12
  656. package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/SKILL.md +0 -1058
  657. package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/assets/example-template.txt +0 -14
  658. package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/references/best-practices.md +0 -304
  659. package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/references/common-patterns.md +0 -271
  660. package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/references/example-reference.md +0 -26
  661. package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/references/testing.md +0 -282
  662. package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/references/top-errors.md +0 -332
  663. package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/references/typescript-patterns.md +0 -291
  664. package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/references/v4-to-v5-migration.md +0 -231
  665. package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/rules/tanstack-query.md +0 -126
  666. package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/scripts/example-script.sh +0 -15
  667. package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/templates/custom-hooks-pattern.tsx +0 -281
  668. package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/templates/devtools-setup.tsx +0 -248
  669. package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/templates/error-boundary.tsx +0 -243
  670. package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/templates/package.json +0 -31
  671. package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/templates/provider-setup.tsx +0 -50
  672. package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/templates/query-client-config.ts +0 -72
  673. package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/templates/use-infinite-query.tsx +0 -214
  674. package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/templates/use-mutation-basic.tsx +0 -201
  675. package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/templates/use-mutation-optimistic.tsx +0 -234
  676. package/dist/baseline/scaffold-baseline/skills/frameworks/trpc/tanstack-query/templates/use-query-basic.tsx +0 -119
  677. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/SKILL.md +0 -914
  678. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/command/turborepo.md +0 -70
  679. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/best-practices/RULE.md +0 -241
  680. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/best-practices/dependencies.md +0 -246
  681. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/best-practices/packages.md +0 -335
  682. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/best-practices/structure.md +0 -270
  683. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/boundaries/RULE.md +0 -126
  684. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/caching/RULE.md +0 -107
  685. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/caching/gotchas.md +0 -169
  686. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/caching/remote-cache.md +0 -127
  687. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/ci/RULE.md +0 -79
  688. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/ci/github-actions.md +0 -162
  689. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/ci/patterns.md +0 -145
  690. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/ci/vercel.md +0 -103
  691. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/cli/RULE.md +0 -100
  692. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/cli/commands.md +0 -297
  693. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/configuration/RULE.md +0 -211
  694. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/configuration/global-options.md +0 -187
  695. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/configuration/gotchas.md +0 -348
  696. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/configuration/tasks.md +0 -285
  697. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/environment/RULE.md +0 -96
  698. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/environment/gotchas.md +0 -141
  699. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/environment/modes.md +0 -101
  700. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/filtering/RULE.md +0 -148
  701. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/filtering/patterns.md +0 -152
  702. package/dist/baseline/scaffold-baseline/skills/frameworks/turborepo/turborepo/references/watch/RULE.md +0 -99
  703. package/dist/baseline/scaffold-baseline/skills/languages/python/async-python-patterns/SKILL.md +0 -735
  704. package/dist/baseline/scaffold-baseline/skills/languages/python/python-code-style/SKILL.md +0 -360
  705. package/dist/baseline/scaffold-baseline/skills/languages/python/python-design-patterns/SKILL.md +0 -433
  706. package/dist/baseline/scaffold-baseline/skills/languages/python/python-project-structure/SKILL.md +0 -252
  707. package/dist/baseline/scaffold-baseline/skills/languages/python/python-testing-patterns/SKILL.md +0 -622
  708. package/dist/baseline/scaffold-baseline/skills/languages/python/python-testing-patterns/references/advanced-patterns.md +0 -411
  709. package/dist/baseline/scaffold-baseline/skills/languages/typescript/quality-types/SKILL.md +0 -93
  710. package/dist/baseline/scaffold-baseline/skills/misc/secrets-cli/SKILL.md +0 -54
  711. package/dist/baseline/scaffold-baseline/skills/misc/secrets-cli/references/command-reference.md +0 -107
  712. package/dist/baseline/scaffold-baseline/skills/misc/secrets-cli/references/safety-and-errors.md +0 -54
  713. package/dist/baseline/scaffold-baseline/skills/misc/secrets-cli/references/workflows.md +0 -106
  714. package/dist/baseline/scaffold-baseline/skills/misc/timesheet/SKILL.md +0 -87
  715. package/dist/baseline/scaffold-baseline/skills/misc/timesheet/scripts/git-timesheet-evidence.mjs +0 -214
  716. package/dist/baseline/scaffold-baseline/skills/phases/bug-discovery-phase/REFERENCE.md +0 -193
  717. package/dist/baseline/scaffold-baseline/skills/phases/bug-discovery-phase/SKILL.md +0 -46
  718. package/dist/baseline/scaffold-baseline/skills/phases/bug-resolution-phase/REFERENCE.md +0 -183
  719. package/dist/baseline/scaffold-baseline/skills/phases/bug-resolution-phase/SKILL.md +0 -50
  720. package/dist/baseline/scaffold-baseline/skills/phases/bug-resolution-phase/agents/openai.yaml +0 -2
  721. package/dist/baseline/scaffold-baseline/skills/phases/debugging-phase/SKILL.md +0 -88
  722. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/SKILL.md +0 -52
  723. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/agents/openai.yaml +0 -2
  724. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/closeout.md +0 -35
  725. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/debug.md +0 -30
  726. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/docs-ingest.md +0 -27
  727. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/implement.md +0 -32
  728. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/plan.md +0 -27
  729. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/review.md +0 -29
  730. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/router.md +0 -46
  731. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/spec.md +0 -26
  732. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/artifact-state.md +0 -42
  733. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/phase-handoff.md +0 -27
  734. package/dist/baseline/scaffold-baseline/skills/phases/design-phase/SKILL.md +0 -48
  735. package/dist/baseline/scaffold-baseline/skills/phases/design-phase/agents/openai.yaml +0 -2
  736. package/dist/baseline/scaffold-baseline/skills/phases/design-phase/phases/approval.md +0 -37
  737. package/dist/baseline/scaffold-baseline/skills/phases/design-phase/phases/backlog.md +0 -28
  738. package/dist/baseline/scaffold-baseline/skills/phases/design-phase/phases/delivery-handoff.md +0 -29
  739. package/dist/baseline/scaffold-baseline/skills/phases/design-phase/phases/grill.md +0 -37
  740. package/dist/baseline/scaffold-baseline/skills/phases/design-phase/phases/intake.md +0 -25
  741. package/dist/baseline/scaffold-baseline/skills/phases/design-phase/phases/prototype.md +0 -30
  742. package/dist/baseline/scaffold-baseline/skills/phases/design-phase/phases/router.md +0 -66
  743. package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/SKILL.md +0 -46
  744. package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/agents/openai.yaml +0 -4
  745. package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/phases/private-internal.md +0 -57
  746. package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/phases/public-docs.md +0 -52
  747. package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/phases/router.md +0 -42
  748. package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/references/concept-pages.md +0 -70
  749. package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/references/flow-pages.md +0 -56
  750. package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/references/fumadocs-routing.md +0 -74
  751. package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/references/learning-artifacts.md +0 -96
  752. package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/references/public-docs.md +0 -90
  753. package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/references/repo-docs.md +0 -38
  754. package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/references/wiki-ingest.md +0 -134
  755. package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/SKILL.md +0 -53
  756. package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/agents/openai.yaml +0 -2
  757. package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/references/frontier-lifecycle.md +0 -70
  758. package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/references/root-routing.md +0 -29
  759. package/dist/baseline/scaffold-baseline/skills/phases/goalify/EXAMPLES.md +0 -11
  760. package/dist/baseline/scaffold-baseline/skills/phases/goalify/SKILL.md +0 -32
  761. package/dist/baseline/scaffold-baseline/skills/phases/requirements-phase/SKILL.md +0 -69
  762. package/dist/baseline/scaffold-baseline/skills/phases/requirements-phase/agents/openai.yaml +0 -2
  763. package/dist/baseline/scaffold-baseline/skills/phases/resolve-debt-phase/SKILL.md +0 -89
  764. package/dist/baseline/scaffold-baseline/skills/phases/resolve-debt-phase/agents/openai.yaml +0 -2
  765. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/REFERENCE.md +0 -147
  766. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/SKILL.md +0 -54
  767. package/dist/baseline/scaffold-baseline.json +0 -12
  768. package/dist/baseline/scaffold-baseline.tgz +0 -0
  769. package/dist/skills/agnostic/docs/writing-great-skills/GLOSSARY.md +0 -69
  770. package/dist/skills/agnostic/docs/writing-great-skills/SKILL.md +0 -61
  771. package/dist/skills/agnostic/planning/create-spec/references/backlog-sync.md +0 -49
  772. package/dist/skills/agnostic/planning/create-spec/references/discovery.md +0 -54
  773. package/dist/skills/agnostic/planning/create-spec/references/grill-phase.md +0 -42
  774. package/dist/skills/agnostic/planning/create-spec/references/questioning.md +0 -51
  775. package/dist/skills/agnostic/planning/implement-spec/references/sequential.md +0 -48
  776. package/dist/skills/frameworks/nestjs/nestjs-best-practices/.gitignore +0 -29
  777. /package/dist/{baseline/scaffold-baseline/skills/agnostic/requirements/grilling → skills/agnostic/docs/writing-for-agents}/LICENSE +0 -0
  778. /package/dist/{baseline/scaffold-baseline/skills/phases/bug-discovery-phase → skills/phases/prototype-phase}/agents/openai.yaml +0 -0
@@ -1,2478 +0,0 @@
1
- import { lstat, readFile, realpath, readdir, readlink } from "node:fs/promises";
2
- import { spawn } from "node:child_process";
3
- import { createHash, randomUUID } from "node:crypto";
4
- import path from "node:path";
5
- import { createInterface } from "node:readline";
6
- import { fileURLToPath } from "node:url";
7
-
8
- import { agents, capabilityPacks } from "../subagents/manifest.mjs";
9
- import { claudeAdapter } from "./harness-projection/adapters/claude.mjs";
10
- import { codexAdapter } from "./harness-projection/adapters/codex.mjs";
11
- import { cursorAdapter } from "./harness-projection/adapters/cursor.mjs";
12
- import { openCodeAdapter } from "./harness-projection/adapters/opencode.mjs";
13
- import { applyProjection } from "./harness-projection/apply.mjs";
14
- import { project } from "./harness-projection/core.mjs";
15
-
16
- const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
17
- const sharedAgentsPath = path.join(repoRoot, ".agents/AGENTS.md");
18
- const sharedSkillsPath = path.join(repoRoot, ".agents/skills");
19
- const sharedHooksPath = path.join(repoRoot, ".agents/hooks");
20
- const contextPlanPath = path.join(repoRoot, ".devpunks/context-plan.json");
21
- const projectionReceiptPath = path.join(repoRoot, ".devpunks/harness-projection-receipt.json");
22
- const adapters = [claudeAdapter, codexAdapter, cursorAdapter, openCodeAdapter];
23
- let previousCopyFallbacks = [];
24
- const currentCopyFallbacks = new Map();
25
- let operationRepoRootIdentity;
26
-
27
- const confinedMutationScript = String.raw`
28
- import { spawnSync } from "node:child_process";
29
- import {
30
- closeSync,
31
- constants,
32
- fchmodSync,
33
- fstatSync,
34
- linkSync,
35
- lstatSync,
36
- mkdirSync,
37
- openSync,
38
- readSync,
39
- renameSync,
40
- rmSync,
41
- statSync,
42
- symlinkSync,
43
- unlinkSync,
44
- writeFileSync,
45
- writeSync,
46
- } from "node:fs";
47
- import { createInterface } from "node:readline";
48
-
49
- const parent = JSON.parse(process.argv[1]);
50
- const assertParentIdentity = () => {
51
- const current = statSync(".");
52
- if (current.dev !== parent.device || current.ino !== parent.inode) {
53
- const error = new Error("Confined mutation parent identity changed.");
54
- error.code = "ESTALE";
55
- throw error;
56
- }
57
- };
58
-
59
- const leafKind = (entry) =>
60
- entry.isSymbolicLink()
61
- ? "symlink"
62
- : entry.isFile()
63
- ? "file"
64
- : entry.isDirectory()
65
- ? "directory"
66
- : "other";
67
-
68
- const assertExpectedLeaf = (targetPath, expected) => {
69
- const target = lstatSync(targetPath, { throwIfNoEntry: false });
70
- const matches =
71
- expected.kind === "absent"
72
- ? target === undefined
73
- : target !== undefined &&
74
- target.dev === expected.device &&
75
- target.ino === expected.inode &&
76
- leafKind(target) === expected.kind;
77
- if (!matches) {
78
- const error = new Error("Confined mutation target changed after validation.");
79
- error.code = "ESTALE_TARGET";
80
- throw error;
81
- }
82
- return target;
83
- };
84
-
85
- const confinedDirectoryCopyScript = [
86
- 'import { cpSync, statSync } from "node:fs";',
87
- "const expected = JSON.parse(process.argv[1]);",
88
- 'const current = statSync(".");',
89
- "if (current.dev !== expected.device || current.ino !== expected.inode) {",
90
- ' throw new Error("Confined copy directory identity changed.");',
91
- "}",
92
- 'cpSync(process.argv[2], ".", { recursive: true });',
93
- ].join("\n");
94
-
95
- const copyIntoClaimedDirectory = (request, expected) => {
96
- const result = spawnSync(
97
- process.execPath,
98
- ["--input-type=module", "--eval", confinedDirectoryCopyScript, JSON.stringify(expected), request.source],
99
- { cwd: request.target, stdio: "ignore" },
100
- );
101
- if (result.error !== undefined) throw result.error;
102
- if (result.status !== 0) {
103
- const error = new Error("Confined directory copy failed.");
104
- error.code = "EIO";
105
- throw error;
106
- }
107
- };
108
-
109
- const mutate = (request) => {
110
- let descriptor;
111
- let createdIdentity;
112
- let response = {};
113
- let sourceDescriptor;
114
- let writePath;
115
- try {
116
- assertParentIdentity();
117
- if (request.operation === "read") {
118
- descriptor = openSync(
119
- request.target,
120
- constants.O_RDONLY | (constants.O_NONBLOCK ?? 0) | (constants.O_NOFOLLOW ?? 0),
121
- );
122
- const opened = fstatSync(descriptor);
123
- if (
124
- !opened.isFile() ||
125
- request.expectedTarget.kind !== "file" ||
126
- opened.dev !== request.expectedTarget.device ||
127
- opened.ino !== request.expectedTarget.inode
128
- ) {
129
- const error = new Error("Confined read target changed before descriptor read.");
130
- error.code = "ESTALE_TARGET";
131
- throw error;
132
- }
133
- if (opened.size > request.maximumBytes) {
134
- const error = new Error("Confined file exceeds the read limit.");
135
- error.code = "EFBIG";
136
- throw error;
137
- }
138
- const chunks = [];
139
- let total = 0;
140
- while (total <= request.maximumBytes) {
141
- const chunk = Buffer.alloc(Math.min(64 * 1024, request.maximumBytes + 1 - total));
142
- const bytesRead = readSync(descriptor, chunk, 0, chunk.length, null);
143
- if (bytesRead === 0) break;
144
- chunks.push(chunk.subarray(0, bytesRead));
145
- total += bytesRead;
146
- }
147
- if (total > request.maximumBytes) {
148
- const error = new Error("Confined file exceeds the read limit.");
149
- error.code = "EFBIG";
150
- throw error;
151
- }
152
- response = { content: Buffer.concat(chunks).toString("base64") };
153
- closeSync(descriptor);
154
- descriptor = undefined;
155
- } else if (request.operation === "mkdir") {
156
- const target = lstatSync(request.target, { throwIfNoEntry: false });
157
- if (target === undefined) {
158
- mkdirSync(request.target);
159
- } else if (target.isSymbolicLink() || !target.isDirectory()) {
160
- const error = new Error("Refusing to replace an unsafe confined directory.");
161
- error.code = "EINVAL";
162
- throw error;
163
- }
164
- } else if (request.operation === "write") {
165
- const target = lstatSync(request.target, { throwIfNoEntry: false });
166
- if (target !== undefined && (target.isSymbolicLink() || !target.isFile())) {
167
- const error = new Error("Refusing to replace an unsafe confined target.");
168
- error.code = "EINVAL";
169
- throw error;
170
- }
171
- const expectedTarget =
172
- target === undefined
173
- ? { kind: "absent" }
174
- : { device: target.dev, inode: target.ino, kind: leafKind(target) };
175
- writePath = request.temporary;
176
- descriptor = openSync(
177
- writePath,
178
- constants.O_CREAT | constants.O_EXCL | constants.O_WRONLY | (constants.O_NOFOLLOW ?? 0),
179
- target?.mode ?? 0o666,
180
- );
181
- const created = fstatSync(descriptor);
182
- createdIdentity = { device: created.dev, inode: created.ino };
183
- assertParentIdentity();
184
- writeFileSync(descriptor, request.content);
185
- if (target !== undefined) {
186
- fchmodSync(descriptor, target.mode & 0o7777);
187
- }
188
- closeSync(descriptor);
189
- descriptor = undefined;
190
- assertParentIdentity();
191
- assertExpectedLeaf(request.target, expectedTarget);
192
- renameSync(request.temporary, request.target);
193
- assertParentIdentity();
194
- } else if (request.operation === "remove") {
195
- assertExpectedLeaf(request.target, request.expectedTarget);
196
- if (lstatSync(request.claim, { throwIfNoEntry: false }) !== undefined) {
197
- const error = new Error("Confined removal claim path already exists.");
198
- error.code = "EEXIST";
199
- throw error;
200
- }
201
- renameSync(request.target, request.claim);
202
- try {
203
- assertParentIdentity();
204
- assertExpectedLeaf(request.claim, request.expectedTarget);
205
- rmSync(request.claim, { force: true, recursive: request.recursive });
206
- } catch (error) {
207
- if (lstatSync(request.claim, { throwIfNoEntry: false }) !== undefined) {
208
- try {
209
- if (lstatSync(request.target, { throwIfNoEntry: false }) !== undefined) {
210
- const restorationError = new Error(
211
- "Confined removal target was recreated before claim restoration.",
212
- );
213
- restorationError.code = "ESTALE_TARGET";
214
- throw restorationError;
215
- }
216
- const claim = lstatSync(request.claim);
217
- if (claim.isFile()) {
218
- linkSync(request.claim, request.target);
219
- unlinkSync(request.claim);
220
- } else {
221
- renameSync(request.claim, request.target);
222
- }
223
- } catch (cause) {
224
- const restorationError = new Error(
225
- "Confined removal could not restore its claimed target.",
226
- { cause },
227
- );
228
- restorationError.backup = request.claim;
229
- restorationError.code = "ESTALE_TARGET";
230
- throw restorationError;
231
- }
232
- }
233
- throw error;
234
- }
235
- assertParentIdentity();
236
- } else if (request.operation === "symlink") {
237
- if (lstatSync(request.target, { throwIfNoEntry: false }) !== undefined) {
238
- const error = new Error("Confined symlink target already exists.");
239
- error.code = "EEXIST";
240
- throw error;
241
- }
242
- symlinkSync(request.linkTarget, request.target, request.type);
243
- assertParentIdentity();
244
- } else if (request.operation === "copy") {
245
- assertExpectedLeaf(request.target, request.expectedTarget);
246
- if (request.recursive) {
247
- mkdirSync(request.target);
248
- const created = lstatSync(request.target);
249
- createdIdentity = { device: created.dev, inode: created.ino };
250
- writePath = request.target;
251
- copyIntoClaimedDirectory(request, createdIdentity);
252
- assertParentIdentity();
253
- assertExpectedLeaf(request.target, { ...createdIdentity, kind: "directory" });
254
- } else {
255
- sourceDescriptor = openSync(
256
- request.source,
257
- constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0),
258
- );
259
- const source = fstatSync(sourceDescriptor);
260
- if (!source.isFile()) {
261
- const error = new Error("Confined copy source is not a regular file.");
262
- error.code = "EINVAL";
263
- throw error;
264
- }
265
- writePath = request.target;
266
- descriptor = openSync(
267
- request.target,
268
- constants.O_CREAT | constants.O_EXCL | constants.O_WRONLY,
269
- source.mode,
270
- );
271
- const created = fstatSync(descriptor);
272
- createdIdentity = { device: created.dev, inode: created.ino };
273
- const buffer = Buffer.alloc(64 * 1024);
274
- for (;;) {
275
- const bytesRead = readSync(sourceDescriptor, buffer, 0, buffer.length, null);
276
- if (bytesRead === 0) break;
277
- let offset = 0;
278
- while (offset < bytesRead) {
279
- offset += writeSync(descriptor, buffer, offset, bytesRead - offset);
280
- }
281
- }
282
- fchmodSync(descriptor, source.mode & 0o7777);
283
- closeSync(descriptor);
284
- descriptor = undefined;
285
- closeSync(sourceDescriptor);
286
- sourceDescriptor = undefined;
287
- }
288
- writePath = undefined;
289
- createdIdentity = undefined;
290
- assertParentIdentity();
291
- }
292
- return response;
293
- } catch (error) {
294
- if (descriptor !== undefined) {
295
- closeSync(descriptor);
296
- }
297
- if (sourceDescriptor !== undefined) {
298
- closeSync(sourceDescriptor);
299
- }
300
- if (writePath !== undefined && createdIdentity !== undefined) {
301
- const current = lstatSync(writePath, { throwIfNoEntry: false });
302
- if (
303
- current !== undefined &&
304
- current.dev === createdIdentity.device &&
305
- current.ino === createdIdentity.inode
306
- ) {
307
- rmSync(writePath, {
308
- force: true,
309
- recursive: request.operation === "copy" && request.recursive === true,
310
- });
311
- }
312
- }
313
- throw error;
314
- }
315
- };
316
-
317
- const lines = createInterface({ input: process.stdin });
318
- for await (const line of lines) {
319
- try {
320
- const response = mutate(JSON.parse(line));
321
- process.stdout.write(JSON.stringify({ ok: true, ...response }) + "\n");
322
- } catch (error) {
323
- process.stdout.write(JSON.stringify({
324
- ok: false,
325
- backup: error && typeof error === "object" && "backup" in error ? error.backup : undefined,
326
- code: error && typeof error === "object" && "code" in error ? error.code : undefined,
327
- message: error instanceof Error ? error.message : String(error),
328
- }) + "\n");
329
- }
330
- }
331
- `;
332
-
333
- const confinedMutationEnvironment = Object.fromEntries(
334
- ["SystemRoot", "WINDIR"].flatMap((key) => {
335
- const value = process.env[key];
336
- return value === undefined ? [] : [[key, value]];
337
- }),
338
- );
339
-
340
- const mutationWorkers = new Map();
341
- const maximumMutationWorkers = 8;
342
- let mutationWorkerReservations = 0;
343
- const mutationWorkerCapacityWaiters = [];
344
- const mutationWorkerExits = new Set();
345
-
346
- function grantMutationWorkerCapacity() {
347
- while (
348
- mutationWorkers.size + mutationWorkerReservations < maximumMutationWorkers &&
349
- mutationWorkerCapacityWaiters.length > 0
350
- ) {
351
- mutationWorkerReservations += 1;
352
- mutationWorkerCapacityWaiters.shift()();
353
- }
354
- }
355
-
356
- function evictIdleMutationWorker() {
357
- for (const worker of mutationWorkers.values()) {
358
- if (worker.pending.length === 0 && !worker.closing) {
359
- closeMutationWorker(worker);
360
- return;
361
- }
362
- }
363
- }
364
-
365
- async function acquireMutationWorkerCapacity() {
366
- if (mutationWorkers.size + mutationWorkerReservations < maximumMutationWorkers) {
367
- mutationWorkerReservations += 1;
368
- return;
369
- }
370
- evictIdleMutationWorker();
371
- await new Promise((resolve) => mutationWorkerCapacityWaiters.push(resolve));
372
- }
373
-
374
- function releaseMutationWorkerCapacity() {
375
- mutationWorkerReservations -= 1;
376
- grantMutationWorkerCapacity();
377
- }
378
-
379
- function closeMutationWorker(worker) {
380
- if (mutationWorkers.get(worker.key) !== worker || worker.closing) return;
381
- worker.closing = true;
382
- if (!worker.child.stdin.destroyed) worker.child.stdin.end();
383
- }
384
-
385
- function scheduleMutationWorkerClose(worker) {
386
- if (worker.pending.length > 0 || worker.closing) return;
387
- if (worker.idleTimer !== undefined) clearTimeout(worker.idleTimer);
388
- worker.idleTimer = setTimeout(() => closeMutationWorker(worker), 25);
389
- }
390
-
391
- function createMutationWorker(parentDirectory, parentIdentity, key) {
392
- const child = spawn(
393
- process.execPath,
394
- ["--input-type=module", "--eval", confinedMutationScript, JSON.stringify(parentIdentity)],
395
- {
396
- cwd: parentDirectory,
397
- env: confinedMutationEnvironment,
398
- stdio: ["pipe", "pipe", "ignore"],
399
- },
400
- );
401
- const pending = [];
402
- let terminalError;
403
- let resolveExited;
404
- let exitSettled = false;
405
- const exited = new Promise((resolve) => {
406
- resolveExited = resolve;
407
- });
408
- mutationWorkerExits.add(exited);
409
- void exited.then(() => mutationWorkerExits.delete(exited));
410
- const worker = {
411
- child,
412
- closing: false,
413
- exited,
414
- idleTimer: undefined,
415
- key,
416
- pending,
417
- request(request) {
418
- if (terminalError !== undefined) return Promise.reject(terminalError);
419
- return new Promise((resolve, reject) => {
420
- pending.push({ reject, resolve });
421
- child.stdin.write(`${JSON.stringify(request)}\n`, (error) => {
422
- if (error !== null && error !== undefined) fail(error);
423
- });
424
- });
425
- },
426
- get terminalError() {
427
- return terminalError;
428
- },
429
- };
430
- const settleExit = () => {
431
- if (exitSettled) return;
432
- exitSettled = true;
433
- if (worker.idleTimer !== undefined) clearTimeout(worker.idleTimer);
434
- if (mutationWorkers.get(key) === worker) {
435
- mutationWorkers.delete(key);
436
- grantMutationWorkerCapacity();
437
- }
438
- resolveExited();
439
- };
440
- const fail = (error) => {
441
- terminalError ??= error;
442
- while (pending.length > 0) pending.shift().reject(error);
443
- };
444
- child.once("error", (error) => {
445
- fail(error);
446
- settleExit();
447
- });
448
- child.once("exit", (code) => {
449
- if (code !== 0 || pending.length > 0) {
450
- fail(new Error(`Confined filesystem mutation worker exited with ${code}.`));
451
- }
452
- settleExit();
453
- });
454
- child.stdout.setEncoding("utf-8");
455
- createInterface({ input: child.stdout }).on("line", (line) => {
456
- const waiter = pending.shift();
457
- if (waiter === undefined) return;
458
- try {
459
- waiter.resolve(JSON.parse(line));
460
- } catch (error) {
461
- waiter.reject(error);
462
- }
463
- });
464
- mutationWorkers.set(key, worker);
465
- return worker;
466
- }
467
-
468
- async function runStableMutation(parentDirectory, request, content) {
469
- const key = `${parentDirectory}\0${request.parent.device}:${request.parent.inode}`;
470
- let worker = mutationWorkers.get(key);
471
- if (worker === undefined || worker.closing || worker.terminalError !== undefined) {
472
- await acquireMutationWorkerCapacity();
473
- try {
474
- worker = mutationWorkers.get(key);
475
- if (worker === undefined || worker.closing || worker.terminalError !== undefined) {
476
- worker = createMutationWorker(parentDirectory, request.parent, key);
477
- }
478
- } finally {
479
- releaseMutationWorkerCapacity();
480
- }
481
- }
482
- if (worker.idleTimer !== undefined) {
483
- clearTimeout(worker.idleTimer);
484
- worker.idleTimer = undefined;
485
- }
486
- let result;
487
- try {
488
- result = await worker.request({
489
- ...request,
490
- ...(content === undefined ? {} : { content }),
491
- });
492
- } finally {
493
- scheduleMutationWorkerClose(worker);
494
- }
495
- if (!result.ok) {
496
- const backupPath =
497
- result.backup === undefined ? undefined : path.join(parentDirectory, result.backup);
498
- const error = new Error(
499
- `${result.message ?? "Confined filesystem mutation failed."}${
500
- backupPath === undefined ? "" : ` Retained backup: ${backupPath}.`
501
- }`,
502
- );
503
- if (result.code !== undefined) {
504
- Object.assign(error, { code: result.code });
505
- }
506
- if (backupPath !== undefined) {
507
- Object.assign(error, { backupPath });
508
- }
509
- throw error;
510
- }
511
- return result;
512
- }
513
-
514
- async function closeMutationWorkers() {
515
- for (const worker of mutationWorkers.values()) closeMutationWorker(worker);
516
- const exits = [...mutationWorkerExits];
517
- await Promise.all(exits);
518
- }
519
-
520
- function isOutsideRoot(relativePath) {
521
- return (
522
- relativePath === ".." ||
523
- relativePath.startsWith(`..${path.sep}`) ||
524
- path.isAbsolute(relativePath)
525
- );
526
- }
527
-
528
- async function lstatOrNull(targetPath) {
529
- return lstat(targetPath).catch((error) => {
530
- if (error?.code === "ENOENT") return null;
531
- throw error;
532
- });
533
- }
534
-
535
- function confinedRelativePath(targetPath, operation) {
536
- const relativeTarget = path.relative(repoRoot, path.resolve(targetPath));
537
- if (relativeTarget.length === 0 || isOutsideRoot(relativeTarget)) {
538
- throw new Error(`Refusing to ${operation} outside ${repoRoot}`);
539
- }
540
- return relativeTarget;
541
- }
542
-
543
- async function captureRepoRootIdentity(operation) {
544
- const root = await lstatOrNull(repoRoot);
545
- if (root === null || root.isSymbolicLink() || !root.isDirectory()) {
546
- throw new Error(`Refusing to ${operation} through changed root ${repoRoot}`);
547
- }
548
- return { device: root.dev, inode: root.ino };
549
- }
550
-
551
- function repoRootIdentityForOperation(operation) {
552
- if (operationRepoRootIdentity === undefined) {
553
- throw new Error(`Confined filesystem session is not initialized for ${operation}`);
554
- }
555
- return operationRepoRootIdentity;
556
- }
557
-
558
- async function assertRepoRootIdentity(expected, operation) {
559
- const current = await lstatOrNull(repoRoot);
560
- if (
561
- current === null ||
562
- current.isSymbolicLink() ||
563
- !current.isDirectory() ||
564
- current.dev !== expected.device ||
565
- current.ino !== expected.inode
566
- ) {
567
- throw new Error(`Refusing to ${operation} through changed root ${repoRoot}`);
568
- }
569
- }
570
-
571
- async function captureLeafExpectation(targetPath) {
572
- const target = await lstatOrNull(targetPath);
573
- if (target === null) return { kind: "absent" };
574
- return {
575
- device: target.dev,
576
- inode: target.ino,
577
- kind: target.isSymbolicLink()
578
- ? "symlink"
579
- : target.isFile()
580
- ? "file"
581
- : target.isDirectory()
582
- ? "directory"
583
- : "other",
584
- };
585
- }
586
-
587
- async function assertConfinedDirectoryComponents(components, operation, repoRootIdentity) {
588
- await assertRepoRootIdentity(repoRootIdentity, operation);
589
- const resolvedRoot = await realpath(repoRoot);
590
- let currentDirectory = repoRoot;
591
- for (const component of components) {
592
- currentDirectory = path.join(currentDirectory, component);
593
- const entry = await lstatOrNull(currentDirectory);
594
- if (entry === null) break;
595
- if (
596
- entry.isSymbolicLink() ||
597
- !entry.isDirectory() ||
598
- isOutsideRoot(path.relative(resolvedRoot, await realpath(currentDirectory)))
599
- ) {
600
- throw new Error(`Refusing to ${operation} through ${currentDirectory}`);
601
- }
602
- }
603
- await assertRepoRootIdentity(repoRootIdentity, operation);
604
- }
605
-
606
- async function assertConfinedRegularFile(targetPath, suppliedRepoRootIdentity) {
607
- const operation = "write scaffold content";
608
- const repoRootIdentity = suppliedRepoRootIdentity ?? repoRootIdentityForOperation(operation);
609
- const relativeTarget = confinedRelativePath(targetPath, "write scaffold content");
610
- await assertConfinedDirectoryComponents(
611
- relativeTarget.split(path.sep).slice(0, -1),
612
- operation,
613
- repoRootIdentity,
614
- );
615
-
616
- const target = await lstatOrNull(targetPath);
617
- if (target !== null && (target.isSymbolicLink() || !target.isFile())) {
618
- throw new Error(`Refusing to replace unsafe scaffold file ${targetPath}`);
619
- }
620
- await assertRepoRootIdentity(repoRootIdentity, operation);
621
- return target;
622
- }
623
-
624
- async function captureConfinedDirectoryIdentity(directoryPath, operation, repoRootIdentity) {
625
- const relativeDirectory = path.relative(repoRoot, path.resolve(directoryPath));
626
- if (isOutsideRoot(relativeDirectory)) {
627
- throw new Error(`Refusing to ${operation} through changed parent ${directoryPath}`);
628
- }
629
- await assertConfinedDirectoryComponents(
630
- relativeDirectory.split(path.sep).filter(Boolean),
631
- operation,
632
- repoRootIdentity,
633
- );
634
- const entry = await lstatOrNull(directoryPath);
635
- if (entry === null || entry.isSymbolicLink() || !entry.isDirectory()) {
636
- throw new Error(`Refusing to ${operation} through changed parent ${directoryPath}`);
637
- }
638
- await assertRepoRootIdentity(repoRootIdentity, operation);
639
- return { device: entry.dev, inode: entry.ino };
640
- }
641
-
642
- async function assertSameDirectoryIdentity(directoryPath, expected, operation, repoRootIdentity) {
643
- const current = await captureConfinedDirectoryIdentity(
644
- directoryPath,
645
- operation,
646
- repoRootIdentity,
647
- );
648
- if (current.device !== expected.device || current.inode !== expected.inode) {
649
- throw new Error(`Refusing to ${operation} through changed parent ${directoryPath}`);
650
- }
651
- }
652
-
653
- async function ensureConfinedDirectory(directoryPath, suppliedRepoRootIdentity) {
654
- const operation = "create scaffold directories";
655
- const repoRootIdentity = suppliedRepoRootIdentity ?? repoRootIdentityForOperation(operation);
656
- if (path.resolve(directoryPath) === repoRoot) {
657
- await assertRepoRootIdentity(repoRootIdentity, operation);
658
- return;
659
- }
660
- const relativeDirectory = confinedRelativePath(directoryPath, operation);
661
- await assertRepoRootIdentity(repoRootIdentity, operation);
662
- const resolvedRoot = await realpath(repoRoot);
663
- let currentDirectory = repoRoot;
664
- for (const component of relativeDirectory.split(path.sep)) {
665
- const parentDirectory = currentDirectory;
666
- currentDirectory = path.join(currentDirectory, component);
667
- let entry = await lstatOrNull(currentDirectory);
668
- if (entry === null) {
669
- const parentIdentity = await captureConfinedDirectoryIdentity(
670
- parentDirectory,
671
- operation,
672
- repoRootIdentity,
673
- );
674
- await runStableMutation(parentDirectory, {
675
- operation: "mkdir",
676
- parent: parentIdentity,
677
- target: component,
678
- });
679
- await assertSameDirectoryIdentity(
680
- parentDirectory,
681
- parentIdentity,
682
- operation,
683
- repoRootIdentity,
684
- );
685
- entry = await lstat(currentDirectory);
686
- }
687
- if (
688
- entry.isSymbolicLink() ||
689
- !entry.isDirectory() ||
690
- isOutsideRoot(path.relative(resolvedRoot, await realpath(currentDirectory)))
691
- ) {
692
- throw new Error(`Refusing to create scaffold content through ${currentDirectory}`);
693
- }
694
- await assertRepoRootIdentity(repoRootIdentity, operation);
695
- }
696
- }
697
-
698
- async function removeConfinedPath(targetPath, options = {}) {
699
- const operation = "remove scaffold content";
700
- const repoRootIdentity = repoRootIdentityForOperation(operation);
701
- const relativeTarget = confinedRelativePath(targetPath, operation);
702
- await assertConfinedDirectoryComponents(
703
- relativeTarget.split(path.sep).slice(0, -1),
704
- operation,
705
- repoRootIdentity,
706
- );
707
- const expectedTarget = await captureLeafExpectation(targetPath);
708
- if (expectedTarget.kind === "absent") {
709
- await assertRepoRootIdentity(repoRootIdentity, operation);
710
- return;
711
- }
712
- const parentDirectory = path.dirname(targetPath);
713
- const parentIdentity = await captureConfinedDirectoryIdentity(
714
- parentDirectory,
715
- operation,
716
- repoRootIdentity,
717
- );
718
- await assertSameDirectoryIdentity(parentDirectory, parentIdentity, operation, repoRootIdentity);
719
- await runStableMutation(parentDirectory, {
720
- claim: `.hi-remove-${randomUUID()}`,
721
- expectedTarget,
722
- operation: "remove",
723
- parent: parentIdentity,
724
- recursive: options.recursive === true,
725
- target: path.basename(targetPath),
726
- });
727
- await assertSameDirectoryIdentity(parentDirectory, parentIdentity, operation, repoRootIdentity);
728
- }
729
-
730
- async function writeConfinedTextFile(targetPath, content) {
731
- const operation = "write scaffold content";
732
- const repoRootIdentity = repoRootIdentityForOperation(operation);
733
- await assertConfinedRegularFile(targetPath, repoRootIdentity);
734
- const parentDirectory = path.dirname(targetPath);
735
- await ensureConfinedDirectory(parentDirectory, repoRootIdentity);
736
- await assertConfinedRegularFile(targetPath, repoRootIdentity);
737
- const parentIdentity = await captureConfinedDirectoryIdentity(
738
- parentDirectory,
739
- operation,
740
- repoRootIdentity,
741
- );
742
-
743
- await assertSameDirectoryIdentity(parentDirectory, parentIdentity, operation, repoRootIdentity);
744
- await runStableMutation(
745
- parentDirectory,
746
- {
747
- operation: "write",
748
- parent: parentIdentity,
749
- target: path.basename(targetPath),
750
- temporary: `.hi-${randomUUID()}.tmp`,
751
- },
752
- content,
753
- );
754
- await assertSameDirectoryIdentity(parentDirectory, parentIdentity, operation, repoRootIdentity);
755
- }
756
-
757
- async function readConfinedRegularFile(targetPath, maximumBytes = 16 * 1024 * 1024) {
758
- const operation = "read scaffold content";
759
- const repoRootIdentity = repoRootIdentityForOperation(operation);
760
- const target = await assertConfinedRegularFile(targetPath, repoRootIdentity);
761
- if (target === null) {
762
- await assertRepoRootIdentity(repoRootIdentity, operation);
763
- return null;
764
- }
765
- const parentDirectory = path.dirname(targetPath);
766
- const parentIdentity = await captureConfinedDirectoryIdentity(
767
- parentDirectory,
768
- operation,
769
- repoRootIdentity,
770
- );
771
- await assertSameDirectoryIdentity(parentDirectory, parentIdentity, operation, repoRootIdentity);
772
- try {
773
- const result = await runStableMutation(parentDirectory, {
774
- expectedTarget: {
775
- device: target.dev,
776
- inode: target.ino,
777
- kind: "file",
778
- },
779
- maximumBytes,
780
- operation: "read",
781
- parent: parentIdentity,
782
- target: path.basename(targetPath),
783
- });
784
- await assertSameDirectoryIdentity(parentDirectory, parentIdentity, operation, repoRootIdentity);
785
- if (typeof result.content !== "string") {
786
- throw new Error("Confined filesystem read returned no content.");
787
- }
788
- return Buffer.from(result.content, "base64");
789
- } catch (error) {
790
- await assertSameDirectoryIdentity(parentDirectory, parentIdentity, operation, repoRootIdentity);
791
- if (error?.code === "ENOENT") return null;
792
- throw error;
793
- }
794
- }
795
-
796
- const codexDir = path.join(repoRoot, ".codex");
797
- const codexAgentsDir = path.join(codexDir, "agents");
798
- const codexHooksDir = path.join(codexDir, "hooks");
799
- const codexConfigPath = path.join(codexDir, "config.toml");
800
- const codexAgentsMirrorPath = path.join(codexDir, "AGENTS.md");
801
-
802
- const claudeDir = path.join(repoRoot, ".claude");
803
- const claudeAgentsDir = path.join(claudeDir, "agents");
804
- const claudeHooksDir = path.join(claudeDir, "hooks");
805
- const claudeSettingsPath = path.join(claudeDir, "settings.json");
806
- const claudeAgentsMirrorPath = path.join(claudeDir, "CLAUDE.md");
807
- const claudeSkillsMirrorPath = path.join(claudeDir, "skills");
808
-
809
- const cursorDir = path.join(repoRoot, ".cursor");
810
- const cursorAgentsDir = path.join(cursorDir, "agents");
811
- const cursorHooksDir = path.join(cursorDir, "hooks");
812
- const cursorHooksJsonPath = path.join(cursorDir, "hooks.json");
813
-
814
- const opencodeDir = path.join(repoRoot, ".opencode");
815
- const opencodeAgentsDir = path.join(opencodeDir, "agents");
816
- const opencodePluginsDir = path.join(opencodeDir, "plugins");
817
- const opencodeAgentsMirrorPath = path.join(opencodeDir, "AGENTS.md");
818
- const opencodeConfigPath = path.join(repoRoot, "opencode.json");
819
-
820
- const managedHeader = [
821
- "# Generated by scripts/sync-subagents.mjs.",
822
- "# Do not edit by hand; update .agents/subagents/manifest.mjs and re-run sync.",
823
- ].join("\n");
824
- const claudeManagedComment =
825
- "<!-- Generated by scripts/sync-subagents.mjs. Edit .agents/subagents/manifest.mjs instead. -->";
826
- const cursorManagedComment =
827
- "<!-- Generated by scripts/sync-subagents.mjs. Edit .agents/subagents/manifest.mjs instead. -->";
828
- const opencodeManagedComment =
829
- "<!-- Generated by scripts/sync-subagents.mjs. Edit .agents/subagents/manifest.mjs instead. -->";
830
- const claudeUpdateCheckCommand =
831
- 'node "$CLAUDE_PROJECT_DIR"/.claude/hooks/scaffold-update-check.mjs claude';
832
- const claudeFormatCommand =
833
- 'node "$CLAUDE_PROJECT_DIR"/.claude/hooks/format-edited-file.mjs claude';
834
-
835
- function buildCodexAgentConfig({ hasFormatHook, hasUpdateCheckHook }) {
836
- const lines = [
837
- "[agents]",
838
- "max_depth = 1",
839
- "",
840
- "[features]",
841
- "codex_hooks = true",
842
- "",
843
- "[hooks]",
844
- ];
845
-
846
- if (hasFormatHook || hasUpdateCheckHook) {
847
- const sessionStartHooks = [];
848
- if (hasUpdateCheckHook) {
849
- sessionStartHooks.push(
850
- ' { type = "command", command = "node \\"$(git rev-parse --show-toplevel)/.codex/hooks/scaffold-update-check.mjs\\" codex", statusMessage = "Checking Harness scaffold", timeout = 60 },',
851
- );
852
- }
853
- if (hasFormatHook) {
854
- sessionStartHooks.push(
855
- ' { type = "command", command = "node \\"$(git rev-parse --show-toplevel)/.codex/hooks/format-edited-file.mjs\\" session-start", statusMessage = "Capturing edited-file baseline", timeout = 30 },',
856
- );
857
- }
858
- lines.push(
859
- "SessionStart = [",
860
- ' { matcher = "startup|resume", hooks = [',
861
- ...sessionStartHooks,
862
- " ] },",
863
- "]",
864
- );
865
- }
866
-
867
- if (hasFormatHook) {
868
- lines.push(
869
- "PostToolUse = [",
870
- ' { matcher = "Bash|apply_patch|.*apply.?patch.*|edit|write|multiedit", hooks = [',
871
- ' { type = "command", command = "node \\"$(git rev-parse --show-toplevel)/.codex/hooks/format-edited-file.mjs\\" post", statusMessage = "Auto-formatting edited files", timeout = 30 },',
872
- " ] },",
873
- "]",
874
- );
875
- }
876
-
877
- lines.push("");
878
- return lines.join("\n");
879
- }
880
-
881
- function isObject(value) {
882
- return typeof value === "object" && value !== null && !Array.isArray(value);
883
- }
884
-
885
- function removeClaudeHookCommand(entries, command) {
886
- if (!Array.isArray(entries)) {
887
- return [];
888
- }
889
-
890
- return entries.flatMap((entry) => {
891
- if (!isObject(entry) || !Array.isArray(entry.hooks)) {
892
- return [entry];
893
- }
894
-
895
- const hooks = entry.hooks.filter((hook) => !isObject(hook) || hook.command !== command);
896
- return hooks.length === 0 ? [] : [{ ...entry, hooks }];
897
- });
898
- }
899
-
900
- function setClaudeHookEntries(hooks, key, entries) {
901
- if (entries.length > 0) {
902
- hooks[key] = entries;
903
- } else {
904
- delete hooks[key];
905
- }
906
- }
907
-
908
- function buildClaudeSettingsConfig(existingConfig, { hasFormatHook, hasUpdateCheckHook }) {
909
- const config = isObject(existingConfig) ? existingConfig : {};
910
- const existingHooks = isObject(config.hooks) ? config.hooks : {};
911
- const hooks = { ...existingHooks };
912
- const sessionStartHooks = removeClaudeHookCommand(
913
- existingHooks.SessionStart,
914
- claudeUpdateCheckCommand,
915
- );
916
- const postToolUseHooks = removeClaudeHookCommand(existingHooks.PostToolUse, claudeFormatCommand);
917
-
918
- if (hasUpdateCheckHook) {
919
- hooks.SessionStart = [
920
- ...sessionStartHooks,
921
- {
922
- hooks: [
923
- {
924
- type: "command",
925
- command: claudeUpdateCheckCommand,
926
- timeout: 60,
927
- },
928
- ],
929
- },
930
- ];
931
- } else {
932
- setClaudeHookEntries(hooks, "SessionStart", sessionStartHooks);
933
- }
934
-
935
- if (hasFormatHook) {
936
- hooks.PostToolUse = [
937
- ...postToolUseHooks,
938
- {
939
- matcher: "Edit|Write|MultiEdit",
940
- hooks: [
941
- {
942
- type: "command",
943
- command: claudeFormatCommand,
944
- timeout: 30,
945
- },
946
- ],
947
- },
948
- ];
949
- } else {
950
- setClaudeHookEntries(hooks, "PostToolUse", postToolUseHooks);
951
- }
952
-
953
- return {
954
- ...config,
955
- hooks,
956
- };
957
- }
958
-
959
- function buildCursorHooksConfig({ hasFormatHook, hasUpdateCheckHook }) {
960
- const hooks = {};
961
-
962
- if (hasUpdateCheckHook) {
963
- hooks.sessionStart = [
964
- {
965
- command: "node .cursor/hooks/scaffold-update-check.mjs cursor",
966
- timeout: 60000,
967
- },
968
- ];
969
- }
970
-
971
- if (hasFormatHook) {
972
- hooks.afterFileEdit = [
973
- {
974
- command: "node .cursor/hooks/format-edited-file.mjs cursor",
975
- },
976
- ];
977
- }
978
-
979
- return {
980
- version: 1,
981
- hooks,
982
- };
983
- }
984
-
985
- function buildOpenCodeConfig(existingConfig, { hasFormatHook }) {
986
- const config = { ...existingConfig };
987
- const formatter =
988
- typeof config.formatter === "object" && config.formatter !== null
989
- ? { ...config.formatter }
990
- : {};
991
- delete formatter["harness-format-edited-file"];
992
-
993
- if (hasFormatHook) {
994
- formatter["harness-format-edited-file"] = {
995
- command: ["node", ".agents/hooks/format-edited-file.mjs", "files", "$FILE"],
996
- extensions: [".js", ".jsx", ".ts", ".tsx", ".mjs", ".cjs", ".json", ".py"],
997
- };
998
- }
999
- if (Object.keys(formatter).length > 0) {
1000
- config.formatter = formatter;
1001
- } else {
1002
- delete config.formatter;
1003
- }
1004
-
1005
- return {
1006
- $schema: "https://opencode.ai/config.json",
1007
- ...config,
1008
- };
1009
- }
1010
-
1011
- async function readJsonFile(filePath) {
1012
- try {
1013
- const content = await readConfinedRegularFile(filePath);
1014
- return content === null ? {} : JSON.parse(content.toString("utf8"));
1015
- } catch (error) {
1016
- if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") {
1017
- return {};
1018
- }
1019
- throw error;
1020
- }
1021
- }
1022
-
1023
- function getSkillNames(agent) {
1024
- if (Array.isArray(agent.skills)) {
1025
- return [...new Set(agent.skills)];
1026
- }
1027
-
1028
- return [...new Set(agent.packs.flatMap((pack) => capabilityPacks[pack].skills))];
1029
- }
1030
-
1031
- function formatList(items) {
1032
- return items.map((item) => `- ${item}`).join("\n");
1033
- }
1034
-
1035
- function relativeSkillPath(skillName) {
1036
- const absoluteSkillDir = path.join(sharedSkillsPath, skillName);
1037
- return path.relative(codexAgentsDir, absoluteSkillDir);
1038
- }
1039
-
1040
- function yamlString(value) {
1041
- return JSON.stringify(value);
1042
- }
1043
-
1044
- function encodeJson(value) {
1045
- return `${JSON.stringify(value, null, 2)}\n`;
1046
- }
1047
-
1048
- function encodeOpencodeJson(value, depth = 0) {
1049
- const indent = " ".repeat(depth);
1050
- const childIndent = " ".repeat(depth + 1);
1051
-
1052
- if (Array.isArray(value)) {
1053
- return `[${value.map((item) => JSON.stringify(item)).join(", ")}]`;
1054
- }
1055
-
1056
- if (value && typeof value === "object") {
1057
- const entries = Object.entries(value);
1058
- if (entries.length === 0) {
1059
- return "{}";
1060
- }
1061
-
1062
- const body = entries
1063
- .map(
1064
- ([key, entry]) =>
1065
- `${childIndent}${JSON.stringify(key)}: ${encodeOpencodeJson(entry, depth + 1)}`,
1066
- )
1067
- .join(",\n");
1068
-
1069
- return `{\n${body}\n${indent}}`;
1070
- }
1071
-
1072
- return JSON.stringify(value);
1073
- }
1074
-
1075
- function encodeOpenCodeConfig(value) {
1076
- return `${encodeOpencodeJson(value)}\n`;
1077
- }
1078
-
1079
- async function readGuidance(files) {
1080
- const entries = await Promise.all(
1081
- files.map(async (file) => {
1082
- const absolutePath = path.join(repoRoot, file);
1083
- let content = "";
1084
-
1085
- try {
1086
- content = await readFile(absolutePath, "utf8");
1087
- } catch (error) {
1088
- if (!(error && typeof error === "object" && "code" in error && error.code === "ENOENT")) {
1089
- throw error;
1090
- }
1091
-
1092
- content = [
1093
- `Missing neutral guidance source: ${file}.`,
1094
- "Author the scoped AGENTS.md file, create the sibling CLAUDE.md symlink mirror, then rerun .agents/scripts/sync-subagents.mjs.",
1095
- ].join("\n");
1096
- }
1097
-
1098
- return `### ${file}\n${content.trim()}`;
1099
- }),
1100
- );
1101
-
1102
- return entries.join("\n\n");
1103
- }
1104
-
1105
- function buildPrompt(agent, guidance) {
1106
- const packs = agent.packs.map((pack) => {
1107
- const definition = capabilityPacks[pack];
1108
- return `${pack}: ${definition.description}`;
1109
- });
1110
-
1111
- return [
1112
- `You are the ${agent.name} specialist for this repository.`,
1113
- "",
1114
- "Operate as a narrow owner for the assigned slice instead of broadening scope.",
1115
- "",
1116
- "Primary ownership:",
1117
- formatList(agent.ownedPaths),
1118
- "",
1119
- "Preloaded capability packs:",
1120
- formatList(packs),
1121
- "",
1122
- "Boundary rules:",
1123
- formatList(agent.boundaries),
1124
- "",
1125
- "Scoped skill activation:",
1126
- formatList(agent.activationInstructions ?? []),
1127
- "",
1128
- "Execution expectations:",
1129
- formatList([
1130
- "Prefer doing the assigned slice well over exploring adjacent areas.",
1131
- "If the task clearly belongs to a different specialist, say so explicitly instead of improvising outside your scope.",
1132
- "Keep repo boundaries intact unless the parent explicitly assigns cross-surface coordination.",
1133
- "If your work changes architecture, setup, contracts, decisions, or operator workflow, update the relevant docs or runbook in the same task.",
1134
- ]),
1135
- "",
1136
- "Baked-in scoped guidance:",
1137
- guidance,
1138
- ].join("\n");
1139
- }
1140
-
1141
- function buildClaudeAgent(agent, prompt, skillNames) {
1142
- const frontmatter = [
1143
- "---",
1144
- `name: ${yamlString(agent.name)}`,
1145
- `description: ${yamlString(agent.description)}`,
1146
- "model: inherit",
1147
- "skills:",
1148
- ...skillNames.map((skillName) => ` - ${skillName}`),
1149
- "---",
1150
- "",
1151
- ].join("\n");
1152
-
1153
- return `${frontmatter}${claudeManagedComment}\n\n${prompt}\n`;
1154
- }
1155
-
1156
- function buildCodexAgent(agent, prompt, skillNames) {
1157
- const lines = [
1158
- managedHeader,
1159
- "",
1160
- `name = ${JSON.stringify(agent.name)}`,
1161
- `description = ${JSON.stringify(agent.description)}`,
1162
- 'model_reasoning_effort = "medium"',
1163
- `developer_instructions = """\n${prompt}\n"""`,
1164
- ];
1165
-
1166
- for (const skillName of skillNames) {
1167
- lines.push("");
1168
- lines.push("[[skills.config]]");
1169
- lines.push(`path = ${JSON.stringify(relativeSkillPath(skillName))}`);
1170
- lines.push("enabled = true");
1171
- }
1172
-
1173
- return `${lines.join("\n")}\n`;
1174
- }
1175
-
1176
- function buildCursorAgent(agent, prompt) {
1177
- const frontmatter = [
1178
- "---",
1179
- `name: ${agent.name}`,
1180
- `description: ${yamlString(agent.description)}`,
1181
- "model: inherit",
1182
- "---",
1183
- "",
1184
- ].join("\n");
1185
-
1186
- return `${frontmatter}${cursorManagedComment}\n\n${prompt}\n`;
1187
- }
1188
-
1189
- function buildOpenCodeAgent(agent, prompt) {
1190
- const frontmatter = [
1191
- "---",
1192
- `description: ${yamlString(agent.description)}`,
1193
- "mode: subagent",
1194
- "---",
1195
- "",
1196
- ].join("\n");
1197
-
1198
- return `${frontmatter}${opencodeManagedComment}\n\n${prompt}\n`;
1199
- }
1200
-
1201
- const fileDigest = async (filePath) =>
1202
- createHash("sha256")
1203
- .update(await readFile(filePath))
1204
- .digest("hex");
1205
-
1206
- const copyFallbackKey = ({ source, target }) => `${source}\0${target}`;
1207
-
1208
- async function ensureSymlink(linkPath, targetPath, fallbackIdentity) {
1209
- const repoRootIdentity = repoRootIdentityForOperation("create scaffold symlink");
1210
- const relativeTarget = path.relative(path.dirname(linkPath), targetPath);
1211
- await ensureConfinedDirectory(path.dirname(linkPath), repoRootIdentity);
1212
-
1213
- try {
1214
- const existingStat = await lstat(linkPath);
1215
-
1216
- if (existingStat.isSymbolicLink() && (await readlink(linkPath)) === relativeTarget) {
1217
- return;
1218
- }
1219
- } catch (error) {
1220
- if (!(error && typeof error === "object" && "code" in error && error.code === "ENOENT")) {
1221
- throw error;
1222
- }
1223
- }
1224
-
1225
- await removeConfinedPath(linkPath, { recursive: true });
1226
- const parentDirectory = path.dirname(linkPath);
1227
- const parentIdentity = await captureConfinedDirectoryIdentity(
1228
- parentDirectory,
1229
- "create scaffold symlink",
1230
- repoRootIdentity,
1231
- );
1232
- const targetStat = process.platform === "win32" ? await lstat(targetPath) : undefined;
1233
- const symlinkType = targetStat?.isDirectory() ? "junction" : undefined;
1234
-
1235
- try {
1236
- await assertConfinedDirectoryComponents(
1237
- confinedRelativePath(linkPath, "create scaffold symlink").split(path.sep).slice(0, -1),
1238
- "create scaffold symlink",
1239
- repoRootIdentity,
1240
- );
1241
- await assertSameDirectoryIdentity(
1242
- parentDirectory,
1243
- parentIdentity,
1244
- "create scaffold symlink",
1245
- repoRootIdentity,
1246
- );
1247
- await runStableMutation(parentDirectory, {
1248
- linkTarget: symlinkType === "junction" ? targetPath : relativeTarget,
1249
- operation: "symlink",
1250
- parent: parentIdentity,
1251
- target: path.basename(linkPath),
1252
- ...(symlinkType === undefined ? {} : { type: symlinkType }),
1253
- });
1254
- await assertSameDirectoryIdentity(
1255
- parentDirectory,
1256
- parentIdentity,
1257
- "create scaffold symlink",
1258
- repoRootIdentity,
1259
- );
1260
- } catch (error) {
1261
- if (!(error && typeof error === "object" && "code" in error && error.code === "EPERM")) {
1262
- throw error;
1263
- }
1264
-
1265
- const copyTargetStat = await lstat(targetPath);
1266
- await assertSameDirectoryIdentity(
1267
- parentDirectory,
1268
- parentIdentity,
1269
- "copy scaffold fallback",
1270
- repoRootIdentity,
1271
- );
1272
- await runStableMutation(parentDirectory, {
1273
- expectedTarget: { kind: "absent" },
1274
- operation: "copy",
1275
- parent: parentIdentity,
1276
- recursive: copyTargetStat.isDirectory(),
1277
- source: targetPath,
1278
- target: path.basename(linkPath),
1279
- });
1280
- await assertSameDirectoryIdentity(
1281
- parentDirectory,
1282
- parentIdentity,
1283
- "copy scaffold fallback",
1284
- repoRootIdentity,
1285
- );
1286
- if (fallbackIdentity !== undefined && !copyTargetStat.isDirectory()) {
1287
- currentCopyFallbacks.set(copyFallbackKey(fallbackIdentity), {
1288
- ...fallbackIdentity,
1289
- digest: await fileDigest(linkPath),
1290
- });
1291
- }
1292
- }
1293
- }
1294
-
1295
- async function pathExists(filePath) {
1296
- try {
1297
- await lstat(filePath);
1298
- return true;
1299
- } catch (error) {
1300
- if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") {
1301
- return false;
1302
- }
1303
- throw error;
1304
- }
1305
- }
1306
-
1307
- async function writeManagedFiles(directory, extension, renderedByName, writeCurrent = true) {
1308
- await ensureConfinedDirectory(directory);
1309
-
1310
- const managedNames = new Set(Object.keys(renderedByName).map((name) => `${name}.${extension}`));
1311
-
1312
- for (const filename of await readdir(directory)) {
1313
- if (!filename.endsWith(`.${extension}`)) {
1314
- continue;
1315
- }
1316
-
1317
- const filePath = path.join(directory, filename);
1318
- await assertConfinedRegularFile(filePath);
1319
- const existingBytes = await readConfinedRegularFile(filePath);
1320
- if (existingBytes === null) continue;
1321
- const existingContent = existingBytes.toString("utf8");
1322
- const isManaged =
1323
- extension === "toml"
1324
- ? existingContent.startsWith(managedHeader)
1325
- : existingContent.includes(claudeManagedComment);
1326
-
1327
- if (isManaged && !managedNames.has(filename)) {
1328
- await removeConfinedPath(filePath);
1329
- }
1330
- }
1331
-
1332
- if (writeCurrent) {
1333
- for (const [name, content] of Object.entries(renderedByName)) {
1334
- await writeConfinedTextFile(path.join(directory, `${name}.${extension}`), content);
1335
- }
1336
- }
1337
- }
1338
-
1339
- async function syncHookSurface() {
1340
- await ensureConfinedDirectory(sharedHooksPath);
1341
- await ensureConfinedDirectory(codexHooksDir);
1342
- await ensureConfinedDirectory(claudeHooksDir);
1343
- await ensureConfinedDirectory(cursorHooksDir);
1344
- await ensureConfinedDirectory(opencodePluginsDir);
1345
-
1346
- for (const hookName of ["format-edited-file.mjs", "scaffold-update-check.mjs"]) {
1347
- const sourcePath = path.join(sharedHooksPath, hookName);
1348
- const targetPaths = [
1349
- path.join(codexHooksDir, hookName),
1350
- path.join(claudeHooksDir, hookName),
1351
- path.join(cursorHooksDir, hookName),
1352
- path.join(opencodePluginsDir, hookName),
1353
- ];
1354
-
1355
- if (await pathExists(sourcePath)) {
1356
- for (const targetPath of targetPaths) {
1357
- await ensureSymlink(targetPath, sourcePath);
1358
- }
1359
- } else {
1360
- for (const targetPath of targetPaths) {
1361
- await removeConfinedPath(targetPath, { recursive: true });
1362
- }
1363
- }
1364
- }
1365
- }
1366
-
1367
- async function syncSkillMirrors() {
1368
- await ensureSymlink(claudeSkillsMirrorPath, sharedSkillsPath);
1369
- }
1370
-
1371
- async function syncPromptMirrors() {
1372
- await ensureSymlink(codexAgentsMirrorPath, sharedAgentsPath);
1373
- await ensureSymlink(claudeAgentsMirrorPath, sharedAgentsPath);
1374
- await ensureSymlink(opencodeAgentsMirrorPath, sharedAgentsPath);
1375
- }
1376
-
1377
- async function prepareHarnessApplication() {
1378
- const claudeFiles = {};
1379
- const codexFiles = {};
1380
- const cursorFiles = {};
1381
- const opencodeFiles = {};
1382
-
1383
- for (const agent of agents) {
1384
- const guidance = await readGuidance(agent.guidanceFiles);
1385
- const prompt = buildPrompt(agent, guidance);
1386
- const skillNames = getSkillNames(agent);
1387
-
1388
- claudeFiles[agent.name] = buildClaudeAgent(agent, prompt, skillNames);
1389
- codexFiles[agent.name] = buildCodexAgent(agent, prompt, skillNames);
1390
- cursorFiles[agent.name] = buildCursorAgent(agent, prompt);
1391
- opencodeFiles[agent.name] = buildOpenCodeAgent(agent, prompt);
1392
- }
1393
-
1394
- const availableHooks = {
1395
- hasFormatHook: await pathExists(path.join(sharedHooksPath, "format-edited-file.mjs")),
1396
- hasUpdateCheckHook: await pathExists(path.join(sharedHooksPath, "scaffold-update-check.mjs")),
1397
- };
1398
- return {
1399
- availableHooks,
1400
- rendered: {
1401
- claude: claudeFiles,
1402
- codex: codexFiles,
1403
- cursor: cursorFiles,
1404
- opencode: opencodeFiles,
1405
- },
1406
- };
1407
- }
1408
-
1409
- const harnessAgentSurface = {
1410
- claude: { directory: claudeAgentsDir, extension: "md" },
1411
- codex: { directory: codexAgentsDir, extension: "toml" },
1412
- cursor: { directory: cursorAgentsDir, extension: "md" },
1413
- opencode: { directory: opencodeAgentsDir, extension: "md" },
1414
- };
1415
-
1416
- const harnessConfigPath = {
1417
- claude: claudeSettingsPath,
1418
- codex: codexConfigPath,
1419
- cursor: cursorHooksJsonPath,
1420
- opencode: opencodeConfigPath,
1421
- };
1422
-
1423
- const harnessHookSurface = {
1424
- claude: claudeHooksDir,
1425
- codex: codexHooksDir,
1426
- cursor: cursorHooksDir,
1427
- opencode: opencodePluginsDir,
1428
- };
1429
-
1430
- const actionTargetPath = (action) => {
1431
- const target = action.file ?? action.target ?? action.nativePath;
1432
- return typeof target === "string" ? target.split("#", 1)[0] : undefined;
1433
- };
1434
-
1435
- const actionPathFields = [
1436
- "source",
1437
- "target",
1438
- "file",
1439
- "nativePath",
1440
- "canonicalPath",
1441
- "directory",
1442
- "config.path",
1443
- ];
1444
- const harnessActionOperations = new Set([
1445
- "cleanup-managed-agents",
1446
- "merge-json",
1447
- "merge-toml",
1448
- "mirror",
1449
- "native",
1450
- "reconcile-lifecycle-hooks",
1451
- "render",
1452
- "render-template",
1453
- "use-native-mirror",
1454
- "use-native-prompt",
1455
- "use-native-skill",
1456
- ]);
1457
-
1458
- const actionPathValue = (action, field) =>
1459
- field === "config.path" ? action.config?.path : action[field];
1460
-
1461
- const isPathWithin = (root, candidate) => {
1462
- const relative = path.relative(root, candidate);
1463
- return (
1464
- relative === "" ||
1465
- (!relative.startsWith(`..${path.sep}`) && relative !== ".." && !path.isAbsolute(relative))
1466
- );
1467
- };
1468
-
1469
- const resolveActionPath = (value, field) => {
1470
- if (typeof value !== "string") {
1471
- throw new Error(`Harness action ${field} path must be a string`);
1472
- }
1473
- const candidate = value.split("#", 1)[0];
1474
- const portableCandidate = candidate.replaceAll("\\", "/");
1475
- if (
1476
- candidate.length === 0 ||
1477
- path.isAbsolute(candidate) ||
1478
- path.win32.isAbsolute(candidate) ||
1479
- portableCandidate.split("/").includes("..")
1480
- ) {
1481
- throw new Error(`Harness action ${field} path escapes the repository: ${value}`);
1482
- }
1483
- const resolved = path.resolve(repoRoot, portableCandidate);
1484
- const relative = path.relative(repoRoot, resolved);
1485
- if (relative === ".." || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {
1486
- throw new Error(`Harness action ${field} path escapes the repository: ${value}`);
1487
- }
1488
- return resolved;
1489
- };
1490
-
1491
- const resolveActionPaths = (action) =>
1492
- Object.fromEntries(
1493
- [
1494
- ...actionPathFields.flatMap((field) => {
1495
- const value = actionPathValue(action, field);
1496
- return value === undefined ? [] : [[field, value]];
1497
- }),
1498
- ...(action.managedHookFiles ?? []).map((value, index) => [
1499
- `managedHookFiles[${index}]`,
1500
- value,
1501
- ]),
1502
- ].map(([field, value]) => [field, resolveActionPath(value, field)]),
1503
- );
1504
-
1505
- const hasInvalidActionPaths = (action) => {
1506
- try {
1507
- resolveActionPaths(action);
1508
- return false;
1509
- } catch {
1510
- return true;
1511
- }
1512
- };
1513
-
1514
- async function nearestExistingPath(candidate) {
1515
- let current = candidate;
1516
- while (!(await pathExists(current))) {
1517
- const parent = path.dirname(current);
1518
- if (parent === current) {
1519
- break;
1520
- }
1521
- current = parent;
1522
- }
1523
- return current;
1524
- }
1525
-
1526
- async function assertRealPathContainment(action, actionPaths) {
1527
- const realRepoRoot = await realpath(repoRoot);
1528
- for (const [field, candidate] of Object.entries(actionPaths)) {
1529
- const ancestor = await nearestExistingPath(candidate);
1530
- const realAncestor = await realpath(ancestor);
1531
- if (!isPathWithin(realRepoRoot, realAncestor)) {
1532
- throw new Error(
1533
- `Harness action ${field} path escapes the repository: ${actionPathValue(action, field)}`,
1534
- );
1535
- }
1536
- }
1537
- }
1538
-
1539
- async function writeAdapterConfig(adapterId, availableHooks) {
1540
- if (adapterId === "codex") {
1541
- await writeConfinedTextFile(codexConfigPath, buildCodexAgentConfig(availableHooks));
1542
- await removeConfinedPath(path.join(codexDir, "hooks.json"));
1543
- return;
1544
- }
1545
- if (adapterId === "claude") {
1546
- await assertConfinedRegularFile(claudeSettingsPath);
1547
- await writeConfinedTextFile(
1548
- claudeSettingsPath,
1549
- encodeJson(buildClaudeSettingsConfig(await readJsonFile(claudeSettingsPath), availableHooks)),
1550
- );
1551
- return;
1552
- }
1553
- if (adapterId === "cursor") {
1554
- await writeConfinedTextFile(
1555
- cursorHooksJsonPath,
1556
- encodeJson(buildCursorHooksConfig(availableHooks)),
1557
- );
1558
- return;
1559
- }
1560
- if (adapterId === "opencode") {
1561
- await assertConfinedRegularFile(opencodeConfigPath);
1562
- await writeConfinedTextFile(
1563
- opencodeConfigPath,
1564
- encodeOpenCodeConfig(
1565
- buildOpenCodeConfig(await readJsonFile(opencodeConfigPath), availableHooks),
1566
- ),
1567
- );
1568
- }
1569
- }
1570
-
1571
- const hookIdForAction = (action) =>
1572
- action.id.includes(":lifecycle-hook:") ? action.trace?.contribution?.id : undefined;
1573
-
1574
- async function reconcileLifecycleHooks(action, adapterId, actionPaths) {
1575
- const activeHookIds = new Set();
1576
- for (const hookId of action.hookIds) {
1577
- if (await pathExists(path.join(sharedHooksPath, `${hookId}.mjs`))) {
1578
- activeHookIds.add(hookId);
1579
- }
1580
- }
1581
- for (const [index, managedHookFile] of action.managedHookFiles.entries()) {
1582
- const hookId = path.basename(managedHookFile, ".mjs");
1583
- if (!activeHookIds.has(hookId)) {
1584
- await removeConfinedPath(actionPaths[`managedHookFiles[${index}]`], { recursive: true });
1585
- }
1586
- }
1587
- const projectedHooks = {
1588
- hasFormatHook: action.configurations.some(
1589
- (configuration) =>
1590
- hookIdForAction(configuration) === "format-edited-file" &&
1591
- activeHookIds.has("format-edited-file"),
1592
- ),
1593
- hasUpdateCheckHook: action.configurations.some(
1594
- (configuration) =>
1595
- hookIdForAction(configuration) === "scaffold-update-check" &&
1596
- activeHookIds.has("scaffold-update-check"),
1597
- ),
1598
- };
1599
- if (
1600
- adapterId !== "opencode" ||
1601
- projectedHooks.hasFormatHook ||
1602
- (await pathExists(opencodeConfigPath))
1603
- ) {
1604
- await writeAdapterConfig(adapterId, projectedHooks);
1605
- }
1606
- }
1607
-
1608
- async function applyHarnessAction(action, application) {
1609
- const actionPaths = resolveActionPaths(action);
1610
- await assertRealPathContainment(action, actionPaths);
1611
- const adapterId = action.trace.adapter.id;
1612
-
1613
- if (action.operation === "cleanup-managed-agents") {
1614
- await writeManagedFiles(
1615
- actionPaths.directory,
1616
- action.extension,
1617
- application.rendered[adapterId],
1618
- false,
1619
- );
1620
- return;
1621
- }
1622
- if (action.operation === "reconcile-lifecycle-hooks") {
1623
- await reconcileLifecycleHooks(action, adapterId, actionPaths);
1624
- return;
1625
- }
1626
- if (action.operation === "use-native-mirror") {
1627
- await syncSkillMirrors();
1628
- return;
1629
- }
1630
- if (
1631
- action.operation === "use-native-skill" ||
1632
- action.operation === "use-native-prompt" ||
1633
- action.operation === "native"
1634
- ) {
1635
- return;
1636
- }
1637
- if (action.operation === "mirror") {
1638
- if (action.source !== action.target) {
1639
- const sourcePath = actionPaths.source;
1640
- const targetPath = actionPaths.target;
1641
- if (!(await pathExists(sourcePath))) {
1642
- throw new Error(`Missing canonical source: ${action.source}`);
1643
- }
1644
- if (await pathExists(targetPath)) {
1645
- const targetStat = await lstat(targetPath);
1646
- const previousCopy = previousCopyFallbacks.find(
1647
- (copy) => copy.source === action.source && copy.target === action.target,
1648
- );
1649
- const isManagedCopy =
1650
- targetStat.isFile() &&
1651
- previousCopy !== undefined &&
1652
- (await fileDigest(targetPath)) === previousCopy.digest;
1653
- if (
1654
- !targetStat.isSymbolicLink() &&
1655
- !isManagedCopy &&
1656
- action.id.includes(":scoped-prompt:")
1657
- ) {
1658
- throw new Error(
1659
- `Consumer prompt target requires explicit preservation: ${action.target}`,
1660
- );
1661
- }
1662
- }
1663
- await ensureSymlink(targetPath, sourcePath, {
1664
- source: action.source,
1665
- target: action.target,
1666
- });
1667
- }
1668
- return;
1669
- }
1670
- if (action.operation === "merge-json" || action.operation === "merge-toml") {
1671
- return;
1672
- }
1673
- if (action.operation === "render-template" || action.operation === "render") {
1674
- const name = action.templateId ?? action.contributionId;
1675
- const content = application.rendered[adapterId]?.[name];
1676
- const target = actionTargetPath(action);
1677
- if (typeof content !== "string" || target === undefined) {
1678
- throw new Error(`Missing ${adapterId} render input for ${name ?? "unknown template"}`);
1679
- }
1680
- const targetPath = resolveActionPath(target, "target");
1681
- await writeConfinedTextFile(targetPath, content);
1682
- return;
1683
- }
1684
-
1685
- throw new Error(`Unknown harness application operation: ${action.operation}`);
1686
- }
1687
-
1688
- async function cleanupManagedAgents(application, writeCurrent = false) {
1689
- for (const [adapterId, surface] of Object.entries(harnessAgentSurface)) {
1690
- const rendered = application.rendered[adapterId];
1691
- await writeManagedFiles(surface.directory, surface.extension, rendered, writeCurrent);
1692
- }
1693
- }
1694
-
1695
- async function materializeLegacyHarnesses(application) {
1696
- await writeAdapterConfig("codex", application.availableHooks);
1697
- await writeAdapterConfig("claude", application.availableHooks);
1698
- await writeAdapterConfig("cursor", application.availableHooks);
1699
- if (application.availableHooks.hasFormatHook || (await pathExists(opencodeConfigPath))) {
1700
- await writeAdapterConfig("opencode", application.availableHooks);
1701
- }
1702
- await cleanupManagedAgents(application, true);
1703
- await syncPromptMirrors();
1704
- await syncSkillMirrors();
1705
- await syncHookSurface();
1706
- }
1707
-
1708
- const summaryState = (summary) =>
1709
- summary._tag === "HarnessProjectionFailure"
1710
- ? {
1711
- applied: summary.completed,
1712
- omissions: summary.omissions,
1713
- failures: summary.errors,
1714
- }
1715
- : {
1716
- applied: summary.applied,
1717
- omissions: summary._tag === "HarnessProjectionPartial" ? summary.omissions : [],
1718
- failures: [],
1719
- };
1720
-
1721
- const projectionEvidence = ({ adapter, projection, summary }) => {
1722
- const state = summaryState(summary);
1723
- return {
1724
- adapter: adapter.matrix.adapter,
1725
- matrixVersion: adapter.matrix.matrixVersion,
1726
- actions: projection.actions,
1727
- warnings: [
1728
- ...state.applied
1729
- .filter(({ support }) => support === "degraded")
1730
- .map(({ reason, trace }) => ({
1731
- _tag: "DegradedHarnessCapabilityWarning",
1732
- reason,
1733
- trace,
1734
- })),
1735
- ...state.omissions.map(({ warning, trace }) => ({ ...warning, trace })),
1736
- ],
1737
- omissions: state.omissions,
1738
- failures: state.failures,
1739
- };
1740
- };
1741
-
1742
- const receiptStatus = (projections) =>
1743
- projections.some(({ failures }) => failures.length > 0)
1744
- ? "failure"
1745
- : projections.some(({ warnings, omissions }) => warnings.length > 0 || omissions.length > 0)
1746
- ? "partial"
1747
- : "success";
1748
-
1749
- const projectSafely = (adapter, contextPlan) => {
1750
- try {
1751
- const issue = canonicalContextIssue(contextPlan);
1752
- if (issue !== undefined) {
1753
- throw new Error(issue);
1754
- }
1755
- return project({ adapter, contextPlan });
1756
- } catch (error) {
1757
- return {
1758
- actions: [],
1759
- summary: {
1760
- _tag: "HarnessProjectionFailure",
1761
- completed: [],
1762
- omissions: [],
1763
- errors: [
1764
- {
1765
- _tag: "InvalidHarnessProjectionError",
1766
- trace: {
1767
- contextPlanVersion: contextPlanVersion(contextPlan),
1768
- scopeId: "unknown",
1769
- kind: "skill",
1770
- contribution: { id: "context-plan", version: "unknown" },
1771
- adapter: adapter.matrix.adapter,
1772
- matrixVersion: adapter.matrix.matrixVersion,
1773
- },
1774
- message: error instanceof Error ? error.message : "Invalid canonical context plan",
1775
- },
1776
- ],
1777
- },
1778
- };
1779
- }
1780
- };
1781
-
1782
- const structuralIdentity = (value) => {
1783
- if (Array.isArray(value)) return `[${value.map(structuralIdentity).join(",")}]`;
1784
- if (isObject(value)) {
1785
- return `{${Object.entries(value)
1786
- .toSorted(([left], [right]) => (left === right ? 0 : left < right ? -1 : 1))
1787
- .map(([key, entry]) => `${JSON.stringify(key)}:${structuralIdentity(entry)}`)
1788
- .join(",")}}`;
1789
- }
1790
- return JSON.stringify(value) ?? String(value);
1791
- };
1792
-
1793
- const normalizeProjectionSummary = (summary) => {
1794
- const sort = (values) =>
1795
- [...values].toSorted((left, right) => {
1796
- const leftIdentity = structuralIdentity(left);
1797
- const rightIdentity = structuralIdentity(right);
1798
- return leftIdentity === rightIdentity ? 0 : leftIdentity < rightIdentity ? -1 : 1;
1799
- });
1800
- if (summary._tag === "HarnessProjectionSuccess") {
1801
- return { ...summary, applied: sort(summary.applied) };
1802
- }
1803
- if (summary._tag === "HarnessProjectionPartial") {
1804
- return { ...summary, applied: sort(summary.applied), omissions: sort(summary.omissions) };
1805
- }
1806
- return {
1807
- ...summary,
1808
- completed: sort(summary.completed),
1809
- errors: sort(summary.errors),
1810
- omissions: sort(summary.omissions),
1811
- };
1812
- };
1813
-
1814
- const normalizeProjection = (projection) => ({
1815
- actions: [...projection.actions].toSorted((left, right) =>
1816
- left.id === right.id ? 0 : left.id < right.id ? -1 : 1,
1817
- ),
1818
- summary: normalizeProjectionSummary(projection.summary),
1819
- });
1820
-
1821
- const withManagedAgentCleanup = (adapter, contextPlan, projection) => {
1822
- const surface = harnessAgentSurface[adapter.matrix.adapter.id];
1823
- if (canonicalContextIssue(contextPlan) !== undefined || surface === undefined) {
1824
- return projection;
1825
- }
1826
-
1827
- return {
1828
- ...projection,
1829
- actions: [
1830
- {
1831
- id: `${adapter.matrix.adapter.id}:cleanup-managed-agents`,
1832
- operation: "cleanup-managed-agents",
1833
- directory: path.relative(repoRoot, surface.directory),
1834
- extension: surface.extension,
1835
- trace: {
1836
- contextPlanVersion: contextPlan.version,
1837
- operation: "managed-agent-cleanup",
1838
- adapter: adapter.matrix.adapter,
1839
- matrixVersion: adapter.matrix.matrixVersion,
1840
- },
1841
- },
1842
- ...projection.actions,
1843
- ],
1844
- };
1845
- };
1846
-
1847
- const withLifecycleHookReconciliation = (adapter, contextPlan, projection) => {
1848
- if (canonicalContextIssue(contextPlan) !== undefined) {
1849
- return projection;
1850
- }
1851
- const configPath = harnessConfigPath[adapter.matrix.adapter.id];
1852
- const hookDirectory = harnessHookSurface[adapter.matrix.adapter.id];
1853
- const lifecycleActions = projection.actions.filter((action) =>
1854
- action.id.includes(":lifecycle-hook:"),
1855
- );
1856
- return {
1857
- ...projection,
1858
- actions: [
1859
- ...projection.actions,
1860
- {
1861
- id: `${adapter.matrix.adapter.id}:reconcile-lifecycle-hooks`,
1862
- operation: "reconcile-lifecycle-hooks",
1863
- file: path.relative(repoRoot, configPath),
1864
- managedHookFiles: ["format-edited-file", "scaffold-update-check"].map((hookId) =>
1865
- path.relative(repoRoot, path.join(hookDirectory, `${hookId}.mjs`)),
1866
- ),
1867
- hookIds: [
1868
- ...new Set(
1869
- lifecycleActions.map(hookIdForAction).filter((hookId) => hookId !== undefined),
1870
- ),
1871
- ].toSorted(),
1872
- configurations: lifecycleActions.filter(
1873
- (action) =>
1874
- action.operation === "merge-json" ||
1875
- action.operation === "merge-toml" ||
1876
- action.config !== undefined,
1877
- ),
1878
- trace: {
1879
- contextPlanVersion: contextPlan.version,
1880
- operation: "lifecycle-hook-reconciliation",
1881
- adapter: adapter.matrix.adapter,
1882
- matrixVersion: adapter.matrix.matrixVersion,
1883
- },
1884
- },
1885
- ],
1886
- };
1887
- };
1888
-
1889
- const sameTrace = (left, right) =>
1890
- left.contextPlanVersion === right.contextPlanVersion &&
1891
- left.scopeId === right.scopeId &&
1892
- left.kind === right.kind &&
1893
- left.contribution.id === right.contribution.id &&
1894
- left.contribution.version === right.contribution.version &&
1895
- left.adapter.id === right.adapter.id &&
1896
- left.adapter.version === right.adapter.version &&
1897
- left.matrixVersion === right.matrixVersion;
1898
-
1899
- const withApplicationOmissions = (summary, omissions) => {
1900
- if (omissions.length === 0) {
1901
- return summary;
1902
- }
1903
- const omittedTraces = omissions.map(({ trace }) => trace);
1904
- const keepApplied = ({ trace }) => !omittedTraces.some((omitted) => sameTrace(trace, omitted));
1905
-
1906
- if (summary._tag === "HarnessProjectionFailure") {
1907
- return {
1908
- ...summary,
1909
- completed: summary.completed.filter(keepApplied),
1910
- omissions: [...summary.omissions, ...omissions],
1911
- };
1912
- }
1913
-
1914
- const applied = summary.applied.filter(keepApplied);
1915
- return {
1916
- _tag: "HarnessProjectionPartial",
1917
- applied,
1918
- omissions: [
1919
- ...(summary._tag === "HarnessProjectionPartial" ? summary.omissions : []),
1920
- ...omissions,
1921
- ],
1922
- };
1923
- };
1924
-
1925
- async function prepareProjectionApplication(projection) {
1926
- const actions = [];
1927
- const omissions = [];
1928
-
1929
- for (const action of projection.actions) {
1930
- let canonicalSourcePath;
1931
- if (action.id.includes(":scoped-prompt:")) {
1932
- const canonicalSource = action.source ?? action.canonicalPath;
1933
- try {
1934
- canonicalSourcePath =
1935
- typeof canonicalSource === "string"
1936
- ? resolveActionPath(canonicalSource, "source")
1937
- : undefined;
1938
- } catch {
1939
- actions.push(action);
1940
- continue;
1941
- }
1942
- if (canonicalSourcePath !== undefined && !(await pathExists(canonicalSourcePath))) {
1943
- omissions.push({
1944
- _tag: "HarnessApplicationOmission",
1945
- support: "missing",
1946
- trace: action.trace,
1947
- warning: {
1948
- _tag: "MissingCanonicalPromptWarning",
1949
- family: "scoped-prompt",
1950
- reason: `Missing canonical prompt source at ${canonicalSource}`,
1951
- },
1952
- });
1953
- continue;
1954
- }
1955
- }
1956
- let targetPath;
1957
- try {
1958
- targetPath = resolveActionPaths(action).target;
1959
- } catch {
1960
- actions.push(action);
1961
- continue;
1962
- }
1963
- if (
1964
- action.operation === "mirror" &&
1965
- action.id.includes(":scoped-prompt:") &&
1966
- action.source !== action.target &&
1967
- (await pathExists(targetPath))
1968
- ) {
1969
- const targetStat = await lstat(targetPath);
1970
- const isManagedSymlink =
1971
- targetStat.isSymbolicLink() &&
1972
- canonicalSourcePath !== undefined &&
1973
- (await readlink(targetPath)) ===
1974
- path.relative(path.dirname(targetPath), canonicalSourcePath);
1975
- const previousCopy = previousCopyFallbacks.find(
1976
- (copy) => copy.source === action.source && copy.target === action.target,
1977
- );
1978
- const isManagedCopy =
1979
- !targetStat.isSymbolicLink() &&
1980
- targetStat.isFile() &&
1981
- previousCopy !== undefined &&
1982
- (await fileDigest(targetPath)) === previousCopy.digest;
1983
- if (!isManagedSymlink && !isManagedCopy) {
1984
- omissions.push({
1985
- _tag: "HarnessApplicationOmission",
1986
- support: "preserved",
1987
- trace: action.trace,
1988
- warning: {
1989
- _tag: "PreservedConsumerPromptWarning",
1990
- family: "scoped-prompt",
1991
- reason: `Preserved consumer-owned prompt at ${action.target}`,
1992
- },
1993
- });
1994
- continue;
1995
- }
1996
- }
1997
- actions.push(action);
1998
- }
1999
-
2000
- return {
2001
- actions,
2002
- summary: withApplicationOmissions(projection.summary, omissions),
2003
- };
2004
- }
2005
-
2006
- async function readContextPlan() {
2007
- try {
2008
- return {
2009
- exists: true,
2010
- value: JSON.parse(await readFile(contextPlanPath, "utf8")),
2011
- };
2012
- } catch (error) {
2013
- if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") {
2014
- return { exists: false, value: undefined };
2015
- }
2016
- return {
2017
- exists: true,
2018
- value: {
2019
- version: "unknown",
2020
- scopes: null,
2021
- parseError: error instanceof Error ? error.message : "Malformed canonical context plan",
2022
- },
2023
- };
2024
- }
2025
- }
2026
-
2027
- async function readProjectionPlan() {
2028
- const projectionPlanPath = process.env.DP_HARNESS_PROJECTION_PLAN;
2029
- if (projectionPlanPath === undefined) {
2030
- return { exists: false, value: undefined };
2031
- }
2032
- try {
2033
- const value = JSON.parse(await readFile(projectionPlanPath, "utf8"));
2034
- if (
2035
- !isObject(value) ||
2036
- value.version !== "1" ||
2037
- typeof value.contextPlanVersion !== "string" ||
2038
- !Array.isArray(value.projections)
2039
- ) {
2040
- throw new Error("Invalid supplied harness projection plan");
2041
- }
2042
- return { exists: true, value };
2043
- } catch (error) {
2044
- throw new Error("Invalid supplied harness projection plan", { cause: error });
2045
- }
2046
- }
2047
-
2048
- const projectionSummaryShapeIssue = (summary) => {
2049
- if (!isObject(summary)) return "Projection summary must be an object";
2050
- if (summary._tag === "HarnessProjectionSuccess") {
2051
- return Array.isArray(summary.applied) ? undefined : "Success summary must contain applied";
2052
- }
2053
- if (summary._tag === "HarnessProjectionPartial") {
2054
- return Array.isArray(summary.applied) && Array.isArray(summary.omissions)
2055
- ? undefined
2056
- : "Partial summary must contain applied and omissions";
2057
- }
2058
- if (summary._tag === "HarnessProjectionFailure") {
2059
- return Array.isArray(summary.completed) &&
2060
- Array.isArray(summary.omissions) &&
2061
- Array.isArray(summary.errors)
2062
- ? undefined
2063
- : "Failure summary must contain completed, omissions, and errors";
2064
- }
2065
- return "Projection summary tag is invalid";
2066
- };
2067
-
2068
- const actionTraceMatches = ({ trace, plan, projection, contextPlan }) =>
2069
- exactKeys(trace, [
2070
- "contextPlanVersion",
2071
- "scopeId",
2072
- "kind",
2073
- "contribution",
2074
- "adapter",
2075
- "matrixVersion",
2076
- ]) &&
2077
- trace.contextPlanVersion === plan.contextPlanVersion &&
2078
- isNonEmptyString(trace.scopeId) &&
2079
- contributionKinds.has(trace.kind) &&
2080
- exactKeys(trace.contribution, ["id", "version"]) &&
2081
- isNonEmptyString(trace.contribution.id) &&
2082
- isNonEmptyString(trace.contribution.version) &&
2083
- exactKeys(trace.adapter, ["id", "version"]) &&
2084
- trace.adapter.id === projection.matrix.adapter.id &&
2085
- trace.adapter.version === projection.matrix.adapter.version &&
2086
- trace.matrixVersion === projection.matrix.matrixVersion &&
2087
- Array.isArray(contextPlan?.scopes) &&
2088
- contextPlan.scopes.some(
2089
- (scope) =>
2090
- scope?.id === trace.scopeId &&
2091
- Array.isArray(scope.contributions) &&
2092
- scope.contributions.some(
2093
- (contribution) =>
2094
- contribution?.kind === trace.kind &&
2095
- contribution?.identity?.id === trace.contribution.id &&
2096
- contribution.identity.version === trace.contribution.version,
2097
- ),
2098
- );
2099
-
2100
- const contributionTraceKey = (trace) =>
2101
- [
2102
- trace.contextPlanVersion,
2103
- trace.scopeId,
2104
- trace.kind,
2105
- trace.contribution.id,
2106
- trace.contribution.version,
2107
- trace.adapter.id,
2108
- trace.adapter.version,
2109
- trace.matrixVersion,
2110
- ].join("\u0000");
2111
-
2112
- const projectionSummaryIssue = ({ summary, plan, projection, contextPlan }) => {
2113
- const shapeIssue = projectionSummaryShapeIssue(summary);
2114
- if (shapeIssue !== undefined) return shapeIssue;
2115
- const applied = summary._tag === "HarnessProjectionFailure" ? summary.completed : summary.applied;
2116
- const omissions = summary._tag === "HarnessProjectionSuccess" ? [] : summary.omissions;
2117
- const errors = summary._tag === "HarnessProjectionFailure" ? summary.errors : [];
2118
- if (
2119
- applied.some(
2120
- (outcome) =>
2121
- !isObject(outcome) ||
2122
- outcome._tag !== "HarnessProjectionApplied" ||
2123
- (outcome.support !== "supported" && outcome.support !== "degraded") ||
2124
- (outcome.support === "degraded" && !isNonEmptyString(outcome.reason)),
2125
- )
2126
- ) {
2127
- return "Projection summary contains an invalid applied outcome";
2128
- }
2129
- if (
2130
- omissions.some(
2131
- (outcome) =>
2132
- !isObject(outcome) ||
2133
- outcome._tag !== "HarnessProjectionOmission" ||
2134
- outcome.support !== "unsupported" ||
2135
- !isObject(outcome.warning) ||
2136
- outcome.warning._tag !== "UnsupportedHarnessCapabilityWarning" ||
2137
- !contributionKinds.has(outcome.warning.family) ||
2138
- !isNonEmptyString(outcome.warning.reason),
2139
- )
2140
- ) {
2141
- return "Projection summary contains an invalid omission";
2142
- }
2143
- if (
2144
- errors.some(
2145
- (outcome) =>
2146
- !isObject(outcome) ||
2147
- (outcome._tag !== "HarnessAdapterDefectError" &&
2148
- outcome._tag !== "InvalidHarnessProjectionError") ||
2149
- !isNonEmptyString(outcome.message),
2150
- )
2151
- ) {
2152
- return "Projection summary contains an invalid error";
2153
- }
2154
- const outcomes = [...applied, ...omissions, ...errors];
2155
- return outcomes.some(
2156
- (outcome) =>
2157
- !isObject(outcome) ||
2158
- !isObject(outcome.trace) ||
2159
- !actionTraceMatches({ trace: outcome.trace, plan, projection, contextPlan }),
2160
- )
2161
- ? "Projection summary contains an invalid trace"
2162
- : (() => {
2163
- const actionTraces = new Set(
2164
- projection.actions.map(({ trace }) => contributionTraceKey(trace)),
2165
- );
2166
- const appliedTraces = new Set(applied.map(({ trace }) => contributionTraceKey(trace)));
2167
- return actionTraces.size !== appliedTraces.size ||
2168
- [...actionTraces].some((trace) => !appliedTraces.has(trace))
2169
- ? "Projection summary traces do not match projection actions"
2170
- : undefined;
2171
- })();
2172
- };
2173
-
2174
- const validateProjectionPlan = ({ plan, contextPlan }) => {
2175
- const contextIssue = canonicalContextIssue(contextPlan);
2176
- if (contextIssue !== undefined) {
2177
- throw new Error(`Supplied harness projection plan requires canonical context: ${contextIssue}`);
2178
- }
2179
- if (plan.contextPlanVersion !== contextPlanVersion(contextPlan)) {
2180
- throw new Error("Supplied harness projection plan context version does not match");
2181
- }
2182
- const adaptersById = new Map(adapters.map((adapter) => [adapter.matrix.adapter.id, adapter]));
2183
- const ids = plan.projections.map((projection) => projection?.matrix?.adapter?.id);
2184
- if (
2185
- ids.length !== adapters.length ||
2186
- new Set(ids).size !== ids.length ||
2187
- ids.some((id) => !adaptersById.has(id))
2188
- ) {
2189
- throw new Error(
2190
- "Supplied harness projection plan must contain each known adapter exactly once",
2191
- );
2192
- }
2193
- for (const projection of plan.projections) {
2194
- const expected = adaptersById.get(projection.matrix.adapter.id);
2195
- if (
2196
- projection.matrix.adapter.version !== expected.matrix.adapter.version ||
2197
- projection.matrix.matrixVersion !== expected.matrix.matrixVersion
2198
- ) {
2199
- throw new Error(
2200
- `Supplied harness projection matrix mismatch: ${projection.matrix.adapter.id}`,
2201
- );
2202
- }
2203
- if (
2204
- !Array.isArray(projection.actions) ||
2205
- new Set(projection.actions.map((action) => action?.id)).size !== projection.actions.length ||
2206
- projection.actions.some(
2207
- (action) =>
2208
- !isObject(action) ||
2209
- !isNonEmptyString(action.id) ||
2210
- !harnessActionOperations.has(action.operation) ||
2211
- hasInvalidActionPaths(action) ||
2212
- !isObject(action.trace) ||
2213
- !actionTraceMatches({ trace: action.trace, plan, projection, contextPlan }),
2214
- )
2215
- ) {
2216
- throw new Error(
2217
- `Supplied harness projection actions are invalid: ${projection.matrix.adapter.id}`,
2218
- );
2219
- }
2220
- const summaryIssue = projectionSummaryIssue({
2221
- summary: projection.summary,
2222
- plan,
2223
- projection,
2224
- contextPlan,
2225
- });
2226
- if (summaryIssue !== undefined) {
2227
- throw new Error(`${summaryIssue}: ${projection.matrix.adapter.id}`);
2228
- }
2229
- const canonical = normalizeProjection(projectSafely(expected, contextPlan));
2230
- if (
2231
- JSON.stringify(projection.actions) !== JSON.stringify(canonical.actions) ||
2232
- JSON.stringify(projection.summary) !== JSON.stringify(canonical.summary)
2233
- ) {
2234
- throw new Error(
2235
- `Supplied harness projection is noncanonical: ${projection.matrix.adapter.id}`,
2236
- );
2237
- }
2238
- }
2239
- return plan;
2240
- };
2241
-
2242
- const exactKeys = (value, keys) =>
2243
- isObject(value) &&
2244
- Object.keys(value).length === keys.length &&
2245
- Object.keys(value).every((key) => keys.includes(key));
2246
-
2247
- const isNonEmptyString = (value) => typeof value === "string" && value.length > 0;
2248
- const isOrder = (value) => Number.isInteger(value) && value >= 0;
2249
- const contributionKinds = new Set([
2250
- "skill",
2251
- "scoped-prompt",
2252
- "lifecycle-hook",
2253
- "tool-configuration",
2254
- "subagent-template",
2255
- ]);
2256
-
2257
- const identityIssue = (identity) =>
2258
- exactKeys(identity, ["id", "version"]) &&
2259
- isNonEmptyString(identity.id) &&
2260
- isNonEmptyString(identity.version)
2261
- ? undefined
2262
- : "Context contribution identity is invalid";
2263
-
2264
- const provenanceIssue = (provenance) =>
2265
- exactKeys(provenance, ["source", "revision"]) &&
2266
- isNonEmptyString(provenance.source) &&
2267
- isNonEmptyString(provenance.revision)
2268
- ? undefined
2269
- : "Context contribution provenance is invalid";
2270
-
2271
- const compatibilityIssue = (compatibility) =>
2272
- Array.isArray(compatibility) &&
2273
- compatibility.every(
2274
- (entry) =>
2275
- exactKeys(entry, ["id", "versionRange"]) &&
2276
- isNonEmptyString(entry.id) &&
2277
- isNonEmptyString(entry.versionRange),
2278
- )
2279
- ? undefined
2280
- : "Context contribution compatibility is invalid";
2281
-
2282
- const contributionIssue = (contribution) => {
2283
- if (
2284
- !exactKeys(contribution, [
2285
- "kind",
2286
- "identity",
2287
- "provenance",
2288
- "compatibility",
2289
- "references",
2290
- "order",
2291
- ])
2292
- ) {
2293
- return "Context contribution fields are invalid";
2294
- }
2295
- return (
2296
- (!contributionKinds.has(contribution.kind)
2297
- ? "Context contribution kind is invalid"
2298
- : undefined) ??
2299
- identityIssue(contribution.identity) ??
2300
- provenanceIssue(contribution.provenance) ??
2301
- compatibilityIssue(contribution.compatibility) ??
2302
- (!Array.isArray(contribution.references) || !contribution.references.every(isNonEmptyString)
2303
- ? "Context contribution references are invalid"
2304
- : undefined) ??
2305
- (!isOrder(contribution.order) ? "Context contribution order is invalid" : undefined)
2306
- );
2307
- };
2308
-
2309
- const scopeIssue = (scope) => {
2310
- if (!exactKeys(scope, ["id", "packs", "contributions"]) || !isNonEmptyString(scope.id)) {
2311
- return "Context scope fields are invalid";
2312
- }
2313
- if (
2314
- !Array.isArray(scope.packs) ||
2315
- !scope.packs.every(
2316
- (pack) =>
2317
- exactKeys(pack, ["id", "order"]) && isNonEmptyString(pack.id) && isOrder(pack.order),
2318
- )
2319
- ) {
2320
- return `Context scope ${scope.id} packs are invalid`;
2321
- }
2322
- if (!Array.isArray(scope.contributions)) {
2323
- return `Context scope ${scope.id} contributions must be an array`;
2324
- }
2325
- for (const contribution of scope.contributions) {
2326
- const issue = contributionIssue(contribution);
2327
- if (issue !== undefined) {
2328
- return `${issue} in scope ${scope.id}`;
2329
- }
2330
- }
2331
- return undefined;
2332
- };
2333
-
2334
- function contextPlanIssue(contextPlan) {
2335
- if (!exactKeys(contextPlan, ["version", "scopes"])) {
2336
- return "Canonical context plan fields are invalid";
2337
- }
2338
- if (contextPlan.version !== "1" || !Array.isArray(contextPlan.scopes)) {
2339
- return "Canonical context plan version or scopes are invalid";
2340
- }
2341
- for (const scope of contextPlan.scopes) {
2342
- const issue = scopeIssue(scope);
2343
- if (issue !== undefined) {
2344
- return issue;
2345
- }
2346
- }
2347
- return undefined;
2348
- }
2349
-
2350
- function subagentManifestIssue(contextPlan) {
2351
- if (!Array.isArray(contextPlan?.scopes)) {
2352
- return undefined;
2353
- }
2354
- const planned = contextPlan.scopes
2355
- .flatMap((scope) => scope.contributions ?? [])
2356
- .filter((contribution) => contribution.kind === "subagent-template")
2357
- .map((contribution) => ({
2358
- id: contribution.identity.id,
2359
- references: [...new Set(contribution.references)].toSorted(),
2360
- }))
2361
- .toSorted((left, right) => left.id.localeCompare(right.id));
2362
- if (planned.length === 0) {
2363
- return undefined;
2364
- }
2365
- const authored = agents
2366
- .map((agent) => ({
2367
- id: agent.name,
2368
- references: getSkillNames(agent).toSorted(),
2369
- }))
2370
- .toSorted((left, right) => left.id.localeCompare(right.id));
2371
- return JSON.stringify(planned) === JSON.stringify(authored)
2372
- ? undefined
2373
- : "Subagent manifest diverges from canonical context plan; run scaffold update to reconcile it";
2374
- }
2375
-
2376
- const canonicalContextIssue = (contextPlan) =>
2377
- contextPlanIssue(contextPlan) ?? subagentManifestIssue(contextPlan);
2378
-
2379
- const contextPlanVersion = (contextPlan) =>
2380
- isObject(contextPlan) && typeof contextPlan.version === "string"
2381
- ? contextPlan.version
2382
- : "unknown";
2383
-
2384
- async function main() {
2385
- operationRepoRootIdentity = await captureRepoRootIdentity("synchronize scaffold output");
2386
- await assertConfinedRegularFile(projectionReceiptPath);
2387
- const previousReceiptBytes = await readConfinedRegularFile(projectionReceiptPath);
2388
- try {
2389
- const previousReceipt = JSON.parse(previousReceiptBytes?.toString("utf8") ?? "null");
2390
- previousCopyFallbacks = Array.isArray(previousReceipt.copyFallbacks)
2391
- ? previousReceipt.copyFallbacks.filter(
2392
- (copy) =>
2393
- isObject(copy) &&
2394
- typeof copy.source === "string" &&
2395
- typeof copy.target === "string" &&
2396
- typeof copy.digest === "string",
2397
- )
2398
- : [];
2399
- } catch {
2400
- previousCopyFallbacks = [];
2401
- }
2402
- const loadedContextPlan = await readContextPlan();
2403
- const loadedProjectionPlan = await readProjectionPlan();
2404
- const application = await prepareHarnessApplication();
2405
- if (!loadedContextPlan.exists && !loadedProjectionPlan.exists) {
2406
- await materializeLegacyHarnesses(application);
2407
- return;
2408
- }
2409
- const contextPlan = loadedContextPlan.value;
2410
- const suppliedProjectionPlan = loadedProjectionPlan.exists
2411
- ? validateProjectionPlan({ plan: loadedProjectionPlan.value, contextPlan })
2412
- : undefined;
2413
- const projected =
2414
- suppliedProjectionPlan !== undefined
2415
- ? suppliedProjectionPlan.projections.map((projection) => {
2416
- const adapter = adapters.find(
2417
- ({ matrix }) => matrix.adapter.id === projection.matrix.adapter.id,
2418
- );
2419
- if (adapter === undefined) throw new Error("Validated projection adapter is missing");
2420
- return {
2421
- adapter,
2422
- projection: withLifecycleHookReconciliation(
2423
- adapter,
2424
- contextPlan,
2425
- withManagedAgentCleanup(adapter, contextPlan, {
2426
- actions: projection.actions,
2427
- summary: projection.summary,
2428
- }),
2429
- ),
2430
- };
2431
- })
2432
- : adapters.map((adapter) => ({
2433
- adapter,
2434
- projection: withLifecycleHookReconciliation(
2435
- adapter,
2436
- contextPlan,
2437
- withManagedAgentCleanup(adapter, contextPlan, projectSafely(adapter, contextPlan)),
2438
- ),
2439
- }));
2440
- const applied = [];
2441
-
2442
- for (const entry of projected) {
2443
- const applicationProjection = await prepareProjectionApplication(entry.projection);
2444
- const summary = await applyProjection({
2445
- projection: applicationProjection,
2446
- filesystem: { apply: (action) => applyHarnessAction(action, application) },
2447
- });
2448
- applied.push(
2449
- projectionEvidence({
2450
- adapter: entry.adapter,
2451
- projection: applicationProjection,
2452
- summary,
2453
- }),
2454
- );
2455
- }
2456
-
2457
- const receipt = {
2458
- version: "1",
2459
- contextPlanVersion: contextPlanVersion(contextPlan),
2460
- status: receiptStatus(applied),
2461
- projections: applied,
2462
- copyFallbacks: [...currentCopyFallbacks.values()].toSorted((left, right) =>
2463
- copyFallbackKey(left).localeCompare(copyFallbackKey(right)),
2464
- ),
2465
- };
2466
- await writeConfinedTextFile(projectionReceiptPath, encodeJson(receipt));
2467
- if (receipt.status === "failure") {
2468
- throw new Error(
2469
- `Harness projection failed; inspect ${path.relative(repoRoot, projectionReceiptPath)}`,
2470
- );
2471
- }
2472
- }
2473
-
2474
- try {
2475
- await main();
2476
- } finally {
2477
- await closeMutationWorkers();
2478
- }