bmad-module-skill-forge 1.4.1 → 1.5.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 (231) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/README.md +0 -8
  3. package/docs/_data/pinned.yaml +1 -1
  4. package/docs/_internal/STABILITY.md +1 -1
  5. package/docs/architecture.md +2 -2
  6. package/docs/examples.md +1 -1
  7. package/docs/workflows.md +5 -5
  8. package/package.json +2 -2
  9. package/src/README.md +1 -1
  10. package/src/knowledge/ccc-bridge.md +12 -12
  11. package/src/knowledge/qmd-registry.md +5 -5
  12. package/src/shared/health-check.md +5 -5
  13. package/src/shared/references/description-guard-protocol.md +100 -0
  14. package/src/shared/references/output-contract-schema.md +1 -1
  15. package/src/shared/scripts/schemas/skf-brief-result-envelope.v1.json +6 -6
  16. package/src/shared/scripts/schemas/skf-setup-result-envelope.v1.json +9 -3
  17. package/src/shared/scripts/schemas/skf-update-result-envelope.v1.json +149 -0
  18. package/src/shared/scripts/schemas/skill-brief.v1.json +22 -2
  19. package/src/shared/scripts/skf-build-change-manifest.py +420 -0
  20. package/src/shared/scripts/skf-check-workspace-drift.py +321 -0
  21. package/src/shared/scripts/skf-compare-file-hashes.py +357 -0
  22. package/src/shared/scripts/skf-description-guard.py +359 -0
  23. package/src/shared/scripts/skf-detect-language.py +2 -2
  24. package/src/shared/scripts/skf-detect-scripts-assets.py +613 -0
  25. package/src/shared/scripts/skf-detect-tools.py +147 -16
  26. package/src/shared/scripts/skf-detect-workspaces.py +1 -1
  27. package/src/shared/scripts/skf-disqualify-candidates.py +576 -0
  28. package/src/shared/scripts/skf-emit-brief-result-envelope.py +3 -3
  29. package/src/shared/scripts/skf-emit-result-envelope.py +93 -9
  30. package/src/shared/scripts/skf-enumerate-stack-skills.py +514 -0
  31. package/src/shared/scripts/skf-forge-tier-rw.py +11 -11
  32. package/src/shared/scripts/skf-hash-content.py +284 -0
  33. package/src/shared/scripts/skf-load-provenance.py +295 -0
  34. package/src/shared/scripts/skf-manifest-ops.py +22 -6
  35. package/src/shared/scripts/skf-merge-ccc-exclusions.py +34 -4
  36. package/src/shared/scripts/skf-pair-intersect.py +250 -0
  37. package/src/shared/scripts/skf-provenance-gap-dispatch.py +433 -0
  38. package/src/shared/scripts/skf-qmd-classify-collections.py +42 -8
  39. package/src/shared/scripts/skf-recommend-scope-type.py +2 -2
  40. package/src/shared/scripts/skf-render-quick-metadata.py +2 -2
  41. package/src/shared/scripts/skf-resolve-authoritative-files.py +504 -0
  42. package/src/shared/scripts/skf-scan-manifests.py +738 -0
  43. package/src/shared/scripts/skf-scan-skill-md-structure.py +375 -0
  44. package/src/shared/scripts/skf-update-active-symlink.py +315 -0
  45. package/src/shared/scripts/skf-validate-brief-inputs.py +5 -5
  46. package/src/shared/scripts/skf-validate-brief-schema.py +348 -0
  47. package/src/shared/scripts/skf-write-skill-brief.py +61 -5
  48. package/src/skf-analyze-source/SKILL.md +69 -16
  49. package/src/skf-analyze-source/assets/skill-brief-schema.md +1 -1
  50. package/src/skf-analyze-source/customize.toml +55 -0
  51. package/src/skf-analyze-source/{steps-c/step-01b-continue.md → references/continue.md} +12 -12
  52. package/src/skf-analyze-source/{steps-c/step-06-generate-briefs.md → references/generate-briefs.md} +29 -10
  53. package/src/skf-analyze-source/{steps-c/step-07-health-check.md → references/health-check.md} +5 -3
  54. package/src/skf-analyze-source/{steps-c/step-03-identify-units.md → references/identify-units.md} +48 -14
  55. package/src/skf-analyze-source/{steps-c/step-01-init.md → references/init.md} +32 -9
  56. package/src/skf-analyze-source/{steps-c/step-04-map-and-detect.md → references/map-and-detect.md} +52 -25
  57. package/src/skf-analyze-source/{steps-c/step-05-recommend.md → references/recommend.md} +15 -8
  58. package/src/skf-analyze-source/{steps-c/step-02-scan-project.md → references/scan-project.md} +16 -10
  59. package/src/skf-analyze-source/references/unit-detection-heuristics.md +2 -0
  60. package/src/skf-analyze-source/templates/analysis-report-template.md +6 -6
  61. package/src/skf-audit-skill/SKILL.md +66 -15
  62. package/src/skf-audit-skill/assets/drift-report-template.md +6 -5
  63. package/src/skf-audit-skill/customize.toml +49 -0
  64. package/src/skf-audit-skill/{steps-c/step-07-health-check.md → references/health-check.md} +5 -3
  65. package/src/skf-audit-skill/{steps-c/step-01-init.md → references/init.md} +63 -19
  66. package/src/skf-audit-skill/{steps-c/step-02-re-index.md → references/re-index.md} +11 -11
  67. package/src/skf-audit-skill/{steps-c/step-06-report.md → references/report.md} +25 -7
  68. package/src/skf-audit-skill/{steps-c/step-04-semantic-diff.md → references/semantic-diff.md} +6 -6
  69. package/src/skf-audit-skill/{steps-c/step-05-severity-classify.md → references/severity-classify.md} +5 -5
  70. package/src/skf-audit-skill/references/severity-rules.md +2 -0
  71. package/src/skf-audit-skill/{steps-c/step-03-structural-diff.md → references/structural-diff.md} +35 -17
  72. package/src/skf-brief-skill/SKILL.md +49 -19
  73. package/src/skf-brief-skill/assets/description-voice-examples.md +1 -1
  74. package/src/skf-brief-skill/assets/skill-brief-schema.md +32 -2
  75. package/src/skf-brief-skill/customize.toml +44 -0
  76. package/src/skf-brief-skill/{steps-c/step-02-analyze-target.md → references/analyze-target.md} +27 -15
  77. package/src/skf-brief-skill/{steps-c/step-04-confirm-brief.md → references/confirm-brief.md} +13 -10
  78. package/src/skf-brief-skill/references/draft-checkpoint.md +4 -4
  79. package/src/skf-brief-skill/{steps-c/step-01-gather-intent.md → references/gather-intent.md} +35 -29
  80. package/src/skf-brief-skill/references/headless-args.md +9 -9
  81. package/src/skf-brief-skill/references/headless-source-authority-detection.md +1 -1
  82. package/src/skf-brief-skill/{steps-c/step-06-health-check.md → references/health-check.md} +4 -2
  83. package/src/skf-brief-skill/references/portfolio-similarity-check.md +2 -2
  84. package/src/skf-brief-skill/references/qmd-collection-registration.md +2 -2
  85. package/src/skf-brief-skill/{steps-c/step-03-scope-definition.md → references/scope-definition.md} +27 -20
  86. package/src/skf-brief-skill/references/version-resolution.md +2 -2
  87. package/src/skf-brief-skill/{steps-c/step-05-write-brief.md → references/write-brief.md} +29 -16
  88. package/src/skf-create-skill/SKILL.md +25 -19
  89. package/src/skf-create-skill/assets/compile-assembly-rules.md +3 -3
  90. package/src/skf-create-skill/assets/skill-sections.md +5 -5
  91. package/src/skf-create-skill/assets/tessl-dismissal-rules.md +11 -11
  92. package/src/skf-create-skill/customize.toml +35 -0
  93. package/src/skf-create-skill/references/authoritative-files-protocol.md +142 -0
  94. package/src/skf-create-skill/{steps-c/step-05-compile.md → references/compile.md} +16 -16
  95. package/src/skf-create-skill/{steps-c/step-03d-component-extraction.md → references/component-extraction.md} +16 -16
  96. package/src/skf-create-skill/{steps-c/step-02-ecosystem-check.md → references/ecosystem-check.md} +4 -4
  97. package/src/skf-create-skill/{steps-c/step-04-enrich.md → references/enrich.md} +3 -3
  98. package/src/skf-create-skill/{steps-c/step-03-extract.md → references/extract.md} +52 -120
  99. package/src/skf-create-skill/references/extraction-patterns.md +10 -8
  100. package/src/skf-create-skill/{steps-c/step-07-generate-artifacts.md → references/generate-artifacts.md} +11 -11
  101. package/src/skf-create-skill/{steps-c/step-09-health-check.md → references/health-check.md} +4 -2
  102. package/src/skf-create-skill/{steps-c/step-01-load-brief.md → references/load-brief.md} +40 -32
  103. package/src/skf-create-skill/{steps-c/step-08-report.md → references/report.md} +8 -8
  104. package/src/skf-create-skill/references/source-resolution-protocols.md +6 -6
  105. package/src/skf-create-skill/{steps-c/sub/step-02b-ccc-discover.md → references/sub/ccc-discover.md} +5 -5
  106. package/src/skf-create-skill/{steps-c/sub/step-03c-fetch-docs.md → references/sub/fetch-docs.md} +28 -12
  107. package/src/skf-create-skill/{steps-c/sub/step-03b-fetch-temporal.md → references/sub/fetch-temporal.md} +81 -50
  108. package/src/skf-create-skill/{steps-c/step-06-validate.md → references/validate.md} +48 -28
  109. package/src/skf-create-stack-skill/SKILL.md +76 -17
  110. package/src/skf-create-stack-skill/assets/provenance-map-schema.md +102 -0
  111. package/src/skf-create-stack-skill/assets/stack-skill-template.md +1 -1
  112. package/src/skf-create-stack-skill/customize.toml +46 -0
  113. package/src/skf-create-stack-skill/{steps-c/step-06-compile-stack.md → references/compile-stack.md} +6 -5
  114. package/src/skf-create-stack-skill/references/compose-mode-rules.md +3 -1
  115. package/src/skf-create-stack-skill/{steps-c/step-05-detect-integrations.md → references/detect-integrations.md} +37 -11
  116. package/src/skf-create-stack-skill/{steps-c/step-02-detect-manifests.md → references/detect-manifests.md} +32 -28
  117. package/src/skf-create-stack-skill/{steps-c/step-07-generate-output.md → references/generate-output.md} +11 -85
  118. package/src/skf-create-stack-skill/{steps-c/step-10-health-check.md → references/health-check.md} +4 -2
  119. package/src/skf-create-stack-skill/{steps-c/step-01-init.md → references/init.md} +70 -4
  120. package/src/skf-create-stack-skill/references/integration-patterns.md +2 -0
  121. package/src/skf-create-stack-skill/references/manifest-patterns.md +2 -0
  122. package/src/skf-create-stack-skill/{steps-c/step-04-parallel-extract.md → references/parallel-extract.md} +44 -17
  123. package/src/skf-create-stack-skill/{steps-c/step-03-rank-and-confirm.md → references/rank-and-confirm.md} +5 -4
  124. package/src/skf-create-stack-skill/{steps-c/step-09-report.md → references/report.md} +3 -3
  125. package/src/skf-create-stack-skill/{steps-c/step-08-validate.md → references/validate.md} +6 -6
  126. package/src/skf-drop-skill/SKILL.md +84 -12
  127. package/src/skf-drop-skill/customize.toml +57 -0
  128. package/src/skf-drop-skill/{steps-c/step-02-execute.md → references/execute.md} +49 -34
  129. package/src/skf-drop-skill/{steps-c/step-04-health-check.md → references/health-check.md} +6 -4
  130. package/src/skf-drop-skill/{steps-c/step-03-report.md → references/report.md} +13 -5
  131. package/src/skf-drop-skill/{steps-c/step-01-select.md → references/select.md} +63 -15
  132. package/src/skf-export-skill/SKILL.md +85 -16
  133. package/src/skf-export-skill/assets/managed-section-format.md +3 -3
  134. package/src/skf-export-skill/assets/snippet-format.md +2 -2
  135. package/src/skf-export-skill/customize.toml +49 -0
  136. package/src/skf-export-skill/{steps-c/step-03-generate-snippet.md → references/generate-snippet.md} +11 -11
  137. package/src/skf-export-skill/{steps-c/step-07-health-check.md → references/health-check.md} +6 -4
  138. package/src/skf-export-skill/{steps-c/step-01-load-skill.md → references/load-skill.md} +11 -49
  139. package/src/skf-export-skill/references/manifest-rebuild.md +68 -0
  140. package/src/skf-export-skill/references/multi-skill-mode.md +38 -0
  141. package/src/skf-export-skill/references/orphan-context-detection.md +75 -0
  142. package/src/skf-export-skill/references/orphan-row-detection.md +102 -0
  143. package/src/skf-export-skill/{steps-c/step-02-package.md → references/package.md} +7 -7
  144. package/src/skf-export-skill/references/preflight-snippet-root-probe.md +79 -0
  145. package/src/skf-export-skill/{steps-c/step-06-summary.md → references/summary.md} +23 -11
  146. package/src/skf-export-skill/{steps-c/step-05-token-report.md → references/token-report.md} +5 -5
  147. package/src/skf-export-skill/{steps-c/step-04-update-context.md → references/update-context.md} +109 -113
  148. package/src/skf-quick-skill/SKILL.md +63 -123
  149. package/src/skf-quick-skill/customize.toml +44 -0
  150. package/src/skf-quick-skill/references/batch-mode.md +102 -0
  151. package/src/skf-quick-skill/{steps-c/step-04-compile.md → references/compile.md} +10 -10
  152. package/src/skf-quick-skill/{steps-c/step-02-ecosystem-check.md → references/ecosystem-check.md} +5 -5
  153. package/src/skf-quick-skill/{steps-c/step-06-finalize.md → references/finalize.md} +7 -7
  154. package/src/skf-quick-skill/{steps-c/step-07-health-check.md → references/health-check.md} +3 -3
  155. package/src/skf-quick-skill/{steps-c/step-03-quick-extract.md → references/quick-extract.md} +5 -5
  156. package/src/skf-quick-skill/references/registry-resolution.md +2 -0
  157. package/src/skf-quick-skill/{steps-c/step-01-resolve-target.md → references/resolve-target.md} +14 -10
  158. package/src/skf-quick-skill/{steps-c/step-05-write-and-validate.md → references/write-and-validate.md} +4 -4
  159. package/src/skf-refine-architecture/SKILL.md +86 -16
  160. package/src/skf-refine-architecture/customize.toml +49 -0
  161. package/src/skf-refine-architecture/{steps-c/step-05-compile.md → references/compile.md} +4 -4
  162. package/src/skf-refine-architecture/{steps-c/step-02-gap-analysis.md → references/gap-analysis.md} +5 -5
  163. package/src/skf-refine-architecture/{steps-c/step-07-health-check.md → references/health-check.md} +6 -4
  164. package/src/skf-refine-architecture/{steps-c/step-04-improvements.md → references/improvements.md} +5 -5
  165. package/src/skf-refine-architecture/references/init.md +144 -0
  166. package/src/skf-refine-architecture/{steps-c/step-03-issue-detection.md → references/issue-detection.md} +5 -5
  167. package/src/skf-refine-architecture/references/refinement-rules.md +2 -0
  168. package/src/skf-refine-architecture/{steps-c/step-06-report.md → references/report.md} +14 -5
  169. package/src/skf-rename-skill/SKILL.md +82 -12
  170. package/src/skf-rename-skill/customize.toml +52 -0
  171. package/src/skf-rename-skill/{steps-c/step-02-execute.md → references/execute.md} +94 -99
  172. package/src/skf-rename-skill/references/health-check.md +30 -0
  173. package/src/skf-rename-skill/references/rebuild-context.md +110 -0
  174. package/src/skf-rename-skill/{steps-c/step-03-report.md → references/report.md} +13 -5
  175. package/src/skf-rename-skill/{steps-c/step-01-select.md → references/select.md} +59 -20
  176. package/src/skf-setup/SKILL.md +35 -35
  177. package/src/skf-setup/customize.toml +33 -0
  178. package/src/skf-setup/{steps-c/step-03-auto-index.md → references/auto-index.md} +10 -18
  179. package/src/skf-setup/{steps-c/step-01b-ccc-index.md → references/ccc-index.md} +16 -31
  180. package/src/skf-setup/{steps-c/step-01-detect-and-tier.md → references/detect-and-tier.md} +23 -10
  181. package/src/skf-setup/{steps-c/step-05-health-check.md → references/health-check.md} +1 -1
  182. package/src/skf-setup/{steps-c/step-04-report.md → references/report.md} +21 -19
  183. package/src/skf-setup/references/tier-rules.md +1 -1
  184. package/src/skf-setup/{steps-c/step-02-write-config.md → references/write-config.md} +14 -13
  185. package/src/skf-test-skill/SKILL.md +77 -15
  186. package/src/skf-test-skill/customize.toml +54 -0
  187. package/src/skf-test-skill/{steps-c/step-04-coherence-check.md → references/coherence-check.md} +37 -73
  188. package/src/skf-test-skill/{steps-c/step-03-coverage-check.md → references/coverage-check.md} +16 -39
  189. package/src/skf-test-skill/{steps-c/step-02-detect-mode.md → references/detect-mode.md} +4 -26
  190. package/src/skf-test-skill/{steps-c/step-04b-external-validators.md → references/external-validators.md} +6 -28
  191. package/src/skf-test-skill/references/health-check.md +14 -0
  192. package/src/skf-test-skill/{steps-c/step-01-init.md → references/init.md} +21 -37
  193. package/src/skf-test-skill/references/migration-section-rules.md +4 -2
  194. package/src/skf-test-skill/{steps-c/step-06-report.md → references/report.md} +41 -51
  195. package/src/skf-test-skill/{steps-c/step-05-score.md → references/score.md} +26 -43
  196. package/src/skf-test-skill/references/scoring-rules.md +8 -6
  197. package/src/skf-test-skill/references/source-access-protocol.md +7 -5
  198. package/src/skf-test-skill/scripts/compute-score.py +88 -17
  199. package/src/skf-test-skill/templates/test-report-template.md +13 -13
  200. package/src/skf-update-skill/SKILL.md +23 -14
  201. package/src/skf-update-skill/customize.toml +44 -0
  202. package/src/skf-update-skill/{steps-c/step-02-detect-changes.md → references/detect-changes.md} +176 -68
  203. package/src/skf-update-skill/references/health-check.md +32 -0
  204. package/src/skf-update-skill/{steps-c/step-01-init.md → references/init.md} +56 -8
  205. package/src/skf-update-skill/references/manual-section-rules.md +4 -0
  206. package/src/skf-update-skill/references/merge-conflict-rules.md +4 -0
  207. package/src/skf-update-skill/{steps-c/step-04-merge.md → references/merge.md} +8 -8
  208. package/src/skf-update-skill/{steps-c/step-03-re-extract.md → references/re-extract.md} +53 -44
  209. package/src/skf-update-skill/references/remote-source-resolution.md +5 -1
  210. package/src/skf-update-skill/references/report.md +214 -0
  211. package/src/skf-update-skill/{steps-c/step-05-validate.md → references/validate.md} +5 -5
  212. package/src/skf-update-skill/{steps-c/step-06-write.md → references/write.md} +73 -51
  213. package/src/skf-verify-stack/SKILL.md +89 -17
  214. package/src/skf-verify-stack/assets/feasibility-report-template.md +4 -4
  215. package/src/skf-verify-stack/customize.toml +50 -0
  216. package/src/skf-verify-stack/references/coverage-patterns.md +2 -2
  217. package/src/skf-verify-stack/{steps-c/step-02-coverage.md → references/coverage.md} +13 -9
  218. package/src/skf-verify-stack/{steps-c/step-07-health-check.md → references/health-check.md} +7 -5
  219. package/src/skf-verify-stack/references/init.md +170 -0
  220. package/src/skf-verify-stack/references/integration-verification-rules.md +1 -1
  221. package/src/skf-verify-stack/{steps-c/step-03-integrations.md → references/integrations.md} +18 -14
  222. package/src/skf-verify-stack/{steps-c/step-06-report.md → references/report.md} +27 -42
  223. package/src/skf-verify-stack/{steps-c/step-04-requirements.md → references/requirements.md} +13 -9
  224. package/src/skf-verify-stack/{steps-c/step-05-synthesize.md → references/synthesize.md} +14 -10
  225. package/tools/validate-docs-drift.js +1 -1
  226. package/src/skf-refine-architecture/steps-c/step-01-init.md +0 -136
  227. package/src/skf-rename-skill/steps-c/step-04-health-check.md +0 -22
  228. package/src/skf-test-skill/steps-c/step-07-health-check.md +0 -25
  229. package/src/skf-update-skill/steps-c/step-07-report.md +0 -148
  230. package/src/skf-update-skill/steps-c/step-08-health-check.md +0 -22
  231. package/src/skf-verify-stack/steps-c/step-01-init.md +0 -178
@@ -0,0 +1,170 @@
1
+ ---
2
+ nextStepFile: 'coverage.md'
3
+ feasibilitySchemaRef: 'src/shared/references/feasibility-report-schema.md'
4
+ atomicWriteProbeOrder:
5
+ - '{project-root}/_bmad/skf/shared/scripts/skf-atomic-write.py'
6
+ - '{project-root}/src/shared/scripts/skf-atomic-write.py'
7
+ # {outputFile} and {outputFileLatest} resolve from the activation-stored
8
+ # {project_slug}, {timestamp}, and {outputFolderPath} variables (set in
9
+ # SKILL.md On Activation §2 + §4). The activation-stored values are
10
+ # fixed for the entire run, so every later reference sees the same
11
+ # filename — no order-of-operations bug.
12
+ outputFile: '{outputFolderPath}/feasibility-report-{project_slug}-{timestamp}.md'
13
+ outputFileLatest: '{outputFolderPath}/feasibility-report-{project_slug}-latest.md'
14
+ # Resolve `{enumerateStackSkillsHelper}` by probing
15
+ # `{enumerateStackSkillsProbeOrder}` in order (installed SKF module path
16
+ # first, src/ dev-checkout fallback); first existing path wins. §2 calls
17
+ # it for the deterministic skills inventory (cascade-resolved exports,
18
+ # metadata-hash for change-detection, confidence-tier mapping). HALT if
19
+ # neither candidate exists — falls through to LLM-driven subagent fan-out
20
+ # only as graceful degradation, see §2.
21
+ enumerateStackSkillsProbeOrder:
22
+ - '{project-root}/_bmad/skf/shared/scripts/skf-enumerate-stack-skills.py'
23
+ - '{project-root}/src/shared/scripts/skf-enumerate-stack-skills.py'
24
+ ---
25
+
26
+ <!-- Config: communicate in {communication_language}. Initialize the feasibility report skeleton in {document_output_language}. -->
27
+
28
+ # Step 1: Initialize Verification
29
+
30
+ ## STEP GOAL:
31
+
32
+ Load all generated skills from the skills output folder, accept the architecture document path (required) and optional PRD/vision document path from the user, validate that all inputs exist and are readable, create the feasibility report document, and present an initialization summary before auto-proceeding.
33
+
34
+ ## Rules
35
+
36
+ - Focus only on loading inputs, scanning skills, and creating the report skeleton — do not perform analysis
37
+ - Auto-proceed — halts only on validation errors
38
+
39
+ ## MANDATORY SEQUENCE
40
+
41
+ ### 1. Accept Input Documents
42
+
43
+ "**Verify Stack — Feasibility Analysis** (read-only — never modifies your skills, architecture doc, or PRD).
44
+
45
+ If you meant to *generate* skills first, type `cancel` and run `[CS] Create Skill` or `[QS] Quick Skill`. Otherwise, please provide the following:
46
+ 1. **Architecture document path** (REQUIRED) — your project's architecture doc
47
+ 2. **PRD or vision document path** (OPTIONAL) — for requirements coverage analysis
48
+ 3. **Previous feasibility report path** (OPTIONAL) — for delta comparison with a prior run (provide a backup copy)
49
+
50
+ Or type `cancel` / `exit` / `:q` at any prompt to abort cleanly."
51
+
52
+ Wait for user input. **GATE [default: use args]** — If `{headless_mode}` and `--architecture-doc` was provided: use that path and auto-proceed, log: "headless: using provided architecture path". If `--prd` and/or `--previous-report` were provided, consume them at the corresponding sub-validations below. If `--architecture-doc` is absent in headless: HALT (exit code 2, `halt_reason: "input-missing"`) and emit the error envelope.
53
+
54
+ - If the user enters `cancel`, `exit`, `[X]`, `q`, or `:q` at any sub-prompt below: Display "Cancelled — no analysis was performed." and HALT (exit code 6, `halt_reason: "user-cancelled"`).
55
+
56
+ **Validate architecture document:**
57
+ - Confirm the file exists and is readable
58
+ - If missing or unreadable → "Architecture document not found at `{path}`. Provide a valid path."
59
+ - HALT (exit code 2, `halt_reason: "input-invalid"`) if the user cannot provide a valid path. In headless, emit the error envelope per SKILL.md "Result Contract (Headless)" immediately.
60
+
61
+ **Validate PRD document (if provided):**
62
+ - Confirm the file exists and is readable
63
+ - If missing → "PRD document not found at `{path}`. Proceeding without PRD — requirements pass will be skipped."
64
+ - Store PRD availability as `prdAvailable: true|false`
65
+
66
+ **Validate previous report (if provided):**
67
+ - Confirm the file exists and is readable
68
+ - **Collision check:** Resolve `{outputFile}` from the activation-stored `{outputFolderPath}`, `{project_slug}`, and `{timestamp}` (all three computed in SKILL.md On Activation §2 + §4 — they are fixed for the entire run). Then compare both the provided path and `{outputFile}` via `(st_dev, st_ino)` tuples obtained from `stat(2)` on each path (do not rely on absolute-path string equality — symlinks, bind mounts, and case-insensitive filesystems can defeat string comparison; the `(st_dev, st_ino)` comparison is the canonical kernel-level equivalent of `os.path.realpath`-based equality and is strictly stronger because it also catches hardlinks). If `{outputFile}` does not yet exist, resolve its parent via `realpath`, stat that directory, and combine `(st_dev, parent_ino, basename)` for comparison. If the two paths resolve to the same inode, warn: "The previous report path points to the same inode as the new report. This file will be overwritten during this run. Provide a path to a backup copy, or leave empty to skip delta comparison." HALT (exit code 5, `halt_reason: "previous-report-collision"`) until resolved. In headless, emit the error envelope.
69
+ - If missing → "Previous report not found at `{path}`. Proceeding without delta comparison."
70
+ - Store as `previousReport: {path}` (or empty string if not provided)
71
+
72
+ ### 2. Scan Skills Folder
73
+
74
+ **Pre-flight — skills folder existence:**
75
+ - If `{skills_output_folder}` does not exist on disk: HALT (exit code 3, `halt_reason: "skills-folder-missing"`) with "**Cannot proceed.** `{skills_output_folder}` does not exist — run **[SF] Setup Forge** to initialize the forge, then generate skills with [CS] or [QS]." In headless, emit the error envelope.
76
+ - If `{skills_output_folder}` exists but is empty (no subdirectories at all): HALT (exit code 3, `halt_reason: "skills-folder-missing"`) with "**Cannot proceed.** `{skills_output_folder}` contains 0 skills. Generate skills with [CS] Create Skill or [QS] Quick Skill, then re-run [VS]." In headless, emit the error envelope.
77
+
78
+ **Resolve `{enumerateStackSkillsHelper}`** from `{enumerateStackSkillsProbeOrder}`; first existing path wins.
79
+
80
+ **Primary path — deterministic enumeration via shared helper:**
81
+
82
+ ```bash
83
+ python3 {enumerateStackSkillsHelper} enumerate {skills_output_folder}
84
+ ```
85
+
86
+ The helper walks `{skills_output_folder}`, reads each `metadata.json`, applies the exports cascade (metadata → references/ → SKILL.md prose), maps `confidence_tier` (T1/T2/T1-low), captures stack-skill cycles via `composes:`, and emits structured JSON with one entry per skill plus a top-level `warnings[]` array. Cache the result as `skill_inventory` (used by §3, §4, §5, and the integrations + coverage stages).
87
+
88
+ Each helper-emitted entry includes: `skill_name`, `version`, `language`, `confidence_tier`, `exports` (cascade-resolved), `source_repo`, `source_root`, plus a `metadata_hash` for change-detection across runs. The helper's `warnings[]` carries per-skill skip reasons (missing manifest, malformed JSON, non-symlink `active`, orphan-versions, schema-version violations).
89
+
90
+ **Failure-budget guard:** If `len(warnings) / len(skill_inventory) + len(warnings) > 0.20` (the same 20% threshold chosen so a single malformed skill in a small 3-5 skill inventory does not trip the halt), HALT (exit code 7, `halt_reason: "inventory-unreliable"`) with: "Inventory scan unreliable — {len(warnings)}/{total} skills returned malformed metadata or skip warnings. Re-run [VS] after skills stabilize." In headless, emit the error envelope.
91
+
92
+ **Capture mtime:** For each accepted skill in `skill_inventory`, also record `metadata.json`'s mtime via `stat` into the entry as `metadata_mtime`. Step-03 will re-verify this to detect mid-run modifications.
93
+
94
+ **Fallback path — graceful degradation when the helper is unavailable:** If `{enumerateStackSkillsHelper}` has no existing candidate (e.g. partial installation), fall through to the LLM-driven subagent fan-out: launch up to **8 subagents concurrently**, each reading one resolved skill package's `metadata.json` and returning the same JSON shape the helper would emit. Apply the same 20% failure-budget guard. This path exists so verify-stack survives a missing helper, but the deterministic helper is preferred — it has a tested cascade resolver, captures the metadata-hash, and surfaces every skip reason in `warnings[]` consistently.
95
+
96
+ ### 3. Validate Minimum Requirements
97
+
98
+ **Check skill count:**
99
+ - At least 2 valid skills must exist (a stack requires multiple libraries)
100
+ - If fewer than 2 → "**Cannot proceed.** Only {count} skill(s) found in `{skills_output_folder}`. A stack requires at least 2 skills. Generate more skills with [CS] Create Skill or [QS] Quick Skill, then re-run [VS]."
101
+ - HALT (exit code 5, `halt_reason: "insufficient-skills"`). In headless, emit the error envelope.
102
+
103
+ **Check forge_data_folder:**
104
+ - Verify `forge_data_folder` was resolved from config.yaml and is non-empty
105
+ - If undefined or empty → "**Cannot proceed.** `forge_data_folder` is not configured in config.yaml. Re-run [SF] Setup Forge to initialize."
106
+ - HALT (exit code 3, `halt_reason: "forge-folder-unconfigured"`). In headless, emit the error envelope.
107
+
108
+ **Check architecture document:**
109
+ - Confirm it was loaded successfully in section 1
110
+ - If not → HALT with error (should not reach here if section 1 validation passed)
111
+
112
+ ### 4. Create Feasibility Report
113
+
114
+ **Resolve `{atomicWriteHelper}`** from `{atomicWriteProbeOrder}`; first existing path wins. HALT if no candidate exists.
115
+
116
+ This skill is the PRODUCER of the feasibility report schema defined in `{feasibilitySchemaRef}`. All outputs MUST conform to that schema — in particular: `schemaVersion: "1.0"`, the defined verdict token set (`Verified|Plausible|Risky|Blocked`; overall `FEASIBLE|CONDITIONALLY_FEASIBLE|NOT_FEASIBLE`), the filename pattern, and the section-heading order.
117
+
118
+ **Filename variables** (already computed at activation — do not re-derive):
119
+ - `project_slug`: set in SKILL.md On Activation §2 from `project_name`
120
+ - `timestamp`: set in SKILL.md On Activation §2 (UTC `YYYYMMDD-HHmmss`, fixed for the run)
121
+ - `outputFile` resolves to `{outputFolderPath}/feasibility-report-{project_slug}-{timestamp}.md` per the stage frontmatter template
122
+ - `outputFileLatest` resolves to `{outputFolderPath}/feasibility-report-{project_slug}-latest.md` (a copy, not a symlink — per schema)
123
+
124
+ **Load** `{reportTemplatePath}` (the customize-aware template path resolved in SKILL.md On Activation §4) and stage the initial content.
125
+
126
+ **Populate frontmatter (per shared schema — required keys):**
127
+ - `schemaVersion: "1.0"`
128
+ - `reportType: feasibility`
129
+ - `projectName: "{project_name}"`
130
+ - `projectSlug: "{project_slug}"`
131
+ - `generatedAt: "{ISO-8601 UTC}"`
132
+ - `generatedBy: skf-verify-stack`
133
+ - `overallVerdict: "CONDITIONALLY_FEASIBLE"` (provisional until step 5 finalizes)
134
+ - `coveragePercentage: 0`
135
+ - `pairsVerified: 0`, `pairsPlausible: 0`, `pairsRisky: 0`, `pairsBlocked: 0`
136
+ - `recommendationCount: 0`
137
+ - `prdAvailable: true|false` (from section 1 validation)
138
+
139
+ **Populate producer-local bookkeeping keys (not part of the consumer contract):**
140
+ - `architectureDoc`, `prdDoc` (or "none"), `previousReport` (or empty string)
141
+ - `skillsAnalyzed: {count}`
142
+ - `stepsCompleted: ['init']`
143
+
144
+ **Atomic write:** Pipe the staged content through `python3 {atomicWriteHelper} write --target {outputFile}` and then again with `--target {outputFileLatest}`. Both writes use the same staged content. Do NOT use `rm`+rewrite; do NOT create a symlink for the `-latest` copy.
145
+
146
+ On any non-zero exit from either write: HALT (exit code 4, `halt_reason: "write-failed"`) and emit the error envelope per SKILL.md "Result Contract (Headless)" with `report_path: null`, `report_latest_path: null`, `overall_verdict: null`.
147
+
148
+ ### 5. Display Initialization Summary
149
+
150
+ "**Stack Verification Initialized**
151
+
152
+ | Field | Value |
153
+ |-------|-------|
154
+ | **Skills Loaded** | {count} |
155
+ | **Architecture Doc** | {architecture_doc} |
156
+ | **PRD Document** | {prd_doc or 'Not provided — requirements pass will be skipped'} |
157
+ | **Previous Report** | {previousReport or 'Not provided — no delta comparison'} |
158
+
159
+ **Skill Inventory:**
160
+
161
+ | Skill | Language | Tier | Exports |
162
+ |-------|----------|------|---------|
163
+ | {skill_name} | {language} | {confidence_tier} | {exports_documented} |
164
+
165
+ **Proceeding to coverage analysis...**"
166
+
167
+ ### 6. Auto-Proceed to Next Step
168
+
169
+ Load, read the full file and then execute `{nextStepFile}`.
170
+
@@ -17,7 +17,7 @@ Token set is defined canonically in `src/shared/references/feasibility-report-sc
17
17
  | **Risky** | Type mismatch, protocol gap, or language boundary requiring a bridge | A clear gap exists (e.g., TypeScript↔Rust FFI needed) but a workaround is architecturally feasible — a named workaround MUST be cited in the recommendation |
18
18
  | **Blocked** | Fundamental incompatibility — no feasible integration path even with a bridge or adapter layer | The two libraries cannot exchange data in any documented way; requires replacing one of the libraries |
19
19
 
20
- **Promotion rule:** `Verified` requires Check 4 evidence. If Checks 1 and 3 pass but Check 4 fails (no literal substring/name citation from either skill's SKILL.md), the verdict is capped at `Plausible`. This rule is enforced by step-03 §4 and is the producer obligation declared in the shared schema.
20
+ **Promotion rule:** `Verified` requires Check 4 evidence. If Checks 1 and 3 pass but Check 4 fails (no literal substring/name citation from either skill's SKILL.md), the verdict is capped at `Plausible`. This rule is enforced by step 3 §4 and is the producer obligation declared in the shared schema.
21
21
 
22
22
  ---
23
23
 
@@ -1,13 +1,17 @@
1
1
  ---
2
- nextStepFile: './step-04-requirements.md'
3
- integrationRulesData: 'references/integration-verification-rules.md'
4
- coveragePatternsData: 'references/coverage-patterns.md'
2
+ nextStepFile: 'requirements.md'
3
+ integrationRulesData: '{integrationRulesPath}'
4
+ coveragePatternsData: '{coveragePatternsPath}'
5
5
  feasibilitySchemaRef: 'src/shared/references/feasibility-report-schema.md'
6
- atomicWriteScript: '{project-root}/src/shared/scripts/skf-atomic-write.py'
7
- outputFile: '{forge_data_folder}/feasibility-report-{project_slug}-{timestamp}.md'
8
- outputFileLatest: '{forge_data_folder}/feasibility-report-{project_slug}-latest.md'
6
+ atomicWriteProbeOrder:
7
+ - '{project-root}/_bmad/skf/shared/scripts/skf-atomic-write.py'
8
+ - '{project-root}/src/shared/scripts/skf-atomic-write.py'
9
+ outputFile: '{outputFolderPath}/feasibility-report-{project_slug}-{timestamp}.md'
10
+ outputFileLatest: '{outputFolderPath}/feasibility-report-{project_slug}-latest.md'
9
11
  ---
10
12
 
13
+ <!-- Config: communicate in {communication_language}. Append the Integration Verdicts section to the report in {document_output_language}. -->
14
+
11
15
  # Step 3: Integration Verification
12
16
 
13
17
  ## STEP GOAL:
@@ -22,8 +26,6 @@ Cross-reference API surfaces between library pairs that the architecture documen
22
26
 
23
27
  ## MANDATORY SEQUENCE
24
28
 
25
- **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
26
-
27
29
  ### 1. Load Integration Verification Rules
28
30
 
29
31
  Load `{integrationRulesData}` for the cross-reference verification protocol.
@@ -54,7 +56,7 @@ Parse the architecture document for statements describing two or more technologi
54
56
 
55
57
  <!-- Subagent delegation: read SKILL.md files in parallel, return compact JSON -->
56
58
 
57
- For each library in an integration pair, delegate SKILL.md reading to a parallel subagent. Launch up to **8 subagents concurrently** (batch if needed — same 8-way cap as step-01 §2; keeps aggregate token window manageable while still parallelizing typical stack sizes). Each subagent receives one skill's SKILL.md path and MUST:
59
+ For each library in an integration pair, delegate SKILL.md reading to a parallel subagent. Launch up to **8 subagents concurrently** (batch if needed — same 8-way cap as step 1 §2; keeps aggregate token window manageable while still parallelizing typical stack sizes). Each subagent receives one skill's SKILL.md path and MUST:
58
60
  1. Read the SKILL.md file
59
61
  2. Extract the API surface
60
62
  3. ONLY return this compact JSON — no prose, no extra commentary:
@@ -78,7 +80,7 @@ For each library in an integration pair, delegate SKILL.md reading to a parallel
78
80
 
79
81
  **CRITICAL — these fields are inferred, not declared.** `protocols` and `data_formats` do not exist in any skill's `metadata.json`. Treat them as weak evidence from prose scanning only. When either list is used to justify compatibility in Check 2, the per-pair verdict MUST be capped at `Plausible` (see the schema's producer obligations — `src/shared/references/feasibility-report-schema.md`).
80
82
 
81
- **Schema validation (parent):** Each subagent response must contain the required keys (`skill_name`, `language`, `exports`). Reject responses missing required keys and exclude that skill from pair evaluation; HALT if more than **20%** (same failure-budget threshold as step-01 §2; see the justification there) of subagent calls return malformed JSON.
83
+ **Schema validation (parent):** Each subagent response must contain the required keys (`skill_name`, `language`, `exports`). Reject responses missing required keys and exclude that skill from pair evaluation; HALT if more than **20%** (same failure-budget threshold as step 1 §2; see the justification there) of subagent calls return malformed JSON.
82
84
 
83
85
  **Parent collects all subagent JSON summaries.** Do not load full SKILL.md content into parent context.
84
86
 
@@ -88,7 +90,7 @@ For each library in an integration pair, delegate SKILL.md reading to a parallel
88
90
  - `stats.exports_documented` — export count
89
91
  - `confidence_tier` — extraction confidence level
90
92
 
91
- **mtime re-verification:** Re-stat each `metadata.json` and compare against the mtime captured in step-01. If any mtime moved during the run, abort any pair involving that skill with rationale "skill modified mid-run — re-run [VS]".
93
+ **mtime re-verification:** Re-stat each `metadata.json` and compare against the mtime captured in step 1. If any mtime moved during the run, abort any pair involving that skill with rationale "skill modified mid-run — re-run [VS]".
92
94
 
93
95
  Store collected API surface summaries for cross-referencing.
94
96
 
@@ -160,12 +162,14 @@ For each integration pair `{library_a, library_b}`, apply the verification proto
160
162
 
161
163
  ### 6. Append to Report
162
164
 
165
+ **Resolve `{atomicWriteHelper}`** from `{atomicWriteProbeOrder}`; first existing path wins. HALT if no candidate exists.
166
+
163
167
  Write the **Integration Verdicts** section to `{outputFile}` (heading is fixed — consumers grep for `## Integration Verdicts`; the table header MUST be the canonical `| lib_a | lib_b | verdict | rationale |` per `{feasibilitySchemaRef}`; the skill-local display table with the extra Context/Source/Evidence columns can be rendered beneath it for human readers):
164
168
  - Emit the canonical `| lib_a | lib_b | verdict | rationale |` table first (verdict tokens MUST be one of `Verified`, `Plausible`, `Risky`, `Blocked` — case-sensitive)
165
169
  - Include the extended table with Context, Source, and Evidence columns below it
166
- - Include recommendations for Risky and Blocked pairs (Blocked recommendations MUST cite a named candidate per step-05 H6, or the explicit no-candidate notice)
167
- - Update frontmatter: append `'step-03-integrations'` to `stepsCompleted`; set `pairsVerified`, `pairsPlausible`, `pairsRisky`, `pairsBlocked` counts
168
- - Pipe the updated full content through `python3 {atomicWriteScript} write --target {outputFile}` and again with `--target {outputFileLatest}`
170
+ - Include recommendations for Risky and Blocked pairs (Blocked recommendations MUST cite a named candidate per step 5 H6, or the explicit no-candidate notice)
171
+ - Update frontmatter: append `'integrations'` to `stepsCompleted`; set `pairsVerified`, `pairsPlausible`, `pairsRisky`, `pairsBlocked` counts
172
+ - Pipe the updated full content through `python3 {atomicWriteHelper} write --target {outputFile}` and again with `--target {outputFileLatest}`
169
173
 
170
174
  ### 7. Auto-Proceed to Next Step
171
175
 
@@ -1,11 +1,19 @@
1
1
  ---
2
- outputFile: '{forge_data_folder}/feasibility-report-{project_slug}-{timestamp}.md'
3
- outputFileLatest: '{forge_data_folder}/feasibility-report-{project_slug}-latest.md'
2
+ # {outputFile} and {outputFileLatest} resolve from the activation-stored
3
+ # {project_slug}, {timestamp}, and {outputFolderPath} variables (set in
4
+ # SKILL.md On Activation §2 + §4) — same template as init.md frontmatter
5
+ # so every stage sees the same path.
6
+ outputFile: '{outputFolderPath}/feasibility-report-{project_slug}-{timestamp}.md'
7
+ outputFileLatest: '{outputFolderPath}/feasibility-report-{project_slug}-latest.md'
4
8
  feasibilitySchemaRef: 'src/shared/references/feasibility-report-schema.md'
5
- atomicWriteScript: '{project-root}/src/shared/scripts/skf-atomic-write.py'
6
- nextStepFile: './step-07-health-check.md'
9
+ atomicWriteProbeOrder:
10
+ - '{project-root}/_bmad/skf/shared/scripts/skf-atomic-write.py'
11
+ - '{project-root}/src/shared/scripts/skf-atomic-write.py'
12
+ nextStepFile: 'health-check.md'
7
13
  ---
8
14
 
15
+ <!-- Config: communicate in {communication_language}. Render the user-facing summary in {document_output_language}. -->
16
+
9
17
  # Step 6: Present Report
10
18
 
11
19
  ## STEP GOAL:
@@ -19,17 +27,15 @@ Present the complete feasibility report to the user. Display the overall verdict
19
27
 
20
28
  ## MANDATORY SEQUENCE
21
29
 
22
- **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
23
-
24
30
  ### 1. Load Complete Report
25
31
 
26
32
  Read the entire `{outputFile}` to have all data available for presentation.
27
33
 
28
- Verify all expected sections are present in order per `{feasibilitySchemaRef}`: `## Executive Summary`, `## Coverage Analysis`, `## Integration Verdicts`, `## Recommendations`, `## Evidence Sources`. If any section is missing or out of order, HALT and report the schema violation — do not display partial results.
34
+ Verify all expected sections are present in order per `{feasibilitySchemaRef}`: `## Executive Summary`, `## Coverage Analysis`, `## Integration Verdicts`, `## Recommendations`, `## Evidence Sources`. If any section is missing or out of order, HALT (exit code 5, `halt_reason: "schema-violation"`) and report the schema violation — do not display partial results. In headless, emit the error envelope per SKILL.md "Result Contract (Headless)" with `report_path: "{outputFile}"`, `overall_verdict: null`.
29
35
 
30
36
  **Extract metrics from `{outputFile}` frontmatter** (per shared schema in `{feasibilitySchemaRef}`): `skillsAnalyzed`, `coveragePercentage`, `pairsVerified` (as `verified_count`), `pairsPlausible` (as `plausible_count`), `pairsRisky` (as `risky_count`), `pairsBlocked` (as `blocked_count`), `requirementsFulfilled` (as `fulfilled_count`), `requirementsPartial` (as `partial_count`), `requirementsNotAddressed` (as `not_addressed_count`), `requirementsPass`, `overallVerdict`, and `recommendationCount`. Use these mapped display names in the summary table and next steps below.
31
37
 
32
- **Schema guard:** Verify `schemaVersion == "1.0"` in the frontmatter. If mismatched, HALT with "Report frontmatter schemaVersion `{value}` does not match producer schema `1.0` — report was corrupted between steps. Re-run [VS]." (Producer never proceeds past a schema mismatch.)
38
+ **Schema guard:** Verify `schemaVersion == "1.0"` in the frontmatter. If mismatched, HALT (exit code 5, `halt_reason: "schema-violation"`) with "Report frontmatter schemaVersion `{value}` does not match producer schema `1.0` — report was corrupted between steps. Re-run [VS]." (Producer never proceeds past a schema mismatch.) In headless, emit the error envelope.
33
39
 
34
40
  ### 2. Present Summary
35
41
 
@@ -62,35 +68,7 @@ Verify all expected sections are present in order per `{feasibilitySchemaRef}`:
62
68
 
63
69
  ### 3. Present Detailed Findings
64
70
 
65
- Walk through each section briefly, focusing on items that need attention:
66
-
67
- "**Coverage Highlights:**
68
- {IF 100% coverage:}
69
- - All referenced technologies have a matching skill
70
-
71
- {IF any missing:}
72
- - **Missing:** {list of missing technology names}
73
-
74
- **Integration Verdicts:**
75
- {IF all Verified/Plausible:}
76
- - All integration pairs verified or plausible — no blockers
77
-
78
- {IF any Risky:}
79
- - **Risky:** {list of risky pairs with brief concern}
80
-
81
- {IF any Blocked:}
82
- - **Blocked:** {list of blocked pairs with brief incompatibility}
83
-
84
- {IF requirements pass completed:}
85
- **Requirements Gaps:**
86
- {IF all Fulfilled:}
87
- - All stated requirements addressed by the stack
88
-
89
- {IF any Partially Fulfilled:}
90
- - **Partially Fulfilled:** {list of partially covered requirements with gap description}
91
-
92
- {IF any Not Addressed:}
93
- - **Not Addressed:** {list of unaddressed requirements}"
71
+ Walk through the highlights — coverage gaps, risky/blocked integrations, and partial/unaddressed requirements (when a PRD pass ran). Cite specific items by name; cap at the top ~5 per category to keep the summary scannable. The full detail is in `{outputFile}` for the user to inspect via the [R] Review menu (§5).
94
72
 
95
73
  ### 4. Present Next Steps
96
74
 
@@ -122,11 +100,21 @@ Based on the overall verdict, present the appropriate recommendation:
122
100
 
123
101
  ### 4b. Result Contract
124
102
 
103
+ **Resolve `{atomicWriteHelper}`** from `{atomicWriteProbeOrder}`; first existing path wins. HALT if no candidate exists.
104
+
125
105
  Write the result contract per `shared/references/output-contract-schema.md`: the per-run record at `{forge_data_folder}/verify-stack-result-{YYYYMMDD-HHmmss}.json` (UTC timestamp, resolution to seconds) and a copy at `{forge_data_folder}/verify-stack-result-latest.json` (stable path for pipeline consumers — copy, not symlink). Include the feasibility report path (both `{outputFile}` and `{outputFileLatest}`) in `outputs`; include `overallVerdict` (`FEASIBLE` / `CONDITIONALLY_FEASIBLE` / `NOT_FEASIBLE`), `coveragePercentage`, and `recommendationCount` in `summary` — use the case-sensitive schema tokens.
126
106
 
127
- Write both JSON files through `python3 {atomicWriteScript} write --target ...` to avoid partial-write corruption.
107
+ Write both JSON files through `python3 {atomicWriteHelper} write --target ...` to avoid partial-write corruption. On any non-zero exit: HALT (exit code 4, `halt_reason: "write-failed"`) and emit the error envelope.
108
+
109
+ When `{headless_mode}` is true, also emit the single-line envelope on **stdout** before chaining to step 7 (matches the SKILL.md "Result Contract (Headless)" shape):
128
110
 
129
- **Result-contract ordering:** The result contract is written exactly once on the first entry to step-06 (the `[X] Exit verification` path). Re-walks of the report via the `[R] Review full report` menu option do NOT regenerate it — the contract captures the run, not the presentation loop. If the user selects `[R]` repeatedly before exiting, the single on-disk contract written on first entry remains authoritative.
111
+ ```
112
+ SKF_VERIFY_STACK_RESULT_JSON: {"status":"success","report_path":"{outputFile}","report_latest_path":"{outputFileLatest}","overall_verdict":"{overallVerdict}","coverage_percentage":{coveragePercentage},"recommendation_count":{recommendationCount},"exit_code":0,"halt_reason":null}
113
+ ```
114
+
115
+ `{overallVerdict}` uses the schema tokens (`FEASIBLE` / `CONDITIONALLY_FEASIBLE` / `NOT_FEASIBLE`).
116
+
117
+ **Result-contract ordering:** The result contract is written exactly once on the first entry to step 6 (the `[X] Exit verification` path). Re-walks of the report via the `[R] Review full report` menu option do NOT regenerate it — the contract captures the run, not the presentation loop. If the user selects `[R]` repeatedly before exiting, the single on-disk contract written on first entry remains authoritative.
130
118
 
131
119
  ### 5. Present Menu
132
120
 
@@ -150,7 +138,4 @@ Re-run **[VS] Verify Stack** anytime after making changes to your skills or arch
150
138
  - R may be selected multiple times — always walk through the full report
151
139
  - X triggers the health check, which is the true workflow exit
152
140
 
153
- ## CRITICAL STEP COMPLETION NOTE
154
-
155
- When the user selects X, this step chains to the local health-check step (`{nextStepFile}`), which in turn delegates to `shared/health-check.md`. After the health check completes, the verify-stack workflow is fully done. The feasibility report at `{outputFile}` (and its stable `-latest.md` copy) contains the full analysis under the fixed headings: Executive Summary, Coverage Analysis, Integration Verdicts, Recommendations, Evidence Sources.
156
141
 
@@ -1,11 +1,15 @@
1
1
  ---
2
- nextStepFile: './step-05-synthesize.md'
2
+ nextStepFile: 'synthesize.md'
3
3
  feasibilitySchemaRef: 'src/shared/references/feasibility-report-schema.md'
4
- atomicWriteScript: '{project-root}/src/shared/scripts/skf-atomic-write.py'
5
- outputFile: '{forge_data_folder}/feasibility-report-{project_slug}-{timestamp}.md'
6
- outputFileLatest: '{forge_data_folder}/feasibility-report-{project_slug}-latest.md'
4
+ atomicWriteProbeOrder:
5
+ - '{project-root}/_bmad/skf/shared/scripts/skf-atomic-write.py'
6
+ - '{project-root}/src/shared/scripts/skf-atomic-write.py'
7
+ outputFile: '{outputFolderPath}/feasibility-report-{project_slug}-{timestamp}.md'
8
+ outputFileLatest: '{outputFolderPath}/feasibility-report-{project_slug}-latest.md'
7
9
  ---
8
10
 
11
+ <!-- Config: communicate in {communication_language}. Append the Requirements Coverage section to the report in {document_output_language}. -->
12
+
9
13
  # Step 4: Requirements Coverage
10
14
 
11
15
  ## STEP GOAL:
@@ -20,10 +24,10 @@ If a PRD or vision document was provided in Step 01, verify that the combined ca
20
24
 
21
25
  ## MANDATORY SEQUENCE
22
26
 
23
- **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
24
-
25
27
  ### 1. Check PRD Availability
26
28
 
29
+ **Resolve `{atomicWriteHelper}`** from `{atomicWriteProbeOrder}`; first existing path wins. HALT if no candidate exists.
30
+
27
31
  **Read `prdAvailable` from `{outputFile}` frontmatter (set in Step 01). If `prdAvailable` is false (no PRD/vision document was provided):**
28
32
 
29
33
  "**Pass 3: Requirements Coverage — Skipped**
@@ -34,7 +38,7 @@ To include this pass, re-run **[VS]** with a PRD or vision document path.
34
38
 
35
39
  **Proceeding to synthesis...**"
36
40
 
37
- Update `{outputFile}` frontmatter: append `'step-04-requirements'` to `stepsCompleted`; set `requirementsPass: "skipped"`. Pipe the updated content through `python3 {atomicWriteScript} write --target {outputFile}` and again with `--target {outputFileLatest}`.
41
+ Update `{outputFile}` frontmatter: append `'requirements'` to `stepsCompleted`; set `requirementsPass: "skipped"`. Pipe the updated content through `python3 {atomicWriteHelper} write --target {outputFile}` and again with `--target {outputFileLatest}`.
38
42
 
39
43
  Load, read the full file and then execute `{nextStepFile}`. **STOP HERE — do not execute sections 2-6.**
40
44
 
@@ -102,10 +106,10 @@ For each requirement, evaluate whether the combined capabilities of the generate
102
106
  Write the Requirements Coverage content under the `## Recommendations` section (or as a clearly-titled subsection preceding Recommendations — the shared schema's fixed top-level headings are Executive Summary, Coverage Analysis, Integration Verdicts, Recommendations, Evidence Sources; requirements detail lives under Recommendations):
103
107
  - Include the full requirements coverage table
104
108
  - Include recommendations for Not Addressed and Partially Fulfilled items
105
- - Update frontmatter: append `'step-04-requirements'` to `stepsCompleted`
109
+ - Update frontmatter: append `'requirements'` to `stepsCompleted`
106
110
  - Set `requirementsPass: "completed"`
107
111
  - Set `requirementsFulfilled`, `requirementsPartial`, `requirementsNotAddressed` counts
108
- - Pipe the updated full content through `python3 {atomicWriteScript} write --target {outputFile}` and again with `--target {outputFileLatest}`
112
+ - Pipe the updated full content through `python3 {atomicWriteHelper} write --target {outputFile}` and again with `--target {outputFileLatest}`
109
113
 
110
114
  ### 6. Auto-Proceed to Next Step
111
115
 
@@ -1,11 +1,15 @@
1
1
  ---
2
- nextStepFile: './step-06-report.md'
2
+ nextStepFile: 'report.md'
3
3
  feasibilitySchemaRef: 'src/shared/references/feasibility-report-schema.md'
4
- atomicWriteScript: '{project-root}/src/shared/scripts/skf-atomic-write.py'
5
- outputFile: '{forge_data_folder}/feasibility-report-{project_slug}-{timestamp}.md'
6
- outputFileLatest: '{forge_data_folder}/feasibility-report-{project_slug}-latest.md'
4
+ atomicWriteProbeOrder:
5
+ - '{project-root}/_bmad/skf/shared/scripts/skf-atomic-write.py'
6
+ - '{project-root}/src/shared/scripts/skf-atomic-write.py'
7
+ outputFile: '{outputFolderPath}/feasibility-report-{project_slug}-{timestamp}.md'
8
+ outputFileLatest: '{outputFolderPath}/feasibility-report-{project_slug}-latest.md'
7
9
  ---
8
10
 
11
+ <!-- Config: communicate in {communication_language}. Append the Executive Summary, synthesized verdict, and Recommendations to the report in {document_output_language}. -->
12
+
9
13
  # Step 5: Synthesize Verdict
10
14
 
11
15
  ## STEP GOAL:
@@ -19,8 +23,6 @@ Calculate the overall feasibility verdict based on all three analysis passes, ge
19
23
 
20
24
  ## MANDATORY SEQUENCE
21
25
 
22
- **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
23
-
24
26
  ### 1. Calculate Overall Verdict
25
27
 
26
28
  **Zero-coverage short-circuit (evaluate before anything else):** Read `coveragePercentage` from `{outputFile}` frontmatter. If `coveragePercentage == 0`, force `overallVerdict: NOT_FEASIBLE` with rationale "no coverage — analysis vacuous: zero generated skills match the architecture's referenced technologies, so integration and requirements verdicts cannot produce meaningful evidence." Skip the remainder of the verdict ladder; proceed directly to section 2 to generate recommendations for the Missing skills surfaced by Step 02.
@@ -47,7 +49,7 @@ If ANY of the following apply, the verdict is `CONDITIONALLY_FEASIBLE`. Include
47
49
  - Rationale: {IF requirements pass completed:} the stack can support the architecture as described — all requirements fully fulfilled, every integration pair has a literal cross-reference. {IF requirements pass was skipped:} the stack can support the architecture as described — requirements were not evaluated (no PRD provided)
48
50
 
49
51
  **Post-verdict: Zero integration pairs guard (apply after ANY verdict):**
50
- If zero integration pairs were extracted (all four integration counts are 0), fire the guard whenever the user continued past the step-02 `[C] Continue anyway` prompt (i.e., any `[C]` continuation from 0% coverage or any other zero-state) — regardless of how many technologies the architecture document references:
52
+ If zero integration pairs were extracted (all four integration counts are 0), fire the guard whenever the user continued past the step 2 `[C] Continue anyway` prompt (i.e., any `[C]` continuation from 0% coverage or any other zero-state) — regardless of how many technologies the architecture document references:
51
53
  - If the verdict was `FEASIBLE`, override to `CONDITIONALLY_FEASIBLE`
52
54
  - Regardless of verdict, append this note to the rationale: "No integration claims were found in the architecture document prose. Manual review recommended to confirm that technology relationships are not documented exclusively in diagrams or implied without explicit co-mention."
53
55
 
@@ -103,7 +105,7 @@ Assemble the following for the report:
103
105
 
104
106
  **Overall verdict** with rationale citing the decision logic.
105
107
 
106
- **Recommendation list** ordered by priority (count total recommendations as `recommendationCount` — persist this count to `{outputFile}` frontmatter for use in step-06):
108
+ **Recommendation list** ordered by priority (count total recommendations as `recommendationCount` — persist this count to `{outputFile}` frontmatter for use in step 6):
107
109
  1. Blocked integrations (if any)
108
110
  2. Missing skills
109
111
  3. Risky integrations
@@ -121,6 +123,8 @@ Assemble the following for the report:
121
123
 
122
124
  ### 5. Append to Report
123
125
 
126
+ **Resolve `{atomicWriteHelper}`** from `{atomicWriteProbeOrder}`; first existing path wins. HALT if no candidate exists.
127
+
124
128
  Write the **Recommendations** and **Evidence Sources** sections to `{outputFile}` (per the fixed heading order in `{feasibilitySchemaRef}`):
125
129
  - Include overall verdict with rationale in the `## Executive Summary` section (replace the placeholder text from the template)
126
130
  - Include prioritized recommendation list under `## Recommendations`
@@ -128,7 +132,7 @@ Write the **Recommendations** and **Evidence Sources** sections to `{outputFile}
128
132
  - Include suggested next workflow at the end of `## Recommendations`
129
133
  - Populate `## Evidence Sources` with per-skill citations (SKILL.md path, `metadata_schema_version`, `confidence_tier`, stack manifest if any) and architecture/PRD doc paths
130
134
  - Update frontmatter (shared-schema keys):
131
- - Append `'step-05-synthesize'` to `stepsCompleted`
135
+ - Append `'synthesize'` to `stepsCompleted`
132
136
  - Set `overallVerdict` to one of `FEASIBLE`, `CONDITIONALLY_FEASIBLE`, `NOT_FEASIBLE` (case-sensitive, underscores — NOT spaces)
133
137
  - Set `recommendationCount` to the total number of recommendations
134
138
  - If delta was computed (section 3), set `deltaImproved`, `deltaRegressed`, `deltaNew`, `deltaUnchanged`
@@ -137,7 +141,7 @@ Write the **Recommendations** and **Evidence Sources** sections to `{outputFile}
137
141
  - If any pair has Check 4 missing/weak AND was capped at `Plausible`, that alone does NOT force `NOT_FEASIBLE`, but `FEASIBLE` requires zero such pairs
138
142
  - `FEASIBLE` requires 100% coverage AND zero Blocked pairs AND zero Check-4-missing pairs — otherwise downgrade to `CONDITIONALLY_FEASIBLE`
139
143
  - `coveragePercentage == 0` forces `NOT_FEASIBLE` (per section 1 short-circuit)
140
- - Pipe the updated full content through `python3 {atomicWriteScript} write --target {outputFile}` and again with `--target {outputFileLatest}`
144
+ - Pipe the updated full content through `python3 {atomicWriteHelper} write --target {outputFile}` and again with `--target {outputFileLatest}`
141
145
 
142
146
  ### 6. Auto-Proceed to Next Step
143
147
 
@@ -90,7 +90,7 @@ function resolveOmsPath(anchors) {
90
90
  }
91
91
 
92
92
  // Accept either a full SHA match or a short-SHA prefix match, per
93
- // src/skf-update-skill/steps-c/step-03-re-extract.md:36 — the pinned commit
93
+ // src/skf-update-skill/references/re-extract.md:36 — the pinned commit
94
94
  // is often stored as an 8-char short hash. Both anchors and metadata are
95
95
  // lowercased before comparison; blank / null values never match.
96
96
  function commitsMatch(anchorCommit, metadataCommit) {