bmad-module-skill-forge 0.10.0 → 0.10.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/.claude-plugin/marketplace.json +39 -0
  2. package/.gitattributes +16 -0
  3. package/README.md +105 -38
  4. package/docs/404.md +13 -10
  5. package/docs/RELEASING.md +185 -0
  6. package/docs/STABILITY.md +123 -0
  7. package/docs/_data/pinned.yaml +98 -0
  8. package/docs/agents.md +16 -11
  9. package/docs/architecture.md +221 -0
  10. package/docs/bmad-synergy.md +11 -13
  11. package/docs/concepts.md +18 -108
  12. package/docs/examples.md +121 -80
  13. package/docs/getting-started.md +85 -147
  14. package/docs/how-it-works.md +25 -536
  15. package/docs/index.md +44 -27
  16. package/docs/skill-model.md +328 -0
  17. package/docs/troubleshooting.md +39 -0
  18. package/docs/verifying-a-skill.md +232 -0
  19. package/docs/why-skf.md +93 -0
  20. package/docs/workflows.md +119 -13
  21. package/package.json +25 -4
  22. package/src/README.md +23 -25
  23. package/src/forger/forge-tier.yaml +4 -2
  24. package/src/forger/preferences.yaml +7 -1
  25. package/src/knowledge/agentskills-spec.md +1 -1
  26. package/src/knowledge/architecture-verification.md +1 -1
  27. package/src/knowledge/ccc-bridge.md +16 -15
  28. package/src/knowledge/overview.md +11 -11
  29. package/src/knowledge/progressive-capability.md +3 -3
  30. package/src/knowledge/provenance-tracking.md +9 -3
  31. package/src/knowledge/qmd-registry.md +8 -8
  32. package/src/knowledge/skf-knowledge-index.csv +2 -2
  33. package/src/knowledge/skill-lifecycle.md +16 -1
  34. package/src/knowledge/split-body-strategy.md +1 -1
  35. package/src/knowledge/version-paths.md +17 -12
  36. package/src/module-help.csv +18 -17
  37. package/src/shared/health-check.md +372 -0
  38. package/src/shared/references/feasibility-report-schema.md +86 -0
  39. package/src/shared/references/headless-gate-convention.md +62 -0
  40. package/src/shared/references/output-contract-schema.md +35 -0
  41. package/src/shared/references/pipeline-contracts.md +102 -0
  42. package/src/shared/scripts/skf-atomic-write.py +370 -0
  43. package/src/shared/scripts/skf-manifest-ops.py +236 -0
  44. package/src/shared/scripts/skf-preflight.py +164 -0
  45. package/src/shared/scripts/skf-rebuild-managed-sections.py +201 -0
  46. package/src/shared/scripts/skf-severity-classify.py +163 -0
  47. package/src/shared/scripts/skf-skill-inventory.py +210 -0
  48. package/src/shared/scripts/skf-structural-diff.py +257 -0
  49. package/src/shared/scripts/skf-validate-frontmatter.py +318 -0
  50. package/src/shared/scripts/skf-validate-output.py +247 -0
  51. package/src/skf-analyze-source/SKILL.md +57 -0
  52. package/src/skf-analyze-source/assets/skill-brief-schema.md +125 -0
  53. package/src/skf-analyze-source/references/unit-detection-heuristics.md +124 -0
  54. package/src/{workflows/analyze-source → skf-analyze-source}/steps-c/step-01-init.md +6 -66
  55. package/src/{workflows/analyze-source → skf-analyze-source}/steps-c/step-01b-continue.md +4 -59
  56. package/src/{workflows/analyze-source → skf-analyze-source}/steps-c/step-02-scan-project.md +7 -68
  57. package/src/{workflows/analyze-source → skf-analyze-source}/steps-c/step-03-identify-units.md +6 -66
  58. package/src/{workflows/analyze-source → skf-analyze-source}/steps-c/step-04-map-and-detect.md +7 -68
  59. package/src/{workflows/analyze-source → skf-analyze-source}/steps-c/step-05-recommend.md +6 -66
  60. package/src/{workflows/analyze-source → skf-analyze-source}/steps-c/step-06-generate-briefs.md +14 -71
  61. package/src/skf-analyze-source/steps-c/step-07-health-check.md +22 -0
  62. package/src/skf-audit-skill/SKILL.md +59 -0
  63. package/src/{workflows/audit-skill/data → skf-audit-skill/assets}/drift-report-template.md +7 -7
  64. package/src/{workflows/audit-skill/data → skf-audit-skill/references}/severity-rules.md +11 -11
  65. package/src/{workflows/audit-skill → skf-audit-skill}/steps-c/step-01-init.md +24 -68
  66. package/src/{workflows/audit-skill → skf-audit-skill}/steps-c/step-02-re-index.md +36 -71
  67. package/src/{workflows/audit-skill → skf-audit-skill}/steps-c/step-03-structural-diff.md +21 -63
  68. package/src/{workflows/audit-skill → skf-audit-skill}/steps-c/step-04-semantic-diff.md +6 -65
  69. package/src/{workflows/audit-skill → skf-audit-skill}/steps-c/step-05-severity-classify.md +5 -63
  70. package/src/{workflows/audit-skill → skf-audit-skill}/steps-c/step-06-report.md +10 -64
  71. package/src/skf-audit-skill/steps-c/step-07-health-check.md +22 -0
  72. package/src/skf-brief-skill/SKILL.md +53 -0
  73. package/src/{workflows/brief-skill/data → skf-brief-skill/assets}/scope-templates.md +23 -0
  74. package/src/skf-brief-skill/assets/skill-brief-schema.md +206 -0
  75. package/src/{workflows/brief-skill → skf-brief-skill}/steps-c/step-01-gather-intent.md +6 -67
  76. package/src/{workflows/brief-skill → skf-brief-skill}/steps-c/step-02-analyze-target.md +6 -66
  77. package/src/{workflows/brief-skill → skf-brief-skill}/steps-c/step-03-scope-definition.md +12 -68
  78. package/src/{workflows/brief-skill → skf-brief-skill}/steps-c/step-04-confirm-brief.md +5 -63
  79. package/src/{workflows/brief-skill → skf-brief-skill}/steps-c/step-05-write-brief.md +10 -70
  80. package/src/skf-brief-skill/steps-c/step-06-health-check.md +22 -0
  81. package/src/skf-create-skill/SKILL.md +63 -0
  82. package/src/{workflows/create-skill/data → skf-create-skill/assets}/compile-assembly-rules.md +60 -0
  83. package/src/{workflows/create-skill/data → skf-create-skill/assets}/skill-sections.md +92 -23
  84. package/src/skf-create-skill/assets/tessl-dismissal-rules.md +102 -0
  85. package/src/{workflows/create-skill/data → skf-create-skill/references}/extraction-patterns-tracing.md +13 -13
  86. package/src/{workflows/create-skill/data → skf-create-skill/references}/extraction-patterns.md +8 -3
  87. package/src/skf-create-skill/references/source-resolution-protocols.md +239 -0
  88. package/src/{workflows/create-skill/data → skf-create-skill/references}/tier-degradation-rules.md +8 -7
  89. package/src/{workflows/create-skill → skf-create-skill}/steps-c/step-01-load-brief.md +25 -63
  90. package/src/{workflows/create-skill → skf-create-skill}/steps-c/step-02-ecosystem-check.md +8 -64
  91. package/src/skf-create-skill/steps-c/step-03-extract.md +379 -0
  92. package/src/{workflows/create-skill → skf-create-skill}/steps-c/step-03d-component-extraction.md +18 -35
  93. package/src/{workflows/create-skill → skf-create-skill}/steps-c/step-04-enrich.md +12 -69
  94. package/src/{workflows/create-skill → skf-create-skill}/steps-c/step-05-compile.md +71 -75
  95. package/src/skf-create-skill/steps-c/step-06-validate.md +267 -0
  96. package/src/{workflows/create-skill → skf-create-skill}/steps-c/step-07-generate-artifacts.md +30 -74
  97. package/src/skf-create-skill/steps-c/step-08-report.md +145 -0
  98. package/src/skf-create-skill/steps-c/step-09-health-check.md +23 -0
  99. package/src/{workflows/create-skill/steps-c → skf-create-skill/steps-c/sub}/step-02b-ccc-discover.md +8 -66
  100. package/src/skf-create-skill/steps-c/sub/step-03b-fetch-temporal.md +229 -0
  101. package/src/{workflows/create-skill/steps-c → skf-create-skill/steps-c/sub}/step-03c-fetch-docs.md +18 -42
  102. package/src/skf-create-stack-skill/SKILL.md +64 -0
  103. package/src/{workflows/create-stack-skill/data → skf-create-stack-skill/assets}/stack-skill-template.md +2 -1
  104. package/src/{workflows/create-stack-skill/data → skf-create-stack-skill/references}/compose-mode-rules.md +19 -5
  105. package/src/{workflows/create-stack-skill/data → skf-create-stack-skill/references}/integration-patterns.md +1 -1
  106. package/src/{workflows/create-stack-skill/data → skf-create-stack-skill/references}/manifest-patterns.md +10 -10
  107. package/src/{workflows/create-stack-skill → skf-create-stack-skill}/steps-c/step-01-init.md +14 -55
  108. package/src/{workflows/create-stack-skill → skf-create-stack-skill}/steps-c/step-02-detect-manifests.md +29 -63
  109. package/src/{workflows/create-stack-skill → skf-create-stack-skill}/steps-c/step-03-rank-and-confirm.md +9 -59
  110. package/src/{workflows/create-stack-skill → skf-create-stack-skill}/steps-c/step-04-parallel-extract.md +29 -64
  111. package/src/skf-create-stack-skill/steps-c/step-05-detect-integrations.md +164 -0
  112. package/src/{workflows/create-stack-skill → skf-create-stack-skill}/steps-c/step-06-compile-stack.md +7 -60
  113. package/src/skf-create-stack-skill/steps-c/step-07-generate-output.md +328 -0
  114. package/src/{workflows/create-stack-skill → skf-create-stack-skill}/steps-c/step-08-validate.md +17 -63
  115. package/src/skf-create-stack-skill/steps-c/step-09-report.md +128 -0
  116. package/src/skf-create-stack-skill/steps-c/step-10-health-check.md +22 -0
  117. package/src/skf-drop-skill/SKILL.md +57 -0
  118. package/src/{workflows/drop-skill → skf-drop-skill}/steps-c/step-01-select.md +9 -69
  119. package/src/{workflows/drop-skill → skf-drop-skill}/steps-c/step-02-execute.md +30 -106
  120. package/src/skf-drop-skill/steps-c/step-03-report.md +83 -0
  121. package/src/skf-drop-skill/steps-c/step-04-health-check.md +22 -0
  122. package/src/skf-export-skill/SKILL.md +57 -0
  123. package/src/skf-export-skill/assets/managed-section-format.md +138 -0
  124. package/src/{workflows/export-skill/data → skf-export-skill/assets}/snippet-format.md +8 -12
  125. package/src/skf-export-skill/steps-c/step-01-load-skill.md +247 -0
  126. package/src/{workflows/export-skill → skf-export-skill}/steps-c/step-02-package.md +5 -58
  127. package/src/{workflows/export-skill → skf-export-skill}/steps-c/step-03-generate-snippet.md +15 -77
  128. package/src/{workflows/export-skill → skf-export-skill}/steps-c/step-04-update-context.md +59 -133
  129. package/src/{workflows/export-skill → skf-export-skill}/steps-c/step-05-token-report.md +4 -58
  130. package/src/{workflows/export-skill → skf-export-skill}/steps-c/step-06-summary.md +16 -68
  131. package/src/skf-export-skill/steps-c/step-07-health-check.md +22 -0
  132. package/src/skf-forger/SKILL.md +110 -0
  133. package/src/skf-forger/bmad-skill-manifest.yaml +11 -0
  134. package/src/skf-quick-skill/SKILL.md +56 -0
  135. package/src/{workflows/quick-skill/data → skf-quick-skill/references}/registry-resolution.md +6 -6
  136. package/src/{workflows/quick-skill → skf-quick-skill}/steps-c/step-01-resolve-target.md +9 -62
  137. package/src/{workflows/quick-skill → skf-quick-skill}/steps-c/step-02-ecosystem-check.md +5 -59
  138. package/src/{workflows/quick-skill → skf-quick-skill}/steps-c/step-03-quick-extract.md +18 -61
  139. package/src/{workflows/quick-skill → skf-quick-skill}/steps-c/step-04-compile.md +6 -60
  140. package/src/{workflows/quick-skill → skf-quick-skill}/steps-c/step-05-validate.md +58 -78
  141. package/src/skf-quick-skill/steps-c/step-06-write.md +73 -0
  142. package/src/skf-quick-skill/steps-c/step-07-health-check.md +22 -0
  143. package/src/skf-refine-architecture/SKILL.md +57 -0
  144. package/src/{workflows/refine-architecture/data → skf-refine-architecture/references}/refinement-rules.md +16 -16
  145. package/src/{workflows/refine-architecture → skf-refine-architecture}/steps-c/step-01-init.md +6 -63
  146. package/src/{workflows/refine-architecture → skf-refine-architecture}/steps-c/step-02-gap-analysis.md +29 -71
  147. package/src/{workflows/refine-architecture → skf-refine-architecture}/steps-c/step-03-issue-detection.md +5 -65
  148. package/src/{workflows/refine-architecture → skf-refine-architecture}/steps-c/step-04-improvements.md +5 -64
  149. package/src/{workflows/refine-architecture → skf-refine-architecture}/steps-c/step-05-compile.md +5 -56
  150. package/src/{workflows/refine-architecture → skf-refine-architecture}/steps-c/step-06-report.md +11 -64
  151. package/src/skf-refine-architecture/steps-c/step-07-health-check.md +22 -0
  152. package/src/skf-rename-skill/SKILL.md +58 -0
  153. package/src/{workflows/rename-skill → skf-rename-skill}/steps-c/step-01-select.md +12 -73
  154. package/src/{workflows/rename-skill → skf-rename-skill}/steps-c/step-02-execute.md +32 -113
  155. package/src/skf-rename-skill/steps-c/step-03-report.md +83 -0
  156. package/src/skf-rename-skill/steps-c/step-04-health-check.md +22 -0
  157. package/src/skf-setup/SKILL.md +55 -0
  158. package/src/{workflows/setup-forge → skf-setup}/steps-c/step-01-detect-and-tier.md +6 -62
  159. package/src/{workflows/setup-forge → skf-setup}/steps-c/step-01b-ccc-index.md +9 -65
  160. package/src/{workflows/setup-forge → skf-setup}/steps-c/step-02-write-config.md +15 -60
  161. package/src/{workflows/setup-forge → skf-setup}/steps-c/step-03-auto-index.md +7 -66
  162. package/src/skf-setup/steps-c/step-04-report.md +92 -0
  163. package/src/skf-setup/steps-c/step-05-health-check.md +22 -0
  164. package/src/skf-test-skill/SKILL.md +59 -0
  165. package/src/skf-test-skill/references/migration-section-rules.md +114 -0
  166. package/src/skf-test-skill/references/scoring-rules.md +207 -0
  167. package/src/skf-test-skill/references/source-access-protocol.md +109 -0
  168. package/src/skf-test-skill/scripts/compute-score.py +310 -0
  169. package/src/skf-test-skill/steps-c/step-01-init.md +238 -0
  170. package/src/{workflows/test-skill → skf-test-skill}/steps-c/step-02-detect-mode.md +4 -62
  171. package/src/skf-test-skill/steps-c/step-03-coverage-check.md +347 -0
  172. package/src/skf-test-skill/steps-c/step-04-coherence-check.md +239 -0
  173. package/src/{workflows/test-skill → skf-test-skill}/steps-c/step-04b-external-validators.md +42 -77
  174. package/src/skf-test-skill/steps-c/step-05-score.md +266 -0
  175. package/src/skf-test-skill/steps-c/step-06-report.md +290 -0
  176. package/src/skf-test-skill/steps-c/step-07-health-check.md +25 -0
  177. package/src/skf-test-skill/templates/test-report-template.md +58 -0
  178. package/src/skf-update-skill/SKILL.md +58 -0
  179. package/src/{workflows/update-skill/data → skf-update-skill/references}/manual-section-rules.md +6 -6
  180. package/src/{workflows/update-skill/data → skf-update-skill/references}/merge-conflict-rules.md +5 -5
  181. package/src/skf-update-skill/references/remote-source-resolution.md +94 -0
  182. package/src/{workflows/update-skill → skf-update-skill}/steps-c/step-01-init.md +22 -69
  183. package/src/skf-update-skill/steps-c/step-02-detect-changes.md +255 -0
  184. package/src/skf-update-skill/steps-c/step-03-re-extract.md +336 -0
  185. package/src/{workflows/update-skill → skf-update-skill}/steps-c/step-04-merge.md +60 -72
  186. package/src/{workflows/update-skill → skf-update-skill}/steps-c/step-05-validate.md +5 -62
  187. package/src/skf-update-skill/steps-c/step-06-write.md +278 -0
  188. package/src/{workflows/update-skill → skf-update-skill}/steps-c/step-07-report.md +11 -69
  189. package/src/skf-update-skill/steps-c/step-08-health-check.md +22 -0
  190. package/src/skf-verify-stack/SKILL.md +60 -0
  191. package/src/skf-verify-stack/assets/feasibility-report-template.md +76 -0
  192. package/src/{workflows/verify-stack/data → skf-verify-stack/references}/coverage-patterns.md +12 -4
  193. package/src/skf-verify-stack/references/integration-verification-rules.md +78 -0
  194. package/src/skf-verify-stack/steps-c/step-01-init.md +178 -0
  195. package/src/{workflows/verify-stack → skf-verify-stack}/steps-c/step-02-coverage.md +27 -72
  196. package/src/skf-verify-stack/steps-c/step-03-integrations.md +179 -0
  197. package/src/{workflows/verify-stack → skf-verify-stack}/steps-c/step-04-requirements.md +14 -67
  198. package/src/skf-verify-stack/steps-c/step-05-synthesize.md +147 -0
  199. package/src/skf-verify-stack/steps-c/step-06-report.md +156 -0
  200. package/src/skf-verify-stack/steps-c/step-07-health-check.md +25 -0
  201. package/tools/cli/commands/install.js +1 -1
  202. package/tools/cli/commands/status.js +21 -23
  203. package/tools/cli/commands/uninstall.js +11 -19
  204. package/tools/cli/commands/update.js +2 -2
  205. package/tools/cli/lib/ide-skills.js +216 -0
  206. package/tools/cli/lib/installer.js +29 -52
  207. package/tools/cli/lib/manifest.js +11 -5
  208. package/tools/cli/lib/platform-codes.yaml +223 -0
  209. package/tools/cli/lib/ui.js +76 -47
  210. package/tools/validate-docs-drift.js +193 -0
  211. package/src/agents/forger.agent.yaml +0 -114
  212. package/src/workflows/README.md +0 -174
  213. package/src/workflows/analyze-source/data/skill-brief-schema.md +0 -125
  214. package/src/workflows/analyze-source/data/unit-detection-heuristics.md +0 -124
  215. package/src/workflows/analyze-source/workflow.md +0 -61
  216. package/src/workflows/audit-skill/workflow.md +0 -64
  217. package/src/workflows/brief-skill/data/skill-brief-schema.md +0 -159
  218. package/src/workflows/brief-skill/workflow.md +0 -58
  219. package/src/workflows/create-skill/data/source-resolution-protocols.md +0 -200
  220. package/src/workflows/create-skill/steps-c/step-03-extract.md +0 -301
  221. package/src/workflows/create-skill/steps-c/step-03b-fetch-temporal.md +0 -253
  222. package/src/workflows/create-skill/steps-c/step-06-validate.md +0 -254
  223. package/src/workflows/create-skill/steps-c/step-08-report.md +0 -179
  224. package/src/workflows/create-skill/workflow.md +0 -53
  225. package/src/workflows/create-stack-skill/steps-c/step-05-detect-integrations.md +0 -196
  226. package/src/workflows/create-stack-skill/steps-c/step-07-generate-output.md +0 -270
  227. package/src/workflows/create-stack-skill/steps-c/step-09-report.md +0 -150
  228. package/src/workflows/create-stack-skill/workflow.md +0 -59
  229. package/src/workflows/drop-skill/steps-c/step-03-report.md +0 -136
  230. package/src/workflows/drop-skill/workflow.md +0 -63
  231. package/src/workflows/export-skill/data/managed-section-format.md +0 -103
  232. package/src/workflows/export-skill/steps-c/step-01-load-skill.md +0 -237
  233. package/src/workflows/export-skill/workflow.md +0 -58
  234. package/src/workflows/quick-skill/steps-c/step-06-write.md +0 -178
  235. package/src/workflows/quick-skill/workflow.md +0 -58
  236. package/src/workflows/refine-architecture/workflow.md +0 -61
  237. package/src/workflows/rename-skill/steps-c/step-03-report.md +0 -133
  238. package/src/workflows/rename-skill/workflow.md +0 -64
  239. package/src/workflows/setup-forge/steps-c/step-04-report.md +0 -159
  240. package/src/workflows/setup-forge/workflow.md +0 -51
  241. package/src/workflows/shared/health-check.md +0 -231
  242. package/src/workflows/test-skill/data/scoring-rules.md +0 -123
  243. package/src/workflows/test-skill/data/source-access-protocol.md +0 -51
  244. package/src/workflows/test-skill/steps-c/step-01-init.md +0 -217
  245. package/src/workflows/test-skill/steps-c/step-03-coverage-check.md +0 -280
  246. package/src/workflows/test-skill/steps-c/step-04-coherence-check.md +0 -271
  247. package/src/workflows/test-skill/steps-c/step-05-score.md +0 -222
  248. package/src/workflows/test-skill/steps-c/step-06-report.md +0 -208
  249. package/src/workflows/test-skill/templates/test-report-template.md +0 -28
  250. package/src/workflows/test-skill/workflow.md +0 -57
  251. package/src/workflows/update-skill/data/remote-source-resolution.md +0 -57
  252. package/src/workflows/update-skill/steps-c/step-02-detect-changes.md +0 -221
  253. package/src/workflows/update-skill/steps-c/step-03-re-extract.md +0 -256
  254. package/src/workflows/update-skill/steps-c/step-06-write.md +0 -265
  255. package/src/workflows/update-skill/workflow.md +0 -56
  256. package/src/workflows/verify-stack/data/feasibility-report-template.md +0 -63
  257. package/src/workflows/verify-stack/data/integration-verification-rules.md +0 -73
  258. package/src/workflows/verify-stack/steps-c/step-01-init.md +0 -179
  259. package/src/workflows/verify-stack/steps-c/step-03-integrations.md +0 -195
  260. package/src/workflows/verify-stack/steps-c/step-05-synthesize.md +0 -191
  261. package/src/workflows/verify-stack/steps-c/step-06-report.md +0 -200
  262. package/src/workflows/verify-stack/workflow.md +0 -61
  263. package/tools/cli/lib/compiler.js +0 -306
  264. package/tools/cli/lib/ide-commands.js +0 -244
  265. /package/src/{workflows/analyze-source → skf-analyze-source}/templates/analysis-report-template.md +0 -0
  266. /package/src/{workflows/quick-skill/data → skf-quick-skill/assets}/skill-template.md +0 -0
  267. /package/src/{workflows/setup-forge/data → skf-setup/references}/tier-rules.md +0 -0
  268. /package/src/{workflows/test-skill/data → skf-test-skill/assets}/output-section-formats.md +0 -0
@@ -0,0 +1,238 @@
1
+ ---
2
+ nextStepFile: './step-02-detect-mode.md'
3
+ outputFile: '{forge_version}/test-report-{skill_name}-{run_id}.md'
4
+ templateFile: 'templates/test-report-template.md'
5
+ sidecarFile: '{sidecar_path}/forge-tier.yaml'
6
+ skillsOutputFolder: '{skills_output_folder}'
7
+ # frontmatterScript resolves deterministically by probing two candidate
8
+ # paths from `{project-root}` in order. There is NO silent manual fallback —
9
+ # if neither candidate exists, the step HALTs with a diagnostic.
10
+ frontmatterScriptProbeOrder:
11
+ - '{project-root}/_bmad/skf/shared/scripts/skf-validate-frontmatter.py'
12
+ - '{project-root}/src/shared/scripts/skf-validate-frontmatter.py'
13
+ versionPathsKnowledge: 'knowledge/version-paths.md'
14
+ ---
15
+
16
+ # Step 1: Initialize Test
17
+
18
+ ## STEP GOAL:
19
+
20
+ Discover and validate the target skill, load forge tier state to determine analysis depth, and create the test report document from template.
21
+
22
+ ## Rules
23
+
24
+ - Focus only on input discovery and validation — do not begin analysis
25
+ - Validate all required files exist before proceeding
26
+
27
+ ## MANDATORY SEQUENCE
28
+
29
+ **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
30
+
31
+ ### 1. Receive Skill Path
32
+
33
+ If skill path was provided as workflow argument, use it directly.
34
+
35
+ **Recognized flags on the invocation:**
36
+ - `--allow-workspace-drift` — bypass the section 5b pre-flight guard that halts when local workspace HEAD does not match `metadata.source_commit`. Store `allow_workspace_drift: true` in workflow context when present. No effect when `source_commit` is unpinned or the source is not a git working tree.
37
+
38
+ If no path provided, ask:
39
+
40
+ "**Which skill would you like to test?**
41
+
42
+ Provide the skill path or name. I'll search in `{skillsOutputFolder}`.
43
+
44
+ **Path or name:**"
45
+
46
+ ### 2. Validate Skill Exists (version-aware)
47
+
48
+ Resolve the skill path using version-aware resolution (see `{versionPathsKnowledge}`):
49
+
50
+ 1. Read `{skillsOutputFolder}/.export-manifest.json` and look up the skill name in `exports` to get `active_version`
51
+ 2. If found: resolve to `{skill_package}` = `{skillsOutputFolder}/{skill_name}/{active_version}/{skill_name}/`
52
+ 3. If not in manifest: check for `active` symlink at `{skillsOutputFolder}/{skill_name}/active` — resolve to `{skill_group}/active/{skill_name}/`
53
+ 4. If neither: fall back to flat path `{skillsOutputFolder}/{skill_name}/`. If SKILL.md exists at the flat path, auto-migrate per `{versionPathsKnowledge}` migration rules
54
+ 5. Store the resolved path as `{resolved_skill_package}`
55
+
56
+ Check that the skill package contains required files:
57
+
58
+ **Required files:**
59
+ - `{resolved_skill_package}/SKILL.md` — the skill documentation
60
+ - `{resolved_skill_package}/metadata.json` — skill metadata
61
+
62
+ **If SKILL.md missing:**
63
+ "**Error: SKILL.md not found at `{resolved_skill_package}/SKILL.md`**
64
+
65
+ This skill has not been created yet. Run the **create-skill** workflow first."
66
+
67
+ HALT — do not proceed.
68
+
69
+ **If metadata.json missing:**
70
+ "**Warning:** metadata.json not found. Proceeding with limited metadata. Some checks may be skipped."
71
+
72
+ ### 3. Validate Frontmatter Compliance
73
+
74
+ **3a. Resolve `{frontmatterScript}` deterministically.** Probe each candidate path in `{frontmatterScriptProbeOrder}` (in order) against the filesystem:
75
+
76
+ 1. `{project-root}/_bmad/skf/shared/scripts/skf-validate-frontmatter.py` (installed module layout)
77
+ 2. `{project-root}/src/shared/scripts/skf-validate-frontmatter.py` (development-tree layout)
78
+
79
+ Use the FIRST path that exists as `{frontmatterScript}`. There is no manual fallback.
80
+
81
+ **If neither path exists, HALT** with the diagnostic below. test-skill is a quality gate; without the deterministic validator it cannot produce a trustworthy frontmatter verdict, and silent manual checks have been known to miss subtle spec drift. The missing helper must be restored before testing continues:
82
+
83
+ ```
84
+ Error: cannot locate skf-validate-frontmatter.py at either of:
85
+ - {project-root}/_bmad/skf/shared/scripts/skf-validate-frontmatter.py
86
+ - {project-root}/src/shared/scripts/skf-validate-frontmatter.py
87
+
88
+ test-skill requires the deterministic frontmatter validator. Install the
89
+ SKF module (`skf init`) or run from a development checkout with src/ present.
90
+ ```
91
+
92
+ Do not proceed. No partial test report is written.
93
+
94
+ **3b. Run the validator (30s timeout — deterministic validator should finish in <1s; the cap only guards against runaway python):**
95
+
96
+ ```bash
97
+ timeout 30s python3 {frontmatterScript} {resolved_skill_package}/SKILL.md --skill-dir-name {skill_name}
98
+ ```
99
+
100
+ If the command trips the 30s wall-clock (exit code `124`), set
101
+ `analysis_confidence: degraded` and `toolingStatus: frontmatter-validator-timeout`
102
+ in workflow context, apply the step-05 tooling-degraded cap (score capped at
103
+ `threshold - 1` → auto-FAIL), and record the reason in evidence-report.
104
+
105
+ Parse the JSON output. Per B2, treat each `status` value explicitly:
106
+
107
+ - `status: "pass"` — continue silently.
108
+ - `status: "warn"` — display the warning below, log each issue as a pre-check finding, and continue with testing. Frontmatter issues surface in the gap report alongside coverage/coherence findings.
109
+ - `status: "fail"` — **HALT with auto-FAIL.** Frontmatter failure indicates the skill will be rejected by `npx skills add` and `npx skill-check check`; shipping it would produce a false PASS downstream. Write the halt note into the evidence-report and exit the workflow. If `{headless_mode}`, set `testResult: fail` in the output frontmatter before exiting so the result contract records the terminal state.
110
+
111
+ ```
112
+ **Warning/Error: SKILL.md frontmatter is non-compliant with agentskills.io specification.**
113
+
114
+ {list issues from the JSON output}
115
+
116
+ This skill will fail `npx skills add` and `npx skill-check check`. {If warn:} Consider fixing frontmatter before proceeding (run `npx skill-check check <skill-dir> --fix` to auto-fix deterministic issues). {If fail:} test-skill cannot proceed — halt and repair frontmatter, then re-run.
117
+ ```
118
+
119
+ **3c. Python runtime probe.** Before the first invocation, confirm `python3` is on `$PATH` (`command -v python3`). If missing, set `analysis_confidence: degraded` in workflow context and carry a **score cap** into step-05: `capped_score = threshold - 1` → forces auto-FAIL until the runtime is restored. Record the reason in evidence-report and the test report frontmatter (`analysisConfidence: degraded`, `toolingStatus: python3-missing`).
120
+
121
+ ### 4. Load Forge Tier State
122
+
123
+ Read `{sidecarFile}` to determine available analysis depth.
124
+
125
+ **If forge-tier.yaml exists:**
126
+ - Read `tier` value (Quick, Forge, Forge+, or Deep)
127
+ - Read tool availability flags (ast_grep, gh_cli, qmd)
128
+
129
+ **If forge-tier.yaml missing:**
130
+ "**Cannot proceed.** forge-tier.yaml not found at `{sidecarFile}`. Please run the **setup** workflow first to configure your forge tier (Quick/Forge/Forge+/Deep)."
131
+
132
+ HALT — do not proceed.
133
+
134
+ ### 4b. Apply Tier Override (if set)
135
+
136
+ Read `{sidecar_path}/preferences.yaml`. If `tier_override` is set and is a valid tier value (Quick, Forge, Forge+, or Deep), update `detected_tier` to the override value for use in subsequent steps and output documents.
137
+
138
+ ### 5. Load Skill Metadata
139
+
140
+ Read `metadata.json` to extract:
141
+ - `name` — display name
142
+ - `skill_type` — single or stack (needed for mode detection)
143
+ - `source_path` — path to source code (if present)
144
+ - `source_commit` — pinned commit the skill was extracted against (may be null for docs-only skills, `"local"` for non-git sources, or a per-repo map for stack skills)
145
+ - `source_ref` — pinned ref (tag/branch/`HEAD`) used at extraction time
146
+ - `generation_date` — when skill was generated
147
+ - `confidence_tier` — tier used during creation
148
+
149
+ If source path override was provided as optional input, use that instead.
150
+
151
+ ### 5b. Verify Workspace HEAD Matches Pinned Commit
152
+
153
+ Test-skill reads `source_path` during coverage and coherence analysis. If the local workspace has drifted from `metadata.source_commit`, gap and signature-mismatch findings will silently reflect the drifted tree, not the skill's pinned source — producing false positives that downstream update-skill runs may then "repair" by corrupting correct documentation.
154
+
155
+ - Resolve `pinned_commit` from `metadata.source_commit`.
156
+ - **If `pinned_commit` is null, empty, or `"local"`:** skip the guard; log `workspace_drift_check: skipped (no pinned commit)` and continue to section 6.
157
+ - **If `pinned_commit` is a per-repo map (stack skills):** iterate each `{repo_path: commit}` entry — for each repo run `git -C "{repo_path}" rev-parse HEAD` and compare to its pinned commit (accept full-SHA or short-SHA-prefix match). If ANY repo diverges and the user did not pass `--allow-workspace-drift`, HALT with exit status `halted-for-workspace-drift` listing every mismatched repo. On all-match: log `workspace_drift_check: ok (stack, {N} repos verified)` and continue to section 6. Per B6, this guard MUST iterate every repo — do not skip stack skills.
158
+ - **If `source_path` is not a git working tree** (bare checkout, tarball extract, docs-only source) — detect by `git -C "{source_path}" rev-parse --is-inside-work-tree`, non-zero exit means skip: log `workspace_drift_check: skipped (not a git working tree)` and continue to section 6.
159
+ - **Otherwise** run `git -C "{source_path}" rev-parse HEAD` and compare to `pinned_commit`. Accept full-SHA or short-SHA-prefix match (stored pins are often 8-char short hashes — see `src/knowledge/provenance-tracking.md`).
160
+ - **On match:** log `workspace_drift_check: ok ({short_sha})` and continue.
161
+ - **On mismatch, AND the user did not pass `--allow-workspace-drift`:** HALT with exit status `halted-for-workspace-drift`. Display:
162
+
163
+ ```
164
+ Workspace HEAD does not match the commit this skill was pinned against.
165
+
166
+ pinned (metadata.source_commit): {pinned_commit}
167
+ pinned ref (metadata.source_ref): {source_ref or "unset"}
168
+ workspace HEAD ({source_path}): {head_sha}
169
+
170
+ Test-skill verifies against the source the skill was extracted from.
171
+ Testing against a drifted tree produces false gaps/mismatches. Re-sync:
172
+
173
+ git -C "{source_path}" checkout {source_ref or pinned_commit}
174
+
175
+ Or re-run test-skill with `--allow-workspace-drift` to test against the
176
+ current workspace (accepts that findings reflect HEAD, not the pin).
177
+ ```
178
+
179
+ Do not proceed. The test report has not been created; no partial writes.
180
+ - **On mismatch WITH `--allow-workspace-drift`:** log `workspace_drift_check: overridden (pinned={pinned_commit}, head={head_sha})`, carry the warning into the final report frontmatter (`workspaceDrift: overridden`), and set `allow_workspace_drift: true` in workflow context (consumed by step-05 §5 M5 — a PASS under drift is demoted to `pass-with-drift` and `nextWorkflow` is forced to `update-skill`, never `export-skill`). Continue.
181
+
182
+ ### 6. Create Output Document
183
+
184
+ **6a. Generate `{run_id}`** per B5: a per-run identifier of the form `{YYYYMMDDTHHmmssZ}-{pid}-{rand4}` (UTC timestamp + process PID + 4-char random hex). Store in workflow context. All per-run artifacts in this and subsequent steps MUST carry this suffix; step-06 verifies `testDate` in the resulting report matches the run's stamp and fail-fast otherwise.
185
+
186
+ **6b. Acquire the per-skill test lock** (B4): `flock {forge_version}/.test-skill.lock` for the duration of this run to serialize concurrent `skf-test-skill` invocations against the same skill. If the lock is already held by another run, HALT with "another test-skill run is active for {skill_name}".
187
+
188
+ **6c. Create `{outputFile}` from `{templateFile}`** — use `{forge_version}/test-report-{skill_name}-{run_id}.md` per B5. Initial frontmatter:
189
+
190
+ ```yaml
191
+ ---
192
+ workflowType: 'test-skill'
193
+ skillName: '{skill_name}'
194
+ skillDir: '{skill_path}'
195
+ runId: '{run_id}'
196
+ testMode: ''
197
+ forgeTier: '{detected_tier}'
198
+ testResult: ''
199
+ score: ''
200
+ threshold: ''
201
+ analysisConfidence: '{full|degraded}'
202
+ toolingStatus: '{ok|python3-missing|frontmatter-validator-missing|frontmatter-validator-timeout}'
203
+ workspaceDrift: '{not-checked|ok|overridden}'
204
+ testDate: '{run_id timestamp ISO-8601 UTC}'
205
+ stepsCompleted: ['step-01-init']
206
+ nextWorkflow: ''
207
+ ---
208
+ ```
209
+
210
+ ### 7. Report Initialization Status
211
+
212
+ "**Test initialization complete.**
213
+
214
+ **Skill:** {skill_name}
215
+ **Path:** {skill_path}
216
+ **Type:** {skill_type}
217
+ **Forge Tier:** {detected_tier}
218
+ **Source:** {source_path}
219
+
220
+ **Proceeding to mode detection...**"
221
+
222
+ ### 8. Auto-Proceed
223
+
224
+ Display: "**Proceeding to mode detection...**"
225
+
226
+ #### Menu Handling Logic:
227
+
228
+ - After initialization is complete, update {outputFile} frontmatter stepsCompleted, then immediately load, read entire file, then execute {nextStepFile}
229
+
230
+ #### EXECUTION RULES:
231
+
232
+ - This is an auto-proceed initialization step with no user choices
233
+ - Proceed directly to next step after setup
234
+
235
+ ## CRITICAL STEP COMPLETION NOTE
236
+
237
+ ONLY WHEN all required files are validated, forge tier is loaded, output document is created, and initialization status is reported, will you then load and read fully `{nextStepFile}` to execute mode detection.
238
+
@@ -1,9 +1,6 @@
1
1
  ---
2
- name: 'step-02-detect-mode'
3
- description: 'Determine naive (individual) vs contextual (stack) testing mode'
4
-
5
2
  nextStepFile: './step-03-coverage-check.md'
6
- outputFile: '{forge_version}/test-report-{skill_name}.md'
3
+ outputFile: '{forge_version}/test-report-{skill_name}-{run_id}.md'
7
4
  ---
8
5
 
9
6
  # Step 2: Detect Mode
@@ -12,43 +9,10 @@ outputFile: '{forge_version}/test-report-{skill_name}.md'
12
9
 
13
10
  Examine the skill metadata to determine whether this is an individual skill (naive mode — API surface coverage only) or a stack skill (contextual mode — full coherence validation including cross-references and integration patterns).
14
11
 
15
- ## MANDATORY EXECUTION RULES (READ FIRST):
16
-
17
- ### Universal Rules:
18
-
19
- - 🛑 NEVER override mode detection with assumptions — use actual metadata
20
- - 📖 CRITICAL: Read the complete step file before taking any action
21
- - 🔄 CRITICAL: When loading next step, ensure entire file is read
22
- - ⚙️ TOOL/SUBPROCESS FALLBACK: If any instruction references a subprocess, subagent, or tool you do not have access to, you MUST still achieve the outcome in your main context thread
23
- - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
24
-
25
- ### Role Reinforcement:
26
-
27
- - ✅ You are a skill auditor in Ferris's Audit mode
28
- - ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
29
- - ✅ Mode detection is deterministic — based on metadata, not judgment
30
- - ✅ Report the detected mode clearly and explain what it means for analysis depth
31
-
32
- ### Step-Specific Rules:
33
-
34
- - 🎯 Focus only on mode detection — do NOT begin coverage or coherence analysis
35
- - 🚫 FORBIDDEN to start analyzing exports or references in this step
36
- - 💬 Explain what each mode means for the upcoming analysis
37
- - 📋 Set testMode in output frontmatter before proceeding
38
-
39
- ## EXECUTION PROTOCOLS:
40
-
41
- - 🎯 Read skill metadata to determine type
42
- - 💾 Update {outputFile} frontmatter with testMode and append Test Summary section
43
- - 📖 Update stepsCompleted in {outputFile}
44
- - 🚫 FORBIDDEN to proceed without setting testMode
12
+ ## Rules
45
13
 
46
- ## CONTEXT BOUNDARIES:
47
-
48
- - Available: Skill metadata loaded in step 01, forge tier state, output document
49
- - Focus: Mode detection only — classify skill type, set test mode
50
- - Limits: Do not analyze content — just determine the correct testing mode
51
- - Dependencies: step-01 must have validated skill exists and loaded metadata
14
+ - Focus only on mode detection — do not begin coverage or coherence analysis
15
+ - Set testMode in output frontmatter before proceeding
52
16
 
53
17
  ## MANDATORY SEQUENCE
54
18
 
@@ -139,25 +103,3 @@ Display: "**Proceeding to coverage check...**"
139
103
 
140
104
  ONLY WHEN testMode is set in the output frontmatter and the Test Summary section is appended to the output document, will you then load and read fully `{nextStepFile}` to execute coverage check.
141
105
 
142
- ---
143
-
144
- ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
145
-
146
- ### ✅ SUCCESS:
147
-
148
- - Skill type correctly identified from metadata
149
- - Test mode set (naive or contextual) in output frontmatter
150
- - Test Summary section appended to output document
151
- - Mode rationale documented
152
- - Analysis plan stated based on mode + tier combination
153
- - Auto-proceeded to step 03
154
-
155
- ### ❌ SYSTEM FAILURE:
156
-
157
- - Guessing mode without reading metadata
158
- - Not setting testMode in output frontmatter
159
- - Not appending Test Summary section
160
- - Starting analysis in this step
161
- - Hardcoding paths instead of using frontmatter variables
162
-
163
- **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.