bmad-module-skill-forge 0.9.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/module.yaml +4 -0
  38. package/src/shared/health-check.md +372 -0
  39. package/src/shared/references/feasibility-report-schema.md +86 -0
  40. package/src/shared/references/headless-gate-convention.md +62 -0
  41. package/src/shared/references/output-contract-schema.md +35 -0
  42. package/src/shared/references/pipeline-contracts.md +102 -0
  43. package/src/shared/scripts/skf-atomic-write.py +370 -0
  44. package/src/shared/scripts/skf-manifest-ops.py +236 -0
  45. package/src/shared/scripts/skf-preflight.py +164 -0
  46. package/src/shared/scripts/skf-rebuild-managed-sections.py +201 -0
  47. package/src/shared/scripts/skf-severity-classify.py +163 -0
  48. package/src/shared/scripts/skf-skill-inventory.py +210 -0
  49. package/src/shared/scripts/skf-structural-diff.py +257 -0
  50. package/src/shared/scripts/skf-validate-frontmatter.py +318 -0
  51. package/src/shared/scripts/skf-validate-output.py +247 -0
  52. package/src/skf-analyze-source/SKILL.md +57 -0
  53. package/src/skf-analyze-source/assets/skill-brief-schema.md +125 -0
  54. package/src/skf-analyze-source/references/unit-detection-heuristics.md +124 -0
  55. package/src/{workflows/analyze-source → skf-analyze-source}/steps-c/step-01-init.md +6 -66
  56. package/src/{workflows/analyze-source → skf-analyze-source}/steps-c/step-01b-continue.md +4 -59
  57. package/src/{workflows/analyze-source → skf-analyze-source}/steps-c/step-02-scan-project.md +7 -68
  58. package/src/{workflows/analyze-source → skf-analyze-source}/steps-c/step-03-identify-units.md +6 -66
  59. package/src/{workflows/analyze-source → skf-analyze-source}/steps-c/step-04-map-and-detect.md +7 -68
  60. package/src/{workflows/analyze-source → skf-analyze-source}/steps-c/step-05-recommend.md +6 -66
  61. package/src/{workflows/analyze-source → skf-analyze-source}/steps-c/step-06-generate-briefs.md +14 -66
  62. package/src/skf-analyze-source/steps-c/step-07-health-check.md +22 -0
  63. package/src/skf-audit-skill/SKILL.md +59 -0
  64. package/src/{workflows/audit-skill/data → skf-audit-skill/assets}/drift-report-template.md +7 -7
  65. package/src/{workflows/audit-skill/data → skf-audit-skill/references}/severity-rules.md +11 -11
  66. package/src/{workflows/audit-skill → skf-audit-skill}/steps-c/step-01-init.md +24 -68
  67. package/src/{workflows/audit-skill → skf-audit-skill}/steps-c/step-02-re-index.md +36 -71
  68. package/src/{workflows/audit-skill → skf-audit-skill}/steps-c/step-03-structural-diff.md +21 -63
  69. package/src/{workflows/audit-skill → skf-audit-skill}/steps-c/step-04-semantic-diff.md +6 -65
  70. package/src/{workflows/audit-skill → skf-audit-skill}/steps-c/step-05-severity-classify.md +5 -63
  71. package/src/{workflows/audit-skill → skf-audit-skill}/steps-c/step-06-report.md +10 -59
  72. package/src/skf-audit-skill/steps-c/step-07-health-check.md +22 -0
  73. package/src/skf-brief-skill/SKILL.md +53 -0
  74. package/src/{workflows/brief-skill/data → skf-brief-skill/assets}/scope-templates.md +23 -0
  75. package/src/skf-brief-skill/assets/skill-brief-schema.md +206 -0
  76. package/src/{workflows/brief-skill → skf-brief-skill}/steps-c/step-01-gather-intent.md +6 -67
  77. package/src/{workflows/brief-skill → skf-brief-skill}/steps-c/step-02-analyze-target.md +6 -66
  78. package/src/{workflows/brief-skill → skf-brief-skill}/steps-c/step-03-scope-definition.md +12 -68
  79. package/src/{workflows/brief-skill → skf-brief-skill}/steps-c/step-04-confirm-brief.md +5 -63
  80. package/src/{workflows/brief-skill → skf-brief-skill}/steps-c/step-05-write-brief.md +10 -69
  81. package/src/skf-brief-skill/steps-c/step-06-health-check.md +22 -0
  82. package/src/skf-create-skill/SKILL.md +63 -0
  83. package/src/{workflows/create-skill/data → skf-create-skill/assets}/compile-assembly-rules.md +60 -0
  84. package/src/{workflows/create-skill/data → skf-create-skill/assets}/skill-sections.md +92 -23
  85. package/src/skf-create-skill/assets/tessl-dismissal-rules.md +102 -0
  86. package/src/{workflows/create-skill/data → skf-create-skill/references}/extraction-patterns-tracing.md +13 -13
  87. package/src/{workflows/create-skill/data → skf-create-skill/references}/extraction-patterns.md +8 -3
  88. package/src/skf-create-skill/references/source-resolution-protocols.md +239 -0
  89. package/src/{workflows/create-skill/data → skf-create-skill/references}/tier-degradation-rules.md +8 -7
  90. package/src/{workflows/create-skill → skf-create-skill}/steps-c/step-01-load-brief.md +25 -63
  91. package/src/{workflows/create-skill → skf-create-skill}/steps-c/step-02-ecosystem-check.md +8 -64
  92. package/src/skf-create-skill/steps-c/step-03-extract.md +379 -0
  93. package/src/{workflows/create-skill → skf-create-skill}/steps-c/step-03d-component-extraction.md +18 -35
  94. package/src/{workflows/create-skill → skf-create-skill}/steps-c/step-04-enrich.md +12 -69
  95. package/src/{workflows/create-skill → skf-create-skill}/steps-c/step-05-compile.md +71 -75
  96. package/src/skf-create-skill/steps-c/step-06-validate.md +267 -0
  97. package/src/{workflows/create-skill → skf-create-skill}/steps-c/step-07-generate-artifacts.md +30 -74
  98. package/src/skf-create-skill/steps-c/step-08-report.md +145 -0
  99. package/src/skf-create-skill/steps-c/step-09-health-check.md +23 -0
  100. package/src/{workflows/create-skill/steps-c → skf-create-skill/steps-c/sub}/step-02b-ccc-discover.md +8 -66
  101. package/src/skf-create-skill/steps-c/sub/step-03b-fetch-temporal.md +229 -0
  102. package/src/{workflows/create-skill/steps-c → skf-create-skill/steps-c/sub}/step-03c-fetch-docs.md +18 -42
  103. package/src/skf-create-stack-skill/SKILL.md +64 -0
  104. package/src/{workflows/create-stack-skill/data → skf-create-stack-skill/assets}/stack-skill-template.md +2 -1
  105. package/src/{workflows/create-stack-skill/data → skf-create-stack-skill/references}/compose-mode-rules.md +19 -5
  106. package/src/{workflows/create-stack-skill/data → skf-create-stack-skill/references}/integration-patterns.md +1 -1
  107. package/src/{workflows/create-stack-skill/data → skf-create-stack-skill/references}/manifest-patterns.md +10 -10
  108. package/src/{workflows/create-stack-skill → skf-create-stack-skill}/steps-c/step-01-init.md +14 -55
  109. package/src/{workflows/create-stack-skill → skf-create-stack-skill}/steps-c/step-02-detect-manifests.md +29 -63
  110. package/src/{workflows/create-stack-skill → skf-create-stack-skill}/steps-c/step-03-rank-and-confirm.md +9 -59
  111. package/src/{workflows/create-stack-skill → skf-create-stack-skill}/steps-c/step-04-parallel-extract.md +29 -64
  112. package/src/skf-create-stack-skill/steps-c/step-05-detect-integrations.md +164 -0
  113. package/src/{workflows/create-stack-skill → skf-create-stack-skill}/steps-c/step-06-compile-stack.md +7 -60
  114. package/src/skf-create-stack-skill/steps-c/step-07-generate-output.md +328 -0
  115. package/src/{workflows/create-stack-skill → skf-create-stack-skill}/steps-c/step-08-validate.md +17 -63
  116. package/src/skf-create-stack-skill/steps-c/step-09-report.md +128 -0
  117. package/src/skf-create-stack-skill/steps-c/step-10-health-check.md +22 -0
  118. package/src/skf-drop-skill/SKILL.md +57 -0
  119. package/src/{workflows/drop-skill → skf-drop-skill}/steps-c/step-01-select.md +9 -69
  120. package/src/{workflows/drop-skill → skf-drop-skill}/steps-c/step-02-execute.md +30 -106
  121. package/src/skf-drop-skill/steps-c/step-03-report.md +83 -0
  122. package/src/skf-drop-skill/steps-c/step-04-health-check.md +22 -0
  123. package/src/skf-export-skill/SKILL.md +57 -0
  124. package/src/skf-export-skill/assets/managed-section-format.md +138 -0
  125. package/src/{workflows/export-skill/data → skf-export-skill/assets}/snippet-format.md +8 -12
  126. package/src/skf-export-skill/steps-c/step-01-load-skill.md +247 -0
  127. package/src/{workflows/export-skill → skf-export-skill}/steps-c/step-02-package.md +5 -58
  128. package/src/{workflows/export-skill → skf-export-skill}/steps-c/step-03-generate-snippet.md +15 -77
  129. package/src/{workflows/export-skill → skf-export-skill}/steps-c/step-04-update-context.md +59 -133
  130. package/src/{workflows/export-skill → skf-export-skill}/steps-c/step-05-token-report.md +4 -58
  131. package/src/{workflows/export-skill → skf-export-skill}/steps-c/step-06-summary.md +20 -64
  132. package/src/skf-export-skill/steps-c/step-07-health-check.md +22 -0
  133. package/src/skf-forger/SKILL.md +110 -0
  134. package/src/skf-forger/bmad-skill-manifest.yaml +11 -0
  135. package/src/skf-quick-skill/SKILL.md +56 -0
  136. package/src/{workflows/quick-skill/data → skf-quick-skill/references}/registry-resolution.md +6 -6
  137. package/src/{workflows/quick-skill → skf-quick-skill}/steps-c/step-01-resolve-target.md +9 -62
  138. package/src/{workflows/quick-skill → skf-quick-skill}/steps-c/step-02-ecosystem-check.md +5 -59
  139. package/src/{workflows/quick-skill → skf-quick-skill}/steps-c/step-03-quick-extract.md +18 -61
  140. package/src/{workflows/quick-skill → skf-quick-skill}/steps-c/step-04-compile.md +6 -60
  141. package/src/{workflows/quick-skill → skf-quick-skill}/steps-c/step-05-validate.md +58 -78
  142. package/src/skf-quick-skill/steps-c/step-06-write.md +73 -0
  143. package/src/skf-quick-skill/steps-c/step-07-health-check.md +22 -0
  144. package/src/skf-refine-architecture/SKILL.md +57 -0
  145. package/src/{workflows/refine-architecture/data → skf-refine-architecture/references}/refinement-rules.md +16 -16
  146. package/src/{workflows/refine-architecture → skf-refine-architecture}/steps-c/step-01-init.md +6 -63
  147. package/src/{workflows/refine-architecture → skf-refine-architecture}/steps-c/step-02-gap-analysis.md +29 -71
  148. package/src/{workflows/refine-architecture → skf-refine-architecture}/steps-c/step-03-issue-detection.md +5 -65
  149. package/src/{workflows/refine-architecture → skf-refine-architecture}/steps-c/step-04-improvements.md +5 -64
  150. package/src/{workflows/refine-architecture → skf-refine-architecture}/steps-c/step-05-compile.md +5 -56
  151. package/src/{workflows/refine-architecture → skf-refine-architecture}/steps-c/step-06-report.md +14 -64
  152. package/src/skf-refine-architecture/steps-c/step-07-health-check.md +22 -0
  153. package/src/skf-rename-skill/SKILL.md +58 -0
  154. package/src/{workflows/rename-skill → skf-rename-skill}/steps-c/step-01-select.md +12 -73
  155. package/src/{workflows/rename-skill → skf-rename-skill}/steps-c/step-02-execute.md +32 -113
  156. package/src/skf-rename-skill/steps-c/step-03-report.md +83 -0
  157. package/src/skf-rename-skill/steps-c/step-04-health-check.md +22 -0
  158. package/src/skf-setup/SKILL.md +55 -0
  159. package/src/{workflows/setup-forge → skf-setup}/steps-c/step-01-detect-and-tier.md +6 -62
  160. package/src/{workflows/setup-forge → skf-setup}/steps-c/step-01b-ccc-index.md +9 -65
  161. package/src/{workflows/setup-forge → skf-setup}/steps-c/step-02-write-config.md +15 -60
  162. package/src/{workflows/setup-forge → skf-setup}/steps-c/step-03-auto-index.md +7 -66
  163. package/src/skf-setup/steps-c/step-04-report.md +92 -0
  164. package/src/skf-setup/steps-c/step-05-health-check.md +22 -0
  165. package/src/skf-test-skill/SKILL.md +59 -0
  166. package/src/skf-test-skill/references/migration-section-rules.md +114 -0
  167. package/src/skf-test-skill/references/scoring-rules.md +207 -0
  168. package/src/skf-test-skill/references/source-access-protocol.md +109 -0
  169. package/src/skf-test-skill/scripts/compute-score.py +310 -0
  170. package/src/skf-test-skill/steps-c/step-01-init.md +238 -0
  171. package/src/{workflows/test-skill → skf-test-skill}/steps-c/step-02-detect-mode.md +4 -62
  172. package/src/skf-test-skill/steps-c/step-03-coverage-check.md +347 -0
  173. package/src/skf-test-skill/steps-c/step-04-coherence-check.md +239 -0
  174. package/src/{workflows/test-skill → skf-test-skill}/steps-c/step-04b-external-validators.md +42 -77
  175. package/src/skf-test-skill/steps-c/step-05-score.md +266 -0
  176. package/src/skf-test-skill/steps-c/step-06-report.md +290 -0
  177. package/src/skf-test-skill/steps-c/step-07-health-check.md +25 -0
  178. package/src/skf-test-skill/templates/test-report-template.md +58 -0
  179. package/src/skf-update-skill/SKILL.md +58 -0
  180. package/src/{workflows/update-skill/data → skf-update-skill/references}/manual-section-rules.md +6 -6
  181. package/src/{workflows/update-skill/data → skf-update-skill/references}/merge-conflict-rules.md +5 -5
  182. package/src/skf-update-skill/references/remote-source-resolution.md +94 -0
  183. package/src/{workflows/update-skill → skf-update-skill}/steps-c/step-01-init.md +22 -69
  184. package/src/skf-update-skill/steps-c/step-02-detect-changes.md +255 -0
  185. package/src/skf-update-skill/steps-c/step-03-re-extract.md +336 -0
  186. package/src/{workflows/update-skill → skf-update-skill}/steps-c/step-04-merge.md +60 -72
  187. package/src/{workflows/update-skill → skf-update-skill}/steps-c/step-05-validate.md +5 -62
  188. package/src/skf-update-skill/steps-c/step-06-write.md +278 -0
  189. package/src/{workflows/update-skill → skf-update-skill}/steps-c/step-07-report.md +11 -66
  190. package/src/skf-update-skill/steps-c/step-08-health-check.md +22 -0
  191. package/src/skf-verify-stack/SKILL.md +60 -0
  192. package/src/skf-verify-stack/assets/feasibility-report-template.md +76 -0
  193. package/src/{workflows/verify-stack/data → skf-verify-stack/references}/coverage-patterns.md +12 -4
  194. package/src/skf-verify-stack/references/integration-verification-rules.md +78 -0
  195. package/src/skf-verify-stack/steps-c/step-01-init.md +178 -0
  196. package/src/{workflows/verify-stack → skf-verify-stack}/steps-c/step-02-coverage.md +27 -72
  197. package/src/skf-verify-stack/steps-c/step-03-integrations.md +179 -0
  198. package/src/{workflows/verify-stack → skf-verify-stack}/steps-c/step-04-requirements.md +14 -67
  199. package/src/skf-verify-stack/steps-c/step-05-synthesize.md +147 -0
  200. package/src/skf-verify-stack/steps-c/step-06-report.md +156 -0
  201. package/src/skf-verify-stack/steps-c/step-07-health-check.md +25 -0
  202. package/tools/cli/commands/install.js +1 -1
  203. package/tools/cli/commands/status.js +21 -23
  204. package/tools/cli/commands/uninstall.js +11 -19
  205. package/tools/cli/commands/update.js +2 -2
  206. package/tools/cli/lib/ide-skills.js +216 -0
  207. package/tools/cli/lib/installer.js +29 -52
  208. package/tools/cli/lib/manifest.js +11 -5
  209. package/tools/cli/lib/platform-codes.yaml +223 -0
  210. package/tools/cli/lib/ui.js +76 -47
  211. package/tools/validate-docs-drift.js +193 -0
  212. package/src/agents/forger.agent.yaml +0 -114
  213. package/src/workflows/README.md +0 -174
  214. package/src/workflows/analyze-source/data/skill-brief-schema.md +0 -125
  215. package/src/workflows/analyze-source/data/unit-detection-heuristics.md +0 -124
  216. package/src/workflows/analyze-source/workflow.md +0 -61
  217. package/src/workflows/audit-skill/workflow.md +0 -64
  218. package/src/workflows/brief-skill/data/skill-brief-schema.md +0 -159
  219. package/src/workflows/brief-skill/workflow.md +0 -58
  220. package/src/workflows/create-skill/data/source-resolution-protocols.md +0 -200
  221. package/src/workflows/create-skill/steps-c/step-03-extract.md +0 -301
  222. package/src/workflows/create-skill/steps-c/step-03b-fetch-temporal.md +0 -253
  223. package/src/workflows/create-skill/steps-c/step-06-validate.md +0 -254
  224. package/src/workflows/create-skill/steps-c/step-08-report.md +0 -176
  225. package/src/workflows/create-skill/workflow.md +0 -53
  226. package/src/workflows/create-stack-skill/steps-c/step-05-detect-integrations.md +0 -196
  227. package/src/workflows/create-stack-skill/steps-c/step-07-generate-output.md +0 -270
  228. package/src/workflows/create-stack-skill/steps-c/step-09-report.md +0 -145
  229. package/src/workflows/create-stack-skill/workflow.md +0 -59
  230. package/src/workflows/drop-skill/steps-c/step-03-report.md +0 -135
  231. package/src/workflows/drop-skill/workflow.md +0 -63
  232. package/src/workflows/export-skill/data/managed-section-format.md +0 -103
  233. package/src/workflows/export-skill/steps-c/step-01-load-skill.md +0 -237
  234. package/src/workflows/export-skill/workflow.md +0 -58
  235. package/src/workflows/quick-skill/steps-c/step-06-write.md +0 -179
  236. package/src/workflows/quick-skill/workflow.md +0 -58
  237. package/src/workflows/refine-architecture/workflow.md +0 -61
  238. package/src/workflows/rename-skill/steps-c/step-03-report.md +0 -132
  239. package/src/workflows/rename-skill/workflow.md +0 -64
  240. package/src/workflows/setup-forge/steps-c/step-04-report.md +0 -156
  241. package/src/workflows/setup-forge/workflow.md +0 -51
  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 -207
  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 -197
  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
@@ -1,221 +0,0 @@
1
- ---
2
- name: 'step-02-detect-changes'
3
- description: 'Diff source file timestamps and hashes against provenance map to identify all changes since last extraction'
4
-
5
- nextStepFile: './step-03-re-extract.md'
6
- noChangeReportFile: './step-07-report.md'
7
- ---
8
-
9
- # Step 2: Detect Changes
10
-
11
- ## STEP GOAL:
12
-
13
- Compare current source code state against the provenance map to produce a complete change manifest identifying every changed, added, deleted, moved, and renamed file and export since last extraction.
14
-
15
- ## MANDATORY EXECUTION RULES (READ FIRST):
16
-
17
- ### Universal Rules:
18
-
19
- - 🛑 NEVER generate content without user input
20
- - 📖 CRITICAL: Read the complete step file before taking any action
21
- - 🔄 CRITICAL: When loading next step with 'C', ensure entire file is read
22
- - 📋 YOU ARE A FACILITATOR, not a content generator
23
- - ⚙️ 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
24
- - ✅ YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
25
-
26
- ### Role Reinforcement:
27
-
28
- - ✅ You are a precision code analyst operating in Surgeon mode
29
- - ✅ Zero-hallucination principle: every change must be verified against actual source state
30
- - ✅ Clinical, terse communication — report changes factually with file:line references
31
- - ✅ You bring provenance-driven analysis; the source code provides ground truth
32
-
33
- ### Step-Specific Rules:
34
-
35
- - 🎯 Focus ONLY on detecting and classifying changes — do not extract or merge
36
- - 🚫 FORBIDDEN to modify any files — read-only change detection
37
- - 🚫 FORBIDDEN to re-extract content — that is step 03
38
- - 💬 Use subprocess Pattern 4 (parallel): In Claude Code, use multiple parallel Agent tool calls or `run_in_background: true`. In Cursor, use parallel requests (IDE-dependent). In CLI, use `xargs -P` or background processes. See [knowledge/tool-resolution.md](../../../knowledge/tool-resolution.md)
39
- - ⚙️ If subprocess unavailable, perform comparison sequentially in main thread
40
-
41
- ## EXECUTION PROTOCOLS:
42
-
43
- - 🎯 Follow MANDATORY SEQUENCE exactly
44
- - 💾 Build change manifest with categorized findings
45
- - 📖 Track change counts by category for summary
46
- - 🚫 FORBIDDEN to proceed if source path is inaccessible
47
-
48
- ## CONTEXT BOUNDARIES:
49
-
50
- - Available: loaded baseline from step 01 (SKILL.md, metadata.json, provenance-map.json, forge-tier, source_root)
51
- - Focus: change detection only — no extraction, no merge
52
- - Limits: read-only operations on source code
53
- - Dependencies: step 01 must have loaded all artifacts successfully
54
-
55
- ## MANDATORY SEQUENCE
56
-
57
- **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
58
-
59
- ### 0. Check for Test Report Input (Gap-Driven Mode)
60
-
61
- **If `update_mode == "gap-driven"` (set in step-01 via `--from-test-report`):**
62
-
63
- Load the test report at `{test_report_path}` and extract findings:
64
-
65
- 1. Read the **Gap Report** section — each gap entry has severity, category, and description
66
- 2. Read the **Coverage Analysis** section — each per-export row has documented/missing/mismatch status
67
- 3. Translate findings into change manifest format:
68
-
69
- | Gap Severity | Gap Type | Change Category |
70
- |-------------|----------|-----------------|
71
- | Critical | Missing export documentation | NEW_EXPORT (undocumented public API) |
72
- | High | Signature mismatch | MODIFIED_EXPORT (signature needs update) |
73
- | Medium | Missing type/interface docs | NEW_EXPORT (undocumented type) |
74
- | Medium | Stale documentation | MODIFIED_EXPORT (docs reference removed export) |
75
- | Low | Missing metadata/examples | metadata update |
76
-
77
- 4. Build the change manifest from translated gaps — no file-level timestamp comparison needed since source hasn't changed
78
- 5. Set `gap_count` from the total number of translated entries
79
- 6. **Skip to section 5** (Display Change Summary) with the gap-derived manifest
80
-
81
- "**Gap-driven update mode.** Translating {gap_count} test report findings into change manifest — source drift detection skipped."
82
-
83
- **If normal mode:** Continue with source drift detection below.
84
-
85
- ### 1. Scan Current Source State
86
-
87
- Read the source directory at `{source_root}` and build a current file inventory:
88
- - For each source file: record path, file size, last modified timestamp
89
- - Focus on file types relevant to the skill (from provenance map file patterns)
90
- - Exclude non-source files (node_modules, build artifacts, etc.)
91
-
92
- ### 2. Compare Against Provenance Map
93
-
94
- **If normal mode (provenance map available):**
95
-
96
- Launch subprocesses in parallel that compare source state against provenance map across these categories, returning change findings per category:
97
-
98
- **Category A — File-level changes:**
99
- - Files in provenance map but missing from source → DELETED
100
- - Files in source but not in provenance map → ADDED
101
- - Files in both but with different timestamps/sizes → MODIFIED
102
- - Files with same content at different paths → MOVED
103
-
104
- **Category B — Export-level changes (for MODIFIED files only):**
105
- - For each modified file, compare export list against provenance map exports
106
- - Exports in provenance but not in source → DELETED_EXPORT
107
- - Exports in source but not in provenance → NEW_EXPORT
108
- - Exports with changed signatures/types → MODIFIED_EXPORT
109
- - Exports at different line numbers but same content → MOVED_EXPORT
110
-
111
- **Category C — Rename detection:**
112
- - Cross-reference deleted files/exports with added files/exports
113
- - If content similarity > 80%: classify as RENAMED instead of deleted+added. **Similarity mechanism by tier:** Quick: compare file size ratio (within 20%) and export name overlap (>70% of exports match by name). Forge and above: use ast-grep to compare export signatures between the deleted and added files. Forge+/Deep: use CCC semantic similarity when available
114
-
115
- **Category D — Script/asset file changes:**
116
- - Compare `file_entries` from provenance-map.json against current source files
117
- - For each file_entry: compute current SHA-256 content hash, compare against stored hash
118
- - Files with changed hashes → MODIFIED_FILE
119
- - Files in provenance but missing from source → DELETED_FILE
120
- - Files in source matching detection patterns (scripts/, bin/, assets/, templates/) but not in provenance → NEW_FILE
121
- - Files in `scripts/[MANUAL]/` or `assets/[MANUAL]/` → SKIP (user-authored, preserved)
122
-
123
- Aggregate all subprocess results into a unified change manifest.
124
-
125
- **If degraded mode (no provenance map):**
126
- - All source files are treated as MODIFIED
127
- - All exports will be fully re-extracted in step 03
128
- - Skip export-level comparison
129
-
130
- ### 3. Build Change Manifest
131
-
132
- Compile the change manifest with structured entries:
133
-
134
- ```
135
- Change Manifest:
136
- files_changed: [count]
137
- files_added: [count]
138
- files_deleted: [count]
139
- files_moved: [count]
140
-
141
- exports_modified: [count]
142
- exports_new: [count]
143
- exports_deleted: [count]
144
- exports_renamed: [count]
145
- exports_moved: [count]
146
-
147
- scripts_modified, scripts_added, scripts_deleted: {counts}
148
- assets_modified, assets_added, assets_deleted: {counts}
149
-
150
- Per-file detail:
151
- {file_path}:
152
- status: MODIFIED|ADDED|DELETED|MOVED
153
- exports_affected: [{export_name, change_type, old_line, new_line}]
154
- ```
155
-
156
- ### 4. Check for No-Change Shortcut
157
-
158
- **If zero changes detected across all categories:**
159
-
160
- "**No changes detected.** Source code matches provenance map exactly.
161
-
162
- The skill `{skill_name}` is current — no update needed.
163
-
164
- **Skipping to report step...**"
165
-
166
- → Skip steps 03-06, immediately load {noChangeReportFile} with "no changes" status.
167
-
168
- ### 5. Display Change Summary and Auto-Proceed
169
-
170
- "**Change Detection Complete:**
171
-
172
- | Category | Count |
173
- |----------|-------|
174
- | Files modified | {count} |
175
- | Files added | {count} |
176
- | Files deleted | {count} |
177
- | Files moved/renamed | {count} |
178
- | Exports affected | {total_export_changes} |
179
-
180
- **Proceeding to re-extraction of {affected_file_count if normal mode, or gap_count if gap-driven mode} changes...**"
181
-
182
- ### 6. Present MENU OPTIONS
183
-
184
- Display: "**Proceeding to re-extraction...**"
185
-
186
- #### Menu Handling Logic:
187
-
188
- - After change manifest is built, immediately load, read entire file, then execute {nextStepFile}
189
- - **EXCEPTION:** If no changes detected (section 4), load {noChangeReportFile} instead
190
-
191
- #### EXECUTION RULES:
192
-
193
- - This is an auto-proceed step with no user choices
194
- - Proceed directly to next step after change detection completes
195
-
196
- ## CRITICAL STEP COMPLETION NOTE
197
-
198
- ONLY WHEN the change manifest is fully built will you load {nextStepFile} to begin re-extraction. If no changes detected, skip to {noChangeReportFile}.
199
-
200
- ---
201
-
202
- ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
203
-
204
- ### ✅ SUCCESS:
205
-
206
- - Every file in provenance map compared against current source state
207
- - Changes categorized correctly (modified, added, deleted, moved, renamed)
208
- - Export-level changes detected for modified files
209
- - Change manifest built with per-file detail
210
- - No-change shortcut correctly routes to report step
211
- - Summary displayed before auto-proceeding
212
-
213
- ### ❌ SYSTEM FAILURE:
214
-
215
- - Not comparing all files in provenance map
216
- - Missing category of changes (e.g., not detecting deletions)
217
- - Modifying any files during detection
218
- - Not detecting rename patterns (treating as delete+add)
219
- - Proceeding with empty change manifest when changes exist
220
-
221
- **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
@@ -1,256 +0,0 @@
1
- ---
2
- name: 'step-03-re-extract'
3
- description: 'Tier-aware AST extraction on changed files only, producing fresh exports with confidence tiers'
4
-
5
- nextStepFile: './step-04-merge.md'
6
- extractionPatternsData: '../../create-skill/data/extraction-patterns.md'
7
- extractionPatternsTracingData: '../../create-skill/data/extraction-patterns-tracing.md'
8
- remoteSourceResolutionData: '../data/remote-source-resolution.md'
9
- tierDegradationRulesData: '../../create-skill/data/tier-degradation-rules.md'
10
- ---
11
-
12
- # Step 3: Re-Extract Changed Exports
13
-
14
- ## STEP GOAL:
15
-
16
- Perform tier-aware extraction on only the changed files identified in step 02, producing fresh export data with confidence tier labels (T1/T1-low/T2) that will be merged into the existing skill in step 04.
17
-
18
- ## MANDATORY EXECUTION RULES (READ FIRST):
19
-
20
- ### Universal Rules:
21
-
22
- - 🛑 NEVER generate content without user input
23
- - 📖 CRITICAL: Read the complete step file before taking any action
24
- - 🔄 CRITICAL: When loading next step with 'C', ensure entire file is read
25
- - 📋 YOU ARE A FACILITATOR, not a content generator
26
- - ⚙️ 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
27
- - ✅ YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
28
-
29
- ### Role Reinforcement:
30
-
31
- - ✅ You are a precision code analyst operating in Surgeon mode
32
- - ✅ Zero-hallucination principle: every extracted instruction must include AST file:line citation
33
- - ✅ Confidence tier labels are MANDATORY on all extracted content
34
- - ✅ You bring AST-backed structural analysis; the source code provides ground truth
35
-
36
- ### Step-Specific Rules:
37
-
38
- - 🎯 Focus ONLY on extracting changed exports — do not merge or modify existing skill
39
- - 🚫 FORBIDDEN to extract unchanged files — only files in the change manifest
40
- - 🚫 FORBIDDEN to modify SKILL.md — extraction produces intermediate data for step 04
41
- - 💬 DO NOT BE LAZY — For EACH changed file, launch a subprocess for deep AST analysis (Pattern 2)
42
- - ⚙️ If subprocess unavailable, perform extraction sequentially in main thread
43
-
44
- ## EXECUTION PROTOCOLS:
45
-
46
- - 🎯 Follow MANDATORY SEQUENCE exactly
47
- - 💾 Produce structured extraction results per changed file
48
- - 📖 Label every extraction with confidence tier
49
- - 🚫 FORBIDDEN to hallucinate exports — only extract what exists in source
50
-
51
- ## CONTEXT BOUNDARIES:
52
-
53
- - Available: change manifest from step 02, forge tier from step 01, source files
54
- - Focus: extraction only — no merge, no write
55
- - Limits: only changed files from manifest
56
- - Dependencies: step 02 must have produced change manifest
57
-
58
- ## MANDATORY SEQUENCE
59
-
60
- **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
61
-
62
- ### 1. Check for Docs-Only Mode
63
-
64
- **If `source_type: "docs-only"` in the original brief or metadata:**
65
-
66
- "**Docs-only skill detected.** This skill was generated from external documentation, not source code. Re-extraction will re-fetch the original `doc_urls` to check for updated content."
67
-
68
- - Re-fetch each URL from `doc_urls` (from the brief or metadata) using whatever web fetching capability is available
69
- - Extract updated API information with T3 `[EXT:{url}]` citations
70
- - Build the updated extraction inventory from fetched content
71
- - Skip all source code extraction below — proceed directly to the merge step (section 5 or equivalent)
72
-
73
- **If `source_type: "source"` (default):** Continue with source extraction below.
74
-
75
- ### 1b. Determine Extraction Strategy by Tier
76
-
77
- **Remote Source Resolution (Forge/Deep only):**
78
-
79
- **MCP source access (ordered fallback):** When `source_repo` is set in metadata.json, try each MCP tool in order to fetch only the changed files from the change manifest. This avoids ephemeral clone overhead entirely. Tools are ordered by data freshness — gh API returns live GitHub content and is preferred for update-skill where current file versions are required. zread and deepwiki depend on manual indexing and may return stale data if indexes haven't been refreshed since the changes being extracted.
80
-
81
- 1. **gh API** — `gh api repos/{owner}/{repo}/contents/{path}` for raw file content
82
- - If accessible: fetch file content (base64-decoded), always current
83
- - If rate-limited, 404, or inaccessible: log tool and reason, continue to next tool
84
- 2. **zread** — `get_repo_structure` + `read_file` for targeted file access
85
- - If repo found: fetch changed files, proceed with extraction
86
- - If "repo not found" or error: log tool and reason, continue to next tool
87
- - Caveat: indexed data — may be stale if index wasn't refreshed after the target changes
88
- 3. **deepwiki** — `ask_question` for targeted export/signature queries
89
- - If repo indexed and returns usable source data: extract from response
90
- - If no results or repo not indexed: log tool and reason, continue to next tool
91
- - Caveat: returns synthesized content, not raw source — extraction quality varies; index may be stale
92
-
93
- **Confidence labeling:** MCP-fetched content written to a temp file and analyzed with ast-grep → T1. MCP-fetched content analyzed with pattern matching (AST unavailable) → T1-low.
94
-
95
- **If all MCP tools fail for this repo:** Fall back to ephemeral clone — load and follow `{remoteSourceResolutionData}` for clone setup, version reconciliation, and AST tool unavailability handling.
96
-
97
- **If all approaches fail (MCP + ephemeral clone):** Degrade to provenance-map-only analysis (State 2, T1 confidence from compilation-time data). Warn user: "Source access failed for {source_repo}. Analysis limited to provenance-map baseline."
98
-
99
- **Quick tier (text pattern matching):**
100
- - Extract function/class/type names via regex patterns
101
- - Extract export statements via text matching
102
- - Confidence: T1-low (pattern-matched, not AST-verified)
103
-
104
- **Forge tier (AST structural extraction):**
105
-
106
- ⚠️ **CRITICAL:** Load and follow the **AST Extraction Protocol** from `{extractionPatternsData}`. Use the decision tree based on the number of changed files: prefer MCP `find_code()` for small sets, `find_code_by_rule()` with scoped YAML rules for medium sets, and CLI `--json=stream` with line-by-line streaming for large sets. Never use `ast-grep --json` (without `=stream`) — it loads the entire result set into memory and will fail on large codebases.
107
-
108
- - Extract: function signatures, type definitions, class members, exported constants
109
- - Extract: parameter types, return types, JSDoc/docstring comments
110
- - Confidence: T1 (AST-verified structural truth)
111
-
112
- **Tier degradation handling (Forge/Forge+/Deep):** If ast-grep is unavailable or fails on individual files, follow `{tierDegradationRulesData}` for fallback strategy and user notification requirements. Silent degradation is forbidden — the user must always know when AST extraction was skipped.
113
-
114
- **Deep tier (AST + QMD semantic enrichment):**
115
- - Perform all Forge tier extractions (T1)
116
- - Additionally: launch a subprocess that queries qmd_bridge for temporal context on changed exports, returning T2 evidence per export
117
- - QMD provides: usage patterns, historical context, related documentation
118
- - Confidence: T1 for structural, T2 for semantic enrichment
119
-
120
- **Tool resolution:** `ast_bridge` → ast-grep MCP tools (`find_code`, `find_code_by_rule`) or `ast-grep` CLI. `qmd_bridge` → QMD MCP tools (`mcp__plugin_qmd-plugin_qmd__search`, `vector_search`) or `qmd` CLI. See [knowledge/tool-resolution.md](../../../knowledge/tool-resolution.md).
121
-
122
- ### 2. Extract Changed Files
123
-
124
- DO NOT BE LAZY — For EACH file in the change manifest with status MODIFIED, ADDED, or RENAMED, launch a subprocess that:
125
-
126
- 1. Loads the source file
127
- 2. Performs tier-appropriate extraction (Quick/Forge/Forge+/Deep)
128
- 3. For each export found:
129
- - Record: export name, type (function/class/type/constant), signature
130
- - Record: file path, start line, end line
131
- - Record: parameters with types (if function/method)
132
- - Record: return type (if function/method)
133
- - Record: JSDoc/docstring summary (if present)
134
- - Label: confidence tier (T1/T1-low/T2)
135
- 4. Returns structured extraction findings to parent
136
-
137
- **For DELETED files:** No extraction needed — deletions handled in merge step.
138
-
139
- **For MOVED files:** Re-extract at new location to update file:line references.
140
-
141
- **Re-export tracing (Forge/Deep only):** After extracting changed files, check if any public exports from the package entry point (`__init__.py`, `index.ts`, `lib.rs`) are unresolved — particularly when a changed file is part of a module re-export chain. Follow the **Re-Export Tracing** protocol in `{extractionPatternsTracingData}` to trace unresolved symbols to their actual definition files.
142
-
143
- ### 2b. CCC Semantic Ranking (Forge+ and Deep with ccc)
144
-
145
- **IF `tools.ccc` is true in forge-tier.yaml:**
146
-
147
- Before aggregating extraction results, use CCC to assess semantic significance of changes:
148
-
149
- 1. Run `ccc_bridge.search("{skill_name}", source_root, top_k=15)` — **Tool resolution:** `/ccc` skill search (Claude Code), ccc MCP (Cursor), `ccc search` (CLI) — to get the skill's most semantically central files
150
- 2. Cross-reference the change manifest files with CCC results
151
- 3. Files appearing in BOTH the change manifest AND CCC's top results are **semantically significant changes** — flag them for priority in the merge step
152
- 4. Store `{ccc_significant_changes: [{file, score}]}` in context
153
-
154
- This helps the merge step (section 4) prioritize which changes are most likely to affect the skill's core content vs. peripheral modifications.
155
-
156
- CCC failures: skip ranking silently, all changes treated equally.
157
-
158
- **Note on remote sources:** If `source_root` is an ephemeral clone (remote source), the clone path is not indexed by CCC. The search will return empty results and semantic ranking will be skipped. This is expected — deferred CCC indexing is implemented in create-skill step-03 but not in update-skill. All changes are treated equally for remote sources.
159
-
160
- **IF `tools.ccc` is false:** Skip this section silently.
161
-
162
- ### 3. Deep Tier QMD Enrichment (Conditional)
163
-
164
- **ONLY if forge_tier == Deep:**
165
-
166
- Read the `qmd_collections` registry from `{sidecar_path}/forge-tier.yaml`.
167
-
168
- Find the collection entry matching the current skill: look for an entry where `skill_name` matches the skill being updated AND `type` is `"extraction"`.
169
-
170
- **If a matching extraction collection is found:**
171
- Launch a subprocess that loads qmd_bridge and for each changed export:
172
- 1. Queries the `{skill_name}-extraction` collection for semantic context related to the export
173
- 2. Searches for usage patterns, documentation references, temporal history
174
- 3. Returns T2 evidence per export (usage frequency, context snippets, related concepts)
175
-
176
- **If no matching collection found in registry:**
177
- Log: "No QMD extraction collection found for {skill_name}. T2 enrichment skipped. Re-run [CS] Create Skill to generate the collection."
178
- Continue without T2 enrichment — extraction still produces T1 results.
179
-
180
- **If forge_tier != Deep:** Skip this section with notice: "QMD enrichment skipped (tier: {forge_tier})"
181
-
182
- ### 4. Compile Extraction Results
183
-
184
- Aggregate all subprocess results into structured extraction data:
185
-
186
- ```
187
- Extraction Results:
188
- files_extracted: [count]
189
- exports_extracted: [count]
190
- confidence_breakdown:
191
- T1: [count]
192
- T1-low: [count]
193
- T2: [count]
194
-
195
- Per-file extractions:
196
- {file_path}:
197
- exports:
198
- - name: {export_name}
199
- type: function|class|type|constant
200
- signature: {full signature}
201
- location: {file}:{start_line}-{end_line}
202
- confidence: T1|T1-low|T2
203
- parameters: [{name, type}]
204
- return_type: {type}
205
- docstring: {summary}
206
- qmd_evidence: {if Deep tier}
207
- ```
208
-
209
- ### 5. Display Extraction Summary and Auto-Proceed
210
-
211
- "**Re-Extraction Complete:**
212
-
213
- | Metric | Count |
214
- |--------|-------|
215
- | Files extracted | {count} |
216
- | Exports extracted | {count} |
217
- | T1 (AST-verified) | {count} |
218
- | T1-low (pattern-matched) | {count} |
219
- | T2 (QMD-enriched) | {count} |
220
-
221
- **Proceeding to merge with existing skill...**"
222
-
223
- ### 6. Present MENU OPTIONS
224
-
225
- Display: "**Proceeding to merge...**"
226
-
227
- - After extraction results are compiled, immediately load, read entire file, then execute {nextStepFile}
228
- - This is an auto-proceed step with no user choices
229
-
230
- ## CRITICAL STEP COMPLETION NOTE
231
-
232
- ONLY WHEN all changed files have been extracted and results compiled will you load {nextStepFile} to begin the merge operation.
233
-
234
- ---
235
-
236
- ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
237
-
238
- ### ✅ SUCCESS:
239
-
240
- - Every changed file from manifest extracted with tier-appropriate method
241
- - All exports labeled with confidence tier (T1/T1-low/T2)
242
- - AST file:line citations on every extracted export
243
- - QMD enrichment performed for Deep tier (skipped with notice for Quick/Forge/Forge+)
244
- - Extraction results compiled with per-file detail
245
- - Summary displayed before auto-proceeding
246
- - No unchanged files extracted
247
-
248
- ### ❌ SYSTEM FAILURE:
249
-
250
- - Extracting unchanged files (wasting resources)
251
- - Missing confidence tier labels on any export
252
- - Hallucinating exports not present in source code
253
- - Skipping QMD enrichment at Deep tier
254
- - Modifying SKILL.md or any existing artifacts during extraction
255
-
256
- **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.