@seasb/metafab 0.0.1 → 2.0.0-next.1

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 (414) hide show
  1. package/README.md +46 -1
  2. package/dist/cli.d.ts +11 -0
  3. package/dist/cli.js +419 -0
  4. package/dist/cli.js.map +1 -0
  5. package/dist/commands/build.d.ts +31 -0
  6. package/dist/commands/build.js +156 -0
  7. package/dist/commands/build.js.map +1 -0
  8. package/dist/commands/check.d.ts +2 -0
  9. package/dist/commands/check.js +52 -0
  10. package/dist/commands/check.js.map +1 -0
  11. package/dist/commands/create.d.ts +2 -0
  12. package/dist/commands/create.js +75 -0
  13. package/dist/commands/create.js.map +1 -0
  14. package/dist/commands/detach.d.ts +2 -0
  15. package/dist/commands/detach.js +24 -0
  16. package/dist/commands/detach.js.map +1 -0
  17. package/dist/commands/diff.d.ts +2 -0
  18. package/dist/commands/diff.js +35 -0
  19. package/dist/commands/diff.js.map +1 -0
  20. package/dist/commands/env.d.ts +4 -0
  21. package/dist/commands/env.js +362 -0
  22. package/dist/commands/env.js.map +1 -0
  23. package/dist/commands/import.d.ts +2 -0
  24. package/dist/commands/import.js +107 -0
  25. package/dist/commands/import.js.map +1 -0
  26. package/dist/commands/init.d.ts +2 -0
  27. package/dist/commands/init.js +77 -0
  28. package/dist/commands/init.js.map +1 -0
  29. package/dist/commands/map.d.ts +2 -0
  30. package/dist/commands/map.js +42 -0
  31. package/dist/commands/map.js.map +1 -0
  32. package/dist/commands/pipeline-add.d.ts +2 -0
  33. package/dist/commands/pipeline-add.js +68 -0
  34. package/dist/commands/pipeline-add.js.map +1 -0
  35. package/dist/commands/pipeline-remove.d.ts +2 -0
  36. package/dist/commands/pipeline-remove.js +45 -0
  37. package/dist/commands/pipeline-remove.js.map +1 -0
  38. package/dist/commands/publish.d.ts +2 -0
  39. package/dist/commands/publish.js +153 -0
  40. package/dist/commands/publish.js.map +1 -0
  41. package/dist/commands/types.d.ts +45 -0
  42. package/dist/commands/types.js +2 -0
  43. package/dist/commands/types.js.map +1 -0
  44. package/dist/commands/update.d.ts +2 -0
  45. package/dist/commands/update.js +97 -0
  46. package/dist/commands/update.js.map +1 -0
  47. package/dist/core/adopt.d.ts +53 -0
  48. package/dist/core/adopt.js +676 -0
  49. package/dist/core/adopt.js.map +1 -0
  50. package/dist/core/build/agents.d.ts +26 -0
  51. package/dist/core/build/agents.js +67 -0
  52. package/dist/core/build/agents.js.map +1 -0
  53. package/dist/core/build/index.d.ts +5 -0
  54. package/dist/core/build/index.js +6 -0
  55. package/dist/core/build/index.js.map +1 -0
  56. package/dist/core/build/markers.d.ts +34 -0
  57. package/dist/core/build/markers.js +97 -0
  58. package/dist/core/build/markers.js.map +1 -0
  59. package/dist/core/build/plan.d.ts +82 -0
  60. package/dist/core/build/plan.js +912 -0
  61. package/dist/core/build/plan.js.map +1 -0
  62. package/dist/core/build/preview.d.ts +39 -0
  63. package/dist/core/build/preview.js +344 -0
  64. package/dist/core/build/preview.js.map +1 -0
  65. package/dist/core/build/skill.d.ts +99 -0
  66. package/dist/core/build/skill.js +354 -0
  67. package/dist/core/build/skill.js.map +1 -0
  68. package/dist/core/check/drift.d.ts +13 -0
  69. package/dist/core/check/drift.js +205 -0
  70. package/dist/core/check/drift.js.map +1 -0
  71. package/dist/core/check/index.d.ts +16 -0
  72. package/dist/core/check/index.js +84 -0
  73. package/dist/core/check/index.js.map +1 -0
  74. package/dist/core/check/markers.d.ts +9 -0
  75. package/dist/core/check/markers.js +220 -0
  76. package/dist/core/check/markers.js.map +1 -0
  77. package/dist/core/config/destinations.d.ts +5 -0
  78. package/dist/core/config/destinations.js +20 -0
  79. package/dist/core/config/destinations.js.map +1 -0
  80. package/dist/core/config/load.d.ts +4 -0
  81. package/dist/core/config/load.js +41 -0
  82. package/dist/core/config/load.js.map +1 -0
  83. package/dist/core/config/parse.d.ts +8 -0
  84. package/dist/core/config/parse.js +201 -0
  85. package/dist/core/config/parse.js.map +1 -0
  86. package/dist/core/config/source.d.ts +25 -0
  87. package/dist/core/config/source.js +67 -0
  88. package/dist/core/config/source.js.map +1 -0
  89. package/dist/core/config/types.d.ts +48 -0
  90. package/dist/core/config/types.js +2 -0
  91. package/dist/core/config/types.js.map +1 -0
  92. package/dist/core/config/validate.d.ts +11 -0
  93. package/dist/core/config/validate.js +389 -0
  94. package/dist/core/config/validate.js.map +1 -0
  95. package/dist/core/config/writers.d.ts +14 -0
  96. package/dist/core/config/writers.js +269 -0
  97. package/dist/core/config/writers.js.map +1 -0
  98. package/dist/core/config.d.ts +7 -0
  99. package/dist/core/config.js +8 -0
  100. package/dist/core/config.js.map +1 -0
  101. package/dist/core/discovery.d.ts +34 -0
  102. package/dist/core/discovery.js +272 -0
  103. package/dist/core/discovery.js.map +1 -0
  104. package/dist/core/edit/create.d.ts +18 -0
  105. package/dist/core/edit/create.js +190 -0
  106. package/dist/core/edit/create.js.map +1 -0
  107. package/dist/core/edit/document.d.ts +4 -0
  108. package/dist/core/edit/document.js +16 -0
  109. package/dist/core/edit/document.js.map +1 -0
  110. package/dist/core/edit/factory-yaml.d.ts +17 -0
  111. package/dist/core/edit/factory-yaml.js +213 -0
  112. package/dist/core/edit/factory-yaml.js.map +1 -0
  113. package/dist/core/edit/files.d.ts +6 -0
  114. package/dist/core/edit/files.js +47 -0
  115. package/dist/core/edit/files.js.map +1 -0
  116. package/dist/core/edit/index.d.ts +9 -0
  117. package/dist/core/edit/index.js +10 -0
  118. package/dist/core/edit/index.js.map +1 -0
  119. package/dist/core/edit/map.d.ts +24 -0
  120. package/dist/core/edit/map.js +82 -0
  121. package/dist/core/edit/map.js.map +1 -0
  122. package/dist/core/edit/names.d.ts +2 -0
  123. package/dist/core/edit/names.js +17 -0
  124. package/dist/core/edit/names.js.map +1 -0
  125. package/dist/core/edit/paths.d.ts +8 -0
  126. package/dist/core/edit/paths.js +81 -0
  127. package/dist/core/edit/paths.js.map +1 -0
  128. package/dist/core/edit/pipeline.d.ts +19 -0
  129. package/dist/core/edit/pipeline.js +152 -0
  130. package/dist/core/edit/pipeline.js.map +1 -0
  131. package/dist/core/edit/skill.d.ts +1 -0
  132. package/dist/core/edit/skill.js +10 -0
  133. package/dist/core/edit/skill.js.map +1 -0
  134. package/dist/core/env/condition.d.ts +40 -0
  135. package/dist/core/env/condition.js +283 -0
  136. package/dist/core/env/condition.js.map +1 -0
  137. package/dist/core/env/declarations.d.ts +16 -0
  138. package/dist/core/env/declarations.js +328 -0
  139. package/dist/core/env/declarations.js.map +1 -0
  140. package/dist/core/env/directives.d.ts +75 -0
  141. package/dist/core/env/directives.js +429 -0
  142. package/dist/core/env/directives.js.map +1 -0
  143. package/dist/core/env/git-config.d.ts +15 -0
  144. package/dist/core/env/git-config.js +110 -0
  145. package/dist/core/env/git-config.js.map +1 -0
  146. package/dist/core/env/imports.d.ts +60 -0
  147. package/dist/core/env/imports.js +217 -0
  148. package/dist/core/env/imports.js.map +1 -0
  149. package/dist/core/env/index.d.ts +6 -0
  150. package/dist/core/env/index.js +7 -0
  151. package/dist/core/env/index.js.map +1 -0
  152. package/dist/core/env/markdown.d.ts +22 -0
  153. package/dist/core/env/markdown.js +33 -0
  154. package/dist/core/env/markdown.js.map +1 -0
  155. package/dist/core/env/render.d.ts +13 -0
  156. package/dist/core/env/render.js +65 -0
  157. package/dist/core/env/render.js.map +1 -0
  158. package/dist/core/env/report.d.ts +29 -0
  159. package/dist/core/env/report.js +39 -0
  160. package/dist/core/env/report.js.map +1 -0
  161. package/dist/core/env/scenarios.d.ts +40 -0
  162. package/dist/core/env/scenarios.js +124 -0
  163. package/dist/core/env/scenarios.js.map +1 -0
  164. package/dist/core/env/select.d.ts +30 -0
  165. package/dist/core/env/select.js +191 -0
  166. package/dist/core/env/select.js.map +1 -0
  167. package/dist/core/env/types.d.ts +38 -0
  168. package/dist/core/env/types.js +2 -0
  169. package/dist/core/env/types.js.map +1 -0
  170. package/dist/core/env/validate.d.ts +25 -0
  171. package/dist/core/env/validate.js +212 -0
  172. package/dist/core/env/validate.js.map +1 -0
  173. package/dist/core/factory/discovery.d.ts +9 -0
  174. package/dist/core/factory/discovery.js +139 -0
  175. package/dist/core/factory/discovery.js.map +1 -0
  176. package/dist/core/factory/factory-yaml.d.ts +29 -0
  177. package/dist/core/factory/factory-yaml.js +538 -0
  178. package/dist/core/factory/factory-yaml.js.map +1 -0
  179. package/dist/core/factory/index.d.ts +5 -0
  180. package/dist/core/factory/index.js +6 -0
  181. package/dist/core/factory/index.js.map +1 -0
  182. package/dist/core/factory/lines.d.ts +8 -0
  183. package/dist/core/factory/lines.js +11 -0
  184. package/dist/core/factory/lines.js.map +1 -0
  185. package/dist/core/factory/load.d.ts +4 -0
  186. package/dist/core/factory/load.js +83 -0
  187. package/dist/core/factory/load.js.map +1 -0
  188. package/dist/core/factory/requires.d.ts +9 -0
  189. package/dist/core/factory/requires.js +123 -0
  190. package/dist/core/factory/requires.js.map +1 -0
  191. package/dist/core/factory/types.d.ts +58 -0
  192. package/dist/core/factory/types.js +2 -0
  193. package/dist/core/factory/types.js.map +1 -0
  194. package/dist/core/factory/validate.d.ts +44 -0
  195. package/dist/core/factory/validate.js +460 -0
  196. package/dist/core/factory/validate.js.map +1 -0
  197. package/dist/core/hooks/index.d.ts +8 -0
  198. package/dist/core/hooks/index.js +15 -0
  199. package/dist/core/hooks/index.js.map +1 -0
  200. package/dist/core/hooks/script.d.ts +21 -0
  201. package/dist/core/hooks/script.js +34 -0
  202. package/dist/core/hooks/script.js.map +1 -0
  203. package/dist/core/hooks/sync.d.ts +17 -0
  204. package/dist/core/hooks/sync.js +262 -0
  205. package/dist/core/hooks/sync.js.map +1 -0
  206. package/dist/core/import/conflicts.d.ts +82 -0
  207. package/dist/core/import/conflicts.js +256 -0
  208. package/dist/core/import/conflicts.js.map +1 -0
  209. package/dist/core/import/copy.d.ts +10 -0
  210. package/dist/core/import/copy.js +76 -0
  211. package/dist/core/import/copy.js.map +1 -0
  212. package/dist/core/import/file-tree.d.ts +43 -0
  213. package/dist/core/import/file-tree.js +107 -0
  214. package/dist/core/import/file-tree.js.map +1 -0
  215. package/dist/core/import/index.d.ts +5 -0
  216. package/dist/core/import/index.js +6 -0
  217. package/dist/core/import/index.js.map +1 -0
  218. package/dist/core/import/pipeline-changes.d.ts +8 -0
  219. package/dist/core/import/pipeline-changes.js +89 -0
  220. package/dist/core/import/pipeline-changes.js.map +1 -0
  221. package/dist/core/import/run.d.ts +76 -0
  222. package/dist/core/import/run.js +275 -0
  223. package/dist/core/import/run.js.map +1 -0
  224. package/dist/core/init/gitattributes.d.ts +20 -0
  225. package/dist/core/init/gitattributes.js +89 -0
  226. package/dist/core/init/gitattributes.js.map +1 -0
  227. package/dist/core/init/index.d.ts +4 -0
  228. package/dist/core/init/index.js +5 -0
  229. package/dist/core/init/index.js.map +1 -0
  230. package/dist/core/init/name.d.ts +1 -0
  231. package/dist/core/init/name.js +4 -0
  232. package/dist/core/init/name.js.map +1 -0
  233. package/dist/core/init/run.d.ts +51 -0
  234. package/dist/core/init/run.js +261 -0
  235. package/dist/core/init/run.js.map +1 -0
  236. package/dist/core/init/targets.d.ts +17 -0
  237. package/dist/core/init/targets.js +87 -0
  238. package/dist/core/init/targets.js.map +1 -0
  239. package/dist/core/merge.d.ts +88 -0
  240. package/dist/core/merge.js +239 -0
  241. package/dist/core/merge.js.map +1 -0
  242. package/dist/core/publish/exclude.d.ts +9 -0
  243. package/dist/core/publish/exclude.js +32 -0
  244. package/dist/core/publish/exclude.js.map +1 -0
  245. package/dist/core/publish/git-target.d.ts +32 -0
  246. package/dist/core/publish/git-target.js +460 -0
  247. package/dist/core/publish/git-target.js.map +1 -0
  248. package/dist/core/publish/index.d.ts +10 -0
  249. package/dist/core/publish/index.js +11 -0
  250. package/dist/core/publish/index.js.map +1 -0
  251. package/dist/core/publish/npm-target.d.ts +15 -0
  252. package/dist/core/publish/npm-target.js +177 -0
  253. package/dist/core/publish/npm-target.js.map +1 -0
  254. package/dist/core/publish/package-json.d.ts +31 -0
  255. package/dist/core/publish/package-json.js +74 -0
  256. package/dist/core/publish/package-json.js.map +1 -0
  257. package/dist/core/publish/prepare.d.ts +35 -0
  258. package/dist/core/publish/prepare.js +102 -0
  259. package/dist/core/publish/prepare.js.map +1 -0
  260. package/dist/core/publish/provenance.d.ts +1 -0
  261. package/dist/core/publish/provenance.js +20 -0
  262. package/dist/core/publish/provenance.js.map +1 -0
  263. package/dist/core/publish/publish.d.ts +13 -0
  264. package/dist/core/publish/publish.js +143 -0
  265. package/dist/core/publish/publish.js.map +1 -0
  266. package/dist/core/publish/readme.d.ts +22 -0
  267. package/dist/core/publish/readme.js +109 -0
  268. package/dist/core/publish/readme.js.map +1 -0
  269. package/dist/core/publish/stage.d.ts +19 -0
  270. package/dist/core/publish/stage.js +333 -0
  271. package/dist/core/publish/stage.js.map +1 -0
  272. package/dist/core/publish/types.d.ts +71 -0
  273. package/dist/core/publish/types.js +2 -0
  274. package/dist/core/publish/types.js.map +1 -0
  275. package/dist/core/requires/check.d.ts +15 -0
  276. package/dist/core/requires/check.js +83 -0
  277. package/dist/core/requires/check.js.map +1 -0
  278. package/dist/core/requires/index.d.ts +4 -0
  279. package/dist/core/requires/index.js +5 -0
  280. package/dist/core/requires/index.js.map +1 -0
  281. package/dist/core/requires/inspect.d.ts +44 -0
  282. package/dist/core/requires/inspect.js +114 -0
  283. package/dist/core/requires/inspect.js.map +1 -0
  284. package/dist/core/requires/paths.d.ts +29 -0
  285. package/dist/core/requires/paths.js +83 -0
  286. package/dist/core/requires/paths.js.map +1 -0
  287. package/dist/core/requires/setup.d.ts +37 -0
  288. package/dist/core/requires/setup.js +147 -0
  289. package/dist/core/requires/setup.js.map +1 -0
  290. package/dist/core/setup.d.ts +27 -0
  291. package/dist/core/setup.js +84 -0
  292. package/dist/core/setup.js.map +1 -0
  293. package/dist/core/sources/cache.d.ts +38 -0
  294. package/dist/core/sources/cache.js +264 -0
  295. package/dist/core/sources/cache.js.map +1 -0
  296. package/dist/core/sources/containment.d.ts +21 -0
  297. package/dist/core/sources/containment.js +50 -0
  298. package/dist/core/sources/containment.js.map +1 -0
  299. package/dist/core/sources/env.d.ts +12 -0
  300. package/dist/core/sources/env.js +28 -0
  301. package/dist/core/sources/env.js.map +1 -0
  302. package/dist/core/sources/extract.d.ts +25 -0
  303. package/dist/core/sources/extract.js +639 -0
  304. package/dist/core/sources/extract.js.map +1 -0
  305. package/dist/core/sources/git-process.d.ts +26 -0
  306. package/dist/core/sources/git-process.js +51 -0
  307. package/dist/core/sources/git-process.js.map +1 -0
  308. package/dist/core/sources/git.d.ts +41 -0
  309. package/dist/core/sources/git.js +525 -0
  310. package/dist/core/sources/git.js.map +1 -0
  311. package/dist/core/sources/https.d.ts +21 -0
  312. package/dist/core/sources/https.js +218 -0
  313. package/dist/core/sources/https.js.map +1 -0
  314. package/dist/core/sources/index.d.ts +13 -0
  315. package/dist/core/sources/index.js +14 -0
  316. package/dist/core/sources/index.js.map +1 -0
  317. package/dist/core/sources/npm-cli.d.ts +19 -0
  318. package/dist/core/sources/npm-cli.js +51 -0
  319. package/dist/core/sources/npm-cli.js.map +1 -0
  320. package/dist/core/sources/npm.d.ts +29 -0
  321. package/dist/core/sources/npm.js +411 -0
  322. package/dist/core/sources/npm.js.map +1 -0
  323. package/dist/core/sources/parse.d.ts +46 -0
  324. package/dist/core/sources/parse.js +446 -0
  325. package/dist/core/sources/parse.js.map +1 -0
  326. package/dist/core/sources/path.d.ts +10 -0
  327. package/dist/core/sources/path.js +331 -0
  328. package/dist/core/sources/path.js.map +1 -0
  329. package/dist/core/sources/problems.d.ts +29 -0
  330. package/dist/core/sources/problems.js +36 -0
  331. package/dist/core/sources/problems.js.map +1 -0
  332. package/dist/core/sources/redact.d.ts +2 -0
  333. package/dist/core/sources/redact.js +70 -0
  334. package/dist/core/sources/redact.js.map +1 -0
  335. package/dist/core/sources/resolve.d.ts +9 -0
  336. package/dist/core/sources/resolve.js +29 -0
  337. package/dist/core/sources/resolve.js.map +1 -0
  338. package/dist/core/sources/types.d.ts +86 -0
  339. package/dist/core/sources/types.js +2 -0
  340. package/dist/core/sources/types.js.map +1 -0
  341. package/dist/core/sources/validate.d.ts +9 -0
  342. package/dist/core/sources/validate.js +116 -0
  343. package/dist/core/sources/validate.js.map +1 -0
  344. package/dist/core/summary.d.ts +79 -0
  345. package/dist/core/summary.js +411 -0
  346. package/dist/core/summary.js.map +1 -0
  347. package/dist/core/update/clashes.d.ts +63 -0
  348. package/dist/core/update/clashes.js +192 -0
  349. package/dist/core/update/clashes.js.map +1 -0
  350. package/dist/core/update/detach.d.ts +21 -0
  351. package/dist/core/update/detach.js +38 -0
  352. package/dist/core/update/detach.js.map +1 -0
  353. package/dist/core/update/diff.d.ts +58 -0
  354. package/dist/core/update/diff.js +180 -0
  355. package/dist/core/update/diff.js.map +1 -0
  356. package/dist/core/update/fetch.d.ts +34 -0
  357. package/dist/core/update/fetch.js +73 -0
  358. package/dist/core/update/fetch.js.map +1 -0
  359. package/dist/core/update/index.d.ts +6 -0
  360. package/dist/core/update/index.js +7 -0
  361. package/dist/core/update/index.js.map +1 -0
  362. package/dist/core/update/restore.d.ts +20 -0
  363. package/dist/core/update/restore.js +195 -0
  364. package/dist/core/update/restore.js.map +1 -0
  365. package/dist/core/update/run.d.ts +113 -0
  366. package/dist/core/update/run.js +1135 -0
  367. package/dist/core/update/run.js.map +1 -0
  368. package/dist/core/update/select.d.ts +39 -0
  369. package/dist/core/update/select.js +157 -0
  370. package/dist/core/update/select.js.map +1 -0
  371. package/dist/core/update/spelling.d.ts +51 -0
  372. package/dist/core/update/spelling.js +185 -0
  373. package/dist/core/update/spelling.js.map +1 -0
  374. package/dist/core/update/trees.d.ts +24 -0
  375. package/dist/core/update/trees.js +72 -0
  376. package/dist/core/update/trees.js.map +1 -0
  377. package/dist/errors.d.ts +39 -0
  378. package/dist/errors.js +24 -0
  379. package/dist/errors.js.map +1 -0
  380. package/dist/help.d.ts +51 -0
  381. package/dist/help.js +117 -0
  382. package/dist/help.js.map +1 -0
  383. package/dist/input.d.ts +25 -0
  384. package/dist/input.js +174 -0
  385. package/dist/input.js.map +1 -0
  386. package/dist/output.d.ts +21 -0
  387. package/dist/output.js +37 -0
  388. package/dist/output.js.map +1 -0
  389. package/dist/util/frontmatter.d.ts +12 -0
  390. package/dist/util/frontmatter.js +58 -0
  391. package/dist/util/frontmatter.js.map +1 -0
  392. package/dist/util/fs.d.ts +38 -0
  393. package/dist/util/fs.js +135 -0
  394. package/dist/util/fs.js.map +1 -0
  395. package/dist/util/git-names.d.ts +8 -0
  396. package/dist/util/git-names.js +25 -0
  397. package/dist/util/git-names.js.map +1 -0
  398. package/dist/util/git.d.ts +12 -0
  399. package/dist/util/git.js +33 -0
  400. package/dist/util/git.js.map +1 -0
  401. package/dist/util/suggest.d.ts +6 -0
  402. package/dist/util/suggest.js +48 -0
  403. package/dist/util/suggest.js.map +1 -0
  404. package/dist/util/text.d.ts +8 -0
  405. package/dist/util/text.js +19 -0
  406. package/dist/util/text.js.map +1 -0
  407. package/dist/util/version.d.ts +7 -0
  408. package/dist/util/version.js +13 -0
  409. package/dist/util/version.js.map +1 -0
  410. package/dist/util/yaml.d.ts +30 -0
  411. package/dist/util/yaml.js +201 -0
  412. package/dist/util/yaml.js.map +1 -0
  413. package/package.json +51 -3
  414. package/resources/metafab-skill/SKILL.md +173 -0
package/package.json CHANGED
@@ -1,6 +1,54 @@
1
1
  {
2
2
  "name": "@seasb/metafab",
3
- "version": "0.0.1",
4
- "description": "Placeholder. Use @seasb/metafab 1.0.0 or later.",
5
- "publishConfig": { "access": "public" }
3
+ "version": "2.0.0-next.1",
4
+ "description": "Create, validate, install, and share software factories.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/Traction-Team/meta-harness.git"
8
+ },
9
+ "type": "module",
10
+ "bin": {
11
+ "metafab": "dist/cli.js"
12
+ },
13
+ "engines": {
14
+ "node": ">=20"
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "resources",
19
+ "README.md"
20
+ ],
21
+ "publishConfig": {
22
+ "access": "public",
23
+ "provenance": true
24
+ },
25
+ "scripts": {
26
+ "typecheck": "tsc --noEmit",
27
+ "test": "vitest run",
28
+ "build": "tsc",
29
+ "postbuild": "node -e \"require('node:fs').chmodSync('dist/cli.js', 0o755);\"",
30
+ "verify": "npm run typecheck && npm run test && npm run factory",
31
+ "factory": "npm run build && node dist/cli.js build && git diff --exit-code -- AGENTS.md CLAUDE.md .gitignore .gitattributes && node dist/cli.js check && node .factory/scripts/check.mjs"
32
+ },
33
+ "devDependencies": {
34
+ "@seasb/metafab": "^1.0.0",
35
+ "@types/node": "^20.19.43",
36
+ "@types/picomatch": "^4.0.3",
37
+ "@types/semver": "^7.8.0",
38
+ "@types/ssri": "^7.1.5",
39
+ "@types/validate-npm-package-name": "^4.0.2",
40
+ "typescript": "^7.0.2",
41
+ "verdaccio": "6.8.0",
42
+ "vitest": "^4.1.12"
43
+ },
44
+ "dependencies": {
45
+ "diff": "^8.0.4",
46
+ "node-diff3": "^3.2.1",
47
+ "picomatch": "^4.0.7",
48
+ "semver": "^7.8.5",
49
+ "ssri": "^14.0.0",
50
+ "tar": "^7.5.22",
51
+ "validate-npm-package-name": "^5.0.1",
52
+ "yaml": "^2.9.1"
53
+ }
6
54
  }
@@ -0,0 +1,173 @@
1
+ ---
2
+ name: metafab
3
+ description: Maintain this repository's Metafab factory. Use when editing .factory/, adding workflows or skills, changing the pipeline, running metafab build or check, keeping installed skills current after a clone or pull, or reviewing upstream factory changes.
4
+ ---
5
+
6
+ # Metafab
7
+
8
+ This repository stores its software factory in `.factory/`. Metafab compiles that source into the files agent tools read. Edit `.factory/` and run `metafab build`. Never edit installed copies by hand.
9
+
10
+ ## Find and edit factory source files
11
+
12
+ - `.factory/factory.yaml` names the factory and lists the pipeline.
13
+ - `.factory/AGENTS.md` holds standing instructions for every session.
14
+ - `.factory/workflows/<name>/SKILL.md` is one step of the work.
15
+ - `.factory/skills/<name>/SKILL.md` is reusable project knowledge.
16
+ - `.factory/templates/` and `.factory/scripts/` hold supporting files. They are used in place and are not installed.
17
+
18
+ Every directory below `.factory/` that contains `SKILL.md` is a skill. Directories that start with a dot are ignored. Skill names must be unique across the factory, because installed skills share one flat namespace.
19
+
20
+ ## Create workflows and skills
21
+
22
+ Run `metafab create <path> --description "<when to use it>"`. The last path segment is the skill name. For example, `metafab create workflows/review-slice` creates a workflow and `metafab create review/security` creates a skill in the `review` group.
23
+
24
+ The description is the discovery metadata agent tools use. Write it so a matching request finds the skill: say what it does and when to use it. Put supporting files beside `SKILL.md`.
25
+
26
+ Keep a workflow about one operation. Do not name a specific agent tool in a workflow: in a format 2 factory, put tool-specific commands in a `when` or `switch` block, or in a partial the workflow imports, so each agent reads only its own; in a format 1 factory, put them in a separate harness skill and refer to it.
27
+
28
+ ## Write one factory for several environments
29
+
30
+ When the people who use this factory work in different agent harnesses or workspace tools, one workflow otherwise says "in Amp do this, in Orca do that", and every agent reads every variant. Declare the difference as an environment instead: `build` compiles the factory for the selection, so each agent reads only its own steps.
31
+
32
+ Declare the variables in `.factory/factory.yaml`, which needs `format: 2`:
33
+
34
+ ```yaml
35
+ format: 2
36
+ name: dragonfly
37
+
38
+ env:
39
+ harness:
40
+ values:
41
+ opencode: { label: In OpenCode }
42
+ claude: { label: In Claude Code }
43
+ amp: { label: In Amp (AMP_THREAD_ID is set) }
44
+ workspace:
45
+ values: [orca, orb, worktree]
46
+ default: worktree
47
+ ```
48
+
49
+ A label says, in words an agent can act on, where it is when that value applies, such as `In Amp (AMP_THREAD_ID is set)`. A value with no label is labelled `When <variable> is <value>`, and a `default` applies when the developer selects nothing.
50
+
51
+ Choose the tool by what the text needs:
52
+
53
+ - `when` for a few lines that apply to some environments, such as one setup step.
54
+ - `switch` where every value needs its own text. `check` then lists every switch that a new value has to be added to, which `when` cannot.
55
+ - `import` from `.factory/partials/` when several workflows share one procedure. A partial is a Markdown file that is never installed on its own.
56
+ - A `skills:` entry in `factory.yaml` when a whole skill applies only somewhere.
57
+
58
+ A directive is an HTML comment on a line of its own, so the source still renders and a `SKILL.md` still loads as a normal Agent Skill. `build` removes directive lines from the output:
59
+
60
+ ```md
61
+ <!-- factory:when env.workspace == orca -->
62
+ Create the slice's checkout with the Orca worktree tool.
63
+ <!-- factory:endwhen -->
64
+
65
+ <!-- factory:switch env.workspace -->
66
+ <!-- factory:case orca -->
67
+ Create the slice's checkout with the Orca worktree tool.
68
+ <!-- factory:case orb -->
69
+ Start a new orb for the slice.
70
+ <!-- factory:default -->
71
+ Run `git worktree add` for the slice.
72
+ <!-- factory:endswitch -->
73
+ ```
74
+
75
+ A workflow that shares a procedure imports it. The path is relative to the file that holds the directive, uses `/`, ends in `.md`, and must stay inside `.factory/`:
76
+
77
+ ```md
78
+ <!-- factory:import ../../partials/worktree.md -->
79
+ ```
80
+
81
+ A skill that applies only in some environments says so in `factory.yaml`, not in its frontmatter:
82
+
83
+ ```yaml
84
+ skills:
85
+ orca-worktrees: { when: env.workspace == orca }
86
+ amp-threads: { when: env.harness == amp }
87
+ ```
88
+
89
+ Rules to keep:
90
+
91
+ - Frontmatter is the same in every environment: no directive in a `SKILL.md`'s `name`, `description` or any other field. Write descriptions that do not depend on the harness.
92
+ - A directive is a whole line. Every `when` closes with `endwhen` and every `switch` with `endswitch`, in the same file. Blocks may nest.
93
+ - Each branch must read correctly on its own, because `build` removes text without renumbering lists or reflowing prose.
94
+
95
+ `metafab env` shows each variable, its selected values and the source of each. `metafab env set harness=opencode,claude` replaces the selection in the repository's Git config and rebuilds; add `--global` for every repository on the machine, and `metafab env unset harness` removes it. A setup script sets `FACTORY_ENV_HARNESS=amp` before `metafab build`. A value that Git config or `FACTORY_ENV_*` names and the factory does not declare is ignored with a warning; an undeclared name in `--env` is an error. A variable with no selection falls back to its `default`, then to every value.
96
+
97
+ `metafab check` validates every branch and every import, whatever the local selection is. To see what a teammate on another harness receives, run `metafab build --env harness=amp --out /tmp/preview-amp`: it writes the compiled skills and the `AGENTS.md` block into a directory that must not exist or must be empty, and changes nothing else in the repository.
98
+
99
+ The root `AGENTS.md` block is rendered for every declared value, with a label on each block that does not apply to all of them, so it is the same for every developer. Never put a per-developer instruction there.
100
+
101
+ ## Add workflows to the pipeline
102
+
103
+ The pipeline in `factory.yaml` is the order work moves through the workflows. Add an entry with `metafab pipeline add <workflow> [--after <workflow>] [--stop "<decision>"]`, or edit `factory.yaml` directly.
104
+
105
+ Only workflows can appear in the pipeline. A `stop` entry names the person who acts and what they decide, for example `review-slice: { stop: The code owner approves the PR }`. The generated `AGENTS.md` tells an agent to stop there.
106
+
107
+ ## Build after an edit
108
+
109
+ Run `metafab build` after every change to `.factory/`. It writes the root `AGENTS.md` block, the `CLAUDE.md` import block, the `.gitignore` block, and the installed skills for the targets in `.factory/metafab.yaml`. With `git-hooks: true`, the installed Git hooks also run it after a checkout, merge, or rebase.
110
+
111
+ Targets are chosen with `agents` in `.factory/metafab.yaml`, for example `agents: [claude, codex]`. `metafab build` has no option that overrides them. Set `agents: []` to remove all installed output.
112
+
113
+ Build removes owned output that no longer has a source. It stops with exit code 5 when it finds anything directly in a selected skill destination that Metafab did not generate. Hand edits inside an installed skill are overwritten by the next build. Run `metafab init` to adopt existing repository skills.
114
+
115
+ ## Keep installed skills current
116
+
117
+ Installed skills are ignored by Git, so a clone, a new worktree, a pull, a branch switch, a merge, or a rebase can leave them missing or stale.
118
+
119
+ - **Git hooks.** Set `git-hooks: true` in `.factory/metafab.yaml` or run `metafab init --git-hooks`, then run `metafab build`. A branch checkout, a merge, and a rebase then each run `metafab build`, in every worktree of the clone. A hook Metafab did not write, or a `core.hooksPath`, is left alone: `build` warns and prints the line to add by hand.
120
+ - **Worktree setup scripts.** Run `metafab build` in the setup step of the tool that creates worktrees: `npx --yes @seasb/metafab build`, or `npx metafab build` when the project depends on Metafab. For Orca, commit an `orca.yaml`:
121
+ ```yaml
122
+ scripts:
123
+ setup: |
124
+ npx --yes @seasb/metafab build
125
+ ```
126
+ - **Cloud agents and CI.** They start from a fresh clone, so run `metafab build` in their setup step. CI then runs `git diff --exit-code -- AGENTS.md CLAUDE.md .gitignore .gitattributes` and `metafab check`.
127
+
128
+ ## Check and resolve problems
129
+
130
+ Run `metafab check`. It reports each problem with a path, line, and suggested fix. Errors return exit code 1.
131
+
132
+ Resolve every problem before you commit:
133
+
134
+ 1. Fix the source in `.factory/`.
135
+ 2. Run `metafab build`.
136
+ 3. Run `metafab check` again.
137
+
138
+ Check covers the factory format, configuration, installed copies, generated blocks, unresolved Git conflict markers, and remaining `.upstream` files. A missing installed copy after a fresh clone is fixed by `metafab build`.
139
+
140
+ ## Keep changes reviewable
141
+
142
+ Put factory changes in one commit or pull request. Include the source in `.factory/` and the committed generated files (`AGENTS.md`, `CLAUDE.md`, `.gitignore`, `.gitattributes`). Installed skill directories are ignored by Git.
143
+
144
+ Review the `.factory/` diff. Installed copies are derived from it, and `metafab check` proves they match. Run `metafab build` and `metafab check` before you commit.
145
+
146
+ ## Review upstream changes
147
+
148
+ `metafab update` merges a newer upstream fab into `.factory/`. Use `--dry-run` to preview it, and read the summary before you accept it.
149
+
150
+ After an update:
151
+
152
+ 1. Review the `.factory/` diff, executable changes first.
153
+ 2. Resolve any conflict files left as `.upstream`.
154
+ 3. Run `metafab build` and `metafab check`.
155
+ 4. Commit the merged source and the regenerated files together.
156
+
157
+ Use `metafab diff` to see local edits since the recorded upstream version, and `metafab detach` to drop the upstream link without changing factory files.
158
+
159
+ ## Design a factory
160
+
161
+ Do not start from a template. Ask the person how work moves today, where people decide, and what goes wrong. Then describe that process as workflows and stops.
162
+
163
+ - Make one workflow per real step, not per role or document.
164
+ - Put the pipeline in the order the work actually moves.
165
+ - Add a stop wherever a person decides before work continues. Name who decides and what they approve.
166
+ - Split reusable knowledge into skills rather than repeating it in workflows.
167
+ - If people work in different harnesses, declare `harness` in `env` before writing tool-specific steps.
168
+ - Start with four to eight workflows. Add more only when a step genuinely repeats.
169
+ - List files outside `.factory/` that the workflows need under `requires` in `factory.yaml`, with a template in `.factory/templates/` when Metafab can create them.
170
+ - Put per-repository values in a file a template creates, never in `.factory/`.
171
+ - Put repository-specific standing instructions in the root `AGENTS.md` outside the factory block.
172
+
173
+ A factory that matches how the team already works is easier to follow than one that invents a new process.