bmad-module-skill-forge 2.0.0 → 2.0.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 (235) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.nvmrc +1 -1
  3. package/docs/_data/pinned.yaml +1 -1
  4. package/package.json +2 -2
  5. package/src/knowledge/skill-lifecycle.md +1 -1
  6. package/src/module-help.csv +2 -2
  7. package/src/shared/scripts/skf-comention-pairs.py +350 -0
  8. package/src/shared/scripts/skf-count-tokens.py +222 -0
  9. package/src/shared/scripts/skf-detect-docs.py +232 -1
  10. package/src/shared/scripts/skf-detect-language.py +77 -0
  11. package/src/shared/scripts/skf-detect-tools.py +105 -2
  12. package/src/shared/scripts/skf-enumerate-stack-skills.py +111 -2
  13. package/src/shared/scripts/skf-find-cycles.py +246 -0
  14. package/src/shared/scripts/skf-hash-content.py +487 -2
  15. package/src/shared/scripts/skf-manifest-ops.py +67 -1
  16. package/src/shared/scripts/skf-rebuild-managed-sections.py +180 -0
  17. package/src/shared/scripts/skf-recommend-scope-type.py +1 -2
  18. package/src/shared/scripts/skf-render-metadata-stats.py +499 -0
  19. package/src/shared/scripts/skf-rewrite-skill-name.py +308 -0
  20. package/src/shared/scripts/skf-shard-body.py +461 -0
  21. package/src/shared/scripts/skf-skill-inventory.py +139 -3
  22. package/src/shared/scripts/skf-structural-diff.py +307 -67
  23. package/src/shared/scripts/skf-validate-brief-schema.py +39 -1
  24. package/src/shared/scripts/skf-validate-feasibility-report.py +234 -0
  25. package/src/shared/scripts/skf-validate-frontmatter.py +17 -12
  26. package/src/shared/scripts/skf-validate-output.py +443 -10
  27. package/src/shared/scripts/skf-validate-pins.py +1 -1
  28. package/src/shared/scripts/skf-verify-no-trace.py +214 -0
  29. package/src/shared/scripts/skf-verify-provenance-completeness.py +439 -0
  30. package/src/skf-analyze-source/SKILL.md +17 -32
  31. package/src/skf-analyze-source/customize.toml +2 -0
  32. package/src/skf-analyze-source/references/auto-docs-only.md +116 -0
  33. package/src/skf-analyze-source/references/continue.md +8 -13
  34. package/src/skf-analyze-source/references/generate-briefs.md +28 -12
  35. package/src/skf-analyze-source/references/headless-contract.md +33 -0
  36. package/src/skf-analyze-source/references/health-check.md +1 -2
  37. package/src/skf-analyze-source/references/identify-units.md +25 -36
  38. package/src/skf-analyze-source/references/init.md +12 -25
  39. package/src/skf-analyze-source/references/map-and-detect.md +8 -20
  40. package/src/skf-analyze-source/references/recommend.md +4 -14
  41. package/src/skf-analyze-source/references/scan-project.md +3 -11
  42. package/src/skf-analyze-source/references/step-auto-scope.md +42 -180
  43. package/src/skf-analyze-source/references/unit-detection-heuristics.md +2 -2
  44. package/src/skf-audit-skill/SKILL.md +9 -6
  45. package/src/skf-audit-skill/customize.toml +2 -0
  46. package/src/skf-audit-skill/references/init.md +58 -32
  47. package/src/skf-audit-skill/references/re-index.md +15 -34
  48. package/src/skf-audit-skill/references/report.md +11 -58
  49. package/src/skf-audit-skill/references/semantic-diff.md +4 -22
  50. package/src/skf-audit-skill/references/severity-classify.md +53 -87
  51. package/src/skf-audit-skill/references/step-doc-drift.md +49 -19
  52. package/src/skf-audit-skill/references/structural-diff.md +43 -68
  53. package/src/skf-brief-skill/SKILL.md +7 -36
  54. package/src/skf-brief-skill/assets/scope-templates.md +1 -1
  55. package/src/skf-brief-skill/customize.toml +14 -0
  56. package/src/skf-brief-skill/references/analyze-target.md +6 -14
  57. package/src/skf-brief-skill/references/confirm-brief.md +2 -14
  58. package/src/skf-brief-skill/references/draft-checkpoint.md +8 -8
  59. package/src/skf-brief-skill/references/gather-intent.md +19 -22
  60. package/src/skf-brief-skill/references/headless-args.md +1 -1
  61. package/src/skf-brief-skill/references/health-check.md +1 -22
  62. package/src/skf-brief-skill/references/invocation-contract.md +37 -0
  63. package/src/skf-brief-skill/references/scope-definition.md +4 -14
  64. package/src/skf-brief-skill/references/step-auto-brief.md +1 -5
  65. package/src/skf-brief-skill/references/step-auto-validate.md +1 -5
  66. package/src/skf-brief-skill/references/version-resolution.md +1 -1
  67. package/src/skf-brief-skill/references/write-brief.md +17 -10
  68. package/src/skf-campaign/SKILL.md +15 -84
  69. package/src/skf-campaign/customize.toml +2 -0
  70. package/src/skf-campaign/manifest.yaml +4 -0
  71. package/src/skf-campaign/references/campaign-contracts.md +67 -0
  72. package/src/skf-campaign/references/campaign-directive-spec.md +14 -103
  73. package/src/skf-campaign/references/step-01-setup.md +4 -5
  74. package/src/skf-campaign/references/step-02-strategy.md +8 -3
  75. package/src/skf-campaign/references/step-03-pins.md +1 -1
  76. package/src/skf-campaign/references/step-04-provenance.md +1 -1
  77. package/src/skf-campaign/references/step-05-skill-loop.md +1 -1
  78. package/src/skf-campaign/references/step-06-batch.md +7 -6
  79. package/src/skf-campaign/references/step-11-maintenance.md +2 -2
  80. package/src/skf-campaign/references/step-resume.md +9 -8
  81. package/src/skf-campaign/scripts/campaign-deps.py +10 -1
  82. package/src/skf-campaign/scripts/campaign-render-batch.py +199 -0
  83. package/src/skf-campaign/scripts/campaign-status.py +162 -0
  84. package/src/skf-campaign/templates/campaign-brief-template.yaml +1 -1
  85. package/src/skf-create-skill/SKILL.md +14 -3
  86. package/src/skf-create-skill/assets/compile-assembly-rules.md +17 -38
  87. package/src/skf-create-skill/assets/skill-sections.md +9 -100
  88. package/src/skf-create-skill/assets/tessl-dismissal-rules.md +4 -13
  89. package/src/skf-create-skill/customize.toml +13 -0
  90. package/src/skf-create-skill/references/authoritative-files-protocol.md +7 -7
  91. package/src/skf-create-skill/references/compile.md +34 -47
  92. package/src/skf-create-skill/references/component-extraction.md +8 -35
  93. package/src/skf-create-skill/references/ecosystem-check.md +9 -25
  94. package/src/skf-create-skill/references/enrich.md +4 -17
  95. package/src/skf-create-skill/references/extract.md +14 -29
  96. package/src/skf-create-skill/references/extraction-patterns-tracing.md +1 -1
  97. package/src/skf-create-skill/references/extraction-patterns.md +7 -7
  98. package/src/skf-create-skill/references/generate-artifacts.md +9 -23
  99. package/src/skf-create-skill/references/health-check.md +1 -1
  100. package/src/skf-create-skill/references/load-brief.md +16 -18
  101. package/src/skf-create-skill/references/report.md +12 -15
  102. package/src/skf-create-skill/references/source-resolution-protocols.md +3 -3
  103. package/src/skf-create-skill/references/step-auto-shard.md +52 -25
  104. package/src/skf-create-skill/references/step-doc-rot.md +30 -12
  105. package/src/skf-create-skill/references/step-doc-sources.md +2 -2
  106. package/src/skf-create-skill/references/sub/ccc-discover.md +2 -13
  107. package/src/skf-create-skill/references/sub/fetch-docs.md +8 -50
  108. package/src/skf-create-skill/references/sub/fetch-temporal.md +5 -20
  109. package/src/skf-create-skill/references/tier-degradation-rules.md +6 -8
  110. package/src/skf-create-skill/references/validate.md +59 -28
  111. package/src/skf-create-skill/scripts/scan-doc-rot.py +245 -0
  112. package/src/skf-create-stack-skill/SKILL.md +15 -9
  113. package/src/skf-create-stack-skill/assets/provenance-map-schema.md +1 -1
  114. package/src/skf-create-stack-skill/customize.toml +10 -0
  115. package/src/skf-create-stack-skill/references/compile-stack.md +7 -8
  116. package/src/skf-create-stack-skill/references/compose-mode-rules.md +2 -13
  117. package/src/skf-create-stack-skill/references/detect-integrations.md +49 -54
  118. package/src/skf-create-stack-skill/references/detect-manifests.md +37 -30
  119. package/src/skf-create-stack-skill/references/generate-output.md +24 -75
  120. package/src/skf-create-stack-skill/references/init.md +9 -81
  121. package/src/skf-create-stack-skill/references/manifest-patterns.md +5 -35
  122. package/src/skf-create-stack-skill/references/parallel-extract.md +12 -27
  123. package/src/skf-create-stack-skill/references/rank-and-confirm.md +6 -6
  124. package/src/skf-create-stack-skill/references/report.md +27 -62
  125. package/src/skf-create-stack-skill/references/validate.md +35 -31
  126. package/src/skf-drop-skill/SKILL.md +20 -23
  127. package/src/skf-drop-skill/customize.toml +10 -0
  128. package/src/skf-drop-skill/references/execute.md +51 -31
  129. package/src/skf-drop-skill/references/headless-contract.md +18 -0
  130. package/src/skf-drop-skill/references/health-check.md +1 -13
  131. package/src/skf-drop-skill/references/report.md +42 -10
  132. package/src/skf-drop-skill/references/select.md +88 -48
  133. package/src/skf-drop-skill/scripts/dir-sizes.py +116 -0
  134. package/src/skf-export-skill/SKILL.md +17 -14
  135. package/src/skf-export-skill/assets/managed-section-format.md +2 -5
  136. package/src/skf-export-skill/customize.toml +10 -6
  137. package/src/skf-export-skill/references/generate-snippet.md +21 -35
  138. package/src/skf-export-skill/references/load-skill.md +44 -42
  139. package/src/skf-export-skill/references/multi-skill-mode.md +1 -1
  140. package/src/skf-export-skill/references/orphan-context-detection.md +11 -3
  141. package/src/skf-export-skill/references/package.md +27 -33
  142. package/src/skf-export-skill/references/preflight-snippet-root-probe.md +24 -5
  143. package/src/skf-export-skill/references/result-envelope.md +28 -0
  144. package/src/skf-export-skill/references/summary.md +11 -5
  145. package/src/skf-export-skill/references/token-report.md +42 -24
  146. package/src/skf-export-skill/references/update-context.md +32 -33
  147. package/src/skf-forger/SKILL.md +27 -39
  148. package/src/skf-forger/references/pipeline-mode.md +34 -0
  149. package/src/skf-forger/scripts/parse-pipeline.py +270 -0
  150. package/src/skf-quick-skill/SKILL.md +10 -60
  151. package/src/skf-quick-skill/customize.toml +9 -0
  152. package/src/skf-quick-skill/references/batch-mode.md +6 -4
  153. package/src/skf-quick-skill/references/compile.md +15 -52
  154. package/src/skf-quick-skill/references/ecosystem-check.md +5 -20
  155. package/src/skf-quick-skill/references/finalize.md +12 -6
  156. package/src/skf-quick-skill/references/halt-contract.md +54 -0
  157. package/src/skf-quick-skill/references/health-check.md +3 -4
  158. package/src/skf-quick-skill/references/quick-extract.md +7 -18
  159. package/src/skf-quick-skill/references/registry-resolution.md +1 -23
  160. package/src/skf-quick-skill/references/resolve-target.md +27 -34
  161. package/src/skf-quick-skill/references/write-and-validate.md +10 -25
  162. package/src/skf-refine-architecture/SKILL.md +14 -7
  163. package/src/skf-refine-architecture/customize.toml +9 -0
  164. package/src/skf-refine-architecture/references/compile.md +9 -7
  165. package/src/skf-refine-architecture/references/gap-analysis.md +21 -50
  166. package/src/skf-refine-architecture/references/health-check.md +1 -1
  167. package/src/skf-refine-architecture/references/improvements.md +9 -25
  168. package/src/skf-refine-architecture/references/init.md +9 -16
  169. package/src/skf-refine-architecture/references/issue-detection.md +10 -25
  170. package/src/skf-refine-architecture/references/refinement-rules.md +4 -16
  171. package/src/skf-refine-architecture/references/report.md +13 -10
  172. package/src/skf-rename-skill/SKILL.md +11 -21
  173. package/src/skf-rename-skill/customize.toml +10 -0
  174. package/src/skf-rename-skill/references/execute.md +107 -78
  175. package/src/skf-rename-skill/references/exit-codes.md +12 -0
  176. package/src/skf-rename-skill/references/report.md +16 -8
  177. package/src/skf-rename-skill/references/select.md +69 -42
  178. package/src/skf-rename-skill/scripts/skf-validate-rename-name.py +161 -0
  179. package/src/skf-setup/SKILL.md +20 -12
  180. package/src/skf-setup/customize.toml +10 -0
  181. package/src/skf-setup/references/auto-index.md +9 -10
  182. package/src/skf-setup/references/ccc-index.md +14 -15
  183. package/src/skf-setup/references/detect-and-tier.md +6 -8
  184. package/src/skf-setup/references/report.md +22 -31
  185. package/src/skf-setup/references/tier-rules.md +2 -32
  186. package/src/skf-setup/references/write-config.md +9 -10
  187. package/src/skf-test-skill/SKILL.md +10 -8
  188. package/src/skf-test-skill/customize.toml +2 -0
  189. package/src/skf-test-skill/references/coherence-check.md +19 -31
  190. package/src/skf-test-skill/references/coverage-check.md +109 -75
  191. package/src/skf-test-skill/references/detect-mode.md +10 -41
  192. package/src/skf-test-skill/references/external-validators.md +11 -19
  193. package/src/skf-test-skill/references/init.md +38 -20
  194. package/src/skf-test-skill/references/migration-section-rules.md +4 -4
  195. package/src/skf-test-skill/references/report.md +60 -40
  196. package/src/skf-test-skill/references/score.md +32 -64
  197. package/src/skf-test-skill/references/scoring-rules.md +6 -62
  198. package/src/skf-test-skill/references/source-access-protocol.md +6 -6
  199. package/src/skf-test-skill/references/step-hard-gate.md +1 -3
  200. package/src/skf-test-skill/scripts/aggregate-coherence.py +276 -0
  201. package/src/skf-test-skill/scripts/check-metadata-coherence.py +359 -0
  202. package/src/skf-test-skill/scripts/combine-external-scores.py +190 -0
  203. package/src/skf-test-skill/scripts/compute-score.py +131 -1
  204. package/src/skf-test-skill/scripts/reconcile-coverage.py +327 -0
  205. package/src/skf-test-skill/scripts/validate-inventory.py +251 -0
  206. package/src/skf-test-skill/scripts/verify-declared-numerator.py +192 -0
  207. package/src/skf-update-skill/SKILL.md +17 -5
  208. package/src/skf-update-skill/customize.toml +14 -0
  209. package/src/skf-update-skill/references/detect-changes.md +19 -37
  210. package/src/skf-update-skill/references/health-check.md +3 -9
  211. package/src/skf-update-skill/references/init.md +39 -32
  212. package/src/skf-update-skill/references/manual-section-rules.md +1 -2
  213. package/src/skf-update-skill/references/merge-conflict-rules.md +1 -52
  214. package/src/skf-update-skill/references/merge.md +13 -57
  215. package/src/skf-update-skill/references/re-extract.md +12 -24
  216. package/src/skf-update-skill/references/report.md +14 -7
  217. package/src/skf-update-skill/references/validate.md +32 -30
  218. package/src/skf-update-skill/references/write.md +86 -51
  219. package/src/skf-update-skill/scripts/skf-new-file-diff.py +167 -0
  220. package/src/skf-verify-stack/SKILL.md +11 -21
  221. package/src/skf-verify-stack/customize.toml +12 -3
  222. package/src/skf-verify-stack/references/coverage-patterns.md +1 -29
  223. package/src/skf-verify-stack/references/coverage.md +21 -10
  224. package/src/skf-verify-stack/references/exit-codes.md +14 -0
  225. package/src/skf-verify-stack/references/health-check.md +1 -1
  226. package/src/skf-verify-stack/references/init.md +20 -25
  227. package/src/skf-verify-stack/references/integration-verification-rules.md +10 -19
  228. package/src/skf-verify-stack/references/integrations.md +44 -49
  229. package/src/skf-verify-stack/references/report.md +28 -34
  230. package/src/skf-verify-stack/references/requirements.md +3 -3
  231. package/src/skf-verify-stack/references/synthesize.md +36 -39
  232. package/src/skf-verify-stack/scripts/skf-coverage-tally.py +196 -0
  233. package/src/skf-verify-stack/scripts/skf-report-delta.py +256 -0
  234. package/src/skf-verify-stack/scripts/skf-verdict-rollup.py +258 -0
  235. package/src/skf-rename-skill/references/rebuild-context.md +0 -110
@@ -27,74 +27,12 @@ Before anything else, load `{project-root}/_bmad/skf/config.yaml`. If the file i
27
27
 
28
28
  **Halting workflow.**"
29
29
 
30
- STOP — do not proceed.
30
+ Then emit the result envelope on stderr per the Result Contract in SKILL.md (`project_name` is unresolved here, so `skill_name` is `null`), and STOP — do not proceed:
31
31
 
32
- ### 0b. Resume Check
33
-
34
- Before any further init work, check for an interrupted prior run.
35
-
36
- **Probe path.** Resolve `{resume_skill_name}` as `{project_name}-stack` (the same skill name used at step 7) and probe `{forge_data_folder}/{resume_skill_name}/in-progress.json`. (The file lives at the version-agnostic skill root so it can be found before `{version}` resolution.)
37
-
38
- **If no in-progress.json exists:** Continue to §1.
39
-
40
- **If in-progress.json exists:** Load and parse it. Read `last_completed_step` and `started_at` (ISO-8601 timestamp). Surface a soft gate:
41
-
42
- "**Resume previous run?**
43
-
44
- Found a previous in-progress run at `{forge_data_folder}/{resume_skill_name}/in-progress.json` from {started_at}, last completed at step {last_completed_step}.
45
-
46
- - **[C] Continue** (recommended) — resume from the next step after {last_completed_step}, restoring saved workflow state.
47
- - **[F] Fresh** — archive the existing in-progress.json (rename to `in-progress.{timestamp}.json`) and start over from step 1.
48
- - **[X] Cancel and exit** — leave the in-progress.json untouched and halt.
49
-
50
- Select [C/F/X]:"
51
-
52
- **Headless default:** `[C]` Continue.
53
-
54
- **On [C] Continue:**
55
- 1. Restore workflow context from in-progress.json fields: `last_completed_step`, `workflow_state` (mode, tier, scope), and any accumulator fields (partial extractions, ranked libraries, integration pairs, compile-stack output) that the writing step persisted.
56
- 2. Determine the resume target: the step file that runs immediately after `last_completed_step`.
57
- 3. Jump directly to that step file by loading and executing it (skip the remaining §0b–§5 init substeps for this run).
58
-
59
- **On [F] Fresh:**
60
- 1. Compute `{archive_timestamp}` as the current UTC time in `YYYYMMDDTHHMMSSZ` form.
61
- 2. Rename `{forge_data_folder}/{resume_skill_name}/in-progress.json` → `{forge_data_folder}/{resume_skill_name}/in-progress.{archive_timestamp}.json`.
62
- 3. Continue with §1 of this file as if no prior run existed.
63
-
64
- **On [X] Cancel and exit:** HARD HALT with exit code 6 (user-cancelled). Do NOT modify the in-progress.json. Emit the result envelope on stderr per the Result Contract in SKILL.md:
65
-
66
- ```
67
- SKF_STACK_RESULT_JSON: {"status":"error","skill_package":null,"skill_name":"{resume_skill_name}","stack_libraries":[],"mode":null,"exit_code":6,"halt_reason":"user-cancelled"}
68
32
  ```
69
-
70
- **in-progress.json schema (read side).** This PR wires only the READ side of the resume protocol. The WRITE side — each stage step persisting an updated in-progress.json after it completes — is deferred to a follow-up PR. When write-side wiring lands, each step writes the file via `skf-atomic-write.py write` at the end of its mandatory sequence with this shape:
71
-
72
- ```json
73
- {
74
- "schema_version": "1.0",
75
- "skill_name": "{project_name}-stack",
76
- "started_at": "{ISO-8601 of step 1 start}",
77
- "updated_at": "{ISO-8601 of most recent step completion}",
78
- "last_completed_step": "step-NN",
79
- "workflow_state": {
80
- "mode": "code|compose",
81
- "forge_tier": "Quick|Forge|Forge+|Deep",
82
- "headless_mode": false,
83
- "scope": {"explicit_deps": [], "scope_overrides": {}, "architecture_doc_path": null}
84
- },
85
- "accumulators": {
86
- "manifests": [],
87
- "ranked_libraries": [],
88
- "extractions": {},
89
- "integration_pairs": [],
90
- "compiled_stack": null,
91
- "workflow_warnings": []
92
- }
93
- }
33
+ SKF_STACK_RESULT_JSON: {"status":"error","skill_package":null,"skill_name":null,"stack_libraries":[],"mode":null,"exit_code":2,"halt_reason":"config-missing"}
94
34
  ```
95
35
 
96
- Until the write side is wired, in-progress.json will not naturally appear and §0b will fall through to §1 on every run. The resume gate is a no-op until that follow-up lands.
97
-
98
36
  ### 1. Load Forge Tier Configuration
99
37
 
100
38
  Load `{forgeTierFile}` from the Ferris sidecar.
@@ -107,7 +45,11 @@ Load `{forgeTierFile}` from the Ferris sidecar.
107
45
 
108
46
  **Halting workflow.**"
109
47
 
110
- STOP — do not proceed.
48
+ Then emit the result envelope on stderr per the Result Contract in SKILL.md (config loaded, so `skill_name` is known; `mode` is not yet resolved), and STOP — do not proceed:
49
+
50
+ ```
51
+ SKF_STACK_RESULT_JSON: {"status":"error","skill_package":null,"skill_name":"{project_name}-stack","stack_libraries":[],"mode":null,"exit_code":3,"halt_reason":"forge-tier-missing"}
52
+ ```
111
53
 
112
54
  **If forge-tier.yaml exists:**
113
55
 
@@ -156,6 +98,7 @@ Skills use version-nested directories — see `knowledge/version-paths.md` for t
156
98
  - If user provides an architecture document path for composition or explicitly requests compose mode → set `compose_mode: true` and store `architecture_doc_path`
157
99
  - If no manifest files exist in project root AND at least one skill is discoverable in `{skills_output_folder}` → suggest compose mode to the user and ask for optional architecture document path
158
100
  - **Skill discovery (version-aware):** First, read `{skills_output_folder}/.export-manifest.json` — each entry in `exports` names a skill with an `active_version`, which resolves to `{skills_output_folder}/{skill-name}/{active_version}/{skill-name}/` containing `SKILL.md` and `metadata.json`. If the export manifest does not exist or is empty, fall back to scanning for `active` symlinks: check `{skills_output_folder}/*/active/*/SKILL.md` — each match indicates a skill whose package lives at `{skills_output_folder}/{skill-name}/active/{skill-name}/` (the `{active_skill}` template).
101
+ - **Headless default (B8):** If `{headless_mode}` is true, do NOT prompt — auto-accept the suggestion: set `compose_mode: true` and `architecture_doc_path: null` (unless an architecture doc path was supplied via the optional inputs above). This is the constructive default: with no manifests present, code-mode would only halt at step 2 (`no-manifests`), so compose is the sole path that produces output. Log the auto-decision by appending to `workflow_warnings[]`: `{step: "step-01", severity: "info", code: "headless-compose-autodetect", message: "no manifests + {N} discoverable skills — auto-selected compose mode", context: {discoverable_skills: {N}}}`.
159
102
  - If user accepts → set `compose_mode: true` and store `architecture_doc_path` (may be `null` if user chose not to provide one)
160
103
  - If user declines → `compose_mode` remains `false`, continue with code-mode
161
104
 
@@ -166,22 +109,7 @@ If no optional inputs provided, auto-detection will be used.
166
109
 
167
110
  ### 4. Display Initialization Summary
168
111
 
169
- "**Stack Skill Forge initialized.**
170
-
171
- **Project:** {project_name}
172
- **Forge Tier:** {forge_tier} — {tier_description}
173
-
174
- Where tier_description follows positive capability framing:
175
- - Quick: "Source reading and import counting"
176
- - Forge: "AST-backed structural analysis"
177
- - Forge+: "AST structural + CCC semantic co-import augmentation"
178
- - Deep: "Full intelligence — structural + contextual + temporal"
179
-
180
- **Available Tools:** {tool_list}
181
- **Input Mode:** {auto-detect | explicit dependency list | compose mode}
182
-
183
- **If compose mode:** Proceeding to skill loading...
184
- **If code mode:** Proceeding to manifest detection..."
112
+ Report that the Stack Skill Forge is initialized, naming: the project (`{project_name}`); the forge tier (`{forge_tier}`) with its positive-capability framing (Quick = source reading and import counting; Forge = AST-backed structural analysis; Forge+ = AST structural + CCC semantic co-import augmentation; Deep = full intelligence — structural + contextual + temporal); the available tools (`{tool_list}`); and the resolved input mode (auto-detect, explicit dependency list, or compose mode).
185
113
 
186
114
  ### 5. Auto-Proceed to Next Step
187
115
 
@@ -15,41 +15,11 @@
15
15
  | PHP | composer.json | require, require-dev | `use ...`, `require_once` |
16
16
  | .NET | *.csproj | PackageReference | `using ...` |
17
17
 
18
- ## Detection Priority
19
-
20
- 1. Search project root for manifest files (depth 0-1)
21
- 2. Parse each found manifest to extract dependency names
22
- 3. Normalize names across ecosystems (e.g., `@scope/package` `package`)
23
- 4. Deduplicate across multiple manifests
24
-
25
- ## Scan Exclusion Patterns
26
-
27
- When scanning for manifest files, ALWAYS exclude these directories from glob results:
28
-
29
- **Dependency/Vendor Directories:**
30
- - `node_modules/`
31
- - `.venv/` / `venv/` / `.env/`
32
- - `vendor/` (PHP Composer, Go modules)
33
- - `Pods/` (iOS CocoaPods)
34
-
35
- **Build Output Directories:**
36
- - `dist/` / `build/` / `out/`
37
- - `target/` (Rust, Java/Maven)
38
- - `__pycache__/`
39
- - `.next/` / `.nuxt/` / `.output/`
40
-
41
- **Hidden and VCS Directories:**
42
- - `.git/`
43
- - Any directory starting with `.` (except project root hidden config files like `.csproj`)
44
-
45
- **Monorepo Note:** For monorepo structures (e.g., `packages/*/package.json`), the depth 0-1 scan rule already limits scope. If monorepo manifest detection is needed at deeper levels, these exclusions become critical to prevent scanning dependency trees within each package.
46
-
47
- ## Filtering Rules
48
-
49
- - Exclude dev-only dependencies unless they appear in production imports
50
- - Exclude build tools (webpack, babel, eslint, etc.) unless significantly imported
51
- - Include all runtime dependencies by default
52
- - Flag transitive dependencies that appear in direct imports
18
+ <!-- Manifest scanning, name normalization, dedup, exclusion-dir filtering, and
19
+ dev/build-tool filtering are performed by `skf-scan-manifests.py` (invoked in
20
+ detect-manifests.md §2), which implements exactly the ecosystem table above.
21
+ This file is loaded only for that reference table and the import-counting
22
+ exclusions below see the script's `--help` for the operative scan contract. -->
53
23
 
54
24
  ## Import Counting
55
25
 
@@ -60,7 +60,11 @@ The script emits JSON of the form:
60
60
  }
61
61
  ```
62
62
 
63
- Cache this result as `stack_skill_inventory` in workflow state — the per-skill subagent fan-out at §1+ MUST read from this cache rather than re-reading each skill's `SKILL.md` / `metadata.json` / `references/` to determine exports. Append every entry in `warnings[]` to workflow state for the evidence report (the script already labels them per-skill, e.g. `"<skill-name>: no exports found via any resolution path"`). For every entry in `cycles[]`, halt with a structured-error contract on stderra composes-cycle makes the stack unbuildable.
63
+ Cache this result as `stack_skill_inventory` in workflow state — the per-skill subagent fan-out at §1+ MUST read from this cache rather than re-reading each skill's `SKILL.md` / `metadata.json` / `references/` to determine exports. Append every entry in `warnings[]` to workflow state for the evidence report (the script already labels them per-skill, e.g. `"<skill-name>: no exports found via any resolution path"`). If `cycles[]` is non-empty, a composes-cycle makes the stack unbuildable emit the result envelope on stderr per the Result Contract in SKILL.md and exit `3`:
64
+
65
+ ```
66
+ SKF_STACK_RESULT_JSON: {"status":"error","skill_package":null,"skill_name":"{project_name}-stack","stack_libraries":[],"mode":"compose","exit_code":3,"halt_reason":"resolution-failure"}
67
+ ```
64
68
 
65
69
  Build a `per_library_extractions[]` entry for each skill by reading from the cached inventory:
66
70
  - `library`: `inventory.skills[i].name`
@@ -70,15 +74,7 @@ Build a `per_library_extractions[]` entry for each skill by reading from the cac
70
74
  - `metadata_hash`: `inventory.skills[i].metadata_hash` — record for step 7 provenance (null when exports came from references/ or SKILL.md prose).
71
75
  - `usage_patterns`: populated by the §1+ per-skill subagent fan-out, NOT by this script. The script provides the inventory + exports; the subagent does the per-skill usage analysis. They're complementary.
72
76
 
73
- Display an extraction summary:
74
-
75
- "**Loaded {N} skill extractions from existing skills.**
76
-
77
- | Skill | Exports | Confidence | Status |
78
- |-------|---------|------------|--------|
79
- | {name} | {count} | {tier} | Loaded |"
80
-
81
- Auto-proceed to next step.
77
+ Report the loaded extractions — for each skill: export count, confidence tier, and load status. Then auto-proceed to the next step.
82
78
 
83
79
  **If not compose_mode:** Continue with section 1 (existing flow).
84
80
 
@@ -177,26 +173,15 @@ For each library extraction:
177
173
  **If ALL extractions fail:** HALT — cannot produce meaningful stack skill. Before halting (B7):
178
174
 
179
175
  1. Purge any in-flight staging artifacts under the forge workspace: remove `{forge_data_folder}/{project_name}-stack/{version}/*-tmp` and any `{forge_data_folder}/{project_name}-stack/{version}/*.skf-tmp` directories so partial state does not linger.
180
- 2. Emit a structured error contract on stderr: `{"status":"error","skill":"skf-create-stack-skill","stage":"step 4","reason":"all extractions failed","libraries":[...]}`.
181
- 3. Exit with a non-zero status so headless pipelines detect the failure.
182
-
183
- ### 4. Display Extraction Summary
176
+ 2. Emit the result envelope on stderr per the Result Contract in SKILL.md (`stack_libraries` carries the confirmed library names that failed extraction), and exit `2`:
184
177
 
185
- "**Library extraction complete.**
178
+ ```
179
+ SKF_STACK_RESULT_JSON: {"status":"error","skill_package":null,"skill_name":"{project_name}-stack","stack_libraries":["<confirmed-lib>", "..."],"mode":"{code|compose}","exit_code":2,"halt_reason":"all-extractions-failed"}
180
+ ```
186
181
 
187
- | Library | Exports | Patterns | Confidence | Status |
188
- |---------|---------|----------|------------|--------|
189
- | {name} | {count} | {count} | {tier} | ✓ |
190
- | {name} | {count} | {count} | {tier} | ✓ |
191
- | {name} | — | — | — | ⚠ partial |
192
-
193
- **Results:** {success_count}/{total_count} libraries extracted
194
- **Confidence distribution:** T1: {count}, T1-low: {count}, T2: {count}
195
- {If Deep tier:} **T2 enrichment:** {enriched_count}/{total_count} libraries had temporal collections available
196
- {If libraries without temporal > 0:} **Tip:** Run [CS] Create Skill at Deep tier for individual libraries to generate temporal collections, then re-run [SS] for full T2 enrichment.
197
- {If warnings:} **Warnings:** {warning_count} issues noted
182
+ ### 4. Display Extraction Summary
198
183
 
199
- **Proceeding to integration detection...**"
184
+ Report the extraction results: per library the export count, pattern count, confidence tier, and success/partial status; the overall `{success_count}/{total_count}` extracted; and the T1 / T1-low / T2 confidence distribution. At Deep tier, add the T2-enrichment count (`{enriched_count}/{total_count}` libraries with temporal collections available); and if any library lacked a temporal collection, add the tip: run **[CS] Create Skill** at Deep tier for those libraries to generate temporal collections, then re-run **[SS]** for full T2 enrichment. Note any warning count.
200
185
 
201
186
  ### 5. Auto-Proceed to Next Step
202
187
 
@@ -56,7 +56,7 @@ Use ecosystem-appropriate import patterns:
56
56
  - Python: `import library`, `from library import`
57
57
  - Rust: `use library::`, `extern crate library`
58
58
  - Go: `"library"` in import blocks
59
- - (Match patterns from manifest-patterns.md)
59
+ - (Match patterns from `{manifestPatternsPath}`)
60
60
 
61
61
  **Subprocess returns:** `{library_name: import_count, files: [file_paths]}` for each dependency.
62
62
 
@@ -112,13 +112,13 @@ Apply additions/exclusions, display updated list, and ask for final confirmation
112
112
  **If custom list provided:**
113
113
  Use the custom list as `confirmed_dependencies`.
114
114
 
115
- Display final confirmation:
115
+ Display the resolved scope:
116
116
 
117
117
  "**Scope confirmed:** {count} libraries selected for stack skill extraction.
118
118
 
119
- {List confirmed libraries}
119
+ {List confirmed libraries}"
120
120
 
121
- **Proceeding to parallel extraction...**"
121
+ The extraction itself begins only once the user clears the gate below.
122
122
 
123
123
  ### 5. Present MENU OPTIONS
124
124
 
@@ -126,9 +126,9 @@ Display: **Select:** [C] Continue to Extraction | [X] Cancel and exit
126
126
 
127
127
  #### EXECUTION RULES:
128
128
 
129
- - ALWAYS halt and wait for user input after presenting scope
129
+ - This is a confirmation gate — advancing without the user's `C` would extract and ship a stack scope they never approved. Halt and wait for input after presenting scope.
130
130
  - **GATE [default: C]** — If `{headless_mode}`: auto-proceed with [C] Continue (accept all ranked libraries), log: "headless: auto-confirm library scope"
131
- - ONLY proceed to next step when user confirms scope and selects 'C'
131
+ - Proceed to the next step only once the user confirms scope by selecting `C`.
132
132
 
133
133
  #### Menu Handling Logic:
134
134
 
@@ -25,68 +25,17 @@ Display the final summary of the forged stack skill with confidence distribution
25
25
 
26
26
  ## MANDATORY SEQUENCE
27
27
 
28
- ### 1. Display Stack Forged Banner
28
+ ### 1. Report the Forge Result
29
29
 
30
- "**Stack forged: {project_name}-stack {lib_count} libraries, {integration_count} integration patterns**
30
+ Surface the forge result to the console, leading with the win:
31
31
 
32
- Forge tier: **{tier}**"
32
+ - **Headline:** stack `{project_name}-stack` — `{lib_count}` libraries, `{integration_count}` integration patterns, forge tier `{tier}`.
33
+ - **Confidence distribution:** the T1 / T1-low / T2 counts (T1 = AST-verified structural extraction, T1-low = source-reading inference, T2 = QMD-enriched temporal context). **In compose-mode**, note the tiers are inherited from the source skills — they reflect the extraction method used when those skills were originally generated, not the current compose run.
34
+ - **Output files:** the `{skill_package}` deliverables (SKILL.md, context-snippet.md with `{token_estimate}` tokens, metadata.json, `references/` per-library files, and `references/integrations/` pair files when integrations exist), the `{forge_version}` workspace (provenance-map.json, evidence-report.md), and the `{skill_group}/active -> {version}` symlink.
35
+ - **Validation:** all checks passed, or `{warning_count}` finding(s) each with its description.
36
+ - **Warnings — only if `workflow_warnings[]` is non-empty:** the accumulated entries rendered as `[{step}/{severity}] {code}: {message}`. `workflow_warnings[]` (defined in SKILL.md's *Workflow state contract*) is the single sink surfacing every warning pushed during the run; if it is empty, omit this section.
33
37
 
34
- ### 2. Display Confidence Distribution
35
-
36
- "**Confidence distribution:**
37
-
38
- | Tier | Count | Description |
39
- |------|-------|-------------|
40
- | T1 | {count} | AST-verified structural extraction |
41
- | T1-low | {count} | Source reading inference |
42
- | T2 | {count} | QMD-enriched temporal context |
43
-
44
- {IF compose_mode:}
45
- *Note: Confidence tiers above are inherited from source skills — they reflect the extraction method used when those skills were originally generated, not the current compose run.*
46
- {END IF}"
47
-
48
- ### 3. Display Output File Summary
49
-
50
- "**Output files:**
51
-
52
- **Deliverables** (`{skill_package}`):
53
- - SKILL.md — Integration patterns, library summaries, conventions
54
- - context-snippet.md — Compressed stack index ({token_estimate} tokens)
55
- - metadata.json — Skill metadata and library registry
56
- - references/ — {lib_count} per-library reference files
57
- {If integrations:} - references/integrations/ — {pair_count} integration pair files
58
-
59
- **Workspace** (`{forge_version}`):
60
- - provenance-map.json — Extraction source tracking
61
- - evidence-report.md — Evidence and confidence breakdown
62
-
63
- **Symlink:** `{skill_group}/active` -> `{version}`"
64
-
65
- ### 4. Display Validation Summary
66
-
67
- **If validation passed with no findings:**
68
-
69
- "**Validation:** All checks passed"
70
-
71
- **If validation had findings:**
72
-
73
- "**Validation:** {warning_count} warning(s) found
74
- {For each finding:}
75
- - ⚠ {description}"
76
-
77
- ### 5. Display Warnings (Conditional)
78
-
79
- Read from the `workflow_warnings[]` accumulator defined in the Workflow Rules of `SKILL.md` (M4). Every step that emitted a warning during this run pushed a structured entry there — this section is the single sink that surfaces them.
80
-
81
- **Only display if `workflow_warnings[]` is non-empty:**
82
-
83
- "**Warnings:**
84
- {For each entry in workflow_warnings[]:}
85
- - [{step}/{severity}] {code}: {message}"
86
-
87
- **If `workflow_warnings[]` is empty:** Skip this section entirely.
88
-
89
- ### 6. Recommend Next Workflows
38
+ ### 2. Recommend Next Workflows
90
39
 
91
40
  "**Next steps:**
92
41
  - **[TS] test-skill** — Validate the stack skill against its own assertions
@@ -94,7 +43,7 @@ Read from the `workflow_warnings[]` accumulator defined in the Workflow Rules of
94
43
 
95
44
  - **[VS] verify-stack** — Validate the stack's integration feasibility against your architecture document{IF compose_mode:} (re-run to confirm feasibility after any architecture changes from **[RA] refine-architecture**){END IF}"
96
45
 
97
- ### 6b. Result Contract
46
+ ### 2b. Result Contract
98
47
 
99
48
  Write the result contract per `shared/references/output-contract-schema.md` using the shared atomic writer. Two artifacts — both written via `skf-atomic-write.py write`:
100
49
 
@@ -122,7 +71,23 @@ Include `SKILL.md`, `context-snippet.md`, and `metadata.json` paths in `outputs`
122
71
 
123
72
  If either atomic write fails, log the error, leave any prior `-latest.json` untouched, and continue — the report is advisory and should not block the health-check chain.
124
73
 
125
- ### 7. Chain to Health Check
74
+ **Headless success envelope.** When `{headless_mode}` is true, emit the single-line result envelope on **stdout** (the success counterpart to the error envelopes every HARD HALT emits on stderr) before chaining to step 10. `skill_package` is the absolute path to the committed package; `stack_libraries` is the included library names:
75
+
76
+ ```
77
+ SKF_STACK_RESULT_JSON: {"status":"success","skill_package":"{skill_package}","skill_name":"{project_name}-stack","stack_libraries":["<lib>", "..."],"mode":"{code|compose}","exit_code":0,"halt_reason":null}
78
+ ```
79
+
80
+ ### 2c. Post-Completion Hook (optional)
81
+
82
+ If `{onCompleteCommand}` (resolved at SKILL.md On Activation §3 from `workflow.on_complete`) is non-empty, invoke it now — after the result contract (§2b) is written, before chaining to health-check:
83
+
84
+ ```bash
85
+ {onCompleteCommand}
86
+ ```
87
+
88
+ Run it with a bounded timeout (default 60s). On success, continue. On non-zero exit, timeout, or any failure, append the reason to `workflow_warnings[]` (e.g. `on_complete — failed (exit {N}): {stderr_first_line}`) and continue. **The hook must never fail the workflow** — it is integration glue (catalog registration, downstream pipeline notify) orthogonal to the forged stack. When `{onCompleteCommand}` is empty (bundled default), skip this section entirely.
89
+
90
+ ### 3. Chain to Health Check
126
91
 
127
- ONLY WHEN the forge banner, confidence distribution, output file summary, validation summary, warnings (if any), next-workflow recommendations, and result contract have all been handled will you then load, read the full file, and execute `{nextStepFile}`. The health-check step is the true terminal step — do not stop here even though the report reads as final.
92
+ After the report sections above are handled, load, read the full file, and execute `{nextStepFile}`. The health-check step is the true terminal step — do not stop here even though the report reads as final.
128
93
 
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  nextStepFile: 'report.md'
3
- stackSkillTemplate: 'assets/stack-skill-template.md'
3
+ outputValidatorProbeOrder:
4
+ - '{project-root}/_bmad/skf/shared/scripts/skf-validate-output.py'
5
+ - '{project-root}/src/shared/scripts/skf-validate-output.py'
4
6
  ---
5
7
 
6
8
  <!-- Config: communicate in {communication_language}. Artifact text in {document_output_language}. -->
@@ -20,12 +22,25 @@ Validate all written output files against their expected structure and verify co
20
22
 
21
23
  ### 1. Verify File Existence
22
24
 
23
- Check that all expected files exist from written_files[]:
25
+ Run the shared deterministic output validator once against the committed package — it checks the three core deliverable files' existence, SKILL.md frontmatter, and context-snippet format/token in a single call, so this step consumes its JSON rather than re-deriving those by hand. Resolve `{outputValidator}` from `{outputValidatorProbeOrder}` (first existing path wins). If neither candidate exists, log a WARNING (`"output validator unavailable — skf-validate-output.py missing"`) and fall back to the manual file/frontmatter/snippet checks below.
26
+
27
+ ```bash
28
+ python3 {outputValidator} {skill_package} --generated-by create-stack-skill --skill-type stack
29
+ ```
30
+
31
+ Consume from its JSON:
32
+
33
+ - `files_found` — existence of `SKILL.md` / `context-snippet.md` / `metadata.json` (the three core deliverable rows below).
34
+ - `validation.skill_md.frontmatter` — feeds the frontmatter check in §3 (manual-fallback path).
35
+ - `validation.context_snippet.issues` — feeds §8.
36
+ - `validation.stack_counts` — the stack count-equalities, derived deterministically from disk + metadata by the `--skill-type stack` pass: `issues[]` (each `{severity, field, message}`, one per mismatch of `library_count` / `integration_count` / `confidence_distribution`; empty when all agree) and `observed` (`library_count_meta`, `ref_file_count`, `integration_count_meta`, `pair_file_count`, `confidence_sum`). Feeds the count rows in §5 and the confidence-sum row in §7 — do not re-count files or re-sum the distribution by hand.
37
+
38
+ **Under `--skill-type stack`, `validation.skill_md.body` and `validation.metadata` are emitted as `{"skipped": ...}` markers** — the *individual-skill* schema (which looks for `## Overview` / `Description` / `Key Exports` / `Usage` sections and a `source_repo` field) does not apply to a stack package, so the validator skips those passes and runs `validation.stack_counts` instead. Stack-shaped body structure and the remaining (non-count) metadata fields are checked in §4 / §5.
39
+
40
+ Then confirm the remaining files the validator does not cover:
24
41
 
25
42
  **Deliverables** (`{skill_package}`):
26
- - [ ] SKILL.md
27
- - [ ] context-snippet.md
28
- - [ ] metadata.json
43
+ - [ ] SKILL.md · context-snippet.md · metadata.json — from `files_found` above
29
44
  - [ ] references/ directory with per-library files
30
45
  - [ ] references/integrations/ directory with pair files (if integrations detected)
31
46
 
@@ -36,7 +51,7 @@ Check that all expected files exist from written_files[]:
36
51
  **Symlink:**
37
52
  - [ ] `{skill_group}/active` exists and resolves to `{version}`
38
53
 
39
- Record any missing files as **ERROR** findings.
54
+ Record any missing files (from `files_found` or the manual rows) as **ERROR** findings.
40
55
 
41
56
  ### 2. Check Tool Availability
42
57
 
@@ -57,21 +72,15 @@ timeout 10s npx --no-install skill-check -h
57
72
 
58
73
  This validates frontmatter, description, body limits, links, formatting — and auto-fixes deterministic issues. Parse JSON for `scores[].score` (match the entry by `relativePath`/`skillId`; falls back to a top-level `qualityScore` on older skill-check builds), `diagnostics[]`, `fixed[]`.
59
74
 
60
- **Post-fix provenance drift guard (S15):** If `fixed[]` is non-empty, `skill-check --fix` has modified `SKILL.md` after step 7 wrote it. The safe default for v1.0 is to emit a **WARNING** finding listing each auto-fix (`"skill-check --fix modified SKILL.md: {fix_description} — metadata.json hashes/provenance may be out of date"`). Do NOT silently accept the fixes without surfacing the drift. If the caller wants authoritative metadata, they should re-run the workflow.
75
+ **Post-fix provenance drift guard (S15):** If `fixed[]` is non-empty, `skill-check --fix` has modified `SKILL.md` after step 7 wrote it — so the `metadata.json` hashes/provenance recorded against the pre-fix body may now be stale. Emit a **WARNING** finding listing each auto-fix (`"skill-check --fix modified SKILL.md: {fix_description} — metadata.json hashes/provenance may be out of date"`) rather than silently accepting the fixes, so the drift is surfaced. If the caller wants authoritative metadata, they should re-run the workflow.
61
76
 
62
- **If `body.max_lines` reported**, prefer selective split: extract only the largest Tier 2 section(s) to `references/`, keeping Tier 1 content inline (inline passive context achieves 100% task accuracy vs 79% for on-demand retrieval). For a stack capstone the canonical split is the catalog (`Library Reference Index` + `Per-Library Summaries`) → `references/stack-catalog.md`, leaving an inline pointer (see `{stackSkillTemplate}` "Sizing Guidance"). This is the **intended** large-stack layout, not a violation: §4 below accepts the pointer form, so clearing the skill-check body ERROR this way does not also trip the structure check. Fall back to `npx skill-check split-body <skill-dir> --write` if not feasible. Verify any in-SKILL.md anchor links (e.g. to the catalog/pointer or other moved sections) still resolve after the split. Then re-validate.
77
+ **If `body.max_lines` reported**, prefer selective split: extract only the largest Tier 2 section(s) to `references/`, keeping Tier 1 content inline (inline passive context achieves 100% task accuracy vs 79% for on-demand retrieval). For a stack capstone the canonical split is the catalog (`Library Reference Index` + `Per-Library Summaries`) → `references/stack-catalog.md`, leaving an inline pointer (see `{stackSkillTemplatePath}` "Sizing Guidance"). This is the **intended** large-stack layout, not a violation: §4 below accepts the pointer form, so clearing the skill-check body ERROR this way does not also trip the structure check. Fall back to `npx skill-check split-body <skill-dir> --write` if not feasible. Verify any in-SKILL.md anchor links (e.g. to the catalog/pointer or other moved sections) still resolve after the split. Then re-validate.
63
78
 
64
- **If unavailable**, perform manual frontmatter check:
65
- - [ ] Frontmatter present with `---` delimiters
66
- - [ ] `name` — present, non-empty, lowercase alphanumeric + hyphens, 1-64 chars, matches `{project_name}-stack`
67
- - [ ] `description` — present, non-empty, 1-1024 characters
68
- - [ ] No unknown fields — only `name`, `description`, `license`, `compatibility`, `metadata`, `allowed-tools` permitted
69
-
70
- Record frontmatter violations as **WARNING** findings. Invalid frontmatter will fail `npx skills add` and `npx skill-check check`.
79
+ **If unavailable**, do not hand-walk the frontmatter — use `validation.skill_md.frontmatter` from the §1 output-validator run, which checks delimiters, `name` format + directory match (`{project_name}-stack`), `description` presence/length, and unknown fields against the agentskills.io allow-set. Record each reported issue at its severity as a **WARNING** finding. (If the output validator was *also* unavailable in §1, fall back to the manual checklist: `---` delimiters; `name` lowercase-alphanumeric-plus-hyphens 1-64 chars matching `{project_name}-stack`; `description` present and 1-1024 chars; only `name`/`description`/`license`/`compatibility`/`metadata`/`allowed-tools` permitted.) Invalid frontmatter will fail `npx skills add` and `npx skill-check check`.
71
80
 
72
81
  ### 4. Validate SKILL.md Body Structure
73
82
 
74
- Load `{stackSkillTemplate}` and verify SKILL.md contains expected sections:
83
+ Load `{stackSkillTemplatePath}` and verify SKILL.md contains expected sections:
75
84
 
76
85
  - [ ] Header with project name, library count, integration count, forge tier
77
86
  - [ ] Integration Patterns section (before per-library summaries)
@@ -93,11 +102,12 @@ Parse metadata.json and verify required fields:
93
102
  - [ ] `version` and `generation_date` present
94
103
  - [ ] `forge_tier` is present and matches the forge tier from step 01 (`Quick|Forge|Forge+|Deep`)
95
104
  - [ ] `confidence_tier` is present and is exactly one of `T1|T1-low|T2|T3` — the dominant T-code computed from `confidence_distribution` (pick the tier with the highest count; ties resolve to the weaker tier: T1-low > T1, T2 > T1-low, T3 > T2 for tie-break so the reported tier never overstates confidence)
96
- - [ ] `library_count` matches actual reference files; `integration_count` matches pair files
97
105
  - [ ] `libraries` array present and non-empty
98
106
  - [ ] `confidence_distribution` object present with `t1`, `t1_low`, `t2`, `t3` keys (lowercase, matching template definition)
99
107
 
100
- Record mismatches as **WARNING** findings.
108
+ **Count equalities (library / integration)** — do NOT re-count files here; take them from `validation.stack_counts` in the §1 output-validator run (invoked with `--skill-type stack`), which derived them deterministically from disk. The `library_count` vs per-library reference files and `integration_count` vs integration pair files checks surface as `field: "library_count"` / `field: "integration_count"` entries in `validation.stack_counts.issues[]` (absent when they agree); echo the exact numbers from `validation.stack_counts.observed` (`library_count_meta` / `ref_file_count`, `integration_count_meta` / `pair_file_count`). The `confidence_distribution`-sum equality is covered in §7.
109
+
110
+ Record each `validation.stack_counts.issues[]` count entry (`library_count` / `integration_count`) and any other mismatch above as **WARNING** findings.
101
111
 
102
112
  ### 6. Validate Reference File Completeness
103
113
 
@@ -113,17 +123,17 @@ Scan all output files for confidence tier coverage:
113
123
 
114
124
  - [ ] SKILL.md: each per-library summary and integration pair entry has a confidence label
115
125
  - [ ] Reference files: each has a confidence label in its header
116
- - [ ] metadata.json: confidence_distribution sums match library_count
126
+ - [ ] metadata.json: `confidence_distribution` sums to `library_count` — take this from the §1 output-validator run (`--skill-type stack`): the `field: "confidence_distribution"` entry in `validation.stack_counts.issues[]` is present only on mismatch, with `validation.stack_counts.observed.confidence_sum` vs `library_count_meta` for the exact numbers. Do not re-sum the distribution by hand.
117
127
 
118
- Record missing tier labels as **WARNING** findings.
128
+ Record missing tier labels and any `validation.stack_counts` `confidence_distribution` issue as **WARNING** findings.
119
129
 
120
130
  ### 8. Validate context-snippet.md
121
131
 
122
- Verify context-snippet.md follows Vercel-aligned indexed format:
123
- - [ ] First line matches: `[{project}-stack v{version}]|root: {prefix}{project}-stack/` where prefix is `skills/` (draft form) or any IDE skill root (`.{dir}/skills/`)
124
- - [ ] Second line starts with `|IMPORTANT:`
132
+ Take the first-line format, `|IMPORTANT:` second-line, and token-estimate checks from `validation.context_snippet.issues` returned by the §1 output-validator run — it performs the line-1 `[name vVersion]|root:` pattern match, the line-2 check, and the `len(content)//4` token estimate deterministically, so this step does not recompute them. Record each reported issue as a **WARNING** finding.
133
+
134
+ Then verify the two stack-specific rows the generic validator does not cover:
125
135
  - [ ] Stack and integrations lines present
126
- - [ ] Approximate token count is ~80-120 tokens (use the `ceil(char_count / 4)` heuristic from step 7 §5; tolerate up to ~150 if the overflow strategy was applied and a workflow_warning was emitted)
136
+ - [ ] Token estimate lands near the ~80-120 design target from step 7 §5 (the validator flags only its wider <40 / >200 bounds; an ~80-150 snippet with an overflow-strategy `workflow_warning` is expected, not a defect)
127
137
 
128
138
  Record format violations as **WARNING** findings.
129
139
 
@@ -137,13 +147,7 @@ Record security findings as advisory **WARNING** findings — they do not block
137
147
 
138
148
  ### 10. Display Validation Results
139
149
 
140
- **If all checks pass:**
141
-
142
- "**Validation complete — all checks passed.** Files: {count}/{count} present. SKILL.md structure valid. metadata.json fields verified. {lib_count} library + {pair_count} integration files verified. Confidence tiers: complete coverage. **Proceeding to summary report...**"
143
-
144
- **If warnings found:**
145
-
146
- "**Validation complete with {warning_count} finding(s).** Findings: {list each: severity, description, file_path}. Files: {present}/{expected} present. Warnings: {count}. Errors: {count}. {If errors: Note missing files may indicate a write failure in step 07.} **Proceeding to summary report...**"
150
+ Report the validation outcome. If all checks passed, state so and name what was verified: file presence (`{count}/{count}`), SKILL.md structure, metadata.json fields, the `{lib_count}` library + `{pair_count}` integration reference files, and complete confidence-tier coverage. If there were findings, report the `{warning_count}` finding(s) — each with severity, description, and file path — plus files present/expected and warning/error counts; when errors include missing files, note this may indicate a write failure in step 07.
147
151
 
148
152
  ### 11. Auto-Proceed to Next Step
149
153