bmad-module-skill-forge 2.2.0 → 4.0.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 (437) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/README.md +49 -49
  3. package/docs/404.md +10 -8
  4. package/docs/_data/pinned.yaml +22 -13
  5. package/docs/_internal/STABILITY.md +58 -35
  6. package/docs/agents.md +39 -53
  7. package/docs/architecture.md +65 -51
  8. package/docs/bmad-synergy.md +53 -51
  9. package/docs/campaign.md +127 -75
  10. package/docs/concepts.md +34 -28
  11. package/docs/examples.md +70 -68
  12. package/docs/forge-auto.md +34 -31
  13. package/docs/getting-started.md +118 -57
  14. package/docs/how-it-works.md +25 -21
  15. package/docs/index.md +15 -15
  16. package/docs/skill-model.md +70 -59
  17. package/docs/troubleshooting.md +143 -18
  18. package/docs/verifying-a-skill.md +87 -57
  19. package/docs/why-skf.md +24 -22
  20. package/docs/workflows.md +274 -110
  21. package/package.json +18 -10
  22. package/src/forger/preferences.yaml +8 -1
  23. package/src/knowledge/agentskills-spec.md +2 -0
  24. package/src/knowledge/ccc-bridge.md +40 -24
  25. package/src/knowledge/confidence-tiers.md +9 -5
  26. package/src/knowledge/overview.md +3 -3
  27. package/src/knowledge/progressive-capability.md +8 -8
  28. package/src/knowledge/provenance-tracking.md +9 -5
  29. package/src/knowledge/qmd-registry.md +3 -3
  30. package/src/knowledge/skf-knowledge-index.csv +2 -2
  31. package/src/knowledge/skill-lifecycle.md +18 -11
  32. package/src/knowledge/split-body-strategy.md +0 -3
  33. package/src/knowledge/tool-resolution.md +4 -2
  34. package/src/knowledge/version-paths.md +101 -15
  35. package/src/module-help.csv +3 -3
  36. package/src/module.yaml +10 -0
  37. package/src/shared/data/ast-grep-recipes.yaml +608 -0
  38. package/src/shared/data/ide-context-files.json +30 -0
  39. package/src/shared/health-check.md +31 -59
  40. package/src/shared/references/description-guard-protocol.md +12 -9
  41. package/src/shared/references/feasibility-report-schema.md +19 -13
  42. package/src/shared/references/headless-gate-convention.md +55 -3
  43. package/src/shared/references/output-contract-schema.md +19 -8
  44. package/src/shared/references/pipeline-contracts.md +94 -29
  45. package/src/shared/references/tessl-review.md +77 -0
  46. package/src/shared/scripts/schemas/skf-analyze-result-envelope.v1.json +194 -0
  47. package/src/shared/scripts/schemas/skf-audit-result-envelope.v1.json +192 -0
  48. package/src/shared/scripts/schemas/skf-brief-result-envelope.v1.json +32 -4
  49. package/src/shared/scripts/schemas/skf-campaign-result-envelope.v1.json +174 -0
  50. package/src/shared/scripts/schemas/skf-create-skill-result-envelope.v1.json +284 -0
  51. package/src/shared/scripts/schemas/skf-drop-skill-result-envelope.v1.json +164 -0
  52. package/src/shared/scripts/schemas/skf-export-result-envelope.v1.json +160 -0
  53. package/src/shared/scripts/schemas/skf-quick-skill-result-envelope.v1.json +261 -0
  54. package/src/shared/scripts/schemas/skf-refine-architecture-result-envelope.v1.json +192 -0
  55. package/src/shared/scripts/schemas/skf-rename-skill-result-envelope.v1.json +179 -0
  56. package/src/shared/scripts/schemas/skf-setup-result-envelope.v1.json +27 -11
  57. package/src/shared/scripts/schemas/skf-stack-result-envelope.v1.json +176 -0
  58. package/src/shared/scripts/schemas/skf-test-result-envelope.v1.json +173 -0
  59. package/src/shared/scripts/schemas/skf-update-result-envelope.v1.json +19 -5
  60. package/src/shared/scripts/schemas/skf-verify-stack-result-envelope.v1.json +180 -0
  61. package/src/shared/scripts/schemas/skill-brief.v1.json +34 -0
  62. package/src/shared/scripts/schemas/workspace-detection.v1.json +1 -1
  63. package/src/shared/scripts/skf-atomic-write.py +233 -64
  64. package/src/shared/scripts/skf-build-change-manifest.py +2753 -28
  65. package/src/shared/scripts/skf-ccc-git-hygiene.py +532 -0
  66. package/src/shared/scripts/skf-check-unit-records.py +184 -0
  67. package/src/shared/scripts/skf-check-workspace-drift.py +538 -9
  68. package/src/shared/scripts/skf-classify-changed-files.py +772 -0
  69. package/src/shared/scripts/skf-comention-pairs.py +1333 -123
  70. package/src/shared/scripts/skf-compare-file-hashes.py +267 -105
  71. package/src/shared/scripts/skf-count-imports.py +1867 -0
  72. package/src/shared/scripts/skf-count-tokens.py +1 -1
  73. package/src/shared/scripts/skf-derive-assembly-shape.py +21 -3
  74. package/src/shared/scripts/skf-description-guard.py +99 -11
  75. package/src/shared/scripts/skf-detect-docs.py +694 -2
  76. package/src/shared/scripts/skf-detect-language.py +486 -107
  77. package/src/shared/scripts/skf-detect-registry.py +887 -0
  78. package/src/shared/scripts/skf-detect-scripts-assets.py +197 -55
  79. package/src/shared/scripts/skf-detect-tools.py +209 -27
  80. package/src/shared/scripts/skf-detect-workspaces.py +506 -30
  81. package/src/shared/scripts/skf-disqualify-candidates.py +821 -182
  82. package/src/shared/scripts/skf-emit-brief-result-envelope.py +69 -191
  83. package/src/shared/scripts/skf-emit-result-envelope.py +1604 -106
  84. package/src/shared/scripts/skf-enumerate-stack-skills.py +986 -117
  85. package/src/shared/scripts/skf-extract-public-api.py +5247 -96
  86. package/src/shared/scripts/skf-extraction-inventory.py +1280 -0
  87. package/src/shared/scripts/skf-extraction-snapshot.py +664 -0
  88. package/src/shared/scripts/skf-fetch-temporal.py +674 -0
  89. package/src/shared/scripts/skf-find-cycles.py +97 -29
  90. package/src/shared/scripts/skf-find-test-report.py +476 -0
  91. package/src/shared/scripts/skf-forge-tier-rw.py +469 -205
  92. package/src/shared/scripts/skf-github-fetch.py +365 -0
  93. package/src/shared/scripts/skf-github-probe.py +700 -0
  94. package/src/shared/scripts/skf-hash-content.py +180 -20
  95. package/src/shared/scripts/skf-language-corpora.py +1 -1
  96. package/src/shared/scripts/skf-load-provenance.py +161 -27
  97. package/src/shared/scripts/skf-manifest-ops.py +1 -1
  98. package/src/shared/scripts/skf-merge-ccc-exclusions.py +2307 -223
  99. package/src/shared/scripts/skf-merge-doc-urls.py +143 -20
  100. package/src/shared/scripts/skf-names-present.py +221 -0
  101. package/src/shared/scripts/skf-pair-intersect.py +119 -28
  102. package/src/shared/scripts/skf-parse-gaps.py +1384 -0
  103. package/src/shared/scripts/skf-preapply.py +1 -1
  104. package/src/shared/scripts/skf-preflight.py +176 -28
  105. package/src/shared/scripts/skf-promote-staged.py +430 -0
  106. package/src/shared/scripts/skf-provenance-gap-dispatch.py +64 -8
  107. package/src/shared/scripts/skf-qmd-classify-collections.py +229 -45
  108. package/src/shared/scripts/skf-quick-batch.py +774 -0
  109. package/src/shared/scripts/skf-rebuild-managed-sections.py +972 -88
  110. package/src/shared/scripts/skf-recommend-scope-type.py +323 -156
  111. package/src/shared/scripts/skf-render-metadata-stats.py +156 -12
  112. package/src/shared/scripts/skf-render-quick-metadata.py +132 -28
  113. package/src/shared/scripts/skf-render-stack-metadata.py +976 -0
  114. package/src/shared/scripts/skf-resolve-authoritative-files.py +155 -14
  115. package/src/shared/scripts/skf-resolve-package.py +523 -106
  116. package/src/shared/scripts/skf-rewrite-skill-name.py +433 -47
  117. package/src/shared/scripts/skf-run-lock.py +577 -0
  118. package/src/shared/scripts/skf-scan-manifests.py +998 -57
  119. package/src/shared/scripts/skf-scan-skill-md-structure.py +1341 -37
  120. package/src/shared/scripts/skf-severity-classify.py +712 -108
  121. package/src/shared/scripts/skf-shape-detect.py +298 -204
  122. package/src/shared/scripts/skf-shard-body.py +9 -8
  123. package/src/shared/scripts/skf-skill-inventory.py +2412 -89
  124. package/src/shared/scripts/skf-skills-module.py +472 -0
  125. package/src/shared/scripts/skf-source-tree.py +1796 -0
  126. package/src/shared/scripts/skf-structural-diff.py +787 -121
  127. package/src/shared/scripts/skf-tessl-review.py +706 -0
  128. package/src/shared/scripts/skf-update-active-symlink.py +120 -67
  129. package/src/shared/scripts/skf-update-run-state.py +624 -0
  130. package/src/shared/scripts/skf-validate-brief-inputs.py +92 -29
  131. package/src/shared/scripts/skf-validate-brief-schema.py +23 -2
  132. package/src/shared/scripts/skf-validate-feasibility-report.py +577 -66
  133. package/src/shared/scripts/skf-validate-frontmatter.py +103 -26
  134. package/src/shared/scripts/skf-validate-output.py +712 -64
  135. package/src/shared/scripts/skf-validate-pins.py +1 -1
  136. package/src/shared/scripts/skf-verify-no-trace.py +116 -10
  137. package/src/shared/scripts/skf-verify-provenance-completeness.py +3945 -152
  138. package/src/shared/scripts/skf-write-skill-brief.py +406 -25
  139. package/src/shared/tool-requirements.yaml +201 -0
  140. package/src/skf-analyze-source/SKILL.md +41 -36
  141. package/src/skf-analyze-source/assets/skill-brief-schema.md +7 -8
  142. package/src/skf-analyze-source/customize.toml +36 -24
  143. package/src/skf-analyze-source/references/auto-docs-only.md +58 -20
  144. package/src/skf-analyze-source/references/continue.md +2 -13
  145. package/src/skf-analyze-source/references/discover-additional-source.md +147 -0
  146. package/src/skf-analyze-source/references/generate-briefs.md +121 -55
  147. package/src/skf-analyze-source/references/headless-contract.md +42 -15
  148. package/src/skf-analyze-source/references/identify-units.md +96 -110
  149. package/src/skf-analyze-source/references/init.md +73 -71
  150. package/src/skf-analyze-source/references/map-and-detect.md +123 -105
  151. package/src/skf-analyze-source/references/map-unit-exports.md +68 -0
  152. package/src/skf-analyze-source/references/recommend.md +51 -70
  153. package/src/skf-analyze-source/references/scan-project.md +60 -84
  154. package/src/skf-analyze-source/references/scan-root.md +39 -0
  155. package/src/skf-analyze-source/references/step-auto-scope-coexistence.md +47 -0
  156. package/src/skf-analyze-source/references/step-auto-scope-corpora.md +53 -0
  157. package/src/skf-analyze-source/references/step-auto-scope-split.md +91 -0
  158. package/src/skf-analyze-source/references/step-auto-scope.md +208 -293
  159. package/src/skf-analyze-source/references/step-shape-detect.md +14 -12
  160. package/src/skf-analyze-source/references/unit-detection-heuristics.md +37 -42
  161. package/src/skf-audit-skill/SKILL.md +43 -51
  162. package/src/skf-audit-skill/assets/drift-report-template.md +28 -3
  163. package/src/skf-audit-skill/customize.toml +41 -20
  164. package/src/skf-audit-skill/references/constituent-freshness.md +91 -0
  165. package/src/skf-audit-skill/references/doc-drift.md +141 -0
  166. package/src/skf-audit-skill/references/headless-contract.md +29 -0
  167. package/src/skf-audit-skill/references/health-check.md +2 -0
  168. package/src/skf-audit-skill/references/init.md +149 -210
  169. package/src/skf-audit-skill/references/re-index.md +103 -110
  170. package/src/skf-audit-skill/references/report.md +96 -33
  171. package/src/skf-audit-skill/references/semantic-diff.md +34 -25
  172. package/src/skf-audit-skill/references/severity-classify.md +79 -65
  173. package/src/skf-audit-skill/references/severity-rules.md +15 -6
  174. package/src/skf-audit-skill/references/structural-diff.md +80 -90
  175. package/src/skf-audit-skill/references/upstream-checkout.md +77 -0
  176. package/src/skf-audit-skill/scripts/render-drift-tables.py +712 -0
  177. package/src/skf-brief-skill/SKILL.md +37 -26
  178. package/src/skf-brief-skill/assets/description-voice-examples.md +1 -1
  179. package/src/skf-brief-skill/assets/scope-templates.md +18 -25
  180. package/src/skf-brief-skill/assets/skill-brief-schema.md +30 -23
  181. package/src/skf-brief-skill/customize.toml +48 -20
  182. package/src/skf-brief-skill/references/analyze-target.md +144 -127
  183. package/src/skf-brief-skill/references/confirm-brief.md +11 -9
  184. package/src/skf-brief-skill/references/draft-checkpoint.md +36 -17
  185. package/src/skf-brief-skill/references/gather-intent-ratify.md +68 -0
  186. package/src/skf-brief-skill/references/gather-intent.md +87 -182
  187. package/src/skf-brief-skill/references/headless-args.md +84 -16
  188. package/src/skf-brief-skill/references/health-check.md +1 -1
  189. package/src/skf-brief-skill/references/invocation-contract.md +18 -13
  190. package/src/skf-brief-skill/references/portfolio-similarity-check.md +1 -1
  191. package/src/skf-brief-skill/references/qmd-collection-registration.md +7 -10
  192. package/src/skf-brief-skill/references/scope-definition.md +123 -47
  193. package/src/skf-brief-skill/references/step-auto-brief.md +26 -100
  194. package/src/skf-brief-skill/references/step-auto-validate.md +20 -121
  195. package/src/skf-brief-skill/references/version-resolution.md +7 -10
  196. package/src/skf-brief-skill/references/write-brief.md +66 -57
  197. package/src/skf-campaign/SKILL.md +31 -34
  198. package/src/skf-campaign/assets/campaign-state-schema.json +25 -4
  199. package/src/skf-campaign/customize.toml +47 -16
  200. package/src/skf-campaign/references/campaign-contracts.md +39 -29
  201. package/src/skf-campaign/references/campaign-directive-spec.md +4 -2
  202. package/src/skf-campaign/references/health-check.md +7 -16
  203. package/src/skf-campaign/references/step-01-setup.md +46 -84
  204. package/src/skf-campaign/references/step-02-strategy.md +31 -30
  205. package/src/skf-campaign/references/step-03-pins.md +26 -18
  206. package/src/skf-campaign/references/step-04-provenance.md +24 -23
  207. package/src/skf-campaign/references/step-05-skill-loop.md +67 -48
  208. package/src/skf-campaign/references/step-06-batch.md +41 -34
  209. package/src/skf-campaign/references/step-07-capstone.md +40 -25
  210. package/src/skf-campaign/references/step-08-verify.md +28 -29
  211. package/src/skf-campaign/references/step-09-refine.md +29 -30
  212. package/src/skf-campaign/references/step-10-export.md +48 -36
  213. package/src/skf-campaign/references/step-11-maintenance.md +31 -34
  214. package/src/skf-campaign/references/step-resume.md +37 -68
  215. package/src/skf-campaign/scripts/campaign-deps.py +57 -18
  216. package/src/skf-campaign/scripts/campaign-parse-manifest.py +361 -54
  217. package/src/skf-campaign/scripts/campaign-provenance.py +96 -53
  218. package/src/skf-campaign/scripts/campaign-quality-gate.py +592 -0
  219. package/src/skf-campaign/scripts/campaign-render-batch.py +257 -49
  220. package/src/skf-campaign/scripts/campaign-render-kickoff.py +343 -50
  221. package/src/skf-campaign/scripts/campaign-report.py +204 -37
  222. package/src/skf-campaign/scripts/campaign-state.py +1128 -0
  223. package/src/skf-campaign/scripts/campaign-status.py +10 -74
  224. package/src/skf-campaign/scripts/campaign-validate-pins.py +30 -3
  225. package/src/skf-campaign/scripts/campaign-validate-state.py +34 -4
  226. package/src/skf-campaign/templates/campaign-brief-template.yaml +4 -5
  227. package/src/skf-campaign/templates/campaign-report-template.md +5 -1
  228. package/src/skf-campaign/templates/kickoff-template.md +0 -14
  229. package/src/skf-create-skill/SKILL.md +27 -20
  230. package/src/skf-create-skill/assets/compile-assembly-rules.md +11 -8
  231. package/src/skf-create-skill/assets/skill-sections.md +21 -11
  232. package/src/skf-create-skill/customize.toml +20 -8
  233. package/src/skf-create-skill/references/authoritative-files-protocol.md +36 -58
  234. package/src/skf-create-skill/references/batch-mode.md +81 -0
  235. package/src/skf-create-skill/references/ccc-index-check.md +27 -0
  236. package/src/skf-create-skill/references/compile.md +119 -70
  237. package/src/skf-create-skill/references/component-extraction.md +113 -91
  238. package/src/skf-create-skill/references/enrich.md +41 -23
  239. package/src/skf-create-skill/references/entry-points-by-hand.md +37 -0
  240. package/src/skf-create-skill/references/extract.md +204 -162
  241. package/src/skf-create-skill/references/extraction-patterns-by-hand.md +141 -0
  242. package/src/skf-create-skill/references/extraction-patterns-tracing.md +11 -11
  243. package/src/skf-create-skill/references/extraction-patterns.md +588 -201
  244. package/src/skf-create-skill/references/generate-artifacts.md +145 -93
  245. package/src/skf-create-skill/references/health-check.md +1 -1
  246. package/src/skf-create-skill/references/load-brief.md +53 -36
  247. package/src/skf-create-skill/references/relabel-rule.md +12 -0
  248. package/src/skf-create-skill/references/report.md +37 -57
  249. package/src/skf-create-skill/references/source-resolution-protocols.md +58 -169
  250. package/src/skf-create-skill/references/step-auto-shard.md +20 -93
  251. package/src/skf-create-skill/references/step-doc-rot.md +44 -60
  252. package/src/skf-create-skill/references/step-doc-sources.md +28 -19
  253. package/src/skf-create-skill/references/sub/ccc-discover.md +18 -7
  254. package/src/skf-create-skill/references/sub/fetch-docs.md +106 -59
  255. package/src/skf-create-skill/references/sub/fetch-temporal.md +53 -166
  256. package/src/skf-create-skill/references/tier-degradation-rules.md +18 -9
  257. package/src/skf-create-skill/references/validate.md +173 -99
  258. package/src/skf-create-skill/scripts/scan-doc-rot.py +232 -99
  259. package/src/skf-create-stack-skill/SKILL.md +29 -56
  260. package/src/skf-create-stack-skill/assets/metadata-contract.md +51 -0
  261. package/src/skf-create-stack-skill/assets/provenance-map-schema.md +15 -15
  262. package/src/skf-create-stack-skill/assets/stack-skill-template.md +23 -57
  263. package/src/skf-create-stack-skill/customize.toml +23 -12
  264. package/src/skf-create-stack-skill/references/compile-stack.md +57 -66
  265. package/src/skf-create-stack-skill/references/compose-mode-rules.md +24 -44
  266. package/src/skf-create-stack-skill/references/detect-integrations.md +92 -95
  267. package/src/skf-create-stack-skill/references/detect-manifests.md +46 -71
  268. package/src/skf-create-stack-skill/references/generate-output.md +138 -128
  269. package/src/skf-create-stack-skill/references/init.md +90 -32
  270. package/src/skf-create-stack-skill/references/integration-patterns.md +1 -17
  271. package/src/skf-create-stack-skill/references/invocation-contract.md +34 -0
  272. package/src/skf-create-stack-skill/references/manifest-patterns.md +32 -20
  273. package/src/skf-create-stack-skill/references/parallel-extract.md +112 -38
  274. package/src/skf-create-stack-skill/references/rank-and-confirm.md +57 -75
  275. package/src/skf-create-stack-skill/references/report.md +39 -33
  276. package/src/skf-create-stack-skill/references/validate.md +20 -39
  277. package/src/skf-drop-skill/SKILL.md +28 -51
  278. package/src/skf-drop-skill/customize.toml +44 -30
  279. package/src/skf-drop-skill/references/execute.md +83 -146
  280. package/src/skf-drop-skill/references/health-check.md +2 -0
  281. package/src/skf-drop-skill/references/invocation-contract.md +64 -0
  282. package/src/skf-drop-skill/references/report.md +46 -30
  283. package/src/skf-drop-skill/references/select.md +122 -124
  284. package/src/skf-drop-skill/scripts/dir-sizes.py +54 -26
  285. package/src/skf-drop-skill/scripts/drop-roster.py +322 -0
  286. package/src/skf-export-skill/SKILL.md +40 -62
  287. package/src/skf-export-skill/assets/managed-section-format.md +14 -50
  288. package/src/skf-export-skill/assets/snippet-format.md +3 -1
  289. package/src/skf-export-skill/customize.toml +42 -13
  290. package/src/skf-export-skill/references/generate-snippet.md +54 -46
  291. package/src/skf-export-skill/references/health-check.md +2 -0
  292. package/src/skf-export-skill/references/invocation-contract.md +15 -0
  293. package/src/skf-export-skill/references/load-skill.md +88 -62
  294. package/src/skf-export-skill/references/manifest-rebuild.md +9 -10
  295. package/src/skf-export-skill/references/multi-skill-mode.md +4 -4
  296. package/src/skf-export-skill/references/orphan-context-detection.md +13 -5
  297. package/src/skf-export-skill/references/orphan-row-detection.md +31 -22
  298. package/src/skf-export-skill/references/package.md +15 -73
  299. package/src/skf-export-skill/references/preflight-snippet-root-probe.md +51 -70
  300. package/src/skf-export-skill/references/result-envelope.md +31 -16
  301. package/src/skf-export-skill/references/summary.md +41 -17
  302. package/src/skf-export-skill/references/token-report.md +4 -12
  303. package/src/skf-export-skill/references/update-context.md +118 -237
  304. package/src/skf-forger/SKILL.md +61 -37
  305. package/src/skf-forger/bmad-skill-manifest.yaml +4 -1
  306. package/src/skf-forger/customize.toml +43 -0
  307. package/src/skf-forger/references/pipeline-mode.md +73 -18
  308. package/src/skf-forger/scripts/forge-status.py +299 -0
  309. package/src/skf-forger/scripts/parse-pipeline.py +322 -54
  310. package/src/skf-forger/scripts/pipeline-gate.py +428 -0
  311. package/src/skf-forger/scripts/pipeline-journal.py +1052 -0
  312. package/src/skf-quick-skill/SKILL.md +54 -53
  313. package/src/skf-quick-skill/assets/skill-template.md +4 -2
  314. package/src/skf-quick-skill/customize.toml +51 -20
  315. package/src/skf-quick-skill/references/batch-mode.md +74 -21
  316. package/src/skf-quick-skill/references/compile.md +30 -31
  317. package/src/skf-quick-skill/references/ecosystem-check.md +7 -57
  318. package/src/skf-quick-skill/references/finalize.md +69 -18
  319. package/src/skf-quick-skill/references/halt-contract.md +41 -29
  320. package/src/skf-quick-skill/references/health-check.md +5 -3
  321. package/src/skf-quick-skill/references/quick-extract.md +114 -45
  322. package/src/skf-quick-skill/references/registry-resolution.md +9 -64
  323. package/src/skf-quick-skill/references/resolve-target.md +116 -66
  324. package/src/skf-quick-skill/references/write-and-validate.md +79 -40
  325. package/src/skf-refine-architecture/SKILL.md +43 -53
  326. package/src/skf-refine-architecture/customize.toml +49 -20
  327. package/src/skf-refine-architecture/references/compile.md +97 -54
  328. package/src/skf-refine-architecture/references/exit-codes.md +30 -0
  329. package/src/skf-refine-architecture/references/finding-storage.md +21 -0
  330. package/src/skf-refine-architecture/references/gap-analysis.md +101 -38
  331. package/src/skf-refine-architecture/references/improvements.md +14 -20
  332. package/src/skf-refine-architecture/references/init.md +98 -57
  333. package/src/skf-refine-architecture/references/issue-detection.md +32 -39
  334. package/src/skf-refine-architecture/references/refinement-rules.md +37 -48
  335. package/src/skf-refine-architecture/references/report.md +65 -54
  336. package/src/skf-refine-architecture/scripts/skf-check-preservation.py +1619 -0
  337. package/src/skf-rename-skill/SKILL.md +19 -54
  338. package/src/skf-rename-skill/customize.toml +32 -26
  339. package/src/skf-rename-skill/references/execute.md +230 -184
  340. package/src/skf-rename-skill/references/exit-codes.md +7 -7
  341. package/src/skf-rename-skill/references/health-check.md +1 -7
  342. package/src/skf-rename-skill/references/invocation-contract.md +25 -0
  343. package/src/skf-rename-skill/references/report.md +63 -52
  344. package/src/skf-rename-skill/references/select.md +197 -115
  345. package/src/skf-rename-skill/scripts/skf-validate-rename-name.py +161 -21
  346. package/src/skf-setup/SKILL.md +26 -26
  347. package/src/skf-setup/customize.toml +14 -10
  348. package/src/skf-setup/references/auto-index.md +50 -63
  349. package/src/skf-setup/references/ccc-index.md +29 -90
  350. package/src/skf-setup/references/detect-and-tier.md +58 -67
  351. package/src/skf-setup/references/health-check.md +2 -0
  352. package/src/skf-setup/references/invocation-contract.md +14 -0
  353. package/src/skf-setup/references/report.md +43 -166
  354. package/src/skf-setup/references/tier-rules.md +5 -5
  355. package/src/skf-setup/references/write-config.md +34 -57
  356. package/src/skf-test-skill/SKILL.md +17 -57
  357. package/src/skf-test-skill/assets/output-section-formats.md +33 -34
  358. package/src/skf-test-skill/customize.toml +27 -13
  359. package/src/skf-test-skill/references/coherence-check.md +134 -62
  360. package/src/skf-test-skill/references/coverage-check-tiers.md +35 -0
  361. package/src/skf-test-skill/references/coverage-check.md +209 -264
  362. package/src/skf-test-skill/references/detect-mode.md +5 -5
  363. package/src/skf-test-skill/references/external-validators.md +94 -82
  364. package/src/skf-test-skill/references/health-check.md +6 -7
  365. package/src/skf-test-skill/references/init.md +164 -91
  366. package/src/skf-test-skill/references/invocation-contract.md +66 -0
  367. package/src/skf-test-skill/references/migration-section-rules.md +5 -2
  368. package/src/skf-test-skill/references/report.md +164 -142
  369. package/src/skf-test-skill/references/score.md +80 -107
  370. package/src/skf-test-skill/references/scoring-rules.md +42 -155
  371. package/src/skf-test-skill/references/source-access-protocol.md +18 -94
  372. package/src/skf-test-skill/references/step-hard-gate.md +51 -33
  373. package/src/skf-test-skill/scripts/aggregate-coherence.py +218 -30
  374. package/src/skf-test-skill/scripts/build-result-context.py +380 -0
  375. package/src/skf-test-skill/scripts/check-metadata-coherence.py +37 -4
  376. package/src/skf-test-skill/scripts/combine-external-scores.py +23 -6
  377. package/src/skf-test-skill/scripts/compute-score.py +223 -45
  378. package/src/skf-test-skill/scripts/gap-ledger.py +1666 -0
  379. package/src/skf-test-skill/scripts/hard-gate.py +203 -0
  380. package/src/skf-test-skill/scripts/load-coverage-inputs.py +1198 -0
  381. package/src/skf-test-skill/scripts/locate-export-segments.py +835 -0
  382. package/src/skf-test-skill/scripts/reconcile-coverage.py +547 -79
  383. package/src/skf-test-skill/scripts/score-signatures.py +479 -0
  384. package/src/skf-test-skill/scripts/stage-helper-payload.py +148 -0
  385. package/src/skf-test-skill/scripts/validate-inventory.py +311 -16
  386. package/src/skf-test-skill/scripts/verify-declared-numerator.py +133 -56
  387. package/src/skf-test-skill/templates/test-report-template.md +21 -15
  388. package/src/skf-update-skill/SKILL.md +38 -25
  389. package/src/skf-update-skill/customize.toml +27 -12
  390. package/src/skf-update-skill/references/detect-changes.md +253 -223
  391. package/src/skf-update-skill/references/gap-driven.md +336 -0
  392. package/src/skf-update-skill/references/health-check.md +31 -5
  393. package/src/skf-update-skill/references/init.md +254 -84
  394. package/src/skf-update-skill/references/invocation-contract.md +12 -0
  395. package/src/skf-update-skill/references/manual-section-rules.md +6 -23
  396. package/src/skf-update-skill/references/merge.md +182 -49
  397. package/src/skf-update-skill/references/re-extract.md +53 -262
  398. package/src/skf-update-skill/references/report.md +102 -35
  399. package/src/skf-update-skill/references/write.md +357 -155
  400. package/src/skf-update-skill/scripts/skf-new-file-diff.py +183 -46
  401. package/src/skf-verify-stack/SKILL.md +23 -42
  402. package/src/skf-verify-stack/assets/feasibility-report-template.md +11 -5
  403. package/src/skf-verify-stack/customize.toml +55 -22
  404. package/src/skf-verify-stack/references/coverage-patterns.md +17 -8
  405. package/src/skf-verify-stack/references/coverage.md +67 -64
  406. package/src/skf-verify-stack/references/exit-codes.md +21 -8
  407. package/src/skf-verify-stack/references/init.md +107 -62
  408. package/src/skf-verify-stack/references/integration-verification-rules.md +12 -13
  409. package/src/skf-verify-stack/references/integrations.md +106 -65
  410. package/src/skf-verify-stack/references/report.md +59 -42
  411. package/src/skf-verify-stack/references/requirements.md +32 -9
  412. package/src/skf-verify-stack/references/synthesize.md +53 -39
  413. package/src/skf-verify-stack/scripts/skf-coverage-tally.py +398 -52
  414. package/src/skf-verify-stack/scripts/skf-previous-report.py +330 -0
  415. package/src/skf-verify-stack/scripts/skf-report-delta.py +453 -49
  416. package/src/skf-verify-stack/scripts/skf-verdict-rollup.py +240 -27
  417. package/tools/cli/commands/install.js +11 -4
  418. package/tools/cli/commands/status.js +15 -3
  419. package/tools/cli/commands/update.js +11 -4
  420. package/tools/cli/lib/tool-check.js +320 -0
  421. package/tools/cli/lib/version-check.js +22 -9
  422. package/tools/cli/skf-cli.js +4 -1
  423. package/.gitattributes +0 -16
  424. package/.nvmrc +0 -1
  425. package/docs/_internal/RELEASING.md +0 -679
  426. package/release-audits/v1.0.0-launch-audit.md +0 -728
  427. package/src/skf-audit-skill/references/step-doc-drift.md +0 -177
  428. package/src/skf-brief-skill/references/headless-source-authority-detection.md +0 -26
  429. package/src/skf-campaign/manifest.yaml +0 -15
  430. package/src/skf-create-skill/assets/tessl-dismissal-rules.md +0 -106
  431. package/src/skf-create-skill/references/ecosystem-check.md +0 -74
  432. package/src/skf-drop-skill/references/headless-contract.md +0 -18
  433. package/src/skf-update-skill/references/merge-conflict-rules.md +0 -15
  434. package/src/skf-update-skill/references/remote-source-resolution.md +0 -98
  435. package/src/skf-update-skill/references/validate.md +0 -124
  436. package/tools/validate-docs-drift.js +0 -233
  437. package/tools/validate-docs-links.js +0 -665
@@ -0,0 +1,51 @@
1
+ # Stack metadata.json Contract
2
+
3
+ The `metadata.json` every stack package carries, which step 7 §6 writes. This file is fixed: `stack_skill_template_path` overrides only the SKILL.md, context-snippet, catalog and reference-file structures of `assets/stack-skill-template.md`, never this contract. `generated_by`, `tool_versions.skf`, and `skill_type` with `forge_tier` or `confidence_tier` are the markers SKF's ownership check reads, so a stack written without them would be refused as not SKF output by every later run.
4
+
5
+ ## metadata.json Structure
6
+
7
+ ```json
8
+ {
9
+ "skill_type": "stack",
10
+ "name": "{stack_name}",
11
+ "version": "1.0.0",
12
+ "generation_date": "{ISO-8601}",
13
+ "forge_tier": "{Quick|Forge|Forge+|Deep}",
14
+ "confidence_tier": "{T1|T1-low|T2|T3}",
15
+ "spec_version": "1.3",
16
+ "source_authority": "{official|community|internal}",
17
+ "generated_by": "create-stack-skill",
18
+ "exports": [],
19
+ "library_count": 0,
20
+ "integration_count": 0,
21
+ "libraries": ["lib1", "lib2"],
22
+ "integration_pairs": [["lib1", "lib2"]],
23
+ "language": "{primary language or list of languages from constituent skills}",
24
+ "ast_node_count": "{number-or-omitted-if-no-ast}",
25
+ "confidence_distribution": {
26
+ "t1": 0,
27
+ "t1_low": 0,
28
+ "t2": 0,
29
+ "t3": 0
30
+ },
31
+ "tool_versions": {
32
+ "ast_grep": "{version-or-null}",
33
+ "qmd": "{version-or-null}",
34
+ "skf": "{skf_version}"
35
+ },
36
+ "stats": {
37
+ "exports_documented": 0,
38
+ "exports_public_api": 0,
39
+ "exports_internal": 0,
40
+ "exports_total": 0,
41
+ "public_api_coverage": 0.0,
42
+ "total_coverage": 0.0,
43
+ "scripts_count": 0,
44
+ "assets_count": 0
45
+ },
46
+ "dependencies": [],
47
+ "compatibility": "{semver-range}"
48
+ }
49
+ ```
50
+
51
+ Step 7 §6 writes `library_count`, `integration_count`, `libraries`, `integration_pairs`, `confidence_distribution`, `confidence_tier` and `source_authority` verbatim from `skf-render-stack-metadata.py`. `confidence_distribution` counts libraries, each by its `per_library_extractions[].confidence`; the evidence report bins the provenance entries.
@@ -11,16 +11,16 @@ Canonical schema templates for the workspace `provenance-map.json` artifact writ
11
11
 
12
12
  Both variants share the top-level `provenance_version`, `skill_name`, `skill_type`, `generated_at`, `entries[]`, and `integrations[]` shape. They differ in source-anchor fields (`source_repo` / `source_commit` / `source_ref`), in `entries[].extraction_method` values, in `integrations[].detection_method` values, and in compose-mode's additional `constituents[]` array which enables drift detection via metadata-hash comparison.
13
13
 
14
- > **Note:** Per-export entries use the same schema as single skills (see `skill-sections.md`), with `source_library` identifying the originating library. In compose-mode, `constituents[]` enables audit to detect constituent drift via metadata hash comparison.
14
+ > **Note:** A per-export entry has the fields the templates below give, with `source_library` naming its library and no `ast_node_type`: the stack methods `ast_bridge` and `source_reading` pair with no node kind.
15
15
 
16
16
  ## Code-mode variant
17
17
 
18
- Used when the workflow ran in code-mode against an actual codebase. `source_repo` and `source_commit` capture the upstream anchor(s); `entries[].extraction_method` records how each export was discovered (`ast_bridge`, `source_reading`, or `qmd_bridge`). `integrations[].detection_method` is `"co-import grep"` because integration pairs are confirmed by co-import file evidence.
18
+ Used when the workflow ran in code-mode against an actual codebase. `source_repo` and `source_commit` capture the upstream anchor(s); `entries[].extraction_method` names the tool that read the export (`ast_bridge` or `source_reading`): step 4 §1 gives the labels each method pairs with, and §3a relabels them with `skf-render-stack-metadata.py relabel`. `entries[].source_file` is relative to `{project_root}`, the project root (`project_root` from step 1), whatever folder `{scan_root}` narrowed the scan to, and `source_line` is the line that defines the export. `integrations[].co_import_files[]` holds each file that imports both libraries, as `skf-render-stack-metadata.py provenance` copies it from the `skf-pair-intersect.py` result step 5 saved (`path`, relative to `{project_root}` too because step 3 counts imports with `--relative-to {project_root}`, and `line_a` and `line_b`, the first line that imports each library). `integrations[].detection_method` is `"co-import grep"` because integration pairs are confirmed by co-import file evidence.
19
19
 
20
20
  ```json
21
21
  {
22
22
  "provenance_version": "2.0",
23
- "skill_name": "{project_name}-stack",
23
+ "skill_name": "{stack_name}",
24
24
  "skill_type": "stack",
25
25
  "source_repo": ["{repo_url_1}", "{repo_url_2}"],
26
26
  "source_commit": {"{repo_1}": "{hash_1}", "{repo_2}": "{hash_2}"},
@@ -34,9 +34,9 @@ Used when the workflow ran in code-mode against an actual codebase. `source_repo
34
34
  "return_type": "{type}",
35
35
  "source_file": "{file}",
36
36
  "source_line": 0,
37
- "confidence": "T1|T1-low|T2",
38
- "extraction_method": "ast_bridge|source_reading|qmd_bridge",
39
- "signature_source": "T1|T2|T3"
37
+ "confidence": "T1|T1-low",
38
+ "extraction_method": "ast_bridge|source_reading",
39
+ "signature_source": "T1|T1-low"
40
40
  }
41
41
  ],
42
42
  "integrations": [
@@ -44,8 +44,8 @@ Used when the workflow ran in code-mode against an actual codebase. `source_repo
44
44
  "libraries": ["{libA}", "{libB}"],
45
45
  "pattern_type": "{type}",
46
46
  "detection_method": "co-import grep",
47
- "co_import_files": [{"file": "{path}", "line": 0}],
48
- "confidence": "T1|T2"
47
+ "co_import_files": [{"path": "{path}", "line_a": 0, "line_b": 0}],
48
+ "confidence": "T1|T1-low"
49
49
  }
50
50
  ]
51
51
  }
@@ -53,12 +53,12 @@ Used when the workflow ran in code-mode against an actual codebase. `source_repo
53
53
 
54
54
  ## Compose-mode variant
55
55
 
56
- Used when the workflow ran in compose-mode against pre-generated constituent skills. Source-anchor fields (`source_repo`, `source_commit`, `source_ref`) are `null` because there is no codebase to anchor against — provenance traces back to the constituent skills instead, captured in the `constituents[]` array. Each entry's `extraction_method` is `"compose-from-skill"`; integrations have `detection_method` of `"architecture_co_mention"` (named in the architecture doc), `"constituent_documented_contract"` (a cross-library contract documented in a constituent skill's integration docs but not co-mentioned in the architecture document — e.g. a grep-verified upstream seam cited from a source skill), or `"inferred_from_shared_domain"` (synthesized inference from shared language/domain, no cited contract). `detection_method` records *how* an edge was discovered; it is orthogonal to `confidence`, which is inherited from the constituent skills per the Confidence Tier Inheritance matrix in `{composeModeRulesPath}` (the integration tier is the weaker of the pair — never forced to a fixed band by detection method).
56
+ Used when the workflow ran in compose-mode against pre-generated constituent skills. Source-anchor fields (`source_repo`, `source_commit`, `source_ref`) are `null` because there is no codebase to anchor against: provenance traces back to the constituent skills instead, captured in the `constituents[]` array. Each entry's `extraction_method` is `"compose-from-skill"`; integrations have `detection_method` of `"architecture_co_mention"` (named together in the architecture doc, in a passage step 5 confirmed), `"constituent_documented_contract"` (a cross-library contract a constituent skill's own docs state, found when there is no architecture document, e.g. a grep-verified upstream seam cited from a source skill), or `"inferred_from_shared_domain"` (inferred from shared domain keywords, no cited contract; a shared language alone never makes a pair). `detection_method` records *how* an edge was discovered; it is orthogonal to `confidence`, which is inherited from the constituent skills per the Confidence Tier Inheritance rule in `references/compose-mode-rules.md` (the pair tier `skf-render-stack-metadata.py` gives, never forced to a fixed band by detection method).
57
57
 
58
58
  ```json
59
59
  {
60
60
  "provenance_version": "2.0",
61
- "skill_name": "{project_name}-stack",
61
+ "skill_name": "{stack_name}",
62
62
  "skill_type": "stack",
63
63
  "source_repo": null,
64
64
  "source_commit": null,
@@ -66,16 +66,16 @@ Used when the workflow ran in compose-mode against pre-generated constituent ski
66
66
  "generated_at": "{ISO-8601}",
67
67
  "entries": [
68
68
  {
69
- "export_name": "{name}",
69
+ "export_name": "{literal identifier}",
70
70
  "export_type": "{type}",
71
71
  "source_library": "{library-name}",
72
72
  "params": [],
73
73
  "return_type": "{type}",
74
74
  "source_file": "{from constituent skill}",
75
75
  "source_line": 0,
76
- "confidence": "T1|T1-low|T2",
76
+ "confidence": "T1|T1-low|T2|T3",
77
77
  "extraction_method": "compose-from-skill",
78
- "signature_source": "T1|T2|T3"
78
+ "signature_source": "T1|T1-low|T2|T3"
79
79
  }
80
80
  ],
81
81
  "integrations": [
@@ -90,7 +90,7 @@ Used when the workflow ran in compose-mode against pre-generated constituent ski
90
90
  "constituents": [
91
91
  {
92
92
  "skill_name": "{constituent-skill-name}",
93
- "skill_path": "skills/{skill-dir}/",
93
+ "skill_path": "{skills_output_folder, relative to the project root}/{skill-dir}/",
94
94
  "version": "{version from constituent metadata.json}",
95
95
  "composed_at": "{ISO-8601}",
96
96
  "metadata_hash": "sha256:{hash of constituent metadata.json}"
@@ -99,4 +99,4 @@ Used when the workflow ran in compose-mode against pre-generated constituent ski
99
99
  }
100
100
  ```
101
101
 
102
- **Use the `metadata_hash` value already stored in workflow state during step 2 (S13) — do NOT re-read and re-hash at step 7 time. The stored hash captures the state as it was at manifest-detection time, which is the correct provenance anchor.**
102
+ Step 7 writes `constituents[]` with `skf-render-stack-metadata.py provenance`, the only copier of each `metadata_hash`: the provenance anchor step 4 §0 read, copied from its saved inventory, never hashed again. Each `skill_path` is the constituent's folder in `skills_output_folder`, relative to the project root that Audit Skill resolves it from.
@@ -4,11 +4,12 @@
4
4
 
5
5
  ```markdown
6
6
  ---
7
- name: {project_name}-stack
7
+ name: {stack_name}
8
8
  description: >
9
9
  Stack skill for {project_name} — {lib_count} libraries with
10
10
  {integration_count} integration patterns. Use when working with
11
- this project's technology stack.
11
+ this project's technology stack. NOT for: individual library usage
12
+ outside this project's conventions.
12
13
  ---
13
14
 
14
15
  # {project_name} Stack Skill
@@ -26,7 +27,7 @@ description: >
26
27
  **Type:** {pattern_type}
27
28
  **Pattern:** {description}
28
29
  **Key files:** {file_list}
29
- **Confidence:** {T1/T1-low/T2}
30
+ **Confidence:** {T1/T1-low/T2/T3}
30
31
 
31
32
  ## Library Reference Index
32
33
 
@@ -40,7 +41,8 @@ description: >
40
41
  **Role in stack:** {one-line description of what this library does in this project}
41
42
  **Key exports used:** {comma-separated list}
42
43
  **Usage pattern:** {brief pattern description}
43
- **Confidence:** {T1/T1-low/T2}
44
+ **Confidence:** {T1/T1-low/T2/T3}
45
+ **Reference:** [ref](references/{name}.md)
44
46
 
45
47
  ## Conventions
46
48
 
@@ -64,6 +66,10 @@ ceilings at compile time:
64
66
  below). For a **small stack**, keep them inline — inline passive context yields
65
67
  higher task accuracy than on-demand retrieval, and small stacks fit comfortably.
66
68
  Integration Patterns and Conventions stay inline regardless (Tier 1, load-bearing).
69
+ Whenever the catalog moves into `references/stack-catalog.md`, at compile time
70
+ or in a later body-size split, its Reference links become file-relative,
71
+ `[ref]({name}.md)`, because a link resolves from the file that holds it (see
72
+ "references/stack-catalog.md Structure" below).
67
73
  - **Inline pointer form** (replaces the two sections above when extracted):
68
74
 
69
75
  ```markdown
@@ -84,63 +90,22 @@ ceilings at compile time:
84
90
  Indexed format targeting ~80-120 tokens per stack:
85
91
 
86
92
  ```markdown
87
- [{project}-stack v{version}]|root: skills/{project}-stack/
88
- |IMPORTANT: {project}-stack — read SKILL.md before writing integration code. Do NOT rely on training data.
93
+ [{stack_name} v{version}]|root: skills/{stack_name}/
94
+ |IMPORTANT: {stack_name} — read SKILL.md before writing integration code. Do NOT rely on training data.
89
95
  |stack: {dep-1}@{v1}, {dep-2}@{v2}, {dep-3}@{v3}
90
96
  |integrations: {pattern-1}, {pattern-2}
91
97
  |gotchas: {1-2 most critical integration pitfalls}
92
98
  ```
93
99
 
94
- ## metadata.json Structure
95
-
96
- ```json
97
- {
98
- "skill_type": "stack",
99
- "name": "{project}-stack",
100
- "version": "1.0.0",
101
- "generation_date": "{ISO-8601}",
102
- "forge_tier": "{Quick|Forge|Forge+|Deep}",
103
- "confidence_tier": "{T1|T1-low|T2|T3}",
104
- "spec_version": "1.3",
105
- "source_authority": "{official|community|internal}",
106
- "generated_by": "create-stack-skill",
107
- "exports": [],
108
- "library_count": 0,
109
- "integration_count": 0,
110
- "libraries": ["lib1", "lib2"],
111
- "integration_pairs": [["lib1", "lib2"]],
112
- "language": "{primary language or list of languages from constituent skills}",
113
- "ast_node_count": "{number-or-omitted-if-no-ast}",
114
- "confidence_distribution": {
115
- "t1": 0,
116
- "t1_low": 0,
117
- "t2": 0,
118
- "t3": 0
119
- },
120
- "tool_versions": {
121
- "ast_grep": "{version-or-null}",
122
- "qmd": "{version-or-null}",
123
- "skf": "{skf_version}"
124
- },
125
- "stats": {
126
- "exports_documented": 0,
127
- "exports_public_api": 0,
128
- "exports_internal": 0,
129
- "exports_total": 0,
130
- "public_api_coverage": 0.0,
131
- "total_coverage": 0.0,
132
- "scripts_count": 0,
133
- "assets_count": 0
134
- },
135
- "dependencies": [],
136
- "compatibility": "{semver-range}"
137
- }
138
- ```
139
-
140
100
  ## references/stack-catalog.md Structure
141
101
 
142
102
  Written **only for large stacks** (see Sizing Guidance) when the catalog is
143
- extracted out of SKILL.md. Holds the two sections verbatim from the inline form:
103
+ extracted out of SKILL.md. Holds the two sections from the inline form with
104
+ their links rewritten: a link resolves from the file that holds it, and this
105
+ file sits in `references/` beside the per-library files, so a link to one of
106
+ them is `{name}.md` (the Reference column's `[ref]({name}.md)`). The inline
107
+ form's `references/{name}.md` would resolve to `references/references/{name}.md`
108
+ from here.
144
109
 
145
110
  ```markdown
146
111
  # {project_name} Stack — Library Catalog
@@ -152,7 +117,7 @@ extracted out of SKILL.md. Holds the two sections verbatim from the inline form:
152
117
 
153
118
  | Library | Imports | Key Exports | Confidence | Reference |
154
119
  |---------|---------|-------------|------------|-----------|
155
- | {name} | {count} | {top_exports} | {tier} | [ref](references/{name}.md) |
120
+ | {name} | {count} | {top_exports} | {tier} | [ref]({name}.md) |
156
121
 
157
122
  ## Per-Library Summaries
158
123
 
@@ -160,7 +125,8 @@ extracted out of SKILL.md. Holds the two sections verbatim from the inline form:
160
125
  **Role in stack:** {one-line description of what this library does in this project}
161
126
  **Key exports used:** {comma-separated list}
162
127
  **Usage pattern:** {brief pattern description}
163
- **Confidence:** {T1/T1-low/T2}
128
+ **Confidence:** {T1/T1-low/T2/T3}
129
+ **Reference:** [ref]({name}.md)
164
130
  ```
165
131
 
166
132
  ## references/{library}.md Structure
@@ -170,7 +136,7 @@ extracted out of SKILL.md. Holds the two sections verbatim from the inline form:
170
136
 
171
137
  **Version:** {version_from_manifest}
172
138
  **Import count:** {count} files *(compose-mode: replace with **Export count:** {count} exports)*
173
- **Confidence:** {T1/T1-low/T2}
139
+ **Confidence:** {T1/T1-low/T2/T3}
174
140
 
175
141
  ## Key Exports
176
142
  [Top exports used in this project with signatures]
@@ -189,7 +155,7 @@ extracted out of SKILL.md. Holds the two sections verbatim from the inline form:
189
155
 
190
156
  **Type:** {pattern_type}
191
157
  **Co-import files:** {count}
192
- **Confidence:** {T1/T1-low/T2 [composed]}
158
+ **Confidence:** {T1/T1-low/T2/T3 [composed]}
193
159
 
194
160
  ## Integration Pattern
195
161
  [Detailed description of how these libraries connect]
@@ -1,8 +1,8 @@
1
1
  # DO NOT EDIT -- overwritten on every update.
2
2
  #
3
3
  # Workflow customization surface for skf-create-stack-skill.
4
- # Team overrides: _bmad/custom/skf-create-stack-skill.toml (under {project-root})
5
- # Personal overrides: _bmad/custom/skf-create-stack-skill.user.toml (under {project-root})
4
+ # Team overrides: {project-root}/_bmad/custom/skf-create-stack-skill.toml
5
+ # Personal overrides: {project-root}/_bmad/custom/skf-create-stack-skill.user.toml
6
6
 
7
7
  [workflow]
8
8
 
@@ -10,7 +10,9 @@
10
10
  # scalars: override wins • arrays (persistent_facts, activation_steps_*): append
11
11
  # arrays-of-tables with `code`/`id`: replace matching items, append new ones.
12
12
 
13
- # Steps to run before the standard activation (uv probe, config load).
13
+ # Steps SKILL.md On Activation step 3 runs right after the customization
14
+ # resolve: config.yaml is loaded and headless mode resolved by then, and
15
+ # init.md's pre-flight (the emitter, the run folder) has not run yet.
14
16
  # Overrides append. Use for org-wide pre-flight checks (auth, network,
15
17
  # compliance) that must precede any stack compilation work.
16
18
 
@@ -26,21 +28,29 @@ activation_steps_append = []
26
28
  # (house style, naming conventions, integration-pattern guardrails).
27
29
  # Overrides append.
28
30
  #
29
- # Each entry is either:
31
+ # Each entry is one of:
30
32
  # - a literal sentence, e.g. "Stack skills must cite their constituent libraries."
31
33
  # - a file reference prefixed with `file:`, e.g.
32
34
  # "file:{project-root}/docs/stack-style.md" (globs supported; file
33
35
  # contents are loaded and treated as facts).
36
+ # - an entry prefixed with `!`, which loads nothing and drops each earlier
37
+ # entry it names.
38
+ #
39
+ # The default below loads every project-context.md under {project-root}.
40
+ # Overrides append, so they cannot delete it; to stop loading those files,
41
+ # set in {project-root}/_bmad/custom/skf-create-stack-skill.toml:
42
+ # persistent_facts = ["!file:{project-root}/**/project-context.md"]
34
43
 
35
44
  persistent_facts = [
36
45
  "file:{project-root}/**/project-context.md",
37
46
  ]
38
47
 
39
- # Command invoked once the workflow reaches its terminal stage — after the
40
- # stack package is committed and the result contract is written (step 9,
41
- # report.md §6c), before the health-check chain. Override wins. Use for a
42
- # terminal action such as catalog registration or notifying a downstream
43
- # pipeline. Empty string = no terminal action. The hook never fails the run.
48
+ # Command invoked once a run finishes (step 9, report.md §2c): after the
49
+ # stack package is committed, the report is shown and the result files are
50
+ # written, before the health-check chain. A run that halts never invokes it.
51
+ # Override wins. Use for a terminal action such as catalog registration or
52
+ # notifying a downstream pipeline. Empty string = no terminal action. The
53
+ # hook never fails the run: a failure prints one report line.
44
54
 
45
55
  on_complete = ""
46
56
 
@@ -48,9 +58,10 @@ on_complete = ""
48
58
  #
49
59
  # Lift the canonical asset paths so orgs can substitute house-style copies
50
60
  # without forking the skill. Empty string = use the bundled default.
61
+ # stack_skill_template_path covers the SKILL.md, context snippet, catalog and
62
+ # reference-file structures; the metadata.json contract
63
+ # (assets/metadata-contract.md) carries SKF's ownership markers, so no
64
+ # override replaces it.
51
65
 
52
66
  stack_skill_template_path = ""
53
67
  integration_patterns_path = ""
54
- manifest_patterns_path = ""
55
- compose_mode_rules_path = ""
56
- provenance_map_schema_path = ""
@@ -1,5 +1,16 @@
1
1
  ---
2
2
  nextStepFile: 'generate-output.md'
3
+ renderStackMetadataProbeOrder:
4
+ - '{project-root}/_bmad/skf/shared/scripts/skf-render-stack-metadata.py'
5
+ - '{project-root}/src/shared/scripts/skf-render-stack-metadata.py'
6
+ emitEnvelopeProbeOrder:
7
+ - '{project-root}/_bmad/skf/shared/scripts/skf-emit-result-envelope.py'
8
+ - '{project-root}/src/shared/scripts/skf-emit-result-envelope.py'
9
+ bundleFile: '{run_dir}/extraction-bundle.json'
10
+ exportRecordsFile: '{run_dir}/export-records.json'
11
+ draftFolder: '{run_dir}/draft'
12
+ # A fixed path: the compose rules are not a customization surface.
13
+ composeModeRulesPath: 'references/compose-mode-rules.md'
3
14
  ---
4
15
 
5
16
  <!-- Config: communicate in {communication_language}. Artifact text in {document_output_language}. -->
@@ -8,40 +19,39 @@ nextStepFile: 'generate-output.md'
8
19
 
9
20
  ## STEP GOAL:
10
21
 
11
- Assemble the main SKILL.md by combining per-library extractions with the integration layer, and present for user review before writing output files.
22
+ Assemble the main SKILL.md by combining per-library extractions with the integration layer, write it as the run's draft, and get it approved before step 7 writes the package.
12
23
 
13
24
  ## Rules
14
25
 
15
26
  - Compile SKILL.md following the stack-skill-template structure — integration patterns go first
16
- - Do not write output files (Step 07)
17
- - Present compiled content for user review
27
+ - Write only the draft in `{draftFolder}`: every file of the package is step 7's, staged from the approved draft
28
+ - Present the stats and the draft's path for review; display the full draft only when the user asks, never in a headless run
18
29
 
19
30
  ## MANDATORY SEQUENCE
20
31
 
21
- ### 1. Load Template Structure
32
+ **Halt envelope.** Every HALT in this step names its exit code, `halt_reason` and phase. Stage `{run_dir}/halt.json` as `{"phase": "<phase>", "halt_reason": "<halt_reason>", "reason": "<the halt message, one line>", "skill_name": "{stack_name}", "mode": "<code|compose>", "stack_libraries": ["<confirmed library>", ...]}`, then run:
22
33
 
23
- Load `{stackSkillTemplatePath}` and prepare SKILL.md section structure.
34
+ ```bash
35
+ uv run {emitEnvelopeHelper} emit-halt --workflow skf-create-stack-skill --run-dir "{run_dir}" --target stderr < "{run_dir}/halt.json"
36
+ ```
24
37
 
25
- ### 2. Generate Frontmatter
38
+ Display the line it prints, then stop with the halt's exit code (`references/invocation-contract.md` lists every halt). If `{emitEnvelopeHelper}` is not bound, resolve it from `{emitEnvelopeProbeOrder}`; if no path exists, or the emitter exits non-zero or prints no line, display the halt message alone.
26
39
 
27
- The SKILL.md MUST begin with YAML frontmatter (agentskills.io compliance):
40
+ ### 1. Load Template Structure
28
41
 
29
- ```yaml
30
- ---
31
- name: {project_name}-stack
32
- description: >
33
- Stack skill for {project_name} — {lib_count} libraries with
34
- {integration_count} integration patterns. Use when working with
35
- this project's technology stack. NOT for: individual library usage
36
- outside this project's conventions.
37
- ---
42
+ Load `{stackSkillTemplatePath}` and prepare SKILL.md section structure. Every section below compiles from `{bundleFile}`: step 4's per-library extractions and step 5's integration graph (`integrations[]`, `hubs`, `cross_cutting`), never from memory. A library's key exports are its records in `{exportRecordsFile}` in code mode (each with its `source_library`), and its bundle entry's `exports` in compose mode.
43
+
44
+ **The stack's counts.** Take them from the helper step 7 §6 also runs, never by hand. Resolve `{renderStackMetadataHelper}` from `{renderStackMetadataProbeOrder}`; first existing path wins. If no candidate exists, HALT (exit 3, `halt_reason: "helper-missing"`, phase `compile-stack:stats`) with "**Cannot proceed.** `skf-render-stack-metadata.py` is missing, so the stack cannot be counted. Re-install SKF, then re-run." Otherwise run:
45
+
46
+ ```bash
47
+ uv run {renderStackMetadataHelper} metadata --input -
38
48
  ```
39
49
 
40
- **Frontmatter rules:**
50
+ piping `{"mode": "code|compose", "libraries": [{"name": "<library>", "confidence": "<its per_library_extractions[].confidence>"}, ...], "integrations": [{"a": "<library>", "b": "<library>"}, ...]}`, every library and every pair of `{bundleFile}`. On exit `2`, fix the input its stderr names and run it again. Bind `{lib_count}` ← its `library_count` and `{integration_count}` ← its `integration_count`, which §2's description and §7's stats name, and keep its `confidence_distribution` for §7.
51
+
52
+ ### 2. Generate Frontmatter
41
53
 
42
- - `name`: lowercase alphanumeric + hyphens only, must match skill output directory name. **Stack skills MUST end in `-stack`** (e.g., `{project_name}-stack`) — this is how consumers (skf-verify-stack, skf-test-skill) detect stack vs individual skills.
43
- - `description`: non-empty, max 1024 chars, trigger-optimized for agent discovery. MUST use third-person voice ("Processes..." not "I can..." or "You can..."). **Do NOT enumerate every library by name** — a 12+ library stack overruns 1024 chars. Keep the generic "{lib_count} libraries with {integration_count} integration patterns" form; if a per-library parenthetical is used, cap it to the top libraries by import/export count with a `+{N} more` suffix (full list lives in `metadata.json` `libraries[]`). See "Sizing Guidance for Large Stacks" in `{stackSkillTemplatePath}`.
44
- - No other frontmatter fields — only `name`, `description`, `license`, `compatibility`, `metadata`, `allowed-tools` are permitted by spec
54
+ Use the template's frontmatter with the counts §1 bound; its Sizing Guidance caps the description.
45
55
 
46
56
  ### 3. Compile Integration Layer
47
57
 
@@ -59,6 +69,7 @@ Compile in order:
59
69
  - Pattern description with file:line citations
60
70
  - Key files demonstrating the integration
61
71
  - Confidence tier label
72
+ - **In compose mode**, render each pair in the evidence format of `{composeModeRulesPath}` instead, from its entry's `evidence`, `reference`, `tier` and `qualifier`, adding the VS lines and annotation that file's Feasibility Report Integration gives when the entry's `vs` is set; a compose pair has no key files.
62
73
 
63
74
  **Hub library connections:**
64
75
  - For each hub library (3+ connections):
@@ -67,77 +78,57 @@ Compile in order:
67
78
 
68
79
  ### 4. Compile Per-Library Sections
69
80
 
70
- **Catalog placement (decide once, applies to this section and §6).** The
71
- `Per-Library Summaries` and `Library Reference Index` are the largest sections
72
- and grow with the stack. For a **large stack** (heuristic: **> 6 libraries OR
73
- > 6 integration patterns**), author both into `references/stack-catalog.md`
74
- (structure in `{stackSkillTemplatePath}`) and place only the inline pointer from the
75
- template's "Sizing Guidance" in SKILL.md — this keeps the body under the 500-line
76
- `body.max_lines` budget that step 08 enforces. For a **small stack**, keep both
77
- inline (inline passive context yields higher task accuracy). Either way, step 08's
78
- body-size gate is the backstop; step 08 (`validate.md` §4) accepts both forms.
79
-
80
- For each confirmed library (ordered by integration connectivity, then import count — **in compose-mode**, order by integration connectivity, then skill confidence tier since import counts are not available):
81
+ **Catalog placement (decide once, applies to this section and §6).** By the template's Sizing Guidance, a large stack authors the `Per-Library Summaries` and `Library Reference Index` into `references/stack-catalog.md`, whose per-library links read `[ref]({name}.md)`, and leaves the inline pointer in SKILL.md; a small stack keeps both inline, its links reading `[ref](references/{name}.md)`. A link resolves from the file that holds it.
81
82
 
82
- - Role in stack (one-line description)
83
- - Key exports used in this project
84
- - Usage patterns from extraction
85
- - Confidence tier label
86
- - Link to reference file: `references/{library}.md`
83
+ Order the libraries by integration connectivity, then import count (**in compose-mode**, connectivity then skill confidence tier, since import counts are not available).
87
84
 
88
85
  ### 5. Compile Project Conventions
89
86
 
90
- Extract project-specific conventions from the extractions:
91
- - Common initialization patterns
92
- - Error handling approaches across libraries
93
- - Configuration conventions
94
- - Import organization patterns
87
+ The conventions the extractions show recurring across libraries.
95
88
 
96
89
  ### 6. Compile Library Reference Index
97
90
 
98
- Place per the §4 catalog-placement decision (inline for small stacks; in
99
- `references/stack-catalog.md` for large stacks). Create the reference index table:
91
+ Per the template and §4's placement (**in compose-mode**: replace the Imports column with Export Count from source skill metadata, since import counts are not available).
100
92
 
101
- | Library | Imports | Key Exports | Confidence | Reference |
102
- |---------|---------|-------------|------------|-----------|
103
- | ... | ... | ... | ... | ... |
93
+ The Reference column follows the §4 link rule: `[ref](references/{name}.md)` when the index stays in SKILL.md, `[ref]({name}.md)` when it goes to `references/stack-catalog.md`.
104
94
 
105
- (**in compose-mode**: replace the Imports column with Export Count from source skill metadata, since import counts are not available)
95
+ ### 7. Write the Draft and Its Stats
106
96
 
107
- ### 7. Present Compiled SKILL.md Preview
97
+ Write the compiled SKILL.md to `{draftFolder}/SKILL.md`, and, when §4 moved the catalog out, the catalog to `{draftFolder}/stack-catalog.md`. The draft is what the review approves: step 7 stages it verbatim.
108
98
 
109
- "**Stack skill compilation complete. Please review:**
99
+ Then display, with the counts and the distribution of the §1 helper run:
110
100
 
111
- ---
112
-
113
- {Display full compiled SKILL.md content}
114
-
115
- ---
101
+ "**Stack skill compilation complete. Please review the draft:** `{draftFolder}/SKILL.md`{IF catalog:} and `{draftFolder}/stack-catalog.md`{END IF}
116
102
 
117
103
  **Compilation stats:**
118
- - **Libraries:** {count}
119
- - **Integration pairs:** {count}
120
- - **Cross-cutting patterns:** {count}
121
- - **Confidence:** T1: {count}, T1-low: {count}, T2: {count}
104
+ - **Libraries:** {lib_count}
105
+ - **Integration pairs:** {integration_count}
106
+ - **Cross-cutting patterns:** {each entry of the bundle's `cross_cutting`, or none}
107
+ - **Confidence (libraries per tier, `per_library_extractions[].confidence`):** T1: {its `confidence_distribution.t1`}, T1-low: {`t1_low`}, T2: {`t2`}, T3: {`t3`}
122
108
 
123
109
  **Please review the integration layer and per-library sections.**
124
110
  - Does the integration layer capture how your libraries connect?
125
111
  - Are the per-library summaries accurate?
126
- - Any sections to adjust before writing output?"
112
+ - Any sections to adjust before writing output? Edit the draft yourself, or tell me what to change."
127
113
 
128
114
  ### 8. Present MENU OPTIONS
129
115
 
130
- Display: **Select:** [C] Continue to Output Generation | [X] Cancel and exit
116
+ Display: **Select:** [C] Continue to Output Generation | [P] Preview the full draft | [X] Cancel and exit
131
117
 
132
118
  #### EXECUTION RULES:
133
119
 
134
- - This is a review gate — advancing without the user's `C` would write output files from a compilation they never reviewed. Halt and wait for input after presenting the compiled SKILL.md.
135
- - **GATE [default: C]** — If `{headless_mode}`: auto-proceed with [C] Continue, log: "headless: auto-approve stack compilation"
120
+ - This is a review gate: advancing without the user's `C` would write output files from a compilation they never reviewed. Halt and wait for input after presenting the stats.
121
+ - **GATE [default: C]**: If `{headless_mode}`: auto-proceed with [C] Continue, displaying no draft, and record the auto-decision: stage `{"gate": "compile-stack.review", "default_action": "C", "taken_action": "C", "reason": "headless: approved the compiled draft"}` as `{run_dir}/decision.json` and run:
122
+
123
+ ```bash
124
+ uv run {emitEnvelopeHelper} record --workflow skf-create-stack-skill --run-dir "{run_dir}" --decision < "{run_dir}/decision.json"
125
+ ```
126
+
136
127
  - Proceed to the next step only once the user approves by selecting `C`.
137
128
 
138
129
  #### Menu Handling Logic:
139
130
 
140
- - IF C: Store skill_content, then load, read entire file, then execute {nextStepFile}
141
- - IF X: Invoke the rollback contract (purge any `{forge_data_folder}/{project_name}-stack/{version}/*-tmp` and `*.skf-tmp` staging artifacts under the forge workspace, leave any existing committed stack package untouched), emit the `SKF_STACK_RESULT_JSON` envelope on stderr with `status: "error"`, `halt_reason: "user-cancelled"`, `exit_code: 6`, and exit with code 6
142
- - IF Any other: Process as feedback, adjust compilation, redisplay preview, then [Redisplay Menu Options](#8-present-menu-options)
143
-
131
+ - IF C: The draft files as they stand on disk, the user's own edits included, are the approved compilation. Load, read entire file, then execute {nextStepFile}
132
+ - IF P: Display the full draft files, then [Redisplay Menu Options](#8-present-menu-options)
133
+ - IF X: HALT (exit 6, `halt_reason: "user-cancelled"`, phase `compile-stack:review`): leave any existing committed stack package untouched, emit the envelope, then delete the run folder (`rm -rf "{run_dir}"`), the draft and the bundle with it
134
+ - IF Any other: Process it as feedback: apply it to the draft files in `{draftFolder}`. When it drops a library or a pair, drop it from `{bundleFile}` too (a library with its pairs, and its records from `{exportRecordsFile}`), so step 7 writes no file the draft no longer covers; then run the §1 helper call again, rebinding the counts, and rewrite the draft's `description` with them. Show the stats again, then [Redisplay Menu Options](#8-present-menu-options)