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,9 +1,6 @@
1
1
  ---
2
- name: 'step-03-generate-snippet'
3
- description: 'Generate context-snippet.md in Vercel-aligned indexed format'
4
-
5
2
  nextStepFile: './step-04-update-context.md'
6
- snippetFormatData: '../data/snippet-format.md'
3
+ snippetFormatData: 'assets/snippet-format.md'
7
4
  ---
8
5
 
9
6
  # Step 3: Generate Snippet
@@ -12,41 +9,11 @@ snippetFormatData: '../data/snippet-format.md'
12
9
 
13
10
  To generate or update context-snippet.md for the skill in the Vercel-aligned indexed format, targeting ~80-120 tokens per skill with T1-now content only.
14
11
 
15
- ## MANDATORY EXECUTION RULES (READ FIRST):
16
-
17
- ### Universal Rules:
18
-
19
- - 📖 CRITICAL: Read the complete step file before taking any action
20
- - 🔄 CRITICAL: When loading next step with 'C', ensure entire file is read
21
- - ⚙️ 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
22
- - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
23
-
24
- ### Role Reinforcement:
25
-
26
- - ✅ You are a delivery and packaging specialist in Ferris Delivery mode
27
- - ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
28
- - ✅ Compress precisely — every token in a snippet must earn its place
29
-
30
- ### Step-Specific Rules:
31
-
32
- - 🎯 Focus only on generating the context-snippet.md content
33
- - 🚫 FORBIDDEN to include T2 annotations or temporal context — T1-now only
34
- - 💬 This is a deterministic generation step — auto-proceed when complete
35
- - 📋 If `passive_context: false` was detected in step-01, SKIP this step entirely and auto-proceed to step-04
36
-
37
- ## EXECUTION PROTOCOLS:
38
-
39
- - 🎯 Follow the MANDATORY SEQUENCE exactly
40
- - 💾 Write context-snippet.md to skill directory (or hold in context if dry-run)
41
- - 📖 Load {snippetFormatData} for format template
42
- - 🚫 Strict adherence to Vercel-aligned format — no deviations
12
+ ## Rules
43
13
 
44
- ## CONTEXT BOUNDARIES:
45
-
46
- - Available: Skill metadata (name, exports, skill_type, components, integrations) from step-01
47
- - Focus: Snippet generation in exact Vercel-aligned format
48
- - Limits: T1-now content only, ~80-120 tokens target
49
- - Dependencies: Step-01 metadata, step-02 package validation
14
+ - Focus only on generating the context-snippet.md content — T1-now only, no T2 annotations
15
+ - If `passive_context: false` was detected in step-01, skip this step entirely
16
+ - **Multi-skill mode:** when step-01 loaded more than one skill (`len(skill_batch) > 1`), iterate sections 2–5 per skill. Each skill has its own prior-gotchas carry-forward state (§2.5) do not share state across skills. §2.7 resolves `{skill_root}` once for the run (it depends on `target_context_files`, not the skill). See step-01 §1c.
50
17
 
51
18
  ## MANDATORY SEQUENCE
52
19
 
@@ -70,7 +37,7 @@ Load {snippetFormatData} and read the format template for the skill type.
70
37
 
71
38
  Before generating new snippet content, check for a prior snippet:
72
39
 
73
- 1. Read `{resolved_skill_package}/context-snippet.md` if it exists (resolved in step-01 — see [knowledge/version-paths.md](../../../knowledge/version-paths.md))
40
+ 1. Read `{resolved_skill_package}/context-snippet.md` if it exists (resolved in step-01 — see `knowledge/version-paths.md`)
74
41
  2. If it exists, extract the `|gotchas:` line (if any). Trim leading whitespace and the `|gotchas:` prefix, then capture the remaining content as `prior_gotchas_content`.
75
42
  3. **Detect the carry-forward marker:** If `prior_gotchas_content` starts with the token `[CARRIED]` (whitespace-insensitive), set `prior_gotchas_already_carried = true` and strip the marker before storing the remainder. Otherwise set `prior_gotchas_already_carried = false`.
76
43
  4. **Distinguish empty from absent:** If the `|gotchas:` line exists but has no non-whitespace content after the prefix, treat it as **absent** — set `prior_gotchas = null`. Only a non-empty value counts as a prior gotchas line worth carrying forward.
@@ -78,17 +45,13 @@ Before generating new snippet content, check for a prior snippet:
78
45
 
79
46
  These values will be used as a fallback in section 3 if new gotchas cannot be derived. The `[CARRIED]` marker provides a **hard one-cycle expiry**: gotchas that were already carried once will be dropped on the next carry-forward attempt rather than preserved indefinitely.
80
47
 
81
- ### 2.7. Resolve Platform Root Path
48
+ ### 2.7. Resolve Skill Root Path
82
49
 
83
- Using the first platform in `target_platforms` (resolved in step-01), resolve the root path prefix:
50
+ **If `snippet_skill_root_override` is set in config.yaml:** Use its value directly as `{skill_root}` and skip the IDE-mapping lookup below. This is the authoring-repo escape hatch — repos where skills live under a single shared directory (e.g. `skills/`) that does not match any per-IDE skill root. Log: "Using snippet_skill_root_override: `{override}` — bypassing IDE mapping for snippet root path."
84
51
 
85
- | Platform | `{platform_root}` |
86
- |----------|-------------------|
87
- | `claude` | `.claude/skills/` |
88
- | `cursor` | `.cursor/skills/` |
89
- | `copilot` | `.agents/skills/` |
52
+ **Otherwise (default):** Using the first entry in `target_context_files` (resolved in step-01), take its `skill_root` value. This is the IDE's actual skill directory (e.g., `.claude/skills/`, `.windsurf/skills/`, `.github/skills/`).
90
53
 
91
- Store `{platform_root}` for use in snippet generation. The context-snippet.md written to disk uses this platform's root path.
54
+ Store `{skill_root}` for use in snippet generation. The context-snippet.md written to disk uses this resolved skill root path.
92
55
 
93
56
  ### 3. Generate Snippet Content
94
57
 
@@ -106,7 +69,7 @@ Store `{platform_root}` for use in snippet generation. The context-snippet.md wr
106
69
 
107
70
  Generate:
108
71
  ```
109
- [{skill-name} v{version}]|root: {platform_root}{skill-name}/
72
+ [{skill-name} v{version}]|root: {skill_root}{skill-name}/
110
73
  |IMPORTANT: {skill-name} v{version} — read SKILL.md before writing {skill-name} code. Do NOT rely on training data.
111
74
  |quick-start:{SKILL.md#quick-start}
112
75
  |api: {export-1}(), {export-2}(), {export-3}, {export-4}(), {export-5}
@@ -122,7 +85,7 @@ Generate:
122
85
 
123
86
  Generate:
124
87
  ```
125
- [{project}-stack v{version}]|root: {platform_root}{project}-stack/
88
+ [{project}-stack v{version}]|root: {skill_root}{project}-stack/
126
89
  |IMPORTANT: {project}-stack — read SKILL.md before writing integration code. Do NOT rely on training data.
127
90
  |stack: {dep-1}@{v1}, {dep-2}@{v2}, {dep-3}@{v3}
128
91
  |integrations: {pattern-1}, {pattern-2}
@@ -135,9 +98,9 @@ Generate:
135
98
 
136
99
  Estimate token count of generated snippet (approximate: words * 1.3).
137
100
 
138
- - Target: ~80-120 tokens per skill
139
- - Warning threshold: >150 tokens
140
- - If exceeding warning threshold, trim description, exports list, or refs to fit
101
+ - Target: ~80-120 tokens per skill (aspirational for Quick/Forge tiers)
102
+ - Warning threshold: >300 tokens (hard ceiling — Deep tier may legitimately exceed 120 when gotchas carry load-bearing breaking-change notices)
103
+ - If exceeding warning threshold, trim description, exports list, or refs to fit — **do NOT drop gotchas to fit the target**; gotchas exist precisely to deliver the "do not rely on training data" signal and are the last thing to cut
141
104
 
142
105
  ### 5. Write or Preview Snippet
143
106
 
@@ -180,28 +143,3 @@ Display: "**Proceeding to context update...**"
180
143
 
181
144
  ONLY WHEN snippet generation is complete (or skipped due to passive_context opt-out) will you load and read fully `{nextStepFile}` to execute context update.
182
145
 
183
- ---
184
-
185
- ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
186
-
187
- ### ✅ SUCCESS:
188
-
189
- - Snippet format loaded from {snippetFormatData}
190
- - Content generated matching exact Vercel-aligned format
191
- - Section anchors verified against SKILL.md headings (split-body anchors rewritten or omitted)
192
- - Token count estimated and within target
193
- - File written (or previewed in dry-run)
194
- - Passive context opt-out correctly handled (skip when disabled)
195
- - Prior gotchas checked and carried forward when new derivation yields nothing (with warning)
196
- - Auto-proceed to step-04
197
-
198
- ### ❌ SYSTEM FAILURE:
199
-
200
- - Silently dropping prior gotchas without checking for carry-forward
201
- - Deviating from Vercel-aligned indexed format
202
- - Including T2 annotations or temporal context
203
- - Not checking passive_context setting
204
- - Not estimating token count
205
- - Halting for user input (auto-proceed step)
206
-
207
- **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
@@ -1,9 +1,6 @@
1
1
  ---
2
- name: 'step-04-update-context'
3
- description: 'Update managed section in CLAUDE.md/AGENTS.md with four-case logic per ADR-J'
4
-
5
2
  nextStepFile: './step-05-token-report.md'
6
- managedSectionData: '../data/managed-section-format.md'
3
+ managedSectionData: 'assets/managed-section-format.md'
7
4
  ---
8
5
 
9
6
  # Step 4: Update Context
@@ -12,44 +9,13 @@ managedSectionData: '../data/managed-section-format.md'
12
9
 
13
10
  To update the managed `<!-- SKF:BEGIN/END -->` section in the platform-appropriate context file (CLAUDE.md/AGENTS.md/.cursorrules) using the four-case logic defined by ADR-J (Create, Append, Regenerate, Malformed Markers halt), rebuilding the complete skill index from all exported skills.
14
11
 
15
- ## MANDATORY EXECUTION RULES (READ FIRST):
16
-
17
- ### Universal Rules:
18
-
19
- - 🛑 NEVER modify content outside `<!-- SKF:BEGIN/END -->` markers
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
- - ⚙️ TOOL/SUBPROCESS FALLBACK: If any instruction references a subprocess, subagent, or tool you do not have access to, you MUST still achieve the outcome in your main context thread
23
- - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
24
-
25
- ### Role Reinforcement:
26
-
27
- - ✅ You are a delivery and packaging specialist in Ferris Delivery mode
28
- - ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
29
- - ✅ Surgical precision required — existing file content MUST be preserved
30
- - ✅ User confirms changes before any writes to shared context files
31
-
32
- ### Step-Specific Rules:
33
-
34
- - 🎯 Focus only on the managed section update in the target context file
35
- - 🚫 FORBIDDEN to modify ANY content outside `<!-- SKF:BEGIN -->` and `<!-- SKF:END -->` markers
36
- - 🚫 FORBIDDEN to write without user confirmation — this modifies shared project files
37
- - 💬 Show a clear diff preview before writing
38
- - 📋 If `passive_context: false` was detected in step-01, SKIP this step entirely and auto-proceed
39
-
40
- ## EXECUTION PROTOCOLS:
41
-
42
- - 🎯 Follow the MANDATORY SEQUENCE exactly
43
- - 💾 Load {managedSectionData} for format template and three-case logic
44
- - 📖 Rebuild the COMPLETE skill index — not just the current skill
45
- - 🚫 ZERO data loss — verify preserved content before and after write
12
+ ## Rules
46
13
 
47
- ## CONTEXT BOUNDARIES:
48
-
49
- - Available: Skill metadata from step-01, context-snippet.md from step-03, platform flag
50
- - Focus: Three-case detection and managed section update
51
- - Limits: Only modify content between markers preserve everything else
52
- - Dependencies: Step-03 must have generated the snippet (or step skipped if passive_context off)
14
+ - Focus only on the managed section update in the target context file
15
+ - Do not modify any content outside `<!-- SKF:BEGIN -->` and `<!-- SKF:END -->` markers
16
+ - Do not write without user confirmation this modifies shared project files
17
+ - If `passive_context: false` was detected in step-01, skip this step entirely
18
+ - **Multi-skill mode:** this step executes ONCE for the whole batch, not once per skill. §4b already builds the exported skill set from the manifest (plus current export targets), so a multi-skill run naturally appears as a single rebuild. The only batch adjustment is in §9b: update the manifest entry for every skill in `skill_batch` (not just one), and include all of them when computing `ides_written`. See step-01 §1c.
53
19
 
54
20
  ## MANDATORY SEQUENCE
55
21
 
@@ -67,61 +33,55 @@ Auto-proceed immediately to {nextStepFile}.
67
33
 
68
34
  ### 2. Load Managed Section Format
69
35
 
70
- Load {managedSectionData} and read the complete format template and three-case logic.
36
+ Load {managedSectionData} and read the complete format template and four-case logic.
71
37
 
72
38
  ### 3. Determine Target File(s)
73
39
 
74
- Using the `target_platforms` list resolved in step-01, determine all target files:
75
-
76
- | Platform | Target File |
77
- |----------|-------------|
78
- | `claude` | CLAUDE.md |
79
- | `cursor` | .cursorrules |
80
- | `copilot` | AGENTS.md |
40
+ Using the `target_context_files` list resolved in step-01, determine all target files. Each entry has `{context_file, skill_root}` — the context file to write and the IDE's skill directory for root path resolution.
81
41
 
82
- For each platform in `target_platforms`, resolve target file path: `{project-root}/{target-file}`
42
+ For each entry in `target_context_files`, resolve target file path: `{context_file}`
83
43
 
84
- **If multiple platforms:** Sections 4-9a execute as a loop — one full pass per target platform. Each iteration uses the same skill index but rewrites root paths per platform (section 4d) and writes to the platform-specific target file. Section 9b executes once after all iterations complete.
44
+ **If multiple context files:** Sections 4-9a execute as a loop — one full pass per target context file. Each iteration uses the same skill index but rewrites root paths per context file's `skill_root` (section 4d) and writes to the target context file. Section 9b executes once after all iterations complete.
85
45
 
86
- **Processing order:** Process platforms in the order listed in `target_platforms`.
46
+ **Processing order:** Process context files in the order listed in `target_context_files`.
87
47
 
88
48
  #### 3b. Detect Orphaned Platform Files (Stale Managed Sections)
89
49
 
90
- A platform file becomes orphaned when its IDE is removed from `config.yaml` after a prior export. The file still contains an SKF managed section pointing to stale skill versions, but no future export will rewrite it.
50
+ A context file becomes orphaned when its IDE is removed from `config.yaml` after a prior export. The file still contains an SKF managed section pointing to stale skill versions, but no future export will rewrite it.
91
51
 
92
- Build `orphaned_platform_files` — the set of platform context files that exist on disk with an `<!-- SKF:BEGIN -->` marker but whose platform is NOT in the current `target_platforms` list:
52
+ Build `orphaned_context_files` — the set of context files that exist on disk with an `<!-- SKF:BEGIN -->` marker but whose context file is NOT in the current `target_context_files` list:
93
53
 
94
- 1. For each platform in the full set `{claude, cursor, copilot}`:
95
- - If the platform is in `target_platforms`, skip (it will be rewritten in the main loop)
96
- - Otherwise, check whether its target file exists (`CLAUDE.md`, `.cursorrules`, or `AGENTS.md`)
54
+ 1. For each known context file in `{CLAUDE.md, .cursorrules, AGENTS.md}`:
55
+ - If the context file is in `target_context_files`, skip (it will be rewritten in the main loop)
56
+ - Otherwise, check whether the file exists at `{context_file}`
97
57
  - If the file exists, read it and check for the `<!-- SKF:BEGIN -->` marker
98
- - If the marker is present, add the file path to `orphaned_platform_files` along with the platform name
58
+ - If the marker is present, add the file path to `orphaned_context_files` along with the context file name
99
59
 
100
- 2. If `orphaned_platform_files` is non-empty, emit a warning:
60
+ 2. If `orphaned_context_files` is non-empty, emit a warning:
101
61
 
102
- "**Orphaned platform files detected.** The following files contain SKF managed sections but their platforms are no longer in `config.yaml` `ides`:
103
- {list: platform → file path}
62
+ "**Orphaned context files detected.** The following files contain SKF managed sections but no configured IDEs target them:
63
+ {list: context file → file path}
104
64
 
105
65
  The managed sections in these files are stale. Options:
106
66
  - **(a) clear** — remove the SKF managed section from each orphaned file (surgical marker replacement, leaves user content intact)
107
- - **(b) keep** — leave them untouched (they will remain stale until you re-add the IDE or delete the file)
67
+ - **(b) keep** — leave them untouched (they will remain stale until you re-add an IDE that targets this file or delete the file)
108
68
  - **(c) rewrite** — also rewrite the orphaned files with the current skill index (use this if the IDE was removed by mistake)"
109
69
 
110
70
  3. Wait for user choice. In non-interactive mode (dry-run or unattended), default to **(b) keep** and print the warning only.
111
71
 
112
72
  4. If the user chose **(a) clear**: for each orphaned file, replace everything between `<!-- SKF:BEGIN` and `<!-- SKF:END -->` (inclusive) with an empty string, preserving surrounding content byte-exactly. Record the cleared files in `orphans_cleared`.
113
73
 
114
- 5. If the user chose **(c) rewrite**: add each orphaned platform to a separate `rewrite_platforms` list (kept distinct from `target_platforms` so the user's intent to only export to configured IDEs is preserved in the manifest's `platforms` field). Sections 4–9a will loop over `target_platforms + rewrite_platforms` for this run only. Record the rewritten files in `orphans_rewritten`.
74
+ 5. If the user chose **(c) rewrite**: add each orphaned context file to a separate `rewrite_context_files` list (kept distinct from `target_context_files` so the user's intent to only export to configured IDEs is preserved in the manifest). Use `.agents/skills/` as the default skill root for rewritten orphans. Sections 4–9a will loop over `target_context_files + rewrite_context_files` for this run only. Record the rewritten files in `orphans_rewritten`.
115
75
 
116
76
  6. If the user chose **(b) keep**: record nothing and proceed.
117
77
 
118
- This cleanup only runs during interactive export. Drop-skill and rename-skill operate on the manifest's declared platforms and are not responsible for orphan detection.
78
+ This cleanup only runs during interactive export. Drop-skill and rename-skill operate on the manifest's declared context files and are not responsible for orphan detection.
119
79
 
120
80
  ### 4. Rebuild Complete Skill Index
121
81
 
122
82
  #### 4a. Read Export Manifest (v2 — version-aware)
123
83
 
124
- Read `{skills_output_folder}/.export-manifest.json` — see [knowledge/version-paths.md](../../../knowledge/version-paths.md) for the full v2 schema:
84
+ Read `{skills_output_folder}/.export-manifest.json` — see `knowledge/version-paths.md` for the full v2 schema:
125
85
 
126
86
  **If the file exists:** Parse JSON. Check for `schema_version` field:
127
87
 
@@ -134,17 +94,17 @@ Read `{skills_output_folder}/.export-manifest.json` — see [knowledge/version-p
134
94
  "active_version": "0.6.0",
135
95
  "versions": {
136
96
  "0.1.0": {
137
- "platforms": ["claude"],
97
+ "ides": ["claude-code"],
138
98
  "last_exported": "2026-01-15",
139
99
  "status": "deprecated"
140
100
  },
141
101
  "0.5.0": {
142
- "platforms": ["claude"],
102
+ "ides": ["claude-code"],
143
103
  "last_exported": "2026-03-15",
144
104
  "status": "archived"
145
105
  },
146
106
  "0.6.0": {
147
- "platforms": ["claude", "copilot"],
107
+ "ides": ["claude-code", "github-copilot"],
148
108
  "last_exported": "2026-04-04",
149
109
  "status": "active"
150
110
  }
@@ -160,10 +120,12 @@ Read `{skills_output_folder}/.export-manifest.json` — see [knowledge/version-p
160
120
  - `"deprecated"` — dropped via drop-skill workflow; excluded from all exports (files may or may not exist on disk)
161
121
  - `"draft"` — created but never exported
162
122
 
123
+ **Legacy `platforms` → `ides` rename:** Pre-rename v2 manifests used a `platforms` array at the version level. If a version entry contains `platforms` instead of (or in addition to) `ides`, treat `platforms` as `ides` and rewrite it to `ides` on the next manifest write. This is a silent in-place upgrade — no user prompt, no v3 bump.
124
+
163
125
  **v1 manifest** (no `schema_version` field — migrate in-place to v2):
164
- 1. For each entry in `exports`, read its `platforms` and `last_exported`
126
+ 1. For each entry in `exports`, read its `last_exported` (v1 had no per-version IDE list)
165
127
  2. Resolve the skill's current version from `{resolved_skill_package}/metadata.json`
166
- 3. Wrap in v2 structure: set `active_version` to the resolved version, create a single entry in `versions` with `status: "active"`, the original `platforms`, and `last_exported`
128
+ 3. Wrap in v2 structure: set `active_version` to the resolved version, create a single entry in `versions` with `status: "active"`, `ides: []` (unknown — will be filled on next successful export), and `last_exported`
167
129
  4. Set `schema_version: "2"` at root
168
130
  5. Hold the migrated structure in context (it will be written in section 9b)
169
131
 
@@ -194,30 +156,23 @@ Instead of globbing `{skills_output_folder}/*/context-snippet.md`, resolve snipp
194
156
 
195
157
  **If no snippets pass the filter:** Generate managed section with zero skills — header only, no skill entries.
196
158
 
197
- #### 4d. Rewrite Root Paths for Target Platform
198
-
199
- The context-snippet.md files on disk contain root paths for the platform they were originally exported to. When assembling the managed section for the current target platform, rewrite root paths if they differ:
159
+ #### 4d. Rewrite Root Paths for Target Context File
200
160
 
201
- **Platform root path mapping:**
161
+ The context-snippet.md files on disk contain root paths for the IDE they were originally exported to. When assembling the managed section for the current target context file, rewrite root paths if they differ from the target's `skill_root`.
202
162
 
203
- | Platform | Root Path Prefix |
204
- |----------|-----------------|
205
- | `claude` | `.claude/skills/` |
206
- | `cursor` | `.cursor/skills/` |
207
- | `copilot` | `.agents/skills/` |
208
- | _(legacy)_ | `skills/` |
209
-
210
- The legacy `skills/` prefix may appear in snippets exported before platform-aware root paths were introduced, or in draft snippets generated by create-skill/quick-skill.
163
+ **Generic root path rewrite algorithm** (no hardcoded prefix list):
211
164
 
212
165
  For each snippet being included in the managed section:
213
166
 
214
- 1. Read the `root:` value from the snippet's first line
215
- 2. Detect the current root prefix by matching against the known prefixes above (check platform-specific prefixes first, then fall back to legacy `skills/`)
216
- 3. If the detected prefix does not match the current target platform's prefix, rewrite it
217
- 4. Example: if snippet has `root: .claude/skills/my-lib/` but target is `cursor`, rewrite to `root: .cursor/skills/my-lib/`
218
- 5. Example: if snippet has legacy `root: skills/my-lib/` and target is `copilot`, rewrite to `root: .agents/skills/my-lib/`
167
+ 1. Read the `root:` value from the snippet's first line — it has the form `root: {prefix}{skill-name}/`
168
+ 2. Extract the current prefix by stripping the trailing `{skill-name}/` from the root value
169
+ 3. **Override guard:** If `snippet_skill_root_override` is set in config.yaml AND the extracted prefix equals the override value, skip the rewrite for this snippet — leave the root path untouched. This is the authoring-repo escape hatch: when the override is set, any snippet that already matches the override prefix is treated as ground truth and must not be rewritten to a per-IDE path that does not exist on disk.
170
+ 4. Otherwise, compare the extracted prefix against the current target's `skill_root`
171
+ 5. If they differ, replace the prefix with the target's `skill_root`, preserving the skill name
172
+ 6. Example: if snippet has `root: .claude/skills/my-lib/` but target skill_root is `.windsurf/skills/`, rewrite to `root: .windsurf/skills/my-lib/`
173
+ 7. Example: if snippet has legacy `root: skills/my-lib/` and target skill_root is `.github/skills/`, rewrite to `root: .github/skills/my-lib/` — **unless** `snippet_skill_root_override: skills/` is set, in which case the `skills/` prefix is preserved
219
174
 
220
- This ensures each platform's managed section points to the correct platform-specific skill directory, including during migration from pre-platform-aware exports.
175
+ This algorithm handles any IDE's skill root path including future IDEs without enumerating known prefixes. The legacy `skills/` prefix (no leading dot) may appear in draft snippets generated by create-skill/quick-skill before export.
221
176
 
222
177
  **Sort skills alphabetically by name.**
223
178
 
@@ -245,7 +200,7 @@ Assemble the complete managed section:
245
200
 
246
201
  ### 6. Detect Case and Prepare Changes
247
202
 
248
- **Check target file at `{project-root}/{target-file}`:**
203
+ **Check target file at `{target-file}`:**
249
204
 
250
205
  **Case 1: Create (file does not exist)**
251
206
  - Action: Create new file with managed section only
@@ -269,7 +224,7 @@ Assemble the complete managed section:
269
224
 
270
225
  "**Context update prepared.{if multi-platform: ' (platform {i}/{total}: {platform})'}**
271
226
 
272
- **Target:** `{project-root}/{target-file}`
227
+ **Target:** `{target-file}`
273
228
  **Case:** {1: Create / 2: Append / 3: Regenerate}
274
229
  **Skills in index:** {n} skills, {m} stack
275
230
 
@@ -298,9 +253,9 @@ Auto-proceed to {nextStepFile}.
298
253
 
299
254
  Display: "**Select:** [C] Continue — write changes to {target-file}"
300
255
 
301
- **Multi-platform behavior:** When processing multiple platforms, present all platforms' previews together before asking for a single confirmation. After confirmation, write all target files sequentially, verifying each one.
256
+ **Multi-target behavior:** When processing multiple context files, present all previews together before asking for a single confirmation. After confirmation, write all target files sequentially, verifying each one.
302
257
 
303
- "**Targets:** {list all platform → target-file pairs}
258
+ "**Targets:** {list all context-file → target-file pairs}
304
259
  **Ready to write changes to all targets?**"
305
260
 
306
261
  Display: "**Select:** [C] Continue — write changes to all targets"
@@ -313,6 +268,7 @@ Display: "**Select:** [C] Continue — write changes to all targets"
313
268
  #### EXECUTION RULES:
314
269
 
315
270
  - ALWAYS halt and wait for user input after presenting menu
271
+ - **GATE [default: C]** — If `{headless_mode}`: auto-proceed with [C] Continue, log: "headless: auto-approve context file update"
316
272
  - ONLY proceed to next step when user selects 'C'
317
273
  - In dry-run mode, auto-proceed without writing
318
274
 
@@ -331,33 +287,35 @@ After user confirms with 'C':
331
287
 
332
288
  ### 9b. Update Export Manifest (Non-Dry-Run Only)
333
289
 
334
- **This section executes ONCE after all platform iterations complete** (outside the per-platform loop defined in section 3). Only platforms whose writes succeeded in section 9 are recorded.
290
+ **This section executes ONCE after all context-file iterations complete** (outside the per-context-file loop defined in section 3). Only IDEs whose target context files were successfully written and verified in section 9 are recorded.
291
+
292
+ **`ides` field definition:** `ides` is the list of IDE identifiers from `config.yaml.ides` (e.g. `claude-code`, `cursor`, `github-copilot`) whose context files were successfully written and verified in section 9. It is NOT the context file name (`CLAUDE.md`) and NOT the skill root path (`.claude/skills/`). Each IDE → context file → skill root mapping is defined in `skf-export-skill/assets/managed-section-format.md`.
335
293
 
336
294
  1. Read `{skills_output_folder}/.export-manifest.json` (or start with `{"schema_version": "2", "exports": {}}` if it does not exist)
337
- 2. Ensure `schema_version` is `"2"` (if v1 was migrated in section 4a, the migrated structure is already in context)
338
- 3. Add or update the current skill's entry in v2 format:
295
+ 2. Ensure `schema_version` is `"2"` (if v1 was migrated in section 4a, the migrated structure is already in context). If any version entry still has a legacy `platforms` key, rename it to `ides` in place (see §4a).
296
+ 3. Compute `ides_written` the set of IDE identifiers from `config.yaml.ides` whose mapped context file was successfully written in section 9 (deduplicated, sorted). When `--context-file` was passed explicitly, `ides_written` contains only the IDEs that map to that single context file.
297
+ 4. For each skill in `skill_batch` (multi-skill mode) — or the single current skill (single-skill mode) — add or update its entry in v2 format:
339
298
  ```json
340
299
  "{skill-name}": {
341
300
  "active_version": "{version}",
342
301
  "versions": {
343
302
  "{version}": {
344
- "platforms": ["{successfully-written platforms}"],
303
+ "ides": ["{ides_written}"],
345
304
  "last_exported": "{current-date}",
346
305
  "status": "active"
347
306
  }
348
307
  }
349
308
  }
350
309
  ```
351
- - `{version}` is the version from `{resolved_skill_package}/metadata.json`
352
- - Set `platforms` to only the platforms that were successfully written and verified in section 9
310
+ - `{version}` is the version from each skill's `{resolved_skill_package}/metadata.json`
353
311
  - If the skill already has a manifest entry:
354
312
  - Set `active_version` to the current version
355
- - If the version already exists in `versions`, update its `platforms` (merge, deduplicate), `last_exported`, and set `status: "active"`
313
+ - If the version already exists in `versions`, union its existing `ides` with `ides_written` (deduplicate, keep sorted), refresh `last_exported`, and set `status: "active"`
356
314
  - If this is a new version, add it to `versions` with `status: "active"` and set any previously-active version's status to `"archived"`
357
315
  - Preserve all other version entries in `versions` (do not delete archived versions)
358
- 4. Write the updated manifest to `{skills_output_folder}/.export-manifest.json`
316
+ 5. Write the updated manifest once to `{skills_output_folder}/.export-manifest.json` after all skills in the batch have been applied
359
317
 
360
- **Dry-run mode:** Do NOT update the manifest. Display: "**[DRY RUN] Export manifest would be updated for {skill-name} on platform(s) {platform-list}.**"
318
+ **Dry-run mode:** Do NOT update the manifest. Display: "**[DRY RUN] Export manifest would be updated for {skill-name-list} ides: {ides_written}.**" (list every skill in `skill_batch`)
361
319
 
362
320
  **Error handling:** If manifest write fails, warn but do not fail the workflow — the managed section was already written successfully.
363
321
 
@@ -365,35 +323,3 @@ After user confirms with 'C':
365
323
 
366
324
  ONLY WHEN the user confirms changes by selecting 'C' (or auto-proceed in dry-run) and the write is verified will you load and read fully `{nextStepFile}` to execute the token report.
367
325
 
368
- ---
369
-
370
- ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
371
-
372
- ### ✅ SUCCESS:
373
-
374
- - Managed section format loaded from {managedSectionData}
375
- - Target file(s) correctly determined from platform flag or config.yaml ides list
376
- - Multi-platform loop executed for all target_platforms
377
- - Root paths rewritten per platform in managed section
378
- - Complete skill index rebuilt from exported skills only (filtered via .export-manifest.json per ADR-K)
379
- - Export manifest updated after successful write (non-dry-run only)
380
- - Correct case detected (create/append/regenerate)
381
- - Clear diff preview shown to user
382
- - User confirmation received before writing
383
- - Write verified — markers present, external content preserved
384
- - Passive context opt-out correctly handled (skip when disabled)
385
- - Dry-run correctly handled (preview only, no writes)
386
-
387
- ### ❌ SYSTEM FAILURE:
388
-
389
- - Modifying content outside `<!-- SKF:BEGIN/END -->` markers
390
- - Not rebuilding the COMPLETE skill index (only adding current skill)
391
- - Including un-exported skills in managed section (bypasses ADR-K publishing gate)
392
- - Updating export manifest during dry-run
393
- - Writing without user confirmation
394
- - Not verifying write after completion
395
- - Not detecting the correct case (create/append/regenerate)
396
- - Losing existing file content during write
397
- - Not skipping when passive_context is disabled
398
-
399
- **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE. ZERO data loss in target files is NON-NEGOTIABLE.
@@ -1,7 +1,4 @@
1
1
  ---
2
- name: 'step-05-token-report'
3
- description: 'Calculate and report token counts for all export artifacts'
4
-
5
2
  nextStepFile: './step-06-summary.md'
6
3
  ---
7
4
 
@@ -11,40 +8,11 @@ nextStepFile: './step-06-summary.md'
11
8
 
12
9
  To calculate approximate token counts for all exported artifacts and present a clear report showing the token cost of each component, helping users understand the context budget impact of their skills.
13
10
 
14
- ## MANDATORY EXECUTION RULES (READ FIRST):
15
-
16
- ### Universal Rules:
17
-
18
- - 📖 CRITICAL: Read the complete step file before taking any action
19
- - 🔄 CRITICAL: When loading next step with 'C', ensure entire file is read
20
- - ⚙️ 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
21
- - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
22
-
23
- ### Role Reinforcement:
24
-
25
- - ✅ You are a delivery and packaging specialist in Ferris Delivery mode
26
- - ✅ If you already have been given a name, communication_style and identity, continue to use those while playing this new role
27
- - ✅ Report clearly — token counts inform developers' context budget decisions
28
-
29
- ### Step-Specific Rules:
30
-
31
- - 🎯 Focus only on token counting and reporting
32
- - 🚫 FORBIDDEN to modify any files — read-only measurement
33
- - 💬 This is a deterministic reporting step — auto-proceed when complete
34
-
35
- ## EXECUTION PROTOCOLS:
36
-
37
- - 🎯 Follow the MANDATORY SEQUENCE exactly
38
- - 💾 Hold token counts in context for the summary step
39
- - 📖 Use consistent estimation method across all files
40
- - 🚫 No file writes — measurement only
11
+ ## Rules
41
12
 
42
- ## CONTEXT BOUNDARIES:
43
-
44
- - Available: All artifacts from steps 01-04 (SKILL.md, metadata.json, context-snippet.md, managed section content)
45
- - Focus: Token estimation and reporting
46
- - Limits: Estimates only — exact counts vary by tokenizer
47
- - Dependencies: Steps 01-04 must have completed (or been skipped where appropriate)
13
+ - Focus only on token counting and reporting — read-only measurement
14
+ - Auto-proceed when complete
15
+ - **Multi-skill mode:** when step-01 loaded more than one skill (`len(skill_batch) > 1`), compute token counts per skill, then present one aggregate table with one row per skill (context-snippet.md, SKILL.md, metadata.json, references/, package total). Measure the managed section once for the run — it is shared across the batch. See step-01 §1c.
48
16
 
49
17
  ## MANDATORY SEQUENCE
50
18
 
@@ -102,25 +70,3 @@ Display: "**Proceeding to export summary...**"
102
70
 
103
71
  ONLY WHEN the token report is displayed will you load and read fully `{nextStepFile}` to execute the export summary.
104
72
 
105
- ---
106
-
107
- ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
108
-
109
- ### ✅ SUCCESS:
110
-
111
- - All artifacts measured with consistent heuristic
112
- - Clear table format with words and estimated tokens
113
- - Context budget impact explained (always-on vs on-trigger vs full)
114
- - Benchmark comparison for managed section target
115
- - Passive context opt-out correctly handled (skip snippet/section measurements)
116
- - Auto-proceed to step-06
117
-
118
- ### ❌ SYSTEM FAILURE:
119
-
120
- - Not measuring all artifacts
121
- - Inconsistent estimation method
122
- - Not explaining context budget impact
123
- - Modifying any files (read-only step)
124
- - Not auto-proceeding after report
125
-
126
- **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.