@baselane/packs 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (450) hide show
  1. package/LICENSE +191 -0
  2. package/NOTICE +6 -0
  3. package/README.md +15 -0
  4. package/dist/ai-merge.d.ts +26 -0
  5. package/dist/ai-merge.js +165 -0
  6. package/dist/aliases.d.ts +7 -0
  7. package/dist/aliases.js +9 -0
  8. package/dist/compose-draft.d.ts +19 -0
  9. package/dist/compose-draft.js +170 -0
  10. package/dist/drift-detect.d.ts +8 -0
  11. package/dist/drift-detect.js +21 -0
  12. package/dist/index.d.ts +40 -0
  13. package/dist/index.js +21 -0
  14. package/dist/ingest.d.ts +25 -0
  15. package/dist/ingest.js +262 -0
  16. package/dist/load.d.ts +7 -0
  17. package/dist/load.js +29 -0
  18. package/dist/manifest.d.ts +71 -0
  19. package/dist/manifest.js +208 -0
  20. package/dist/materialize-harness.d.ts +15 -0
  21. package/dist/materialize-harness.js +48 -0
  22. package/dist/merge-region.d.ts +60 -0
  23. package/dist/merge-region.js +166 -0
  24. package/dist/overlap.d.ts +32 -0
  25. package/dist/overlap.js +49 -0
  26. package/dist/pack-from-fileset.d.ts +13 -0
  27. package/dist/pack-from-fileset.js +133 -0
  28. package/dist/render/adapters.d.ts +6 -0
  29. package/dist/render/adapters.js +43 -0
  30. package/dist/render/agents-md.d.ts +3 -0
  31. package/dist/render/agents-md.js +49 -0
  32. package/dist/render/bundle-union.d.ts +10 -0
  33. package/dist/render/bundle-union.js +87 -0
  34. package/dist/render/bundle.d.ts +3 -0
  35. package/dist/render/bundle.js +51 -0
  36. package/dist/render/capabilities.d.ts +19 -0
  37. package/dist/render/capabilities.js +86 -0
  38. package/dist/render/claude.d.ts +3 -0
  39. package/dist/render/claude.js +92 -0
  40. package/dist/render/design.d.ts +27 -0
  41. package/dist/render/design.js +443 -0
  42. package/dist/render/graph.d.ts +11 -0
  43. package/dist/render/graph.js +245 -0
  44. package/dist/render/memory.d.ts +35 -0
  45. package/dist/render/memory.js +353 -0
  46. package/dist/render/render-pack.d.ts +3 -0
  47. package/dist/render/render-pack.js +43 -0
  48. package/dist/render/repo-union.d.ts +14 -0
  49. package/dist/render/repo-union.js +94 -0
  50. package/dist/render/rollout-files.d.ts +18 -0
  51. package/dist/render/rollout-files.js +39 -0
  52. package/dist/render/system-map.d.ts +8 -0
  53. package/dist/render/system-map.js +73 -0
  54. package/dist/render/tasks.d.ts +32 -0
  55. package/dist/render/tasks.js +327 -0
  56. package/dist/render/wiki.d.ts +30 -0
  57. package/dist/render/wiki.js +288 -0
  58. package/dist/seed/graph-seed.d.ts +17 -0
  59. package/dist/seed/graph-seed.js +18 -0
  60. package/dist/seed/wiki-seed.d.ts +23 -0
  61. package/dist/seed/wiki-seed.js +133 -0
  62. package/dist/seed-skills.d.ts +18 -0
  63. package/dist/seed-skills.js +134 -0
  64. package/dist/types.d.ts +122 -0
  65. package/dist/types.js +1 -0
  66. package/dist/validate.d.ts +30 -0
  67. package/dist/validate.js +397 -0
  68. package/package.json +38 -0
  69. package/packs/database-review/pack.json +44 -0
  70. package/packs/database-review/rendered/.baselane/capabilities.json +10 -0
  71. package/packs/database-review/rendered/.baselane/system-map/README.md +18 -0
  72. package/packs/database-review/rendered/.claude/agents/database-reviewer.md +8 -0
  73. package/packs/database-review/rendered/.claude/commands/db-review.md +6 -0
  74. package/packs/database-review/rendered/.claude/commands/map.md +6 -0
  75. package/packs/database-review/rendered/.claude/settings.json +26 -0
  76. package/packs/database-review/rendered/.github/copilot-instructions.md +48 -0
  77. package/packs/database-review/rendered/AGENTS.md +66 -0
  78. package/packs/database-review/rendered/CLAUDE.md +9 -0
  79. package/packs/database-review/rendered/GEMINI.md +3 -0
  80. package/packs/disciplined-workflow/pack.json +63 -0
  81. package/packs/disciplined-workflow/rendered/.baselane/capabilities.json +10 -0
  82. package/packs/disciplined-workflow/rendered/.baselane/tasks/README.md +36 -0
  83. package/packs/disciplined-workflow/rendered/.claude/agents/plan-reviewer.md +8 -0
  84. package/packs/disciplined-workflow/rendered/.claude/agents/task-reviewer.md +8 -0
  85. package/packs/disciplined-workflow/rendered/.claude/commands/brainstorm.md +6 -0
  86. package/packs/disciplined-workflow/rendered/.claude/commands/execute-plan.md +6 -0
  87. package/packs/disciplined-workflow/rendered/.claude/commands/plan-work.md +6 -0
  88. package/packs/disciplined-workflow/rendered/.claude/commands/write-plan.md +6 -0
  89. package/packs/disciplined-workflow/rendered/.claude/settings.json +24 -0
  90. package/packs/disciplined-workflow/rendered/.github/copilot-instructions.md +24 -0
  91. package/packs/disciplined-workflow/rendered/AGENTS.md +43 -0
  92. package/packs/disciplined-workflow/rendered/CLAUDE.md +12 -0
  93. package/packs/disciplined-workflow/rendered/GEMINI.md +3 -0
  94. package/packs/frontend-design/pack.json +129 -0
  95. package/packs/frontend-design/rendered/.claude/skills/clone/SKILL.md +39 -0
  96. package/packs/frontend-design/rendered/.claude/skills/functional-ui/SKILL.md +78 -0
  97. package/packs/frontend-design/rendered/.claude/skills/gsap/SKILL.md +36 -0
  98. package/packs/frontend-design/rendered/.claude/skills/gsap/gsap-core.md +254 -0
  99. package/packs/frontend-design/rendered/.claude/skills/gsap/gsap-frameworks.md +266 -0
  100. package/packs/frontend-design/rendered/.claude/skills/gsap/gsap-performance.md +79 -0
  101. package/packs/frontend-design/rendered/.claude/skills/gsap/gsap-plugins.md +433 -0
  102. package/packs/frontend-design/rendered/.claude/skills/gsap/gsap-react.md +136 -0
  103. package/packs/frontend-design/rendered/.claude/skills/gsap/gsap-scrolltrigger.md +296 -0
  104. package/packs/frontend-design/rendered/.claude/skills/gsap/gsap-timeline.md +107 -0
  105. package/packs/frontend-design/rendered/.claude/skills/gsap/gsap-utils.md +284 -0
  106. package/packs/frontend-design/rendered/.claude/skills/marketing-ui/SKILL.md +36 -0
  107. package/packs/frontend-design/rendered/.claude/skills/shadcn/SKILL.md +267 -0
  108. package/packs/frontend-design/rendered/.claude/skills/shadcn/base-vs-radix.md +306 -0
  109. package/packs/frontend-design/rendered/.claude/skills/shadcn/cli.md +290 -0
  110. package/packs/frontend-design/rendered/.claude/skills/shadcn/composition.md +195 -0
  111. package/packs/frontend-design/rendered/.claude/skills/shadcn/customization.md +209 -0
  112. package/packs/frontend-design/rendered/.claude/skills/shadcn/forms.md +192 -0
  113. package/packs/frontend-design/rendered/.claude/skills/shadcn/icons.md +101 -0
  114. package/packs/frontend-design/rendered/.claude/skills/shadcn/mcp.md +105 -0
  115. package/packs/frontend-design/rendered/.claude/skills/shadcn/registry.md +277 -0
  116. package/packs/frontend-design/rendered/.claude/skills/shadcn/styling.md +162 -0
  117. package/packs/frontend-design/rendered/.github/copilot-instructions.md +474 -0
  118. package/packs/frontend-design/rendered/AGENTS.md +33 -0
  119. package/packs/frontend-design/rendered/CLAUDE.md +10 -0
  120. package/packs/frontend-design/rendered/GEMINI.md +456 -0
  121. package/packs/frontend-taste/pack.json +43 -0
  122. package/packs/frontend-taste/rendered/.baselane/capabilities.json +16 -0
  123. package/packs/frontend-taste/rendered/.claude/agents/taste-reviewer.md +8 -0
  124. package/packs/frontend-taste/rendered/.claude/commands/design-review.md +6 -0
  125. package/packs/frontend-taste/rendered/.claude/settings.json +15 -0
  126. package/packs/frontend-taste/rendered/.github/copilot-instructions.md +51 -0
  127. package/packs/frontend-taste/rendered/AGENTS.md +68 -0
  128. package/packs/frontend-taste/rendered/CLAUDE.md +8 -0
  129. package/packs/frontend-taste/rendered/DESIGN.md +72 -0
  130. package/packs/frontend-taste/rendered/GEMINI.md +3 -0
  131. package/packs/go-rules/pack.json +38 -0
  132. package/packs/go-rules/rendered/.claude/agents/go-reviewer.md +8 -0
  133. package/packs/go-rules/rendered/.claude/commands/go-review.md +6 -0
  134. package/packs/go-rules/rendered/.claude/settings.json +15 -0
  135. package/packs/go-rules/rendered/.github/copilot-instructions.md +44 -0
  136. package/packs/go-rules/rendered/AGENTS.md +54 -0
  137. package/packs/go-rules/rendered/CLAUDE.md +8 -0
  138. package/packs/go-rules/rendered/GEMINI.md +3 -0
  139. package/packs/python-rules/pack.json +38 -0
  140. package/packs/python-rules/rendered/.claude/agents/python-reviewer.md +8 -0
  141. package/packs/python-rules/rendered/.claude/commands/python-review.md +6 -0
  142. package/packs/python-rules/rendered/.claude/settings.json +15 -0
  143. package/packs/python-rules/rendered/.github/copilot-instructions.md +43 -0
  144. package/packs/python-rules/rendered/AGENTS.md +53 -0
  145. package/packs/python-rules/rendered/CLAUDE.md +8 -0
  146. package/packs/python-rules/rendered/GEMINI.md +3 -0
  147. package/packs/second-brain/pack.json +36 -0
  148. package/packs/second-brain/rendered/.baselane/capabilities.json +25 -0
  149. package/packs/second-brain/rendered/.baselane/memory/README.md +34 -0
  150. package/packs/second-brain/rendered/.baselane/wiki/README.md +62 -0
  151. package/packs/second-brain/rendered/.claude/agents/librarian.md +14 -0
  152. package/packs/second-brain/rendered/.claude/commands/remember.md +6 -0
  153. package/packs/second-brain/rendered/.claude/commands/wiki.md +6 -0
  154. package/packs/second-brain/rendered/.claude/settings.json +35 -0
  155. package/packs/second-brain/rendered/.github/copilot-instructions.md +24 -0
  156. package/packs/second-brain/rendered/AGENTS.md +41 -0
  157. package/packs/second-brain/rendered/CLAUDE.md +9 -0
  158. package/packs/second-brain/rendered/GEMINI.md +3 -0
  159. package/packs/security-review/pack.json +72 -0
  160. package/packs/security-review/rendered/.claude/agents/security-reviewer.md +8 -0
  161. package/packs/security-review/rendered/.claude/commands/security-audit.md +6 -0
  162. package/packs/security-review/rendered/.claude/commands/security-scan.md +6 -0
  163. package/packs/security-review/rendered/.claude/settings.json +35 -0
  164. package/packs/security-review/rendered/.claude/skills/security-audit/SKILL.md +44 -0
  165. package/packs/security-review/rendered/.claude/skills/validate-at-boundaries/SKILL.md +41 -0
  166. package/packs/security-review/rendered/.github/copilot-instructions.md +137 -0
  167. package/packs/security-review/rendered/AGENTS.md +66 -0
  168. package/packs/security-review/rendered/CLAUDE.md +11 -0
  169. package/packs/security-review/rendered/GEMINI.md +90 -0
  170. package/packs/software-engineer-harness/pack.json +98 -0
  171. package/packs/software-engineer-harness/rendered/.baselane/capabilities.json +15 -0
  172. package/packs/software-engineer-harness/rendered/.baselane/system-map/README.md +18 -0
  173. package/packs/software-engineer-harness/rendered/.baselane/tasks/README.md +36 -0
  174. package/packs/software-engineer-harness/rendered/.claude/agents/architect.md +8 -0
  175. package/packs/software-engineer-harness/rendered/.claude/agents/checker.md +8 -0
  176. package/packs/software-engineer-harness/rendered/.claude/agents/code-reviewer.md +8 -0
  177. package/packs/software-engineer-harness/rendered/.claude/agents/code-simplifier.md +8 -0
  178. package/packs/software-engineer-harness/rendered/.claude/agents/planner.md +8 -0
  179. package/packs/software-engineer-harness/rendered/.claude/agents/reviewer.md +8 -0
  180. package/packs/software-engineer-harness/rendered/.claude/commands/build-and-check.md +6 -0
  181. package/packs/software-engineer-harness/rendered/.claude/commands/map.md +6 -0
  182. package/packs/software-engineer-harness/rendered/.claude/commands/plan-change.md +6 -0
  183. package/packs/software-engineer-harness/rendered/.claude/commands/plan-work.md +6 -0
  184. package/packs/software-engineer-harness/rendered/.claude/commands/review-change.md +6 -0
  185. package/packs/software-engineer-harness/rendered/.claude/commands/tdd-task.md +6 -0
  186. package/packs/software-engineer-harness/rendered/.claude/settings.json +35 -0
  187. package/packs/software-engineer-harness/rendered/.github/copilot-instructions.md +37 -0
  188. package/packs/software-engineer-harness/rendered/AGENTS.md +58 -0
  189. package/packs/software-engineer-harness/rendered/CLAUDE.md +18 -0
  190. package/packs/software-engineer-harness/rendered/GEMINI.md +3 -0
  191. package/packs/systematic-debugging/pack.json +44 -0
  192. package/packs/systematic-debugging/rendered/.claude/agents/debugger.md +8 -0
  193. package/packs/systematic-debugging/rendered/.claude/commands/debug.md +6 -0
  194. package/packs/systematic-debugging/rendered/.claude/commands/root-cause.md +6 -0
  195. package/packs/systematic-debugging/rendered/.claude/settings.json +15 -0
  196. package/packs/systematic-debugging/rendered/.github/copilot-instructions.md +20 -0
  197. package/packs/systematic-debugging/rendered/AGENTS.md +31 -0
  198. package/packs/systematic-debugging/rendered/CLAUDE.md +9 -0
  199. package/packs/systematic-debugging/rendered/GEMINI.md +3 -0
  200. package/packs/token-efficiency-harness/pack.json +49 -0
  201. package/packs/token-efficiency-harness/rendered/.baselane/capabilities.json +10 -0
  202. package/packs/token-efficiency-harness/rendered/.baselane/memory/README.md +34 -0
  203. package/packs/token-efficiency-harness/rendered/.claude/agents/scout.md +8 -0
  204. package/packs/token-efficiency-harness/rendered/.claude/commands/handoff.md +6 -0
  205. package/packs/token-efficiency-harness/rendered/.claude/commands/remember.md +6 -0
  206. package/packs/token-efficiency-harness/rendered/.claude/commands/usage-audit.md +6 -0
  207. package/packs/token-efficiency-harness/rendered/.claude/settings.json +26 -0
  208. package/packs/token-efficiency-harness/rendered/.github/copilot-instructions.md +26 -0
  209. package/packs/token-efficiency-harness/rendered/AGENTS.md +44 -0
  210. package/packs/token-efficiency-harness/rendered/CLAUDE.md +10 -0
  211. package/packs/token-efficiency-harness/rendered/GEMINI.md +3 -0
  212. package/packs/typescript-rules/pack.json +46 -0
  213. package/packs/typescript-rules/rendered/.claude/agents/typescript-reviewer.md +8 -0
  214. package/packs/typescript-rules/rendered/.claude/commands/typescript-review.md +6 -0
  215. package/packs/typescript-rules/rendered/.claude/settings.json +15 -0
  216. package/packs/typescript-rules/rendered/.claude/skills/immutable-updates/SKILL.md +46 -0
  217. package/packs/typescript-rules/rendered/.github/copilot-instructions.md +89 -0
  218. package/packs/typescript-rules/rendered/AGENTS.md +55 -0
  219. package/packs/typescript-rules/rendered/CLAUDE.md +9 -0
  220. package/packs/typescript-rules/rendered/GEMINI.md +51 -0
  221. package/skills/algorithmic-art/LICENSE +202 -0
  222. package/skills/algorithmic-art/LICENSE.txt +202 -0
  223. package/skills/algorithmic-art/SKILL.md +405 -0
  224. package/skills/algorithmic-art/templates/generator_template.js +223 -0
  225. package/skills/algorithmic-art/templates/viewer.html +599 -0
  226. package/skills/brainstorming/LICENSE +21 -0
  227. package/skills/brainstorming/SKILL.md +159 -0
  228. package/skills/brainstorming/scripts/frame-template.html +213 -0
  229. package/skills/brainstorming/scripts/helper.js +167 -0
  230. package/skills/brainstorming/scripts/server.cjs +723 -0
  231. package/skills/brainstorming/scripts/start-server.sh +209 -0
  232. package/skills/brainstorming/scripts/stop-server.sh +120 -0
  233. package/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  234. package/skills/brainstorming/visual-companion.md +291 -0
  235. package/skills/brand-guidelines/LICENSE +202 -0
  236. package/skills/brand-guidelines/LICENSE.txt +202 -0
  237. package/skills/brand-guidelines/SKILL.md +73 -0
  238. package/skills/canvas-design/LICENSE +202 -0
  239. package/skills/canvas-design/LICENSE.txt +202 -0
  240. package/skills/canvas-design/SKILL.md +130 -0
  241. package/skills/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +93 -0
  242. package/skills/canvas-design/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
  243. package/skills/canvas-design/canvas-fonts/BigShoulders-Bold.ttf +0 -0
  244. package/skills/canvas-design/canvas-fonts/BigShoulders-OFL.txt +93 -0
  245. package/skills/canvas-design/canvas-fonts/BigShoulders-Regular.ttf +0 -0
  246. package/skills/canvas-design/canvas-fonts/Boldonse-OFL.txt +93 -0
  247. package/skills/canvas-design/canvas-fonts/Boldonse-Regular.ttf +0 -0
  248. package/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
  249. package/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
  250. package/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
  251. package/skills/canvas-design/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
  252. package/skills/canvas-design/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
  253. package/skills/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +93 -0
  254. package/skills/canvas-design/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
  255. package/skills/canvas-design/canvas-fonts/DMMono-OFL.txt +93 -0
  256. package/skills/canvas-design/canvas-fonts/DMMono-Regular.ttf +0 -0
  257. package/skills/canvas-design/canvas-fonts/EricaOne-OFL.txt +94 -0
  258. package/skills/canvas-design/canvas-fonts/EricaOne-Regular.ttf +0 -0
  259. package/skills/canvas-design/canvas-fonts/GeistMono-Bold.ttf +0 -0
  260. package/skills/canvas-design/canvas-fonts/GeistMono-OFL.txt +93 -0
  261. package/skills/canvas-design/canvas-fonts/GeistMono-Regular.ttf +0 -0
  262. package/skills/canvas-design/canvas-fonts/Gloock-OFL.txt +93 -0
  263. package/skills/canvas-design/canvas-fonts/Gloock-Regular.ttf +0 -0
  264. package/skills/canvas-design/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
  265. package/skills/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
  266. package/skills/canvas-design/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
  267. package/skills/canvas-design/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
  268. package/skills/canvas-design/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
  269. package/skills/canvas-design/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
  270. package/skills/canvas-design/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
  271. package/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
  272. package/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
  273. package/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
  274. package/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
  275. package/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
  276. package/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
  277. package/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
  278. package/skills/canvas-design/canvas-fonts/Italiana-OFL.txt +93 -0
  279. package/skills/canvas-design/canvas-fonts/Italiana-Regular.ttf +0 -0
  280. package/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
  281. package/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
  282. package/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
  283. package/skills/canvas-design/canvas-fonts/Jura-Light.ttf +0 -0
  284. package/skills/canvas-design/canvas-fonts/Jura-Medium.ttf +0 -0
  285. package/skills/canvas-design/canvas-fonts/Jura-OFL.txt +93 -0
  286. package/skills/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
  287. package/skills/canvas-design/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
  288. package/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
  289. package/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
  290. package/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
  291. package/skills/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
  292. package/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
  293. package/skills/canvas-design/canvas-fonts/NationalPark-Bold.ttf +0 -0
  294. package/skills/canvas-design/canvas-fonts/NationalPark-OFL.txt +93 -0
  295. package/skills/canvas-design/canvas-fonts/NationalPark-Regular.ttf +0 -0
  296. package/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
  297. package/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
  298. package/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
  299. package/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
  300. package/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
  301. package/skills/canvas-design/canvas-fonts/PixelifySans-Medium.ttf +0 -0
  302. package/skills/canvas-design/canvas-fonts/PixelifySans-OFL.txt +93 -0
  303. package/skills/canvas-design/canvas-fonts/PoiretOne-OFL.txt +93 -0
  304. package/skills/canvas-design/canvas-fonts/PoiretOne-Regular.ttf +0 -0
  305. package/skills/canvas-design/canvas-fonts/RedHatMono-Bold.ttf +0 -0
  306. package/skills/canvas-design/canvas-fonts/RedHatMono-OFL.txt +93 -0
  307. package/skills/canvas-design/canvas-fonts/RedHatMono-Regular.ttf +0 -0
  308. package/skills/canvas-design/canvas-fonts/Silkscreen-OFL.txt +93 -0
  309. package/skills/canvas-design/canvas-fonts/Silkscreen-Regular.ttf +0 -0
  310. package/skills/canvas-design/canvas-fonts/SmoochSans-Medium.ttf +0 -0
  311. package/skills/canvas-design/canvas-fonts/SmoochSans-OFL.txt +93 -0
  312. package/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
  313. package/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
  314. package/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
  315. package/skills/canvas-design/canvas-fonts/WorkSans-Bold.ttf +0 -0
  316. package/skills/canvas-design/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
  317. package/skills/canvas-design/canvas-fonts/WorkSans-Italic.ttf +0 -0
  318. package/skills/canvas-design/canvas-fonts/WorkSans-OFL.txt +93 -0
  319. package/skills/canvas-design/canvas-fonts/WorkSans-Regular.ttf +0 -0
  320. package/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
  321. package/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
  322. package/skills/dispatching-parallel-agents/LICENSE +21 -0
  323. package/skills/dispatching-parallel-agents/SKILL.md +185 -0
  324. package/skills/executing-plans/LICENSE +21 -0
  325. package/skills/executing-plans/SKILL.md +70 -0
  326. package/skills/finishing-a-development-branch/LICENSE +21 -0
  327. package/skills/finishing-a-development-branch/SKILL.md +241 -0
  328. package/skills/first-party/README.md +32 -0
  329. package/skills/first-party/append-only-jsonl-stores/SKILL.md +50 -0
  330. package/skills/first-party/golden-snapshot-discipline/SKILL.md +45 -0
  331. package/skills/first-party/immutable-updates/SKILL.md +46 -0
  332. package/skills/first-party/manifest.json +10 -0
  333. package/skills/first-party/ts-extension-imports/SKILL.md +49 -0
  334. package/skills/first-party/validate-at-boundaries/SKILL.md +41 -0
  335. package/skills/first-party/zero-dependency-discipline/SKILL.md +41 -0
  336. package/skills/frontend-design/LICENSE +177 -0
  337. package/skills/frontend-design/LICENSE.txt +177 -0
  338. package/skills/frontend-design/SKILL.md +55 -0
  339. package/skills/internal-comms/LICENSE +202 -0
  340. package/skills/internal-comms/LICENSE.txt +202 -0
  341. package/skills/internal-comms/SKILL.md +32 -0
  342. package/skills/internal-comms/examples/3p-updates.md +47 -0
  343. package/skills/internal-comms/examples/company-newsletter.md +65 -0
  344. package/skills/internal-comms/examples/faq-answers.md +30 -0
  345. package/skills/internal-comms/examples/general-comms.md +16 -0
  346. package/skills/mcp-builder/LICENSE +202 -0
  347. package/skills/mcp-builder/LICENSE.txt +202 -0
  348. package/skills/mcp-builder/SKILL.md +236 -0
  349. package/skills/mcp-builder/reference/evaluation.md +602 -0
  350. package/skills/mcp-builder/reference/mcp_best_practices.md +249 -0
  351. package/skills/mcp-builder/reference/node_mcp_server.md +970 -0
  352. package/skills/mcp-builder/reference/python_mcp_server.md +719 -0
  353. package/skills/mcp-builder/scripts/connections.py +151 -0
  354. package/skills/mcp-builder/scripts/evaluation.py +373 -0
  355. package/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
  356. package/skills/mcp-builder/scripts/requirements.txt +2 -0
  357. package/skills/receiving-code-review/LICENSE +21 -0
  358. package/skills/receiving-code-review/SKILL.md +213 -0
  359. package/skills/requesting-code-review/LICENSE +21 -0
  360. package/skills/requesting-code-review/SKILL.md +103 -0
  361. package/skills/requesting-code-review/code-reviewer.md +172 -0
  362. package/skills/seed-manifest.json +185 -0
  363. package/skills/skill-creator/LICENSE +202 -0
  364. package/skills/skill-creator/LICENSE.txt +202 -0
  365. package/skills/skill-creator/SKILL.md +485 -0
  366. package/skills/skill-creator/agents/analyzer.md +274 -0
  367. package/skills/skill-creator/agents/comparator.md +202 -0
  368. package/skills/skill-creator/agents/grader.md +223 -0
  369. package/skills/skill-creator/assets/eval_review.html +146 -0
  370. package/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  371. package/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  372. package/skills/skill-creator/references/schemas.md +430 -0
  373. package/skills/skill-creator/scripts/__init__.py +0 -0
  374. package/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  375. package/skills/skill-creator/scripts/generate_report.py +326 -0
  376. package/skills/skill-creator/scripts/improve_description.py +247 -0
  377. package/skills/skill-creator/scripts/package_skill.py +136 -0
  378. package/skills/skill-creator/scripts/quick_validate.py +103 -0
  379. package/skills/skill-creator/scripts/run_eval.py +310 -0
  380. package/skills/skill-creator/scripts/run_loop.py +328 -0
  381. package/skills/skill-creator/scripts/utils.py +47 -0
  382. package/skills/slack-gif-creator/LICENSE +202 -0
  383. package/skills/slack-gif-creator/LICENSE.txt +202 -0
  384. package/skills/slack-gif-creator/SKILL.md +254 -0
  385. package/skills/slack-gif-creator/core/easing.py +234 -0
  386. package/skills/slack-gif-creator/core/frame_composer.py +176 -0
  387. package/skills/slack-gif-creator/core/gif_builder.py +269 -0
  388. package/skills/slack-gif-creator/core/validators.py +136 -0
  389. package/skills/slack-gif-creator/requirements.txt +4 -0
  390. package/skills/subagent-driven-development/LICENSE +21 -0
  391. package/skills/subagent-driven-development/SKILL.md +418 -0
  392. package/skills/subagent-driven-development/implementer-prompt.md +139 -0
  393. package/skills/subagent-driven-development/scripts/review-package +44 -0
  394. package/skills/subagent-driven-development/scripts/sdd-workspace +22 -0
  395. package/skills/subagent-driven-development/scripts/task-brief +40 -0
  396. package/skills/subagent-driven-development/task-reviewer-prompt.md +188 -0
  397. package/skills/systematic-debugging/CREATION-LOG.md +119 -0
  398. package/skills/systematic-debugging/LICENSE +21 -0
  399. package/skills/systematic-debugging/SKILL.md +296 -0
  400. package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  401. package/skills/systematic-debugging/condition-based-waiting.md +115 -0
  402. package/skills/systematic-debugging/defense-in-depth.md +122 -0
  403. package/skills/systematic-debugging/find-polluter.sh +63 -0
  404. package/skills/systematic-debugging/root-cause-tracing.md +169 -0
  405. package/skills/systematic-debugging/test-academic.md +14 -0
  406. package/skills/systematic-debugging/test-pressure-1.md +58 -0
  407. package/skills/systematic-debugging/test-pressure-2.md +68 -0
  408. package/skills/systematic-debugging/test-pressure-3.md +69 -0
  409. package/skills/test-driven-development/LICENSE +21 -0
  410. package/skills/test-driven-development/SKILL.md +371 -0
  411. package/skills/test-driven-development/testing-anti-patterns.md +299 -0
  412. package/skills/theme-factory/LICENSE +202 -0
  413. package/skills/theme-factory/LICENSE.txt +202 -0
  414. package/skills/theme-factory/SKILL.md +59 -0
  415. package/skills/theme-factory/theme-showcase.pdf +0 -0
  416. package/skills/theme-factory/themes/arctic-frost.md +19 -0
  417. package/skills/theme-factory/themes/botanical-garden.md +19 -0
  418. package/skills/theme-factory/themes/desert-rose.md +19 -0
  419. package/skills/theme-factory/themes/forest-canopy.md +19 -0
  420. package/skills/theme-factory/themes/golden-hour.md +19 -0
  421. package/skills/theme-factory/themes/midnight-galaxy.md +19 -0
  422. package/skills/theme-factory/themes/modern-minimalist.md +19 -0
  423. package/skills/theme-factory/themes/ocean-depths.md +19 -0
  424. package/skills/theme-factory/themes/sunset-boulevard.md +19 -0
  425. package/skills/theme-factory/themes/tech-innovation.md +19 -0
  426. package/skills/using-git-worktrees/LICENSE +21 -0
  427. package/skills/using-git-worktrees/SKILL.md +202 -0
  428. package/skills/using-superpowers/LICENSE +21 -0
  429. package/skills/using-superpowers/SKILL.md +62 -0
  430. package/skills/using-superpowers/references/antigravity-tools.md +23 -0
  431. package/skills/using-superpowers/references/codex-tools.md +39 -0
  432. package/skills/using-superpowers/references/pi-tools.md +16 -0
  433. package/skills/verification-before-completion/LICENSE +21 -0
  434. package/skills/verification-before-completion/SKILL.md +139 -0
  435. package/skills/web-artifacts-builder/LICENSE +202 -0
  436. package/skills/web-artifacts-builder/LICENSE.txt +202 -0
  437. package/skills/web-artifacts-builder/SKILL.md +74 -0
  438. package/skills/web-artifacts-builder/scripts/bundle-artifact.sh +54 -0
  439. package/skills/web-artifacts-builder/scripts/init-artifact.sh +322 -0
  440. package/skills/web-artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
  441. package/skills/webapp-testing/LICENSE +202 -0
  442. package/skills/webapp-testing/LICENSE.txt +202 -0
  443. package/skills/webapp-testing/SKILL.md +96 -0
  444. package/skills/webapp-testing/examples/console_logging.py +35 -0
  445. package/skills/webapp-testing/examples/element_discovery.py +40 -0
  446. package/skills/webapp-testing/examples/static_html_automation.py +33 -0
  447. package/skills/webapp-testing/scripts/with_server.py +106 -0
  448. package/skills/writing-plans/LICENSE +21 -0
  449. package/skills/writing-plans/SKILL.md +174 -0
  450. package/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
package/LICENSE ADDED
@@ -0,0 +1,191 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2026 Mohammad Omar
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,6 @@
1
+ baselane pack library — third-party attributions
2
+ =================================================
3
+ Some packs adapt content from the following MIT-licensed project:
4
+ ECC — https://github.com/affaan-m/ECC — © 2026 Affaan Mustafa — MIT License
5
+ Adapted, not copied verbatim. Each adapted pack also carries an `attribution`
6
+ field surfaced in its generated AGENTS.md.
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # @baselane/packs
2
+
3
+ WorkflowPack schema, validation (`validatePack`), and render pipeline, plus the
4
+ built-in packs and seed skills shipped by the [`baselane`](https://www.npmjs.com/package/baselane)
5
+ CLI (e.g. `disciplined-workflow`, `frontend-taste`, `security-review`).
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ npm install @baselane/packs
11
+ ```
12
+
13
+ Used as a library dependency of `baselane` — most users won't install it directly.
14
+
15
+ Docs: https://baselane.sh
@@ -0,0 +1,26 @@
1
+ export interface MergeInput {
2
+ path: string;
3
+ existing: string;
4
+ managedBody: string;
5
+ packId: string;
6
+ version: string;
7
+ }
8
+ export interface MergeResult {
9
+ path: string;
10
+ merged: string;
11
+ rationale: string;
12
+ usedAi: boolean;
13
+ }
14
+ export interface AiConfig {
15
+ apiKey: string | null;
16
+ model?: string;
17
+ fetchImpl?: typeof fetch;
18
+ }
19
+ /**
20
+ * Merge a pack's managed region into an existing file, preferring an AI-assisted merge
21
+ * that can reconcile the team's surrounding content more gracefully than the mechanical
22
+ * region merge — but never at the risk of corrupting or leaking anything. Any failure
23
+ * (no key, network error, bad response, failed validation) falls back to
24
+ * `mergeManagedRegion`. This function never throws.
25
+ */
26
+ export declare function aiMergeFile(input: MergeInput, cfg: AiConfig): Promise<MergeResult>;
@@ -0,0 +1,165 @@
1
+ import { END_MARKER, buildStartMarker, mergeManagedRegion } from "./merge-region.js";
2
+ const API_URL = "https://api.anthropic.com/v1/messages";
3
+ const ANTHROPIC_VERSION = "2023-06-01";
4
+ const DEFAULT_MODEL = "claude-sonnet-5";
5
+ const MAX_TOKENS = 8192;
6
+ // The marker literals come from merge-region.ts (single source of truth). The AI is
7
+ // instructed to use these exact strings so mergeManagedRegion can still find the region
8
+ // on the next mechanical pass, and so we can validate the AI didn't invent its own.
9
+ function mechanicalFallback(input, rationale) {
10
+ const merged = mergeManagedRegion(input.existing, input.managedBody, input.packId, input.version);
11
+ return { path: input.path, merged, rationale, usedAi: false };
12
+ }
13
+ function errorMessage(error) {
14
+ return error instanceof Error ? error.message : String(error);
15
+ }
16
+ function buildRequestBody(input, model, startMarker) {
17
+ const system = [
18
+ `You adopt a baselane workflow-pack into a repo's existing ${input.path}.`,
19
+ "Preserve ALL of the team's existing project-specific content verbatim (entities, conventions, env vars, service notes) — do not summarize, reformat, or drop any of it.",
20
+ "Add the baselane standard inside exactly one managed region, delimited by these EXACT markers. Do not alter them, and do not invent your own:",
21
+ `Opening marker: ${startMarker}`,
22
+ `Closing marker: ${END_MARKER}`,
23
+ 'Return STRICT JSON and nothing else, matching this shape: {"merged": string, "rationale": string}. "merged" is the full resulting file content; "rationale" is one sentence explaining what you did.',
24
+ ].join("\n");
25
+ const user = [
26
+ "Existing file content (preserve verbatim outside the managed region):",
27
+ "---",
28
+ input.existing,
29
+ "---",
30
+ "",
31
+ "Managed region body to insert between the markers:",
32
+ "---",
33
+ input.managedBody,
34
+ "---",
35
+ ].join("\n");
36
+ return { model, max_tokens: MAX_TOKENS, system, messages: [{ role: "user", content: user }] };
37
+ }
38
+ function extractResponseText(data) {
39
+ if (typeof data !== "object" || data === null)
40
+ return null;
41
+ const content = data.content;
42
+ if (!Array.isArray(content))
43
+ return null;
44
+ for (const block of content) {
45
+ if (typeof block !== "object" || block === null)
46
+ continue;
47
+ const { type, text } = block;
48
+ if (type === "text" && typeof text === "string")
49
+ return text;
50
+ }
51
+ return null;
52
+ }
53
+ // Models sometimes wrap the JSON in prose or a markdown fence despite instructions;
54
+ // try a straight parse first, then fall back to the outermost {...} slice.
55
+ function extractJson(text) {
56
+ const trimmed = text.trim();
57
+ try {
58
+ return JSON.parse(trimmed);
59
+ }
60
+ catch {
61
+ // fall through to the brace-slice attempt below
62
+ }
63
+ const start = trimmed.indexOf("{");
64
+ const end = trimmed.lastIndexOf("}");
65
+ if (start === -1 || end === -1 || end <= start)
66
+ return null;
67
+ try {
68
+ return JSON.parse(trimmed.slice(start, end + 1));
69
+ }
70
+ catch {
71
+ return null;
72
+ }
73
+ }
74
+ function parseAiPayload(text) {
75
+ const raw = extractJson(text);
76
+ if (typeof raw !== "object" || raw === null)
77
+ return null;
78
+ const { merged, rationale } = raw;
79
+ if (typeof merged !== "string" || merged.length === 0)
80
+ return null;
81
+ return { merged, rationale: typeof rationale === "string" ? rationale : "AI merge applied." };
82
+ }
83
+ // Strip every baselane managed region (start-marker … end-marker) from a body, leaving only the
84
+ // developer's own content. Used so the preservation check compares dev-content against dev-content
85
+ // and never counts the pack's freshly-inserted region as "preserving" a deleted line.
86
+ const MANAGED_REGION_RE = /<!-- baselane:start [^\n]*?-->[\s\S]*?<!-- baselane:end -->/g;
87
+ // The merged output must not have dropped ANY of the team's existing content. We check every
88
+ // non-blank line of `existing` survives (as a trimmed substring) in the merged output — but only
89
+ // in the part OUTSIDE the managed region on both sides. Bug #22: without stripping the region, a
90
+ // developer line the model DELETED that ALSO happens to appear in the pack's inserted body (common
91
+ // for house rules like "use parameterized queries") would count as preserved even though the
92
+ // original was removed. Comparing dev-content-to-dev-content closes that. Strict is the SAFE
93
+ // direction: a false negative just falls back to the deterministic mechanical merge, whereas a
94
+ // false positive silently destroys customer content — we err toward the fallback.
95
+ function preservesExisting(existing, merged) {
96
+ const devOnly = (text) => text.replace(MANAGED_REGION_RE, "");
97
+ const mergedDev = devOnly(merged);
98
+ const existingLines = devOnly(existing)
99
+ .split("\n")
100
+ .map((line) => line.trim())
101
+ .filter((line) => line.length > 0);
102
+ return existingLines.every((line) => mergedDev.includes(line));
103
+ }
104
+ function validationFailure(payload, input, startMarker) {
105
+ if (!payload.merged.includes(startMarker) || !payload.merged.includes(END_MARKER)) {
106
+ return "AI response did not include the required markers";
107
+ }
108
+ if (!preservesExisting(input.existing, payload.merged)) {
109
+ return "AI response dropped existing content";
110
+ }
111
+ return null;
112
+ }
113
+ /**
114
+ * Merge a pack's managed region into an existing file, preferring an AI-assisted merge
115
+ * that can reconcile the team's surrounding content more gracefully than the mechanical
116
+ * region merge — but never at the risk of corrupting or leaking anything. Any failure
117
+ * (no key, network error, bad response, failed validation) falls back to
118
+ * `mergeManagedRegion`. This function never throws.
119
+ */
120
+ export async function aiMergeFile(input, cfg) {
121
+ if (!cfg.apiKey) {
122
+ return mechanicalFallback(input, "Mechanical merge (no AI key configured).");
123
+ }
124
+ const startMarker = buildStartMarker(input.packId, input.version);
125
+ const model = cfg.model ?? process.env.BASELANE_MERGE_MODEL ?? DEFAULT_MODEL;
126
+ const fetchImpl = cfg.fetchImpl ?? globalThis.fetch;
127
+ let response;
128
+ try {
129
+ response = await fetchImpl(API_URL, {
130
+ method: "POST",
131
+ headers: {
132
+ "x-api-key": cfg.apiKey,
133
+ "anthropic-version": ANTHROPIC_VERSION,
134
+ "content-type": "application/json",
135
+ },
136
+ body: JSON.stringify(buildRequestBody(input, model, startMarker)),
137
+ });
138
+ }
139
+ catch (error) {
140
+ return mechanicalFallback(input, `Mechanical merge (AI request failed: ${errorMessage(error)}).`);
141
+ }
142
+ if (!response.ok) {
143
+ return mechanicalFallback(input, `Mechanical merge (AI request failed: HTTP ${response.status}).`);
144
+ }
145
+ let data;
146
+ try {
147
+ data = await response.json();
148
+ }
149
+ catch {
150
+ return mechanicalFallback(input, "Mechanical merge (AI response was not valid JSON).");
151
+ }
152
+ const text = extractResponseText(data);
153
+ if (text === null) {
154
+ return mechanicalFallback(input, "Mechanical merge (AI response had no text content).");
155
+ }
156
+ const payload = parseAiPayload(text);
157
+ if (payload === null) {
158
+ return mechanicalFallback(input, "Mechanical merge (AI response was not valid JSON).");
159
+ }
160
+ const failure = validationFailure(payload, input, startMarker);
161
+ if (failure !== null) {
162
+ return mechanicalFallback(input, `Mechanical merge (${failure}).`);
163
+ }
164
+ return { path: input.path, merged: payload.merged, rationale: payload.rationale, usedAi: true };
165
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Retired pack ids that still resolve to their successor, so existing assignments,
3
+ * bundles, and open PRs that reference the old id keep working. The map IS the
4
+ * migration: a retired pack's directory and goldens are deleted, and this entry
5
+ * redirects the id to its successor's content.
6
+ */
7
+ export declare const PACK_ALIASES: Record<string, string>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Retired pack ids that still resolve to their successor, so existing assignments,
3
+ * bundles, and open PRs that reference the old id keep working. The map IS the
4
+ * migration: a retired pack's directory and goldens are deleted, and this entry
5
+ * redirects the id to its successor's content.
6
+ */
7
+ export const PACK_ALIASES = {
8
+ "test-loop": "software-engineer-harness",
9
+ };
@@ -0,0 +1,19 @@
1
+ import type { AnalysisProfile } from "@baselane/analyze";
2
+ import type { ConventionsReport } from "@baselane/analyze";
3
+ import type { WorkflowPack } from "./types.ts";
4
+ export interface DraftPackInput {
5
+ profile: AnalysisProfile;
6
+ conventions: ConventionsReport;
7
+ /** "owner/name" or a dir basename; drives id/title/summary. */
8
+ repoName?: string;
9
+ }
10
+ export interface DraftPackResult {
11
+ /** Already validatePack-checked — never returned unvalidated. */
12
+ pack: WorkflowPack;
13
+ /** The measured-conventions ruleset, reused verbatim as the emitted rules-component payload. */
14
+ rulesMarkdown: string;
15
+ }
16
+ /** Deterministic composer: an analysis report -> a validatePack-checked WorkflowPack draft. The
17
+ * measured conventions become the pack's context markdown AND are returned separately so the caller
18
+ * can emit them as a reusable library `rules` component. */
19
+ export declare function composeDraftPack(input: DraftPackInput): DraftPackResult;
@@ -0,0 +1,170 @@
1
+ import { validatePack } from "./validate.js";
2
+ const UI_FRAMEWORK = /react|next|vue|svelte|angular/i;
3
+ // Test runners are surfaced in `profile.frameworks` alongside UI/backend frameworks, but they're
4
+ // tooling, not architecture — excluded from the stack label so titles/summaries read like
5
+ // "React + TypeScript" instead of getting diluted with "Vitest".
6
+ const TEST_FRAMEWORKS = new Set(["vitest", "jest", "mocha", "@playwright/test"]);
7
+ const DISPLAY_NAMES = {
8
+ typescript: "TypeScript",
9
+ javascript: "JavaScript",
10
+ react: "React",
11
+ next: "Next.js",
12
+ vue: "Vue",
13
+ svelte: "Svelte",
14
+ express: "Express",
15
+ fastify: "Fastify",
16
+ "@nestjs/core": "NestJS",
17
+ };
18
+ function displayName(id) {
19
+ const known = DISPLAY_NAMES[id];
20
+ if (known)
21
+ return known;
22
+ const bare = id.replace(/^@[^/]+\//, "");
23
+ return bare.charAt(0).toUpperCase() + bare.slice(1);
24
+ }
25
+ /** Notable frameworks (UI/backend, not test tooling) followed by languages, deduped
26
+ * case-insensitively. This is "the stack" for titles/summaries — e.g. ["React", "TypeScript"]. */
27
+ function stackParts(profile) {
28
+ const names = [
29
+ ...profile.frameworks.filter((f) => !TEST_FRAMEWORKS.has(f.name)).map((f) => displayName(f.name)),
30
+ ...profile.languages.map(displayName),
31
+ ];
32
+ const seen = new Set();
33
+ return names.filter((name) => {
34
+ const key = name.toLowerCase();
35
+ if (seen.has(key))
36
+ return false;
37
+ seen.add(key);
38
+ return true;
39
+ });
40
+ }
41
+ function lastSegment(repoName) {
42
+ return (repoName ?? "").split("/").pop() ?? "";
43
+ }
44
+ function slugifyRepo(repoName) {
45
+ const slug = lastSegment(repoName)
46
+ .toLowerCase()
47
+ .replace(/[^a-z0-9]+/g, "-")
48
+ .replace(/^-+|-+$/g, "");
49
+ return slug.length > 0 ? slug : "drafted-pack";
50
+ }
51
+ function pct(consistency) {
52
+ return Math.round(consistency * 100);
53
+ }
54
+ function ruleBullet(r) {
55
+ const prefix = r.enforced ? "" : "**Unwritten rule** — ";
56
+ return `- ${prefix}${r.statement} (${pct(r.consistency)}%)`;
57
+ }
58
+ function buildRulesMarkdown(conventions) {
59
+ const toolingLine = conventions.lintConfigs.length > 0
60
+ ? `Configured tooling: ${conventions.lintConfigs.map((c) => `${c.tool} (${c.path})`).join(", ")}.`
61
+ : "No lint/format tooling configured — every convention below is unwritten.";
62
+ const bullets = conventions.rules.length > 0
63
+ ? conventions.rules.map(ruleBullet)
64
+ : ["- No strongly consistent conventions were detected."];
65
+ if (conventions.fileLength) {
66
+ bullets.push(`- File length: p50 ${conventions.fileLength.p50} lines, p90 ${conventions.fileLength.p90} lines`);
67
+ }
68
+ const parts = [
69
+ "## Conventions",
70
+ "",
71
+ `Measured from this repository's own code (${conventions.sampledFiles} files sampled). Rules marked "unwritten" are followed consistently but not enforced by any linter — encode them so agents keep following them.`,
72
+ "",
73
+ toolingLine,
74
+ "",
75
+ ...bullets,
76
+ ];
77
+ if (conventions.mixed.length > 0) {
78
+ parts.push("", "### Measured but inconsistent", "", "Present in the code but below the auto-encode threshold — surfaced for humans, not encoded as rules:");
79
+ for (const m of conventions.mixed) {
80
+ parts.push(`- ${m.statement} — measured but inconsistent, not auto-encoded (${pct(m.consistency)}%)`);
81
+ }
82
+ }
83
+ return parts.join("\n");
84
+ }
85
+ function commandBlocks(profile) {
86
+ const specs = [
87
+ { name: "build", cmd: profile.commands.build },
88
+ { name: "test", cmd: profile.commands.test },
89
+ { name: "lint", cmd: profile.commands.lint },
90
+ ];
91
+ return specs
92
+ .filter((s) => s.cmd !== null)
93
+ .map((s) => ({
94
+ name: s.name,
95
+ description: `Run \`${s.cmd}\` and report failures.`,
96
+ argument_hint: "[extra args]",
97
+ prompt: `Run \`${s.cmd}\` and report any failures with file:line.`,
98
+ }));
99
+ }
100
+ function pluralize(n, word) {
101
+ return `${n} ${word}${n === 1 ? "" : "s"}`;
102
+ }
103
+ /** Total conventions found is rules + mixed (see @baselane/analyze's RULE_THRESHOLD): `rules` are
104
+ * consistency >= 90% (auto-encoded), `mixed` are below that (measured but not auto-encoded). Both
105
+ * count as "found" — a summary that only counts `rules` undercounts what the draft actually surfaces. */
106
+ function conventionsClause(conventions) {
107
+ const total = conventions.rules.length + conventions.mixed.length;
108
+ return `${pluralize(total, "convention")} measured (${conventions.rules.length} consistent, ${conventions.mixed.length} inconsistent)`;
109
+ }
110
+ function capabilityBlocks(profile) {
111
+ const caps = [{ type: "system-map", store: "repo", method: "analyze" }];
112
+ if (profile.languages.length > 0)
113
+ caps.push({ type: "graph", store: "repo", method: "imports" });
114
+ if (profile.frameworks.some((f) => UI_FRAMEWORK.test(f.name))) {
115
+ caps.push({ type: "design", store: "repo", method: "author" });
116
+ }
117
+ return caps;
118
+ }
119
+ /** Two *enforcing* gate hooks — unlike reminder hooks (which only print), these exit non-zero to
120
+ * actually block. The secret-scan gate runs before a Bash tool call and blocks it while gitleaks
121
+ * finds an unredacted secret; the test gate blocks ending the session on a red suite. `settingsJson`
122
+ * passes these commands into `.claude/settings.json` byte-for-byte, so the exit code reaches Claude
123
+ * Code's hook runner intact. Commands are single-line (the `line()` validator rejects newlines). */
124
+ function hookBlocks(profile) {
125
+ const hooks = [
126
+ {
127
+ event: "PreToolUse",
128
+ matcher: "Bash",
129
+ description: "Block shell commands while gitleaks finds an unredacted secret in the working tree.",
130
+ action: "run-command",
131
+ command: "if command -v gitleaks >/dev/null 2>&1; then gitleaks detect --no-git --no-banner --redact >/dev/null 2>&1 || exit 1; fi",
132
+ },
133
+ ];
134
+ if (profile.commands.test) {
135
+ hooks.push({
136
+ event: "Stop",
137
+ matcher: "",
138
+ description: "Do not end the session while the test suite is failing.",
139
+ action: "run-command",
140
+ command: `${profile.commands.test} || exit 1`,
141
+ });
142
+ }
143
+ return hooks;
144
+ }
145
+ /** Deterministic composer: an analysis report -> a validatePack-checked WorkflowPack draft. The
146
+ * measured conventions become the pack's context markdown AND are returned separately so the caller
147
+ * can emit them as a reusable library `rules` component. */
148
+ export function composeDraftPack(input) {
149
+ const { profile, conventions, repoName } = input;
150
+ const rulesMarkdown = buildRulesMarkdown(conventions);
151
+ const label = lastSegment(repoName) || "this repo";
152
+ const stack = stackParts(profile);
153
+ const commands = commandBlocks(profile);
154
+ const capabilities = capabilityBlocks(profile);
155
+ // Package manager rides along in the summary's stack list (more identifying detail than the
156
+ // title needs) but not the title itself, which stays to "React + TypeScript"-style branding.
157
+ const summaryStack = profile.packageManager ? [...stack, profile.packageManager] : stack;
158
+ const candidate = {
159
+ id: slugifyRepo(repoName),
160
+ version: "0.1.0",
161
+ title: stack.length > 0 ? `${label} — ${stack.join(" + ")} conventions` : `${label} starter pack`,
162
+ summary: `Conventions and starter blocks for ${label}${summaryStack.length > 0 ? ` — ${summaryStack.join(", ")}` : ""}: ${conventionsClause(conventions)}, ${pluralize(commands.length, "command")}, plus ${pluralize(capabilities.length, "capability block")}.`,
163
+ context: { markdown: rulesMarkdown },
164
+ capabilities,
165
+ agents: [],
166
+ commands,
167
+ hooks: hookBlocks(profile),
168
+ };
169
+ return { pack: validatePack(candidate), rulesMarkdown };
170
+ }
@@ -0,0 +1,8 @@
1
+ export type DriftKind = "version" | "content" | "missing" | "none";
2
+ /**
3
+ * Worst-of drift across every entry file this pack actually renders — missing (the region is gone)
4
+ * outranks a stale version, which outranks a hand-edited body, which outranks no drift at all. Pure:
5
+ * the caller supplies the repo's current entry-file contents and the pack's freshly rendered FileMap,
6
+ * so this has no I/O and no dependency on how either was obtained.
7
+ */
8
+ export declare function detectPackDrift(entryFiles: Record<string, string>, packId: string, currentVersion: string, renderedFiles: Record<string, string>): DriftKind;
@@ -0,0 +1,21 @@
1
+ import { ENTRY_FILES, extractManagedRegions } from "./merge-region.js";
2
+ const DRIFT_RANK = { none: 0, content: 1, version: 2, missing: 3 };
3
+ /**
4
+ * Worst-of drift across every entry file this pack actually renders — missing (the region is gone)
5
+ * outranks a stale version, which outranks a hand-edited body, which outranks no drift at all. Pure:
6
+ * the caller supplies the repo's current entry-file contents and the pack's freshly rendered FileMap,
7
+ * so this has no I/O and no dependency on how either was obtained.
8
+ */
9
+ export function detectPackDrift(entryFiles, packId, currentVersion, renderedFiles) {
10
+ let worst = "none";
11
+ for (const path of ENTRY_FILES) {
12
+ const rendered = renderedFiles[path];
13
+ if (rendered === undefined)
14
+ continue; // this pack doesn't render this entry file at all
15
+ const region = extractManagedRegions(entryFiles[path] ?? "").find((r) => r.packId === packId);
16
+ const kind = !region ? "missing" : region.version !== currentVersion ? "version" : region.body !== rendered.trim() ? "content" : "none";
17
+ if (DRIFT_RANK[kind] > DRIFT_RANK[worst])
18
+ worst = kind;
19
+ }
20
+ return worst;
21
+ }