bmad-module-skill-forge 1.4.1 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/README.md +0 -8
  3. package/docs/_data/pinned.yaml +1 -1
  4. package/docs/_internal/STABILITY.md +1 -1
  5. package/docs/architecture.md +2 -2
  6. package/docs/examples.md +1 -1
  7. package/docs/workflows.md +5 -5
  8. package/package.json +2 -2
  9. package/src/README.md +1 -1
  10. package/src/knowledge/ccc-bridge.md +12 -12
  11. package/src/knowledge/qmd-registry.md +5 -5
  12. package/src/shared/health-check.md +5 -5
  13. package/src/shared/references/description-guard-protocol.md +100 -0
  14. package/src/shared/references/output-contract-schema.md +1 -1
  15. package/src/shared/scripts/schemas/skf-brief-result-envelope.v1.json +6 -6
  16. package/src/shared/scripts/schemas/skf-setup-result-envelope.v1.json +9 -3
  17. package/src/shared/scripts/schemas/skf-update-result-envelope.v1.json +149 -0
  18. package/src/shared/scripts/schemas/skill-brief.v1.json +22 -2
  19. package/src/shared/scripts/skf-build-change-manifest.py +420 -0
  20. package/src/shared/scripts/skf-check-workspace-drift.py +321 -0
  21. package/src/shared/scripts/skf-compare-file-hashes.py +357 -0
  22. package/src/shared/scripts/skf-description-guard.py +359 -0
  23. package/src/shared/scripts/skf-detect-language.py +2 -2
  24. package/src/shared/scripts/skf-detect-scripts-assets.py +613 -0
  25. package/src/shared/scripts/skf-detect-tools.py +147 -16
  26. package/src/shared/scripts/skf-detect-workspaces.py +1 -1
  27. package/src/shared/scripts/skf-disqualify-candidates.py +576 -0
  28. package/src/shared/scripts/skf-emit-brief-result-envelope.py +3 -3
  29. package/src/shared/scripts/skf-emit-result-envelope.py +93 -9
  30. package/src/shared/scripts/skf-enumerate-stack-skills.py +514 -0
  31. package/src/shared/scripts/skf-forge-tier-rw.py +11 -11
  32. package/src/shared/scripts/skf-hash-content.py +284 -0
  33. package/src/shared/scripts/skf-load-provenance.py +295 -0
  34. package/src/shared/scripts/skf-manifest-ops.py +22 -6
  35. package/src/shared/scripts/skf-merge-ccc-exclusions.py +34 -4
  36. package/src/shared/scripts/skf-pair-intersect.py +250 -0
  37. package/src/shared/scripts/skf-provenance-gap-dispatch.py +433 -0
  38. package/src/shared/scripts/skf-qmd-classify-collections.py +42 -8
  39. package/src/shared/scripts/skf-recommend-scope-type.py +2 -2
  40. package/src/shared/scripts/skf-render-quick-metadata.py +2 -2
  41. package/src/shared/scripts/skf-resolve-authoritative-files.py +504 -0
  42. package/src/shared/scripts/skf-scan-manifests.py +738 -0
  43. package/src/shared/scripts/skf-scan-skill-md-structure.py +375 -0
  44. package/src/shared/scripts/skf-update-active-symlink.py +315 -0
  45. package/src/shared/scripts/skf-validate-brief-inputs.py +5 -5
  46. package/src/shared/scripts/skf-validate-brief-schema.py +348 -0
  47. package/src/shared/scripts/skf-write-skill-brief.py +61 -5
  48. package/src/skf-analyze-source/SKILL.md +69 -16
  49. package/src/skf-analyze-source/assets/skill-brief-schema.md +1 -1
  50. package/src/skf-analyze-source/customize.toml +55 -0
  51. package/src/skf-analyze-source/{steps-c/step-01b-continue.md → references/continue.md} +12 -12
  52. package/src/skf-analyze-source/{steps-c/step-06-generate-briefs.md → references/generate-briefs.md} +29 -10
  53. package/src/skf-analyze-source/{steps-c/step-07-health-check.md → references/health-check.md} +5 -3
  54. package/src/skf-analyze-source/{steps-c/step-03-identify-units.md → references/identify-units.md} +48 -14
  55. package/src/skf-analyze-source/{steps-c/step-01-init.md → references/init.md} +32 -9
  56. package/src/skf-analyze-source/{steps-c/step-04-map-and-detect.md → references/map-and-detect.md} +52 -25
  57. package/src/skf-analyze-source/{steps-c/step-05-recommend.md → references/recommend.md} +15 -8
  58. package/src/skf-analyze-source/{steps-c/step-02-scan-project.md → references/scan-project.md} +16 -10
  59. package/src/skf-analyze-source/references/unit-detection-heuristics.md +2 -0
  60. package/src/skf-analyze-source/templates/analysis-report-template.md +6 -6
  61. package/src/skf-audit-skill/SKILL.md +66 -15
  62. package/src/skf-audit-skill/assets/drift-report-template.md +6 -5
  63. package/src/skf-audit-skill/customize.toml +49 -0
  64. package/src/skf-audit-skill/{steps-c/step-07-health-check.md → references/health-check.md} +5 -3
  65. package/src/skf-audit-skill/{steps-c/step-01-init.md → references/init.md} +63 -19
  66. package/src/skf-audit-skill/{steps-c/step-02-re-index.md → references/re-index.md} +11 -11
  67. package/src/skf-audit-skill/{steps-c/step-06-report.md → references/report.md} +25 -7
  68. package/src/skf-audit-skill/{steps-c/step-04-semantic-diff.md → references/semantic-diff.md} +6 -6
  69. package/src/skf-audit-skill/{steps-c/step-05-severity-classify.md → references/severity-classify.md} +5 -5
  70. package/src/skf-audit-skill/references/severity-rules.md +2 -0
  71. package/src/skf-audit-skill/{steps-c/step-03-structural-diff.md → references/structural-diff.md} +35 -17
  72. package/src/skf-brief-skill/SKILL.md +49 -19
  73. package/src/skf-brief-skill/assets/description-voice-examples.md +1 -1
  74. package/src/skf-brief-skill/assets/skill-brief-schema.md +32 -2
  75. package/src/skf-brief-skill/customize.toml +44 -0
  76. package/src/skf-brief-skill/{steps-c/step-02-analyze-target.md → references/analyze-target.md} +27 -15
  77. package/src/skf-brief-skill/{steps-c/step-04-confirm-brief.md → references/confirm-brief.md} +13 -10
  78. package/src/skf-brief-skill/references/draft-checkpoint.md +4 -4
  79. package/src/skf-brief-skill/{steps-c/step-01-gather-intent.md → references/gather-intent.md} +35 -29
  80. package/src/skf-brief-skill/references/headless-args.md +9 -9
  81. package/src/skf-brief-skill/references/headless-source-authority-detection.md +1 -1
  82. package/src/skf-brief-skill/{steps-c/step-06-health-check.md → references/health-check.md} +4 -2
  83. package/src/skf-brief-skill/references/portfolio-similarity-check.md +2 -2
  84. package/src/skf-brief-skill/references/qmd-collection-registration.md +2 -2
  85. package/src/skf-brief-skill/{steps-c/step-03-scope-definition.md → references/scope-definition.md} +27 -20
  86. package/src/skf-brief-skill/references/version-resolution.md +2 -2
  87. package/src/skf-brief-skill/{steps-c/step-05-write-brief.md → references/write-brief.md} +29 -16
  88. package/src/skf-create-skill/SKILL.md +25 -19
  89. package/src/skf-create-skill/assets/compile-assembly-rules.md +3 -3
  90. package/src/skf-create-skill/assets/skill-sections.md +5 -5
  91. package/src/skf-create-skill/assets/tessl-dismissal-rules.md +11 -11
  92. package/src/skf-create-skill/customize.toml +35 -0
  93. package/src/skf-create-skill/references/authoritative-files-protocol.md +142 -0
  94. package/src/skf-create-skill/{steps-c/step-05-compile.md → references/compile.md} +16 -16
  95. package/src/skf-create-skill/{steps-c/step-03d-component-extraction.md → references/component-extraction.md} +16 -16
  96. package/src/skf-create-skill/{steps-c/step-02-ecosystem-check.md → references/ecosystem-check.md} +4 -4
  97. package/src/skf-create-skill/{steps-c/step-04-enrich.md → references/enrich.md} +3 -3
  98. package/src/skf-create-skill/{steps-c/step-03-extract.md → references/extract.md} +52 -120
  99. package/src/skf-create-skill/references/extraction-patterns.md +10 -8
  100. package/src/skf-create-skill/{steps-c/step-07-generate-artifacts.md → references/generate-artifacts.md} +11 -11
  101. package/src/skf-create-skill/{steps-c/step-09-health-check.md → references/health-check.md} +4 -2
  102. package/src/skf-create-skill/{steps-c/step-01-load-brief.md → references/load-brief.md} +40 -32
  103. package/src/skf-create-skill/{steps-c/step-08-report.md → references/report.md} +8 -8
  104. package/src/skf-create-skill/references/source-resolution-protocols.md +6 -6
  105. package/src/skf-create-skill/{steps-c/sub/step-02b-ccc-discover.md → references/sub/ccc-discover.md} +5 -5
  106. package/src/skf-create-skill/{steps-c/sub/step-03c-fetch-docs.md → references/sub/fetch-docs.md} +28 -12
  107. package/src/skf-create-skill/{steps-c/sub/step-03b-fetch-temporal.md → references/sub/fetch-temporal.md} +81 -50
  108. package/src/skf-create-skill/{steps-c/step-06-validate.md → references/validate.md} +48 -28
  109. package/src/skf-create-stack-skill/SKILL.md +76 -17
  110. package/src/skf-create-stack-skill/assets/provenance-map-schema.md +102 -0
  111. package/src/skf-create-stack-skill/assets/stack-skill-template.md +1 -1
  112. package/src/skf-create-stack-skill/customize.toml +46 -0
  113. package/src/skf-create-stack-skill/{steps-c/step-06-compile-stack.md → references/compile-stack.md} +6 -5
  114. package/src/skf-create-stack-skill/references/compose-mode-rules.md +3 -1
  115. package/src/skf-create-stack-skill/{steps-c/step-05-detect-integrations.md → references/detect-integrations.md} +37 -11
  116. package/src/skf-create-stack-skill/{steps-c/step-02-detect-manifests.md → references/detect-manifests.md} +32 -28
  117. package/src/skf-create-stack-skill/{steps-c/step-07-generate-output.md → references/generate-output.md} +11 -85
  118. package/src/skf-create-stack-skill/{steps-c/step-10-health-check.md → references/health-check.md} +4 -2
  119. package/src/skf-create-stack-skill/{steps-c/step-01-init.md → references/init.md} +70 -4
  120. package/src/skf-create-stack-skill/references/integration-patterns.md +2 -0
  121. package/src/skf-create-stack-skill/references/manifest-patterns.md +2 -0
  122. package/src/skf-create-stack-skill/{steps-c/step-04-parallel-extract.md → references/parallel-extract.md} +44 -17
  123. package/src/skf-create-stack-skill/{steps-c/step-03-rank-and-confirm.md → references/rank-and-confirm.md} +5 -4
  124. package/src/skf-create-stack-skill/{steps-c/step-09-report.md → references/report.md} +3 -3
  125. package/src/skf-create-stack-skill/{steps-c/step-08-validate.md → references/validate.md} +6 -6
  126. package/src/skf-drop-skill/SKILL.md +84 -12
  127. package/src/skf-drop-skill/customize.toml +57 -0
  128. package/src/skf-drop-skill/{steps-c/step-02-execute.md → references/execute.md} +49 -34
  129. package/src/skf-drop-skill/{steps-c/step-04-health-check.md → references/health-check.md} +6 -4
  130. package/src/skf-drop-skill/{steps-c/step-03-report.md → references/report.md} +13 -5
  131. package/src/skf-drop-skill/{steps-c/step-01-select.md → references/select.md} +63 -15
  132. package/src/skf-export-skill/SKILL.md +85 -16
  133. package/src/skf-export-skill/assets/managed-section-format.md +3 -3
  134. package/src/skf-export-skill/assets/snippet-format.md +2 -2
  135. package/src/skf-export-skill/customize.toml +49 -0
  136. package/src/skf-export-skill/{steps-c/step-03-generate-snippet.md → references/generate-snippet.md} +11 -11
  137. package/src/skf-export-skill/{steps-c/step-07-health-check.md → references/health-check.md} +6 -4
  138. package/src/skf-export-skill/{steps-c/step-01-load-skill.md → references/load-skill.md} +11 -49
  139. package/src/skf-export-skill/references/manifest-rebuild.md +68 -0
  140. package/src/skf-export-skill/references/multi-skill-mode.md +38 -0
  141. package/src/skf-export-skill/references/orphan-context-detection.md +75 -0
  142. package/src/skf-export-skill/references/orphan-row-detection.md +102 -0
  143. package/src/skf-export-skill/{steps-c/step-02-package.md → references/package.md} +7 -7
  144. package/src/skf-export-skill/references/preflight-snippet-root-probe.md +79 -0
  145. package/src/skf-export-skill/{steps-c/step-06-summary.md → references/summary.md} +23 -11
  146. package/src/skf-export-skill/{steps-c/step-05-token-report.md → references/token-report.md} +5 -5
  147. package/src/skf-export-skill/{steps-c/step-04-update-context.md → references/update-context.md} +109 -113
  148. package/src/skf-quick-skill/SKILL.md +63 -123
  149. package/src/skf-quick-skill/customize.toml +44 -0
  150. package/src/skf-quick-skill/references/batch-mode.md +102 -0
  151. package/src/skf-quick-skill/{steps-c/step-04-compile.md → references/compile.md} +10 -10
  152. package/src/skf-quick-skill/{steps-c/step-02-ecosystem-check.md → references/ecosystem-check.md} +5 -5
  153. package/src/skf-quick-skill/{steps-c/step-06-finalize.md → references/finalize.md} +7 -7
  154. package/src/skf-quick-skill/{steps-c/step-07-health-check.md → references/health-check.md} +3 -3
  155. package/src/skf-quick-skill/{steps-c/step-03-quick-extract.md → references/quick-extract.md} +5 -5
  156. package/src/skf-quick-skill/references/registry-resolution.md +2 -0
  157. package/src/skf-quick-skill/{steps-c/step-01-resolve-target.md → references/resolve-target.md} +14 -10
  158. package/src/skf-quick-skill/{steps-c/step-05-write-and-validate.md → references/write-and-validate.md} +4 -4
  159. package/src/skf-refine-architecture/SKILL.md +86 -16
  160. package/src/skf-refine-architecture/customize.toml +49 -0
  161. package/src/skf-refine-architecture/{steps-c/step-05-compile.md → references/compile.md} +4 -4
  162. package/src/skf-refine-architecture/{steps-c/step-02-gap-analysis.md → references/gap-analysis.md} +5 -5
  163. package/src/skf-refine-architecture/{steps-c/step-07-health-check.md → references/health-check.md} +6 -4
  164. package/src/skf-refine-architecture/{steps-c/step-04-improvements.md → references/improvements.md} +5 -5
  165. package/src/skf-refine-architecture/references/init.md +144 -0
  166. package/src/skf-refine-architecture/{steps-c/step-03-issue-detection.md → references/issue-detection.md} +5 -5
  167. package/src/skf-refine-architecture/references/refinement-rules.md +2 -0
  168. package/src/skf-refine-architecture/{steps-c/step-06-report.md → references/report.md} +14 -5
  169. package/src/skf-rename-skill/SKILL.md +82 -12
  170. package/src/skf-rename-skill/customize.toml +52 -0
  171. package/src/skf-rename-skill/{steps-c/step-02-execute.md → references/execute.md} +94 -99
  172. package/src/skf-rename-skill/references/health-check.md +30 -0
  173. package/src/skf-rename-skill/references/rebuild-context.md +110 -0
  174. package/src/skf-rename-skill/{steps-c/step-03-report.md → references/report.md} +13 -5
  175. package/src/skf-rename-skill/{steps-c/step-01-select.md → references/select.md} +59 -20
  176. package/src/skf-setup/SKILL.md +35 -35
  177. package/src/skf-setup/customize.toml +33 -0
  178. package/src/skf-setup/{steps-c/step-03-auto-index.md → references/auto-index.md} +10 -18
  179. package/src/skf-setup/{steps-c/step-01b-ccc-index.md → references/ccc-index.md} +16 -31
  180. package/src/skf-setup/{steps-c/step-01-detect-and-tier.md → references/detect-and-tier.md} +23 -10
  181. package/src/skf-setup/{steps-c/step-05-health-check.md → references/health-check.md} +1 -1
  182. package/src/skf-setup/{steps-c/step-04-report.md → references/report.md} +21 -19
  183. package/src/skf-setup/references/tier-rules.md +1 -1
  184. package/src/skf-setup/{steps-c/step-02-write-config.md → references/write-config.md} +14 -13
  185. package/src/skf-test-skill/SKILL.md +77 -15
  186. package/src/skf-test-skill/customize.toml +54 -0
  187. package/src/skf-test-skill/{steps-c/step-04-coherence-check.md → references/coherence-check.md} +37 -73
  188. package/src/skf-test-skill/{steps-c/step-03-coverage-check.md → references/coverage-check.md} +16 -39
  189. package/src/skf-test-skill/{steps-c/step-02-detect-mode.md → references/detect-mode.md} +4 -26
  190. package/src/skf-test-skill/{steps-c/step-04b-external-validators.md → references/external-validators.md} +6 -28
  191. package/src/skf-test-skill/references/health-check.md +14 -0
  192. package/src/skf-test-skill/{steps-c/step-01-init.md → references/init.md} +21 -37
  193. package/src/skf-test-skill/references/migration-section-rules.md +4 -2
  194. package/src/skf-test-skill/{steps-c/step-06-report.md → references/report.md} +41 -51
  195. package/src/skf-test-skill/{steps-c/step-05-score.md → references/score.md} +26 -43
  196. package/src/skf-test-skill/references/scoring-rules.md +8 -6
  197. package/src/skf-test-skill/references/source-access-protocol.md +7 -5
  198. package/src/skf-test-skill/scripts/compute-score.py +88 -17
  199. package/src/skf-test-skill/templates/test-report-template.md +13 -13
  200. package/src/skf-update-skill/SKILL.md +23 -14
  201. package/src/skf-update-skill/customize.toml +44 -0
  202. package/src/skf-update-skill/{steps-c/step-02-detect-changes.md → references/detect-changes.md} +176 -68
  203. package/src/skf-update-skill/references/health-check.md +32 -0
  204. package/src/skf-update-skill/{steps-c/step-01-init.md → references/init.md} +56 -8
  205. package/src/skf-update-skill/references/manual-section-rules.md +4 -0
  206. package/src/skf-update-skill/references/merge-conflict-rules.md +4 -0
  207. package/src/skf-update-skill/{steps-c/step-04-merge.md → references/merge.md} +8 -8
  208. package/src/skf-update-skill/{steps-c/step-03-re-extract.md → references/re-extract.md} +53 -44
  209. package/src/skf-update-skill/references/remote-source-resolution.md +5 -1
  210. package/src/skf-update-skill/references/report.md +214 -0
  211. package/src/skf-update-skill/{steps-c/step-05-validate.md → references/validate.md} +5 -5
  212. package/src/skf-update-skill/{steps-c/step-06-write.md → references/write.md} +73 -51
  213. package/src/skf-verify-stack/SKILL.md +89 -17
  214. package/src/skf-verify-stack/assets/feasibility-report-template.md +4 -4
  215. package/src/skf-verify-stack/customize.toml +50 -0
  216. package/src/skf-verify-stack/references/coverage-patterns.md +2 -2
  217. package/src/skf-verify-stack/{steps-c/step-02-coverage.md → references/coverage.md} +13 -9
  218. package/src/skf-verify-stack/{steps-c/step-07-health-check.md → references/health-check.md} +7 -5
  219. package/src/skf-verify-stack/references/init.md +170 -0
  220. package/src/skf-verify-stack/references/integration-verification-rules.md +1 -1
  221. package/src/skf-verify-stack/{steps-c/step-03-integrations.md → references/integrations.md} +18 -14
  222. package/src/skf-verify-stack/{steps-c/step-06-report.md → references/report.md} +27 -42
  223. package/src/skf-verify-stack/{steps-c/step-04-requirements.md → references/requirements.md} +13 -9
  224. package/src/skf-verify-stack/{steps-c/step-05-synthesize.md → references/synthesize.md} +14 -10
  225. package/tools/validate-docs-drift.js +1 -1
  226. package/src/skf-refine-architecture/steps-c/step-01-init.md +0 -136
  227. package/src/skf-rename-skill/steps-c/step-04-health-check.md +0 -22
  228. package/src/skf-test-skill/steps-c/step-07-health-check.md +0 -25
  229. package/src/skf-update-skill/steps-c/step-07-report.md +0 -148
  230. package/src/skf-update-skill/steps-c/step-08-health-check.md +0 -22
  231. package/src/skf-verify-stack/steps-c/step-01-init.md +0 -178
@@ -1,9 +1,11 @@
1
1
  ---
2
- nextStepFile: './step-06-validate.md'
2
+ nextStepFile: 'validate.md'
3
3
  skillSectionsData: 'assets/skill-sections.md'
4
4
  assemblyRulesData: 'assets/compile-assembly-rules.md'
5
5
  ---
6
6
 
7
+ <!-- Config: communicate in {communication_language}. -->
8
+
7
9
  # Step 5: Compile
8
10
 
9
11
  ## STEP GOAL:
@@ -14,14 +16,12 @@ To assemble the complete skill content from the extraction inventory and enrichm
14
16
 
15
17
  - Focus only on assembling content from extraction inventory + enrichment
16
18
  - Do not include any content without a provenance citation
17
- - Write all compiled artifacts to the staging directory `_bmad-output/{skill-name}/`. Do not write to `skills/` or `forge-data/` — step-07 promotes staged artifacts to their final versioned locations.
19
+ - Write all compiled artifacts to the staging directory `_bmad-output/{skill-name}/`. Do not write to `skills/` or `forge-data/` — step 7 promotes staged artifacts to their final versioned locations.
18
20
  - Do not fabricate examples not found in source tests or docs
19
21
  - Seed `<!-- [MANUAL] -->` markers for future update-skill compatibility
20
22
 
21
23
  ## MANDATORY SEQUENCE
22
24
 
23
- **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
24
-
25
25
  ### 1. Load Data Files
26
26
 
27
27
  Load `{skillSectionsData}` and `{assemblyRulesData}` completely. These define the agentskills.io-compliant format and detailed assembly rules for all output artifacts.
@@ -37,7 +37,7 @@ Create `_bmad-output/{skill-name}/` (and `_bmad-output/{skill-name}/references/`
37
37
  - `provenance-map.json`
38
38
  - `evidence-report.md`
39
39
 
40
- This is the `<staging-skill-dir>` referenced by step-06 (`npx skill-check check`, `npx -y tessl skill review`). Step-07 reads from the in-context copies (resynced by step-06 after any `--fix` modifications) and writes to the final versioned layout.
40
+ This is the `<staging-skill-dir>` referenced by step 6 (`npx skill-check check`, `npx -y tessl skill review`). Step-07 reads from the in-context copies (resynced by step 6 after any `--fix` modifications) and writes to the final versioned layout.
41
41
 
42
42
  ### 1b. Signature Fidelity Rule
43
43
 
@@ -70,7 +70,7 @@ Assemble each section in order using the assembly rules data file (`{assemblyRul
70
70
 
71
71
  Record the count of substitutions in context as `description_sanitizations: {count}` for the evidence report.
72
72
 
73
- **Rationale:** The LTS-stable guarantee is that no angle-bracket character reaches step-06 validation in the description field. The assembly rules in `{assemblyRulesData}` define this as a drafting rule; this step makes it an enforced pass so authors and reviewers don't have to remember it. If the rule is ever bypassed (e.g., by a downstream tool rewriting the description), step-06 §6 provides a recovery path — see `description-xml-tags-guarded-upstream` in `assets/tessl-dismissal-rules.md`.
73
+ **Rationale:** The LTS-stable guarantee is that no angle-bracket character reaches step 6 validation in the description field. The assembly rules in `{assemblyRulesData}` define this as a drafting rule; this step makes it an enforced pass so authors and reviewers don't have to remember it. If the rule is ever bypassed (e.g., by a downstream tool rewriting the description), step 6 §6 provides a recovery path — see `description-xml-tags-guarded-upstream` in `assets/tessl-dismissal-rules.md`.
74
74
 
75
75
  ### 3. Build context-snippet.md Content
76
76
 
@@ -87,7 +87,7 @@ Vercel-aligned indexed format for CLAUDE.md managed section (~80-120 tokens):
87
87
 
88
88
  **Derivation rules:**
89
89
 
90
- - **version**: From source detection (reconciled in step-03), not brief default
90
+ - **version**: From source detection (reconciled in step 3), not brief default
91
91
  - **api**: Top 10 exports from extraction inventory, append `()` to function names
92
92
  - **key-types**: Inline summary of most important enum/type values from Key Types section
93
93
  - **gotchas**: Derived from T2-future annotations (breaking changes), async requirements, version-specific behavior changes. If no gotchas available, omit the gotchas line.
@@ -102,7 +102,7 @@ Following the structure from the skill-sections data file:
102
102
  - Set `source_ref` from resolved source ref (tag name, branch, or `HEAD`; null if unavailable)
103
103
  - Set `stats` from extraction aggregate counts:
104
104
  - `exports_documented`: count of exports with documentation in the assembled SKILL.md
105
- - `exports_public_api`: count of exports from public entry points (`__init__.py`, `index.ts`, `lib.rs`, or equivalent) — derive this from step-03's entry-point validation (section 4b), NOT from the provenance-map entry count (which may be incomplete if extraction patterns missed some export types)
105
+ - `exports_public_api`: count of exports from public entry points (`__init__.py`, `index.ts`, `lib.rs`, or equivalent) — derive this from step 3's entry-point validation (section 4b), NOT from the provenance-map entry count (which may be incomplete if extraction patterns missed some export types)
106
106
  - `exports_internal`: count of all other non-underscore-prefixed exports (internal modules, helpers, adapters)
107
107
  - `exports_total`: `exports_public_api` + `exports_internal`
108
108
  - `public_api_coverage`: `exports_documented / exports_public_api` (1.0 when all public API exports are documented; `null` if `exports_public_api` is 0)
@@ -131,7 +131,7 @@ Following the structure from the skill-sections data file:
131
131
  2. `mcp__plugin_qmd-plugin_qmd__status` → parse version if exposed in status output
132
132
  3. `"unknown"` (final fallback — add a warning to the evidence report)
133
133
  Note: QMD is a Bun/Node package (`@tobilu/qmd`). Install via `bun install -g @tobilu/qmd`.
134
- - Store `commit_short` = first 8 characters of `source_commit` (or `"unknown"` if unavailable) for use in step-08 report.
134
+ - Store `commit_short` = first 8 characters of `source_commit` (or `"unknown"` if unavailable) for use in step 8 report.
135
135
  - If `scripts_inventory` is non-empty, populate `scripts[]` array and set `stats.scripts_count`. If `assets_inventory` is non-empty, populate `assets[]` array and set `stats.assets_count`. Omit these fields entirely when inventories are empty.
136
136
 
137
137
  ### 5. Build references/ Content
@@ -150,19 +150,19 @@ One entry per extracted export: export_name, export_type, params[] (typed string
150
150
 
151
151
  **File entries** — emit one `file_entries[]` row per tracked non-code file when any of these inventories are non-empty:
152
152
 
153
- - `scripts_inventory` → `file_type: "script"`, `extraction_method: "file-copy"`, stored in `{skill_package}/scripts/` by step-07
154
- - `assets_inventory` → `file_type: "asset"`, `extraction_method: "file-copy"`, stored in `{skill_package}/assets/` by step-07
155
- - `promoted_docs` (from step-03 §2a) → `file_type: "doc"`, `extraction_method: "promoted-authoritative"`, **NOT** copied into the skill package by step-07. The source file stays at its original path; only the provenance tracking entry is written. `content_hash` was pre-computed by §2a.
153
+ - `scripts_inventory` → `file_type: "script"`, `extraction_method: "file-copy"`, stored in `{skill_package}/scripts/` by step 7
154
+ - `assets_inventory` → `file_type: "asset"`, `extraction_method: "file-copy"`, stored in `{skill_package}/assets/` by step 7
155
+ - `promoted_docs` (from step 3 §2a) → `file_type: "doc"`, `extraction_method: "promoted-authoritative"`, **NOT** copied into the skill package by step 7. The source file stays at its original path; only the provenance tracking entry is written. `content_hash` was pre-computed by §2a.
156
156
 
157
157
  Each `file_entries[]` row has the same shape regardless of `file_type`: `{file_name, file_type, source_file, content_hash, confidence, extraction_method}`. See `{skillSectionsData}` for full schema and the canonical list of `file_type` values.
158
158
 
159
159
  ### 7. Build evidence-report.md Content
160
160
 
161
- Compilation audit trail: generation date, forge tier, source info, tool versions, extraction summary (files/exports/confidence), warnings. For validation-specific fields (Schema, Body, Security, Content Quality, tessl, Metadata), insert the placeholder text `[PENDING — populated by step-06]`. Step-06 will replace these placeholders with actual results. See `{skillSectionsData}` for full template. Use the same `{skf_version}` value resolved in section 4 when populating the Tool Versions block.
161
+ Compilation audit trail: generation date, forge tier, source info, tool versions, extraction summary (files/exports/confidence), warnings. For validation-specific fields (Schema, Body, Security, Content Quality, tessl, Metadata), insert the placeholder text `[PENDING — populated by step 6]`. Step-06 will replace these placeholders with actual results. See `{skillSectionsData}` for full template. Use the same `{skf_version}` value resolved in section 4 when populating the Tool Versions block.
162
162
 
163
- **Frontmatter — pinned fields (MANDATORY):** emit YAML frontmatter at the top of `evidence-report.md` with at minimum `skill_name`, `generated`, `forge_tier`, and `t2_future_count`. Compute `t2_future_count` as the count of forward-looking (T2-future) temporal annotations in the enrichment data produced by step-04 (`qmd query` + temporal classification). **Emit `t2_future_count: 0` when no T2-future annotations exist** — omission is indistinguishable from "no data" for downstream consumers and would silently flip the skf-test-skill §2b/§5b migration-section gate into Case 2/3 for a Case-1 skill. This frontmatter is the authoritative detection contract — `migration-section-rules.md` Case Rules parse it deterministically rather than grepping prose.
163
+ **Frontmatter — pinned fields (MANDATORY):** emit YAML frontmatter at the top of `evidence-report.md` with at minimum `skill_name`, `generated`, `forge_tier`, and `t2_future_count`. Compute `t2_future_count` as the count of forward-looking (T2-future) temporal annotations in the enrichment data produced by step 4 (`qmd query` + temporal classification). **Emit `t2_future_count: 0` when no T2-future annotations exist** — omission is indistinguishable from "no data" for downstream consumers and would silently flip the skf-test-skill §2b/§5b migration-section gate into Case 2/3 for a Case-1 skill. This frontmatter is the authoritative detection contract — `migration-section-rules.md` Case Rules parse it deterministically rather than grepping prose.
164
164
 
165
- **Auto-Decisions section (headless buffer flush):** read the in-context `headless_decisions[]` list (populated by step-01 tier-override handling, step-02 ecosystem gate, and any future step that auto-resolves a gate under `{headless_mode}`). Emit an `## Auto-Decisions` section with one row per entry:
165
+ **Auto-Decisions section (headless buffer flush):** read the in-context `headless_decisions[]` list (populated by step 1 tier-override handling, step 2 ecosystem gate, and any future step that auto-resolves a gate under `{headless_mode}`). Emit an `## Auto-Decisions` section with one row per entry:
166
166
 
167
167
  ```
168
168
  ## Auto-Decisions
@@ -188,5 +188,5 @@ After all content is assembled in context and written to the staging directory,
188
188
 
189
189
  ## CRITICAL STEP COMPLETION NOTE
190
190
 
191
- ONLY WHEN all 6 content artifacts (SKILL.md, context-snippet.md, metadata.json, references/, provenance-map.json, evidence-report.md) are assembled in context AND written to the staging directory `_bmad-output/{skill-name}/` will you proceed to load `{nextStepFile}` for spec validation. Note: extraction-rules.yaml is generated by step-07 from extraction data, not assembled here.
191
+ ONLY WHEN all 6 content artifacts (SKILL.md, context-snippet.md, metadata.json, references/, provenance-map.json, evidence-report.md) are assembled in context AND written to the staging directory `_bmad-output/{skill-name}/` will you proceed to load `{nextStepFile}` for spec validation. Note: extraction-rules.yaml is generated by step 7 from extraction data, not assembled here.
192
192
 
@@ -1,13 +1,15 @@
1
1
  ---
2
- returnToStep: './step-03-extract.md'
2
+ returnToStep: 'extract.md'
3
3
  extractionPatternsData: 'references/extraction-patterns.md'
4
4
  ---
5
5
 
6
+ <!-- Config: communicate in {communication_language}. -->
7
+
6
8
  # Step 3d: Component Library Extraction
7
9
 
8
10
  ## STEP GOAL:
9
11
 
10
- When `scope.type: "component-library"`, perform specialized extraction that treats the component registry as the primary API surface and props interfaces as API contracts. This step replaces the standard AST extraction flow (step-03 sections 4-4c) and returns control to step-03 section 5 (Build Extraction Inventory).
12
+ When `scope.type: "component-library"`, perform specialized extraction that treats the component registry as the primary API surface and props interfaces as API contracts. This step replaces the standard AST extraction flow (step 3 sections 4-4c) and returns control to step 3 section 5 (Build Extraction Inventory).
11
13
 
12
14
  ## Rules
13
15
 
@@ -17,15 +19,13 @@ When `scope.type: "component-library"`, perform specialized extraction that trea
17
19
 
18
20
  ## MANDATORY SEQUENCE
19
21
 
20
- **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
21
-
22
- **Prerequisite — §2a already ran.** Step-03 executes `§2a Discovered Authoritative Files Protocol` before delegating to this file. Any promoted authoritative files (`llms.txt`, `AGENTS.md`, etc.) are tracked in the `promoted_docs[]` context list and will be written to `file_entries[]` with `file_type: "doc"` by step-05 §6 — they do NOT appear in the filtered file list that was passed into this step, so Phase 1 demo exclusion below only operates on code files. No special handling is required in this file for promoted docs. See step-03 §2a for the full flow.
22
+ **Prerequisite §2a already ran.** Step-03 executes `§2a Discovered Authoritative Files Protocol` before delegating to this file. Any promoted authoritative files (`llms.txt`, `AGENTS.md`, etc.) are tracked in the `promoted_docs[]` context list and will be written to `file_entries[]` with `file_type: "doc"` by step 5 §6 — they do NOT appear in the filtered file list that was passed into this step, so Phase 1 demo exclusion below only operates on code files. No special handling is required in this file for promoted docs. See step 3 §2a for the full flow.
23
23
 
24
24
  ### Phase 1: Demo/Example Exclusion
25
25
 
26
26
  Before extraction, identify and exclude demo/example files to avoid inflating export counts.
27
27
 
28
- **Note:** For remote sources, the file list from step-03 section 2 was built from the API tree. When scanning for demo directories, scan the local workspace/clone path (`remote_clone_path`) instead of the API-derived file list.
28
+ **Note:** For remote sources, the file list from step 3 section 2 was built from the API tree. When scanning for demo directories, scan the local workspace/clone path (`remote_clone_path`) instead of the API-derived file list.
29
29
 
30
30
  **If `scope.demo_patterns` is specified in the brief:** Use those patterns directly.
31
31
 
@@ -42,7 +42,7 @@ Before extraction, identify and exclude demo/example files to avoid inflating ex
42
42
 
43
43
  Confirm exclusion? [Y/n] Or adjust patterns:"
44
44
 
45
- **GATE [default: Y]** — if `{headless_mode}` is true: auto-confirm the auto-detected exclusion patterns, log "headless: auto-confirm demo/example exclusion ({N} files, {M} directories)", and append `{step: "step-03d-component-extraction", gate: "demo-exclusion", decision: "Y", value: "{N} files / {M} dirs", rationale: "headless mode — auto-detected demo patterns accepted", timestamp: {ISO}}` to `headless_decisions[]` for evidence-report assembly in step-05 §7. Then proceed without waiting.
45
+ **GATE [default: Y]** — if `{headless_mode}` is true: auto-confirm the auto-detected exclusion patterns, log "headless: auto-confirm demo/example exclusion ({N} files, {M} directories)", and append `{step: "component-extraction", gate: "demo-exclusion", decision: "Y", value: "{N} files / {M} dirs", rationale: "headless mode — auto-detected demo patterns accepted", timestamp: {ISO}}` to `headless_decisions[]` for evidence-report assembly in step 5 §7. Then proceed without waiting.
46
46
 
47
47
  Wait for user response (interactive only). Apply confirmed patterns to the exclude list. Record `demo_files_excluded: {count}` in context.
48
48
 
@@ -85,7 +85,7 @@ Sample entries:
85
85
 
86
86
  Is this the component registry? [Y/n] Or provide the correct path:"
87
87
 
88
- **GATE [default: Y]** — if `{headless_mode}` is true AND `score >= 7` (high-confidence candidate): auto-confirm the registry candidate, log "headless: auto-confirm registry candidate `{path}` (score {score}/9)", and append `{step: "step-03d-component-extraction", gate: "registry-confirm", decision: "Y", value: "{path} score={score}/9", rationale: "headless mode — high-confidence registry candidate auto-accepted", timestamp: {ISO}}` to `headless_decisions[]`. If `score < 7` in headless mode, auto-reject the candidate (treat as "no registry found"), log "headless: auto-reject low-confidence registry candidate (score {score}/9) — below auto-accept threshold 7", record the decision, and fall through to the "no registry found" branch below. Confidence threshold 7 matches the minimum score the heuristic considers "probable enough to risk" without human eyes.
88
+ **GATE [default: Y]** — if `{headless_mode}` is true AND `score >= 7` (high-confidence candidate): auto-confirm the registry candidate, log "headless: auto-confirm registry candidate `{path}` (score {score}/9)", and append `{step: "component-extraction", gate: "registry-confirm", decision: "Y", value: "{path} score={score}/9", rationale: "headless mode — high-confidence registry candidate auto-accepted", timestamp: {ISO}}` to `headless_decisions[]`. If `score < 7` in headless mode, auto-reject the candidate (treat as "no registry found"), log "headless: auto-reject low-confidence registry candidate (score {score}/9) — below auto-accept threshold 7", record the decision, and fall through to the "no registry found" branch below. Confidence threshold 7 matches the minimum score the heuristic considers "probable enough to risk" without human eyes.
89
89
 
90
90
  Wait for user response (interactive only).
91
91
 
@@ -95,7 +95,7 @@ Wait for user response (interactive only).
95
95
  - **[P]** Provide the registry file path
96
96
  - **[S]** Skip registry — proceed with standard props-first extraction only"
97
97
 
98
- **GATE [default: S]** — if `{headless_mode}` is true: auto-select [S] Skip (props-first extraction without registry), log "headless: no registry detected, auto-skip to props-first extraction (no path was provided in brief.scope.registry_path)", and append `{step: "step-03d-component-extraction", gate: "provide-or-skip-registry", decision: "S", rationale: "headless mode — no human to provide registry path", timestamp: {ISO}}` to `headless_decisions[]`. The default is `[S]` rather than `[P]` because providing a path requires user input that headless cannot supply; skipping degrades gracefully to a smaller but valid extraction.
98
+ **GATE [default: S]** — if `{headless_mode}` is true: auto-select [S] Skip (props-first extraction without registry), log "headless: no registry detected, auto-skip to props-first extraction (no path was provided in brief.scope.registry_path)", and append `{step: "component-extraction", gate: "provide-or-skip-registry", decision: "S", rationale: "headless mode — no human to provide registry path", timestamp: {ISO}}` to `headless_decisions[]`. The default is `[S]` rather than `[P]` because providing a path requires user input that headless cannot supply; skipping degrades gracefully to a smaller but valid extraction.
99
99
 
100
100
  Wait for user response (interactive only).
101
101
 
@@ -204,7 +204,7 @@ Display: "**Variant consolidation: {unique} unique components across {variant_co
204
204
 
205
205
  ### Phase 6: Build Component Extraction Results
206
206
 
207
- Compile all extracted data into the format expected by step-03 section 5:
207
+ Compile all extracted data into the format expected by step 3 section 5:
208
208
 
209
209
  **Per-export entry (for Props interfaces — primary API):**
210
210
 
@@ -237,15 +237,15 @@ Compile all extracted data into the format expected by step-03 section 5:
237
237
  - `demo_files_excluded`: count from Phase 1
238
238
  - `design_variants`: map of variant name → component count (if variants exist)
239
239
 
240
- **Store `component_catalog[]` in context** — this is consumed by step-05 for the Component Catalog section.
240
+ **Store `component_catalog[]` in context** — this is consumed by step 5 for the Component Catalog section.
241
241
 
242
242
  Display: "**Component extraction complete.** Returning to main extraction flow."
243
243
 
244
244
  ## RETURN PROTOCOL
245
245
 
246
- After Phase 6 completes, return control to step-03 section 5 (Build Extraction Inventory). The extraction results from this step are merged into the standard extraction inventory format. Step-03 continues with its normal Gate 2 summary and menu.
246
+ After Phase 6 completes, return control to step 3 section 5 (Build Extraction Inventory). The extraction results from this step are merged into the standard extraction inventory format. Step-03 continues with its normal Gate 2 summary and menu.
247
247
 
248
- Do NOT load `{returnToStep}` — the calling step (step-03) will continue from where it delegated.
248
+ Do NOT load `{returnToStep}` — the calling step (step 3) will continue from where it delegated.
249
249
 
250
250
  ---
251
251
 
@@ -259,8 +259,8 @@ Do NOT load `{returnToStep}` — the calling step (step-03) will continue from w
259
259
  - Components linked to Props via 3-level fallback chain
260
260
  - Variant consolidation produced deduplicated counts (if applicable)
261
261
  - All extracted items have provenance citations
262
- - Results compatible with step-03 section 5 inventory format
263
- - component_catalog stored in context for step-05
262
+ - Results compatible with step 3 section 5 inventory format
263
+ - component_catalog stored in context for step 5
264
264
 
265
265
  ### FAILURE:
266
266
 
@@ -270,6 +270,6 @@ Do NOT load `{returnToStep}` — the calling step (step-03) will continue from w
270
270
  - Documenting component function signatures instead of Props
271
271
  - Including hallucinated component data not in source
272
272
  - Variant deduplication based on filenames instead of registry IDs
273
- - Not returning control to step-03 after completion
273
+ - Not returning control to step 3 after completion
274
274
 
275
275
  **Master Rule:** Zero hallucination — every extraction must trace to source code. The component registry is the source of truth for the API surface.
@@ -1,7 +1,9 @@
1
1
  ---
2
- nextStepFile: './sub/step-02b-ccc-discover.md'
2
+ nextStepFile: 'sub/ccc-discover.md'
3
3
  ---
4
4
 
5
+ <!-- Config: communicate in {communication_language}. -->
6
+
5
7
  # Step 2: Ecosystem Check
6
8
 
7
9
  ## STEP GOAL:
@@ -16,8 +18,6 @@ To search the agentskills.io ecosystem for an existing official skill matching t
16
18
 
17
19
  ## MANDATORY SEQUENCE
18
20
 
19
- **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
20
-
21
21
  ### 1. Check Ecosystem for Existing Skill
22
22
 
23
23
  **Note:** Ecosystem lookup requires the agentskills.io registry API, which is not yet available. The `skill-check` CLI validates local skills but does not query a remote registry.
@@ -70,7 +70,7 @@ Display: "**Ecosystem match found — Select an Option:** [P] Proceed with compi
70
70
  #### EXECUTION RULES:
71
71
 
72
72
  - ALWAYS halt and wait for user input after presenting menu
73
- - **GATE [default: P]** — If `{headless_mode}` and match found: auto-proceed with [P] Proceed, log: "headless: ecosystem match found, auto-proceeding", AND append an entry to the in-context `headless_decisions[]` list: `{step: "step-02-ecosystem-check", gate: "ecosystem-match", decision: "P", rationale: "headless mode — match found, auto-proceed with user's own compilation", timestamp: {ISO}}`. Step-05 §7 (evidence-report assembly) reads `headless_decisions[]` and emits an "Auto-Decisions" section into evidence-report.md.
73
+ - **GATE [default: P]** — If `{headless_mode}` and match found: auto-proceed with [P] Proceed, log: "headless: ecosystem match found, auto-proceeding", AND append an entry to the in-context `headless_decisions[]` list: `{step: "ecosystem-check", gate: "ecosystem-match", decision: "P", rationale: "headless mode — match found, auto-proceed with user's own compilation", timestamp: {ISO}}`. Step-05 §7 (evidence-report assembly) reads `headless_decisions[]` and emits an "Auto-Decisions" section into evidence-report.md.
74
74
  - This menu ONLY appears when an ecosystem match is found
75
75
  - If no match, timeout, or tool unavailable — auto-proceed with no menu
76
76
 
@@ -1,7 +1,9 @@
1
1
  ---
2
- nextStepFile: './step-05-compile.md'
2
+ nextStepFile: 'compile.md'
3
3
  ---
4
4
 
5
+ <!-- Config: communicate in {communication_language}. -->
6
+
5
7
  # Step 4: Enrich
6
8
 
7
9
  ## STEP GOAL:
@@ -17,8 +19,6 @@ To enrich the extraction inventory with temporal context from QMD knowledge sear
17
19
 
18
20
  ## MANDATORY SEQUENCE
19
21
 
20
- **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
21
-
22
22
  ### 1. Check Tier Eligibility
23
23
 
24
24
  **If tier is Quick, Forge, or Forge+:**
@@ -1,18 +1,38 @@
1
1
  ---
2
- nextStepFile: './sub/step-03b-fetch-temporal.md'
3
- componentExtractionStepFile: './step-03d-component-extraction.md'
2
+ nextStepFile: 'sub/fetch-temporal.md'
3
+ componentExtractionStepFile: 'component-extraction.md'
4
4
  extractionPatternsData: 'references/extraction-patterns.md'
5
5
  extractionPatternsTracingData: 'references/extraction-patterns-tracing.md'
6
6
  tierDegradationRulesData: 'references/tier-degradation-rules.md'
7
7
  sourceResolutionData: 'references/source-resolution-protocols.md'
8
+ authoritativeFilesProtocol: 'references/authoritative-files-protocol.md'
8
9
  # Probe installed SKF module path first, src/ dev-checkout fallback. At first
9
10
  # use below, resolve `{atomicWriteHelper}` to the first existing path; HALT if
10
11
  # neither candidate exists — losing atomic-write guarantees is not an option.
11
12
  atomicWriteProbeOrder:
12
13
  - '{project-root}/_bmad/skf/shared/scripts/skf-atomic-write.py'
13
14
  - '{project-root}/src/shared/scripts/skf-atomic-write.py'
15
+ # Resolve `{detectScriptsAssetsHelper}` to the first existing path; HALT if
16
+ # neither candidate exists. §4c relies on the helper for deterministic
17
+ # script/asset detection (file walk, SHA-256 hashing, header-comment purpose
18
+ # extraction); falling back to prose-driven detection would lose hash stability.
19
+ detectScriptsAssetsProbeOrder:
20
+ - '{project-root}/_bmad/skf/shared/scripts/skf-detect-scripts-assets.py'
21
+ - '{project-root}/src/shared/scripts/skf-detect-scripts-assets.py'
22
+ # Resolve `{resolveAuthoritativeFilesHelper}` to the first existing path;
23
+ # HALT if neither exists. §2a uses it to scan the source tree for
24
+ # authoritative AI documentation files, classify each against scope
25
+ # filters + amendments, and load previews + content hashes — all five
26
+ # deterministic phases in one call. Falling back to prose-driven file
27
+ # walking + glob matching + hashing would let the LLM drift on the
28
+ # heuristic list and miss auth-doc files at deeper directory depths.
29
+ resolveAuthoritativeFilesProbeOrder:
30
+ - '{project-root}/_bmad/skf/shared/scripts/skf-resolve-authoritative-files.py'
31
+ - '{project-root}/src/shared/scripts/skf-resolve-authoritative-files.py'
14
32
  ---
15
33
 
34
+ <!-- Config: communicate in {communication_language}. -->
35
+
16
36
  # Step 3: Extract
17
37
 
18
38
  ## STEP GOAL:
@@ -27,8 +47,6 @@ To extract all public exports, function signatures, type definitions, and co-imp
27
47
 
28
48
  ## MANDATORY SEQUENCE
29
49
 
30
- **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
31
-
32
50
  ### 1. Load Extraction Patterns
33
51
 
34
52
  Load `{extractionPatternsData}` completely. Identify the strategy for the current forge tier.
@@ -41,115 +59,15 @@ From the brief, apply scope and pattern filters:
41
59
  - `scope.include` — file globs to include
42
60
  - `scope.exclude` — file globs to exclude
43
61
 
44
- Build the filtered file list from the source tree resolved in step-01. Record the result: "**Filtered file count: {N} files in scope**" — this count is the input to the AST Extraction Protocol decision tree in the extraction patterns data file.
62
+ Build the filtered file list from the source tree resolved in step 1. Record the result: "**Filtered file count: {N} files in scope**" — this count is the input to the AST Extraction Protocol decision tree in the extraction patterns data file.
45
63
 
46
64
  ### 2a. Discovered Authoritative Files Protocol
47
65
 
48
66
  **Skip this section entirely if `source_type: "docs-only"`** — there is no source tree to scan.
49
67
 
50
- Before resolving source access for extraction, scan the source tree for **authoritative AI documentation files** that the brief's scope filters excluded. Project authors increasingly add files specifically written to steer AI assistants (`llms.txt`, `AGENTS.md`, `.cursorrules`, etc.), and these files often contain the **canonical** install command, quick-start, or architecture summary information that nowhere else in the source tree provides. A brief authored from a scan of `src/**` will frequently exclude these files without the author realizing they exist.
51
-
52
- This protocol detects such files, prompts the user, and records the decision in the brief so future runs (re-create, update, audit) honor it.
53
-
54
- **Heuristic scan list (case-insensitive basename match, any directory depth):**
55
-
56
- - `llms.txt`, `llms-full.txt`
57
- - `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, `COPILOT.md`
58
- - `.cursorrules`, `.windsurfrules`, `.clinerules`
59
-
60
- **Procedure:**
61
-
62
- 1. **Walk the source tree** resolved in step-01 (NOT the filtered file list from §2 — we want files the brief excluded too). Match file basenames against the heuristic list case-insensitively.
63
-
64
- 2. **Diff against filtered list.** For each match, check whether the path is already present in §2's filtered file list:
65
- - **Already in scope (matched by `scope.include`):** **remove the path from the filtered file list** and add it directly to `promoted_docs[]` with `{path, heuristic, size_bytes, line_count, content_hash}`. No prompt — the user or a prior amendment already said it belongs in scope, but authoritative docs must never reach §4 code extraction. This is both the "already promoted from a prior run" case and the "user manually added to scope.include" case.
66
- - **Excluded by brief patterns:** this is a **candidate** for the prompt at step 5.
67
-
68
- 3. **Check existing amendments.** Before prompting, consult `brief.scope.amendments[]` (see `src/skf-brief-skill/assets/skill-brief-schema.md` for the schema). If any amendment entry has `path == candidate.path`, the decision is already recorded:
69
- - `action: "promoted"` → the file should already be in `scope.include` (amendments are write-through). No prompt. **Still populate `promoted_docs[]`** for this path — compute its content hash and add a `{path, heuristic, size_bytes, line_count, content_hash}` entry so step-05 §6 writes the `file_entries[]` row. This is the deterministic replay path for re-runs.
70
- - `action: "skipped"` → user previously declined. No prompt. Do not add to `promoted_docs[]`. Move on.
71
-
72
- 4. **Load preview.** For each unresolved candidate, read the first 20 lines of the file. Record the line count and file size in bytes.
73
-
74
- 5. **Prompt.** Present each candidate to the user:
75
-
76
- ```
77
- **Discovered authoritative file excluded by brief scope**
78
-
79
- Path: {relative_path_from_source_root}
80
- Size: {line_count} lines, {bytes} bytes
81
- Matched heuristic: {basename}
82
- Excluded by pattern: {matching_exclude_pattern or "not matched by any scope.include"}
83
-
84
- First 20 lines:
85
- {inline preview}
86
-
87
- This file is typically authored for AI assistants and may contain canonical usage information not present elsewhere in the source. How should extraction handle it?
88
-
89
- [P] Promote — include in this extraction run AND amend brief for future runs
90
- [S] Skip — honor the brief exclusion AND record skip in amendments (no re-prompt)
91
- [U] Update — halt this run and return to skf-brief-skill to refine scope
92
- ```
93
-
94
- 6. **Headless mode (`{headless_mode}` is true):** auto-select `[S] Skip` for every candidate. Record amendment entries with `action: "skipped"` and `reason: "headless: no user to prompt"`. A non-interactive run must never silently promote files into scope — the decision requires a human.
95
-
96
- 7. **Apply decision:**
97
-
98
- - **[P] Promote:**
99
- 1. **Do NOT add the path to the filtered file list from §2.** Authoritative documentation files are not code — they must not go through the AST extraction pipeline in §4, which would silently produce no exports (ghost entries). Instead, add the path to a new in-context list `promoted_docs[]` with `{path, heuristic, size_bytes, line_count, content_hash}`. Compute the SHA-256 content hash of the file now.
100
- 2. Append to `brief.scope.include`: add the exact `candidate.path` as a literal glob (no wildcards — the amendment targets this specific file). This write ensures that a re-run of `skf-create-skill` against the amended brief sees the path in scope and skips re-prompting.
101
- 3. Append to `brief.scope.amendments[]` a new entry with `action: "promoted"`, `path: candidate.path`, `reason: {user-provided one-sentence reason or auto-generated "authoritative AI docs — matched heuristic {basename}"}`, `heuristic: {basename}`, `date: {today ISO}`, `workflow: "skf-create-skill"`.
102
- 4. **Write the amended brief back to disk immediately** at `{forge_data_folder}/{skill_name}/skill-brief.yaml`. Immediate write (not deferred to step-07) ensures a crashed run still leaves the amendment recorded. Preserve all other brief fields and formatting. **Use atomic write + backup:** before writing, copy the original brief to `{forge_data_folder}/{skill_name}/skill-brief.yaml.bak` (overwriting any prior `.bak` — the most recent pre-amendment snapshot is the useful one). Then pipe the amended YAML through the shared atomic writer so a crash mid-write cannot corrupt the brief:
103
-
104
- ```bash
105
- # 1. Backup
106
- cp {forge_data_folder}/{skill_name}/skill-brief.yaml \
107
- {forge_data_folder}/{skill_name}/skill-brief.yaml.bak
108
-
109
- # 2. Atomic write (stdin → tmp → fsync → rename)
110
- cat <<'AMENDED_YAML' | python3 {atomicWriteHelper} write \
111
- --target {forge_data_folder}/{skill_name}/skill-brief.yaml
112
- {amended brief YAML}
113
- AMENDED_YAML
114
- ```
115
-
116
- The helper stages into `{brief}.skf-tmp`, fsyncs, then `os.replace()`s — readers never see a half-written brief.
117
- 5. Display: "**Promoted `{path}`** — tracked as documentation file, amendment recorded."
118
-
119
- - **[S] Skip:**
120
- 1. Do NOT modify `scope.include` or `scope.exclude`.
121
- 2. Append to `brief.scope.amendments[]` a new entry with `action: "skipped"`, `path: candidate.path`, `reason: {user-provided reason or auto-generated "user declined promotion at create-skill §2a"}`, `heuristic: {basename}`, `date: {today ISO}`, `workflow: "skf-create-skill"`.
122
- 3. **Write the amended brief back to disk** so future runs do not re-prompt. Use the same backup-then-atomic-write pattern as the [P] Promote path (copy to `skill-brief.yaml.bak` first, then pipe through `skf-atomic-write.py write --target {brief_path}`).
123
- 4. Display: "**Skipped `{path}`** — decision recorded in amendments."
124
-
125
- - **[U] Update:**
126
- 1. Halt the workflow immediately.
127
- 2. Display: "**Halting create-skill.** Re-run `skf-brief-skill` to refine the scope filters for `{skill_name}`, then re-run `skf-create-skill`. Decisions for previously prompted candidates were already persisted to the brief; the current candidate was not written."
128
- 3. Exit with status `halted-for-brief-refinement`.
129
-
130
- 8. **Summary.** After all candidates are resolved (or none were found), display a one-line summary:
68
+ Load `{authoritativeFilesProtocol}` and execute it. The full protocol (heuristic scan list, helper invocation, classification dispatch, prompt flow, P/S/U decision-apply, summary, provenance-map handoff, downstream consumption) lives there. This stub exists so the inline `### 2a` heading stays present in `extract.md`'s table of contents while keeping the body lean.
131
69
 
132
- - `"Authoritative files scan: {N} candidates, {P} promoted, {S} skipped, {A} pre-decided from amendments."`
133
- - If N = 0: `"Authoritative files scan: no candidates."`
134
-
135
- **Record for evidence report:** `authoritative_files_scan: {candidates: N, promoted: P, skipped: S, pre_decided: A, decisions: [{path, action, heuristic, reason}]}` — step-07 includes this in `evidence-report.md`.
136
-
137
- **How promoted docs reach the provenance map:**
138
-
139
- Promoted docs do NOT flow through §4 code extraction. Instead:
140
-
141
- 1. §2a populates the in-context `promoted_docs[]` list with content hashes.
142
- 2. **Step-05 §6** (provenance-map assembly) reads `promoted_docs[]` and emits one `file_entries[]` entry per promoted doc with `file_type: "doc"`, `extraction_method: "promoted-authoritative"`, `confidence: "T1-low"`, and the pre-computed `content_hash`.
143
- 3. **Step-07 §2** does NOT copy doc files into the skill package (unlike scripts and assets). The source file remains at its original path; only the provenance map tracks it. Future audit and update workflows compare against this tracking entry via content hash — no file copy is required because the intent is drift detection on the *source*, not bundling documentation into the skill output.
144
-
145
- **Re-running `skf-create-skill`** reads the amended brief. Files with `action: "promoted"` amendments already appear in `scope.include`, but §2a still runs — it detects the file is in scope AND has an existing amendment, and takes the "pre-decided" silent path. The `promoted_docs[]` list is rebuilt on each run by scanning amendments with `action: "promoted"` (this is the deterministic replay path).
146
-
147
- **Downstream workflow consumption** (zero code changes required):
148
-
149
- - **`skf-update-skill`** reads `provenance-map.json`. Promoted docs appear as `file_entries[]` entries. Update-skill Category D (script/asset file changes) iterates `file_entries` and compares content hashes — this works identically for `file_type: "doc"` entries, giving drift detection for free.
150
- - **`skf-audit-skill`** (after the bounded re-index fix) scans files from `provenance-map.json`. The re-index builds its list from `entries[].source_file ∪ file_entries[].source_file`, so promoted doc paths are naturally included in the audit scan.
151
-
152
- The brief is the single source of truth for authored scope intent. The provenance map is the single source of truth for extracted state. `scope.amendments[]` is the bridge that records when those two intentionally diverged. `promoted_docs[]` is the in-memory handoff from §2a to step-05 §6; it is not persisted — the persisted form is the `file_entries[]` list in provenance-map.json.
70
+ Briefly: scan the source tree for authoritative AI documentation files (`llms.txt`, `AGENTS.md`, `.cursorrules`, etc.) that the brief's scope filters may have excluded. The `{resolveAuthoritativeFilesHelper}` helper does the deterministic work (walk, scope diff, amendment reconcile, preview load, hashing); the LLM applies the resulting `unresolved[]` prompt loop. Promoted decisions are persisted to the brief immediately so re-runs replay deterministically.
153
71
 
154
72
  ### 2b. Resolve Source Access
155
73
 
@@ -167,7 +85,7 @@ This ensures source code is accessible regardless of which extraction path is ta
167
85
 
168
86
  If ALL of these conditions are true:
169
87
  - `tools.ccc` is true in forge-tier.yaml
170
- - `{ccc_discovery}` is empty (step-02b deferred because source was remote)
88
+ - `{ccc_discovery}` is empty (step 2b deferred because source was remote)
171
89
  - `remote_clone_path` is set (source resolution succeeded for a remote URL)
172
90
  - Tier is Forge+ or Deep
173
91
 
@@ -204,7 +122,7 @@ Then run CCC indexing and discovery on the resolved clone (workspace or ephemera
204
122
 
205
123
  **CCC Discovery Integration (Forge+ and Deep with ccc only):**
206
124
 
207
- If `{ccc_discovery}` is in context and non-empty (populated by step-02b or deferred discovery above):
125
+ If `{ccc_discovery}` is in context and non-empty (populated by step 2b or deferred discovery above):
208
126
  - Sort the filtered file list by CCC relevance score: files appearing in `{ccc_discovery}` results move to the front of the extraction queue, sorted by their relevance score descending
209
127
  - Files NOT in CCC results remain in the queue after ranked files — they are not excluded, only deprioritized
210
128
  - Display: "**CCC discovery: {N} files pre-ranked by semantic relevance** — extraction will prioritize these first."
@@ -227,9 +145,9 @@ Load and execute `{componentExtractionStepFile}` completely. When that step comp
227
145
 
228
146
  **If `source_type: "docs-only"` in the brief data:**
229
147
 
230
- "**Docs-only mode:** No source code to extract. Documentation content will be fetched from `doc_urls` in step-03c."
148
+ "**Docs-only mode:** No source code to extract. Documentation content will be fetched from `doc_urls` in step 3c."
231
149
 
232
- Build an empty extraction inventory with zero exports. **Set `top_exports = []` explicitly in context** — downstream steps (notably §3b targeted searches and step-04 enrichment fan-out) must see an empty list rather than an undefined/missing field so they can short-circuit deterministically. Set `extraction_mode: "docs-only"` in context. Auto-proceed through Gate 2 (section 6) — display the empty inventory and note that T3 content will be produced by the doc-fetcher step.
150
+ Build an empty extraction inventory with zero exports. **Set `top_exports = []` explicitly in context** — downstream steps (notably §3b targeted searches and step 4 enrichment fan-out) must see an empty list rather than an undefined/missing field so they can short-circuit deterministically. Set `extraction_mode: "docs-only"` in context. Auto-proceed through Gate 2 (section 6) — display the empty inventory and note that T3 content will be produced by the doc-fetcher step.
233
151
 
234
152
  **If `source_type: "source"` (default):** Continue with extraction below.
235
153
 
@@ -250,7 +168,7 @@ Source resolution, version reconciliation, and CCC discovery were completed in s
250
168
 
251
169
  **Forge/Forge+/Deep Tier (AST available):**
252
170
 
253
- ⚠️ **CRITICAL:** Before executing AST extraction, load the **AST Extraction Protocol** section from `{extractionPatternsData}`. Follow the decision tree based on the file count from step-01's file tree. This determines whether to use the MCP tool, scoped YAML rules, or CLI streaming. Never use `ast-grep --json` (without `=stream`) — it loads the entire result set into memory and will fail on large codebases. Always use the explicit `run` subcommand with streaming: `ast-grep run -p '{pattern}' --json=stream`.
171
+ ⚠️ **CRITICAL:** Before executing AST extraction, load the **AST Extraction Protocol** section from `{extractionPatternsData}`. Follow the decision tree based on the file count from step 1's file tree. This determines whether to use the MCP tool, scoped YAML rules, or CLI streaming. Never use `ast-grep --json` (without `=stream`) — it loads the entire result set into memory and will fail on large codebases. Always use the explicit `run` subcommand with streaming: `ast-grep run -p '{pattern}' --json=stream`.
254
172
 
255
173
  1. Detect language from brief or file extensions
256
174
  2. Follow the AST Extraction Protocol decision tree from `{extractionPatternsData}`:
@@ -295,15 +213,29 @@ Use the entry point as the authoritative source for `metadata.json`'s `exports[]
295
213
 
296
214
  **Default resolution:** If `scripts_intent` is absent from the brief, treat as `"detect"` (auto-detection). If `assets_intent` is absent, treat as `"detect"`. Only an explicit `"none"` value disables detection.
297
215
 
298
- **If `scripts_intent` is `"none"` AND `assets_intent` is `"none"`:** Skip this section entirely. **If only one is `"none"`:** Skip that category only, proceed with the other.
216
+ Invoke the deterministic detector — it implements the heuristics from `{extractionPatternsTracingData}` (directory conventions, shebang signals, `package.json` `bin` entry-points, asset filename patterns, binary-extension exclusion, generated-path pruning) so this stage doesn't re-derive them per-run:
217
+
218
+ ```bash
219
+ uv run {detectScriptsAssetsHelper} detect <source-root> \
220
+ --scripts-intent <scripts_intent> \
221
+ --assets-intent <assets_intent> \
222
+ [--scope-include "<glob1>,<glob2>,..."] \
223
+ [--max-lines 500]
224
+ ```
299
225
 
300
- After export extraction, scan the source for scripts and assets using the detection patterns in `{extractionPatternsTracingData}`:
226
+ The helper emits JSON on stdout:
301
227
 
302
- 1. Scan source tree for directories/files matching detection heuristics (scripts/, bin/, tools/, cli/ for scripts; assets/, templates/, schemas/, configs/, examples/ for assets)
303
- 2. For each candidate: verify existence, check size (flag >500 lines), exclude binaries, compute SHA-256 hash
304
- 3. Extract purpose from header comments, shebang, README references, or schema fields. Record: file_path, purpose, source_path, language/type, content_hash, confidence (T1-low)
228
+ ```json
229
+ {
230
+ "scripts_inventory": [ {name, source_file, purpose, language, content_hash, confidence, lines, size_flag}, ... ],
231
+ "assets_inventory": [ {name, source_file, purpose, type, content_hash, confidence, lines, size_flag}, ... ],
232
+ "scripts_skipped": <bool>,
233
+ "assets_skipped": <bool>,
234
+ "stats": { "scripts_found": N, "assets_found": M, "files_scanned": K }
235
+ }
236
+ ```
305
237
 
306
- Add results to `scripts_inventory[]` and `assets_inventory[]` alongside the existing export inventory.
238
+ Merge `scripts_inventory[]` and `assets_inventory[]` into the running extraction inventory verbatim — entries already carry `confidence: "T1-low"` and `content_hash` (sha256:...). Records with `size_flag: "oversized"` should be surfaced in §6 (Extraction Summary) so the user can confirm before bundling. If both `scripts_skipped` and `assets_skipped` are true, the helper performs no walk and §4c is effectively a no-op.
307
239
 
308
240
  ### 5. Build Extraction Inventory
309
241
 
@@ -323,7 +255,7 @@ Compile all extracted data into a structured inventory:
323
255
  - Total exports found
324
256
  - Exports by type (functions, types/interfaces, constants)
325
257
  - Confidence breakdown (T1 count, T1-low count)
326
- - `top_exports[]` — sorted list of the top 10-20 public API function names by prominence (import frequency or documentation position). This named field is consumed by step-03b for targeted temporal fetching and cache fingerprinting.
258
+ - `top_exports[]` — sorted list of the top 10-20 public API function names by prominence (import frequency or documentation position). This named field is consumed by step 3b for targeted temporal fetching and cache fingerprinting.
327
259
 
328
260
  **Script/asset counts (when detected):**
329
261
  - `scripts_found`: count of scripts detected
@@ -335,7 +267,7 @@ Compile all extracted data into a structured inventory:
335
267
 
336
268
  ### 6. Present Extraction Summary (Gate 2)
337
269
 
338
- **Docs-only note:** If `docs_only_mode` is active (`extraction_mode: "docs-only"`), display a brief note explaining that T3 content will be added by the doc-fetcher step (step-03c), then auto-proceed past this gate. Example: "Docs-only mode: extraction inventory is empty. Documentation content will be fetched from `doc_urls` in step-03c. Auto-proceeding."
270
+ **Docs-only note:** If `docs_only_mode` is active (`extraction_mode: "docs-only"`), display a brief note explaining that T3 content will be added by the doc-fetcher step (step 3c), then auto-proceed past this gate. Example: "Docs-only mode: extraction inventory is empty. Documentation content will be fetched from `doc_urls` in step 3c. Auto-proceeding."
339
271
 
340
272
  Display the extraction findings for user confirmation:
341
273
 
@@ -30,7 +30,7 @@ Structural extraction via ast-grep — verified exports with line-level citation
30
30
 
31
31
  > **Note:** `ast_bridge.*`, `qmd_bridge.*`, and `ccc_bridge.*` references below are **conceptual interfaces**, not callable functions. Resolve them as follows:
32
32
  > - `ast_bridge.*` → ast-grep MCP tools (`mcp__ast-grep__find_code`, `mcp__ast-grep__find_code_by_rule`) or `ast-grep` CLI
33
- > - `qmd_bridge.*` → QMD MCP `query` tool (`mcp__plugin_qmd-plugin_qmd__query`) taking `searches=[{type:'lex'|'vec'|'hyde', query, intent}]`, or `qmd` CLI (`qmd search` / `qmd vector-search`). The legacy `vector_search` MCP tool has been removed; if a client surfaces a tool-not-found error, degrade gracefully per the QMD step-04 tool-probe note — do not retry the stale name.
33
+ > - `qmd_bridge.*` → QMD MCP `query` tool (`mcp__plugin_qmd-plugin_qmd__query`) taking `searches=[{type:'lex'|'vec'|'hyde', query, intent}]`, or `qmd` CLI (`qmd search` / `qmd vector-search`). The legacy `vector_search` MCP tool has been removed; if a client surfaces a tool-not-found error, degrade gracefully per the QMD step 4 tool-probe note — do not retry the stale name.
34
34
  > - `ccc_bridge.*` → `/ccc` skill (Claude Code), ccc MCP server (Cursor), or `ccc` CLI
35
35
  > - `gh_bridge.*` → `gh api` commands or direct file I/O for local sources
36
36
  >
@@ -64,10 +64,10 @@ Identical extraction to Forge tier. CCC adds an upstream semantic discovery step
64
64
 
65
65
  ### When CCC Pre-Discovery Applies
66
66
 
67
- CCC pre-discovery runs in step-02b-ccc-discover (before this extraction step) when ALL of the following are true:
67
+ CCC pre-discovery runs in ccc-discover (before this extraction step) when ALL of the following are true:
68
68
  - Tier is Forge+ or Deep
69
69
  - `tools.ccc: true` in forge-tier.yaml
70
- - `ccc_index.status` is `"fresh"`, `"stale"`, `"created"`, or `"none"`/`"failed"` (step-02b attempts lazy indexing for the latter two)
70
+ - `ccc_index.status` is `"fresh"`, `"stale"`, `"created"`, or `"none"`/`"failed"` (step 2b attempts lazy indexing for the latter two)
71
71
 
72
72
  The discovery step stores `{ccc_discovery: [{file, score, snippet}]}` in context. This extraction step consumes those results to pre-rank the file list.
73
73
 
@@ -96,16 +96,16 @@ CCC pre-discovery failures (ccc unavailable, command error, empty results) alway
96
96
 
97
97
  ## Deep Tier (AST + QMD)
98
98
 
99
- Same extraction as Forge tier. Deep tier adds enrichment in step-04, not extraction.
99
+ Same extraction as Forge tier. Deep tier adds enrichment in step 4, not extraction.
100
100
 
101
101
  ### Strategy
102
102
  - Identical to Forge tier extraction
103
- - QMD enrichment happens in the next step (step-04-enrich)
103
+ - QMD enrichment happens in the next step (enrich)
104
104
  - Extraction results carry forward unchanged
105
105
 
106
106
  ### Confidence
107
107
  - Extraction: same as Forge (T1)
108
- - Enrichment annotations added in step-04: T2
108
+ - Enrichment annotations added in step 4: T2
109
109
 
110
110
  ---
111
111
 
@@ -113,7 +113,7 @@ Same extraction as Forge tier. Deep tier adds enrichment in step-04, not extract
113
113
 
114
114
  When AST tools are available (Forge/Deep tier), follow this deterministic protocol to prevent output overflow on large codebases.
115
115
 
116
- **"Files in scope"** = files remaining after applying `include_patterns` and `exclude_patterns` from the brief, filtered by the target language extension. This is NOT the total repository file count from step-01's tree listing. Use the filtered count from step-03 section 2 as the decision tree input.
116
+ **"Files in scope"** = files remaining after applying `include_patterns` and `exclude_patterns` from the brief, filtered by the target language extension. This is NOT the total repository file count from step 1's tree listing. Use the filtered count from step 3 section 2 as the decision tree input.
117
117
 
118
118
  ### Decision Tree
119
119
 
@@ -320,7 +320,7 @@ constraints:
320
320
 
321
321
  ### Component Library YAML Rule Recipes
322
322
 
323
- These patterns are used by `step-03d-component-extraction.md` when `scope.type: "component-library"`. They prioritize Props interfaces and PascalCase component exports.
323
+ These patterns are used by `component-extraction.md` when `scope.type: "component-library"`. They prioritize Props interfaces and PascalCase component exports.
324
324
 
325
325
  **React/TypeScript — Props interfaces (primary API contracts):**
326
326
 
@@ -400,6 +400,8 @@ When using ast-grep for extraction, be aware of these documented limitations:
400
400
 
401
401
  7. **Python class patterns with bases/colon return zero (ast-grep 0.42.x):** The patterns `class $NAME($$$BASES)` and `class $NAME($$$BASES):` return zero matches on real Python sources with ast-grep 0.42.0, even on files containing dozens of subclassed public classes. `find_code_by_rule` also rejects the bare inline rule without `kind` as `Rule must specify a set of AST kinds to match. Try adding \`kind\` rule.` **Workaround:** Use the minimal `class $NAME` pattern with `kind: class_definition` (YAML) or `ast-grep run -p 'class $NAME' -l python --json=stream` (CLI), then post-filter names via the `^[^_]` regex. The `^[^_]` constraint enforces the "public" filter since ast-grep's base-match rule is what's broken, not the name-match rule. See the Python — public classes recipe above.
402
402
 
403
+ 8. **Rust `pub fn` any-pattern returns zero; bare `pub fn $NAME` over-captures (ast-grep 0.42.x):** The `rust-public-functions` recipe's `any:` of `pub fn $NAME($$$PARAMS) -> $RET` / `pub fn $NAME($$$PARAMS)` returns "No matches found" on real Rust sources with ast-grep 0.42.2, even on crates containing 200+ public functions. Dropping to the bare `pub fn $NAME` pattern matches, but over-captures restricted-visibility functions such as `pub(crate) fn` / `pub(super) fn`, which are **not** public API. **Workaround:** Prefer a visibility-constrained source grep — `rg '^\s*pub fn ' <src>` filtered to exclude lines beginning `pub(` — cross-checked against the AN-verified public surface, at T1-low confidence. Never silently accept zero results for Rust public functions, and never treat a bare `pub fn $NAME` match set as the public API without stripping `pub(...)`-restricted items. See the Rust — public functions recipe above.
404
+
403
405
  ### Component Library Demo/Example Auto-Exclusion
404
406
 
405
407
  When `scope.type: "component-library"`, auto-detect and propose demo/example exclusions before extraction begins. **User confirmation is required before applying** — some `examples/` directories contain API-level code.