bmad-module-skill-forge 0.8.4 β†’ 0.10.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 (82) hide show
  1. package/README.md +5 -3
  2. package/docs/bmad-synergy.md +183 -0
  3. package/docs/concepts.md +30 -2
  4. package/docs/examples.md +57 -17
  5. package/docs/getting-started.md +17 -0
  6. package/docs/how-it-works.md +143 -29
  7. package/docs/index.md +1 -1
  8. package/docs/workflows.md +43 -5
  9. package/package.json +1 -1
  10. package/src/README.md +47 -0
  11. package/src/agents/forger.agent.yaml +8 -0
  12. package/src/knowledge/agentskills-spec.md +3 -0
  13. package/src/knowledge/overview.md +1 -0
  14. package/src/knowledge/provenance-tracking.md +3 -0
  15. package/src/knowledge/skf-knowledge-index.csv +1 -0
  16. package/src/knowledge/skill-lifecycle.md +19 -7
  17. package/src/knowledge/version-paths.md +243 -0
  18. package/src/module-help.csv +2 -0
  19. package/src/module.yaml +4 -0
  20. package/src/workflows/README.md +9 -1
  21. package/src/workflows/analyze-source/data/skill-brief-schema.md +4 -0
  22. package/src/workflows/analyze-source/steps-c/step-06-generate-briefs.md +5 -0
  23. package/src/workflows/audit-skill/steps-c/step-01-init.md +10 -6
  24. package/src/workflows/audit-skill/steps-c/step-02-re-index.md +1 -1
  25. package/src/workflows/audit-skill/steps-c/step-03-structural-diff.md +1 -1
  26. package/src/workflows/audit-skill/steps-c/step-04-semantic-diff.md +1 -1
  27. package/src/workflows/audit-skill/steps-c/step-05-severity-classify.md +1 -1
  28. package/src/workflows/audit-skill/steps-c/step-06-report.md +7 -2
  29. package/src/workflows/brief-skill/data/skill-brief-schema.md +11 -0
  30. package/src/workflows/brief-skill/steps-c/step-01-gather-intent.md +24 -1
  31. package/src/workflows/brief-skill/steps-c/step-02-analyze-target.md +10 -0
  32. package/src/workflows/brief-skill/steps-c/step-04-confirm-brief.md +9 -0
  33. package/src/workflows/brief-skill/steps-c/step-05-write-brief.md +18 -4
  34. package/src/workflows/create-skill/data/skill-sections.md +2 -0
  35. package/src/workflows/create-skill/data/source-resolution-protocols.md +40 -4
  36. package/src/workflows/create-skill/steps-c/step-03-extract.md +1 -1
  37. package/src/workflows/create-skill/steps-c/step-05-compile.md +1 -0
  38. package/src/workflows/create-skill/steps-c/step-07-generate-artifacts.md +48 -32
  39. package/src/workflows/create-skill/steps-c/step-08-report.md +16 -12
  40. package/src/workflows/create-stack-skill/data/compose-mode-rules.md +12 -6
  41. package/src/workflows/create-stack-skill/steps-c/step-01-init.md +4 -1
  42. package/src/workflows/create-stack-skill/steps-c/step-02-detect-manifests.md +11 -5
  43. package/src/workflows/create-stack-skill/steps-c/step-04-parallel-extract.md +1 -1
  44. package/src/workflows/create-stack-skill/steps-c/step-05-detect-integrations.md +1 -1
  45. package/src/workflows/create-stack-skill/steps-c/step-07-generate-output.md +40 -23
  46. package/src/workflows/create-stack-skill/steps-c/step-08-validate.md +6 -3
  47. package/src/workflows/create-stack-skill/steps-c/step-09-report.md +11 -4
  48. package/src/workflows/drop-skill/steps-c/step-01-select.md +298 -0
  49. package/src/workflows/drop-skill/steps-c/step-02-execute.md +290 -0
  50. package/src/workflows/drop-skill/steps-c/step-03-report.md +136 -0
  51. package/src/workflows/drop-skill/workflow.md +63 -0
  52. package/src/workflows/export-skill/data/managed-section-format.md +33 -8
  53. package/src/workflows/export-skill/data/snippet-format.md +16 -4
  54. package/src/workflows/export-skill/steps-c/step-01-load-skill.md +46 -7
  55. package/src/workflows/export-skill/steps-c/step-02-package.md +2 -2
  56. package/src/workflows/export-skill/steps-c/step-03-generate-snippet.md +39 -7
  57. package/src/workflows/export-skill/steps-c/step-04-update-context.md +185 -13
  58. package/src/workflows/export-skill/steps-c/step-05-token-report.md +2 -2
  59. package/src/workflows/export-skill/steps-c/step-06-summary.md +35 -8
  60. package/src/workflows/quick-skill/steps-c/step-01-resolve-target.md +10 -0
  61. package/src/workflows/quick-skill/steps-c/step-03-quick-extract.md +2 -0
  62. package/src/workflows/quick-skill/steps-c/step-05-validate.md +1 -1
  63. package/src/workflows/quick-skill/steps-c/step-06-write.md +36 -21
  64. package/src/workflows/refine-architecture/steps-c/step-01-init.md +8 -3
  65. package/src/workflows/refine-architecture/steps-c/step-06-report.md +7 -4
  66. package/src/workflows/rename-skill/steps-c/step-01-select.md +281 -0
  67. package/src/workflows/rename-skill/steps-c/step-02-execute.md +391 -0
  68. package/src/workflows/rename-skill/steps-c/step-03-report.md +133 -0
  69. package/src/workflows/rename-skill/workflow.md +64 -0
  70. package/src/workflows/setup-forge/steps-c/step-04-report.md +8 -5
  71. package/src/workflows/shared/health-check.md +231 -0
  72. package/src/workflows/test-skill/steps-c/step-01-init.md +14 -6
  73. package/src/workflows/test-skill/steps-c/step-02-detect-mode.md +1 -1
  74. package/src/workflows/test-skill/steps-c/step-06-report.md +4 -3
  75. package/src/workflows/update-skill/data/remote-source-resolution.md +18 -4
  76. package/src/workflows/update-skill/steps-c/step-01-init.md +15 -8
  77. package/src/workflows/update-skill/steps-c/step-06-write.md +43 -13
  78. package/src/workflows/update-skill/steps-c/step-07-report.md +13 -8
  79. package/src/workflows/verify-stack/steps-c/step-01-init.md +8 -3
  80. package/src/workflows/verify-stack/steps-c/step-06-report.md +6 -3
  81. package/tools/cli/lib/compiler.js +1 -1
  82. package/tools/cli/lib/ui.js +24 -2
@@ -0,0 +1,290 @@
1
+ ---
2
+ name: 'step-02-execute'
3
+ description: 'Execute the drop operation β€” update manifest, rebuild context files, delete files if purge'
4
+ nextStepFile: './step-03-report.md'
5
+ versionPathsKnowledge: '../../../knowledge/version-paths.md'
6
+ managedSectionLogic: '../../export-skill/data/managed-section-format.md'
7
+ ---
8
+
9
+ # Step 2: Execute Drop
10
+
11
+ ## STEP GOAL:
12
+
13
+ Execute the drop decisions recorded in step-01: update the export manifest, rebuild platform context files so dropped versions disappear from managed sections, and (in purge mode) delete the affected directories from disk. Record everything that was changed for the final report in step-03.
14
+
15
+ ## MANDATORY EXECUTION RULES (READ FIRST):
16
+
17
+ ### Universal Rules:
18
+
19
+ - πŸ›‘ NEVER modify content outside `<!-- SKF:BEGIN/END -->` markers in platform context files
20
+ - πŸ›‘ NEVER delete files outside the `affected_directories` list from step-01
21
+ - πŸ“– CRITICAL: Read the complete step file before taking any action
22
+ - πŸ”„ CRITICAL: When loading next step, ensure entire file is read
23
+ - βš™οΈ TOOL/SUBPROCESS FALLBACK: If any instruction references a subprocess, subagent, or tool you do not have access to, you MUST still achieve the outcome in your main context thread
24
+ - βœ… YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
25
+
26
+ ### Role Reinforcement:
27
+
28
+ - βœ… You are Ferris in Management mode β€” a destructive operation specialist
29
+ - βœ… Execute only the decisions confirmed in step-01 β€” no scope expansion, no "while I'm at it" extras
30
+ - βœ… Surgical precision: preserve all content outside `<!-- SKF:BEGIN/END -->` markers
31
+ - βœ… Manifest and filesystem must end in a consistent state
32
+
33
+ ### Step-Specific Rules:
34
+
35
+ - 🎯 Focus only on manifest update, context rebuild, and (in purge mode) file deletion
36
+ - 🚫 FORBIDDEN to re-prompt the user β€” decisions were made in step-01
37
+ - 🚫 FORBIDDEN to delete files in deprecate mode
38
+ - 🚫 FORBIDDEN to widen the deletion scope beyond `affected_directories`
39
+ - πŸ’¬ Report each stage's outcome as it completes so the user sees progress
40
+
41
+ ## EXECUTION PROTOCOLS:
42
+
43
+ - 🎯 Re-read version-paths knowledge to avoid drift between step files
44
+ - πŸ’Ύ Persist the manifest update before touching platform context files
45
+ - πŸ“– Rebuild managed sections from the updated manifest, not from memory
46
+ - 🚫 If any stage fails, halt and report which stage failed with recovery guidance
47
+
48
+ ## CONTEXT BOUNDARIES:
49
+
50
+ - Available: Decisions from step-01 (`target_skill`, `target_versions`, `drop_mode`, `is_skill_level`, `affected_directories`), SKF module config, version-paths knowledge, managed-section format
51
+ - Focus: Manifest mutation, context rebuild, filesystem deletion (purge only)
52
+ - Limits: Only modify content between `<!-- SKF:BEGIN/END -->` markers; only delete directories enumerated in `affected_directories`
53
+ - Dependencies: Step-01 must have completed and stored all decisions in context
54
+
55
+ ## MANDATORY SEQUENCE
56
+
57
+ **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
58
+
59
+ ### 1. Re-read Version-Paths Knowledge
60
+
61
+ Read `{versionPathsKnowledge}` again and confirm the templates and management operations. This ensures the execution step uses the same rules as the selection step even when run in isolation.
62
+
63
+ Also read `{managedSectionLogic}` for the format template, the four-case logic, and the skill index rebuild rules that will be reused in section 3.
64
+
65
+ ### 2. Update Export Manifest
66
+
67
+ **If `target_in_manifest == false`** (draft skill discovered only by on-disk scan): Skip this section entirely. There is no manifest entry to deprecate or delete. Set `manifest_updated = false` and proceed directly to section 3. Step-01 forced `drop_mode = "purge"` and `is_skill_level = true` in this case, so the subsequent sections will hard-delete the on-disk directories without any manifest interaction.
68
+
69
+ **If `target_in_manifest == true`:**
70
+
71
+ Load `{skills_output_folder}/.export-manifest.json`.
72
+
73
+ **If `is_skill_level == false` (version-level drop):**
74
+
75
+ For each version in `target_versions`:
76
+
77
+ 1. Navigate to `exports.{target_skill}.versions.{version}`
78
+ 2. Set `status = "deprecated"`
79
+ 3. Leave `platforms`, `last_exported`, and all other fields unchanged
80
+
81
+ Do NOT change `active_version` on the skill entry in this pass β€” if the dropped version was the active one (only reachable when it was the sole non-deprecated version per the step-01 guard), the active_version field will still point at it, but every consumer excludes deprecated versions from exports.
82
+
83
+ **If `is_skill_level == true` (skill-level drop):**
84
+
85
+ 1. Delete the `exports.{target_skill}` key entirely from the manifest
86
+ 2. Leave all other skill entries untouched
87
+
88
+ **Write the updated manifest back to `{skills_output_folder}/.export-manifest.json`.**
89
+
90
+ Set context flag `manifest_updated = true`.
91
+
92
+ **On error (read/parse/write failure):**
93
+
94
+ - Do not proceed to section 3
95
+ - Report: "**Manifest update failed:** {error}. No files were deleted and platform context files were not rebuilt. The manifest is in its pre-drop state β€” rerun the workflow once the underlying issue is resolved."
96
+ - Store `manifest_updated = false` and jump to section 6
97
+
98
+ ### 3. Rebuild Platform Context Files
99
+
100
+ Load the `ides` list from `config.yaml`. The installer writes installer-specific IDE identifiers (e.g. `claude-code`, `github-copilot`, `codex`, `cline`, `roo`, `windsurf`, `cursor`, `other`), NOT platform values β€” these must be mapped to platforms before any target-file lookup.
101
+
102
+ **Resolve `target_platforms`** using the "IDE β†’ Platform Mapping" table in `{managedSectionLogic}`:
103
+
104
+ 1. For each entry in `config.yaml.ides`, look up its platform value (`claude-code` β†’ `claude`, `github-copilot` β†’ `copilot`, `codex`/`cline`/`roo`/`windsurf`/`other` β†’ `copilot`, `cursor` β†’ `cursor`)
105
+ 2. For any entry not found in the table, default to `copilot` and emit a warning: "Unknown IDE '{value}' in config.yaml β€” defaulting to copilot"
106
+ 3. Deduplicate the resulting platform list (e.g. both `codex` and `cline` collapse to a single `copilot` entry)
107
+ 4. If `config.yaml.ides` is absent or the mapping yields an empty list, fall back to `["copilot"]` and emit a note: "No IDEs configured in config.yaml β€” defaulting to copilot (AGENTS.md)"
108
+
109
+ Store the result as `target_platforms` for this section.
110
+
111
+ For each platform in `target_platforms`:
112
+
113
+ 1. **Resolve target file** using the "Platform Target Files" table in `{managedSectionLogic}`:
114
+
115
+ | Platform | Target File |
116
+ |----------|-------------|
117
+ | `claude` | `{project-root}/CLAUDE.md` |
118
+ | `cursor` | `{project-root}/.cursorrules` |
119
+ | `copilot` | `{project-root}/AGENTS.md` |
120
+
121
+ 2. **Read the current file.**
122
+ - If the file does not exist, skip this platform (nothing to rebuild β€” the file will be re-created next time export-skill runs)
123
+ - If the file exists but contains no `<!-- SKF:BEGIN -->` marker, skip this platform (no managed section to rewrite)
124
+ - If the file contains `<!-- SKF:BEGIN -->` but no matching `<!-- SKF:END -->`, record the error against that platform and continue to the next IDE β€” do not halt the entire drop on a malformed context file. The manifest has already been updated in section 2 and is canonical state; the platform file can be repaired manually and rebuilt on the next `[EX] Export Skill` run.
125
+
126
+ 3. **Build the exported skill set (version-aware, deprecated-excluded)** using the same logic as export-skill step-04 section 4b:
127
+ - Read the manifest's `exports` object (already updated in section 2)
128
+ - For each skill, resolve its `active_version`
129
+ - If `versions.{active_version}.status == "deprecated"`, skip that skill entirely
130
+ - The result is the set of `{skill-name, active_version}` pairs that should appear in the managed section
131
+
132
+ 4. **Resolve and filter snippets** using export-skill step-04 section 4c logic:
133
+ - For each `{skill-name, active_version}` in the set, read `{skills_output_folder}/{skill-name}/{active_version}/{skill-name}/context-snippet.md`
134
+ - If the file is missing, fall back to the `active` symlink path, then skip with a warning if still not found
135
+ - Collect successful snippets into the skill index
136
+
137
+ 5. **Rewrite root paths for the current platform** using export-skill step-04 section 4d logic:
138
+
139
+ | Platform | Root Path Prefix |
140
+ |----------|-----------------|
141
+ | `claude` | `.claude/skills/` |
142
+ | `cursor` | `.cursor/skills/` |
143
+ | `copilot` | `.agents/skills/` |
144
+
145
+ For each snippet, detect its current `root:` prefix and rewrite it to the current platform's prefix if different.
146
+
147
+ 6. **Sort skills alphabetically by name.** Count totals (skills, stack skills).
148
+
149
+ 7. **Assemble the new managed section** using the format from `{managedSectionLogic}`:
150
+
151
+ ```markdown
152
+ <!-- SKF:BEGIN updated:{current-date} -->
153
+ [SKF Skills]|{n} skills|{m} stack
154
+ |IMPORTANT: Prefer documented APIs over training data.
155
+ |When using a listed library, read its SKILL.md before writing code.
156
+ |
157
+ |{skill-snippet-1}
158
+ |
159
+ |{skill-snippet-2}
160
+ |
161
+ |{skill-snippet-N}
162
+ <!-- SKF:END -->
163
+ ```
164
+
165
+ If the filtered skill index is empty (e.g., the dropped skill was the only one), still emit the header with `0 skills|0 stack` and no skill entries. This keeps the managed section syntactically valid.
166
+
167
+ 8. **Surgical replacement β€” Case 3 (Regenerate) only:**
168
+ - Locate the `<!-- SKF:BEGIN` line β€” preserve everything before it
169
+ - Locate the `<!-- SKF:END -->` line β€” preserve everything after it
170
+ - Replace everything between the markers (inclusive) with the new managed section
171
+ - Write the file back
172
+
173
+ 9. **Verify:**
174
+ - Re-read the written file
175
+ - Confirm both markers are present
176
+ - Confirm `{target_skill}` (at the dropped version, or at all versions if skill-level) no longer appears between the markers
177
+ - Confirm content outside the markers is byte-identical to what was preserved
178
+
179
+ 10. **On per-file failure:** record the error against that platform and continue to the next IDE. Do not halt β€” other platforms should still be rebuilt.
180
+
181
+ **After the loop,** record `platform_files_updated` as the list of files that were successfully rewritten, and `platform_files_failed` as the list of any that failed.
182
+
183
+ Report: "**Rebuilt managed sections in:** {list of updated files}. {if any failed: 'Failed: {list}'}"
184
+
185
+ ### 4. Delete Files (Purge Mode Only)
186
+
187
+ **If `drop_mode != "purge"`**, skip this section entirely. Set `files_deleted = []` and `disk_freed = "N/A (soft drop)"`, then jump to section 5.
188
+
189
+ **If `drop_mode == "purge"`:**
190
+
191
+ 1. Initialize `files_deleted = []` and `bytes_freed = 0`.
192
+
193
+ 2. For each directory path in `affected_directories`:
194
+ a. Verify the path is inside either `{skills_output_folder}` or `{forge_data_folder}` (defense in depth against accidental deletion of unrelated paths)
195
+ b. If the directory does not exist, record it as "(already absent)" and continue
196
+ c. Compute the directory size in bytes before deletion (recursive sum)
197
+ d. Delete the directory recursively
198
+ e. Verify deletion succeeded (the path no longer exists)
199
+ f. Append the path to `files_deleted` and add its byte size to `bytes_freed`
200
+
201
+ 3. **Version-level purge, single version:**
202
+ - `{skills_output_folder}/{target_skill}/{version}/` is deleted, but `{skills_output_folder}/{target_skill}/` remains (it still contains other versions or the `active` symlink)
203
+ - If the `active` symlink pointed to the just-deleted version, update or remove it:
204
+ - If other versions remain in the manifest for `{target_skill}`, repoint `active` to the manifest's current `active_version` (skipping deprecated)
205
+ - If no non-deprecated versions remain, remove the `active` symlink (reachable only when dropping the sole surviving version, which in step-01 was permitted because no other non-deprecated versions existed)
206
+
207
+ 4. **Skill-level purge:**
208
+ - `{skills_output_folder}/{target_skill}/` and `{forge_data_folder}/{target_skill}/` are deleted in full β€” the `active` symlink disappears with the parent directory
209
+
210
+ 5. Convert `bytes_freed` to a human-readable string for the final report (e.g. `"4.2 MB"`). Store as `disk_freed`.
211
+
212
+ **On deletion error:**
213
+
214
+ - Record which path failed and the error message
215
+ - Continue attempting the remaining paths β€” partial purge is still better than no purge
216
+ - Report all failures at the end of this section
217
+
218
+ ### 5. Verify Final State
219
+
220
+ Run these verification checks:
221
+
222
+ 1. **Manifest check:** Re-read `{skills_output_folder}/.export-manifest.json` and confirm:
223
+ - Version-level drop: `exports.{target_skill}.versions.{version}.status == "deprecated"`
224
+ - Skill-level drop: `exports.{target_skill}` is absent
225
+
226
+ 2. **Platform files check:** For each file in `platform_files_updated`, spot-check that the dropped skill/version is no longer referenced between the markers.
227
+
228
+ 3. **Purge check (purge mode only):** For each path in `files_deleted`, confirm it no longer exists on disk.
229
+
230
+ If any verification fails, record the specific failure in `verification_errors` but do not halt β€” proceed to step-03 so the report can surface what succeeded and what needs manual attention.
231
+
232
+ ### 6. Store Results in Context
233
+
234
+ Store the following for step-03:
235
+
236
+ - `files_deleted` β€” list of directory paths actually deleted (purge mode) or `[]` (soft drop)
237
+ - `disk_freed` β€” human-readable size (purge mode) or `"N/A (soft drop)"`
238
+ - `manifest_updated` β€” boolean (true if section 2 succeeded)
239
+ - `platform_files_updated` β€” list of successfully rebuilt files
240
+ - `platform_files_failed` β€” list of files that failed to rebuild (empty if none)
241
+ - `verification_errors` β€” list of verification failures (empty if none)
242
+
243
+ ### 7. Load Next Step
244
+
245
+ Load, read the full file, and then execute `{nextStepFile}`.
246
+
247
+ ## Error Handling Summary
248
+
249
+ If any stage fails, record which stage failed and provide recovery guidance in the final report:
250
+
251
+ | Failed Stage | Recovery Guidance |
252
+ |--------------|-------------------|
253
+ | Manifest update | "Manifest is in pre-drop state. Re-run the workflow once the underlying I/O issue is resolved. No files were deleted." |
254
+ | Platform rebuild | "Manifest is already updated. Re-run `[EX] Export Skill` against any still-valid skill to regenerate the affected managed sections, or rerun the drop workflow." |
255
+ | File deletion (purge) | "Manifest and platform files are consistent. Remaining directories listed in the report can be deleted manually: `rm -rf {path}`." |
256
+ | Verification | "Execution completed but post-write checks found drift. See the report for specific paths requiring manual review." |
257
+
258
+ ## CRITICAL STEP COMPLETION NOTE
259
+
260
+ ONLY WHEN all execution stages have been attempted (manifest update, context rebuild, file deletion in purge mode, verification) and results have been stored in context, will you then load and read fully `{nextStepFile}` to generate the final report.
261
+
262
+ ---
263
+
264
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
265
+
266
+ ### βœ… SUCCESS:
267
+
268
+ - Version-paths knowledge and managed-section format re-read at the start of the step
269
+ - Export manifest updated correctly (deprecated status for version-level, skill removal for skill-level)
270
+ - Platform context files rebuilt for all configured IDEs using the same logic as export-skill step-04 (sections 4b–5), with surgical replacement preserving all content outside markers
271
+ - Deprecated versions no longer appear in any managed section
272
+ - Purge mode: all directories in `affected_directories` deleted with size accounting; `active` symlink updated or removed as appropriate
273
+ - Soft drop: no files deleted; `files_deleted` is empty and `disk_freed` is `"N/A (soft drop)"`
274
+ - Verification checks executed on manifest, platform files, and (if purge) deleted paths
275
+ - All results stored in context for step-03
276
+ - Errors at any stage are recorded with recovery guidance rather than silently swallowed
277
+
278
+ ### ❌ SYSTEM FAILURE:
279
+
280
+ - Deleting files in soft drop mode
281
+ - Deleting directories outside the `affected_directories` list
282
+ - Modifying content outside `<!-- SKF:BEGIN/END -->` markers
283
+ - Rebuilding managed sections from memory instead of the updated manifest
284
+ - Including deprecated versions in the rebuilt skill index
285
+ - Not updating the `active` symlink after a version-level purge when the dropped version was the target
286
+ - Not verifying the final state
287
+ - Hardcoding paths instead of using `{skill_package}`, `{skill_group}`, `{forge_version}`, `{forge_group}` templates
288
+ - Halting the entire workflow on a recoverable per-platform error instead of continuing and reporting
289
+
290
+ **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE. The manifest and the filesystem must end in a consistent state, and every destructive action must trace back to a decision made in step-01.
@@ -0,0 +1,136 @@
1
+ ---
2
+ name: 'step-03-report'
3
+ description: 'Report drop operation results'
4
+ nextStepFile: '../../shared/health-check.md'
5
+ ---
6
+
7
+ # Step 3: Report Drop Results
8
+
9
+ ## STEP GOAL:
10
+
11
+ Present a clear, final summary of what the drop workflow changed β€” manifest state, platform context files, deleted directories, disk freed, and remaining versions β€” so the user can verify the outcome and know whether any manual follow-up is required.
12
+
13
+ ## MANDATORY EXECUTION RULES (READ FIRST):
14
+
15
+ ### Universal Rules:
16
+
17
+ - πŸ›‘ NEVER modify any files in this step β€” report only
18
+ - πŸ“– CRITICAL: Read the complete step file before taking any action
19
+ - πŸ“‹ YOU ARE A FACILITATOR, summarizing what step-02 already executed
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 Ferris in Management mode β€” summarizing a destructive operation with precision
26
+ - βœ… Be explicit about what changed and what did not β€” no glossing over partial failures
27
+ - βœ… Surface recovery guidance when any stage in step-02 reported an error
28
+
29
+ ### Step-Specific Rules:
30
+
31
+ - 🎯 Focus only on reporting the results stored in context by step-02
32
+ - 🚫 FORBIDDEN to re-execute any part of the drop
33
+ - 🚫 FORBIDDEN to hide verification errors or failed platform rebuilds
34
+ - πŸ’¬ Present the final state clearly, including remaining versions for the affected skill
35
+
36
+ ## EXECUTION PROTOCOLS:
37
+
38
+ - 🎯 Render the report using the context values set in step-02 (`target_skill`, `target_versions`, `drop_mode`, `is_skill_level`, `files_deleted`, `disk_freed`, `manifest_updated`, `platform_files_updated`, `platform_files_failed`, `verification_errors`)
39
+ - πŸ“– For the "remaining versions" section, re-read `{skills_output_folder}/.export-manifest.json` (already updated by step-02) to show the current state
40
+ - πŸ’¬ Include the reversibility note only when `drop_mode == "deprecate"`
41
+
42
+ ## CONTEXT BOUNDARIES:
43
+
44
+ - Available: All decision and result values stored in context by step-01 and step-02, plus the updated export manifest on disk
45
+ - Focus: Rendering the final report
46
+ - Limits: No file writes, no deletions, no further execution
47
+ - Dependencies: Step-02 must have completed (or attempted all stages) and stored its results
48
+
49
+ ## MANDATORY SEQUENCE
50
+
51
+ **CRITICAL:** Follow this sequence exactly.
52
+
53
+ ### 1. Determine Remaining Versions
54
+
55
+ **If `is_skill_level == true`:**
56
+
57
+ Set `remaining_versions_display = "(skill fully removed)"`.
58
+
59
+ **If `is_skill_level == false`:**
60
+
61
+ Read `{skills_output_folder}/.export-manifest.json` and look up `exports.{target_skill}.versions`. Build a human-readable list of every remaining version with its status, with the active one marked:
62
+
63
+ ```
64
+ - 0.1.0 (deprecated)
65
+ - 0.5.0 (archived)
66
+ - 0.6.0 (active) *
67
+ ```
68
+
69
+ ### 2. Render the Report
70
+
71
+ Display the following block, filling in values from context:
72
+
73
+ ```
74
+ **Drop operation complete.**
75
+
76
+ Operation: {Deprecate | Purge}
77
+ Skill: {target_skill}
78
+ Version(s): {comma-separated target_versions or "ALL"}
79
+
80
+ Changes:
81
+ - Manifest updated: {yes | no}
82
+ - Platform files rebuilt: {list from platform_files_updated, or "(none)"}
83
+ {if platform_files_failed is non-empty:}
84
+ - Platform files FAILED: {list from platform_files_failed}
85
+ {if drop_mode == "purge":}
86
+ - Files deleted: {list from files_deleted, or "(none β€” nothing on disk)"}
87
+ - Disk space freed: {disk_freed}
88
+
89
+ Remaining versions for {target_skill}:
90
+ {remaining_versions_display}
91
+
92
+ {if drop_mode == "deprecate":}
93
+ **Note:** Files remain on disk. This operation is reversible by manually editing
94
+ `{skills_output_folder}/.export-manifest.json` and changing the version's `status`
95
+ field back to `"active"` or `"archived"`, then re-running `[EX] Export Skill` to
96
+ restore the managed section entry.
97
+
98
+ {if verification_errors is non-empty:}
99
+ **Verification warnings:**
100
+ {list each verification error}
101
+ These require manual review β€” see the error-handling guidance in step-02.
102
+ ```
103
+
104
+ ### 3. Workflow Health Check
105
+
106
+ Load and execute `{nextStepFile}` for workflow self-improvement check.
107
+
108
+ ## CRITICAL STEP COMPLETION NOTE
109
+
110
+ This step chains to the shared health check. After the health check completes, the drop-skill workflow is fully done. Do not re-run any earlier step automatically β€” if the user wants another drop, they should re-invoke the workflow from the top.
111
+
112
+ ---
113
+
114
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
115
+
116
+ ### βœ… SUCCESS:
117
+
118
+ - Report rendered with operation type, skill, version(s), and mode
119
+ - Manifest update outcome clearly stated (yes/no)
120
+ - Platform files rebuilt listed (and failures surfaced when present)
121
+ - Purge mode: files deleted and disk freed reported
122
+ - Soft drop: reversibility note included with concrete instructions
123
+ - Remaining versions for the affected skill accurately listed from the updated manifest (or "(skill fully removed)" for skill-level drops)
124
+ - Verification warnings surfaced, not hidden
125
+ - No further file writes or executions performed
126
+
127
+ ### ❌ SYSTEM FAILURE:
128
+
129
+ - Hiding failed platform rebuilds or verification errors
130
+ - Reporting "complete" when step-02 partially failed without flagging it
131
+ - Reading stale manifest data instead of the post-drop state
132
+ - Re-executing any part of the drop workflow
133
+ - Omitting the reversibility note in soft drop mode
134
+ - Displaying remaining versions from memory rather than from the updated manifest
135
+
136
+ **Master Rule:** The report must be an honest, complete summary of what step-02 actually did. Every partial failure must be visible so the user knows exactly what manual follow-up, if any, is required.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: drop-skill
3
+ description: "Drop (deprecate or purge) skill versions. Soft drop keeps files; hard drop deletes them. Active version guarded."
4
+ web_bundle: true
5
+ installed_path: '{project-root}/_bmad/skf/workflows/skillforge/drop-skill'
6
+ ---
7
+
8
+ # Drop Skill
9
+
10
+ **Goal:** Drop a specific skill version or an entire skill, either as a soft deprecation (manifest-only, files retained) or a hard purge (files deleted). Ensures platform context files are rebuilt to exclude dropped versions.
11
+
12
+ **Your Role:** In addition to your name, communication_style, and persona, you are also Ferris in Delivery/Management mode β€” a destructive operation specialist who enforces safety guards. You treat every drop as potentially irreversible and require explicit user confirmation before touching the manifest or the filesystem. You protect the active version, keep the export manifest consistent with on-disk state, and ensure that downstream platform context files (CLAUDE.md / AGENTS.md / .cursorrules) are rebuilt so dropped versions disappear cleanly.
13
+
14
+ ---
15
+
16
+ ## WORKFLOW ARCHITECTURE
17
+
18
+ This uses **step-file architecture** for disciplined execution:
19
+
20
+ ### Core Principles
21
+
22
+ - **Micro-file Design**: Each step is a self-contained instruction file that is a part of an overall workflow that must be followed exactly
23
+ - **Just-In-Time Loading**: Only the current step file is in memory β€” never load future step files until told to do so
24
+ - **Sequential Enforcement**: Sequence within the step files must be completed in order, no skipping or optimization allowed
25
+ - **Safety-First Destruction**: Every destructive action is preceded by an explicit user confirmation gate; nothing is deleted silently
26
+ - **Manifest-Driven Truth**: The export manifest is the source of truth for what exists and what is active; the filesystem is updated to match
27
+
28
+ ### Step Processing Rules
29
+
30
+ 1. **READ COMPLETELY**: Always read the entire step file before taking any action
31
+ 2. **FOLLOW SEQUENCE**: Execute all numbered sections in order, never deviate
32
+ 3. **WAIT FOR INPUT**: If a menu is presented, halt and wait for user selection
33
+ 4. **CHECK CONTINUATION**: If the step has a menu with Continue as an option, only proceed to next step when user selects 'C' (Continue)
34
+ 5. **LOAD NEXT**: When directed, load, read entire file, then execute the next step file
35
+
36
+ ### Critical Rules (NO EXCEPTIONS)
37
+
38
+ - πŸ›‘ **NEVER** load multiple step files simultaneously
39
+ - πŸ“– **ALWAYS** read entire step file before execution
40
+ - 🚫 **NEVER** skip steps or optimize the sequence
41
+ - 🎯 **ALWAYS** follow the exact instructions in the step file
42
+ - ⏸️ **ALWAYS** halt at menus and wait for user input
43
+ - πŸ“‹ **NEVER** create mental todo lists from future steps
44
+ - βš™οΈ **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
45
+ - πŸ›‘οΈ **NEVER** delete files without explicit user confirmation in purge mode
46
+ - πŸ›‘οΈ **NEVER** drop an active version when other non-deprecated versions exist β€” enforce the active version guard
47
+ - βœ… YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
48
+
49
+ ---
50
+
51
+ ## INITIALIZATION SEQUENCE
52
+
53
+ ### 1. Module Configuration Loading
54
+
55
+ Load and read full config from {project-root}/_bmad/skf/config.yaml and resolve:
56
+
57
+ - `project_name`, `output_folder`, `user_name`, `communication_language`, `document_output_language`
58
+ - `skills_output_folder`, `forge_data_folder`, `sidecar_path`
59
+ - Generate and store `timestamp` as the current date-time in `YYYYMMDD-HHmmss` format. This value is fixed for the entire workflow run and must not be regenerated in subsequent steps.
60
+
61
+ ### 2. First Step Execution
62
+
63
+ Load, read the full file and then execute `./steps-c/step-01-select.md` to begin the workflow.
@@ -18,9 +18,31 @@
18
18
 
19
19
  | Platform | Flag Value | Target File |
20
20
  |----------|-----------|-------------|
21
- | Claude | `claude` (default) | CLAUDE.md |
21
+ | Copilot | `copilot` (default) | AGENTS.md |
22
+ | Claude | `claude` | CLAUDE.md |
22
23
  | Cursor | `cursor` | .cursorrules |
23
- | Copilot | `copilot` | AGENTS.md |
24
+
25
+ ## IDE β†’ Platform Mapping (config.yaml `ides` list)
26
+
27
+ The installer writes installer-specific IDE identifiers to `config.yaml` under the `ides` key (not platform values). Any workflow that rebuilds platform context files from `config.yaml` MUST map each entry to a platform before looking up its target file.
28
+
29
+ | config.yaml IDE value | Platform | Target File | Rationale |
30
+ |----------------------|----------|-------------|-----------|
31
+ | `claude-code` | `claude` | CLAUDE.md | native β€” reads `CLAUDE.md` and `.claude/skills/` |
32
+ | `cursor` | `cursor` | .cursorrules | native β€” reads `.cursorrules` and `.cursor/skills/` |
33
+ | `github-copilot` | `copilot` | AGENTS.md | native β€” reads `AGENTS.md` and `.agents/skills/` |
34
+ | `codex` | `copilot` | AGENTS.md | OpenAI Codex reads `AGENTS.md` (same convention as copilot) |
35
+ | `cline` | `copilot` | AGENTS.md | uses `AGENTS.md` as fallback context file |
36
+ | `roo` | `copilot` | AGENTS.md | uses `AGENTS.md` as fallback context file |
37
+ | `windsurf` | `copilot` | AGENTS.md | uses `AGENTS.md` as fallback context file |
38
+ | `other` | `copilot` | AGENTS.md | generic AGENTS.md fallback |
39
+ | _(any unknown value)_ | `copilot` | AGENTS.md | warn: "Unknown IDE '{value}' in config.yaml β€” defaulting to copilot" |
40
+
41
+ **Deduplication:** When multiple IDE entries map to the same platform (e.g. `codex` and `cline` both β†’ `copilot`), deduplicate so each platform is processed exactly once. Report the deduplication to the user.
42
+
43
+ **Missing `ides` key:** If the `ides` key is absent from `config.yaml`, treat it as an empty list. If the resulting platform set is empty (no recognized entries), fall back to `["copilot"]`.
44
+
45
+ This mapping is the single source of truth. Workflows that need it: `export-skill/step-01` (resolves `target_platforms` for the export), `drop-skill/step-02` and `rename-skill/step-02` (rebuild platform context files after a management operation).
24
46
 
25
47
  ## Four-Case Logic
26
48
 
@@ -62,13 +84,16 @@ Target file contains `<!-- SKF:BEGIN` but no matching `<!-- SKF:END -->` marker.
62
84
 
63
85
  ## Regeneration: Full Index Rebuild
64
86
 
65
- When regenerating (Case 3), rebuild the COMPLETE skill index:
87
+ When regenerating (Case 3) or creating/appending (Cases 1-2), rebuild the skill index from the **exported skill set** only:
88
+
89
+ 1. Read `{skills_output_folder}/.export-manifest.json` (v2 schema β€” see [knowledge/version-paths.md](../../../knowledge/version-paths.md)) to determine which skills have been explicitly exported and their `active_version` (if no manifest exists, only the current export target qualifies)
90
+ 2. For each skill in the exported set, resolve the snippet at `{skills_output_folder}/{skill-name}/{active_version}/{skill-name}/context-snippet.md` (i.e., `{skill_package}/context-snippet.md`). Do NOT use glob patterns across version directories β€” always resolve via manifest `active_version` or `active` symlink
91
+ 3. Count total skills and stack skills (from filtered set only)
92
+ 4. Assemble filtered snippets into managed section
93
+ 5. Sort alphabetically by skill name
94
+ 6. Update the header line with correct counts
66
95
 
67
- 1. Scan `{skills_output_folder}/*/context-snippet.md` for all exported skills
68
- 2. Count total skills and stack skills
69
- 3. Assemble all snippets into managed section
70
- 4. Sort alphabetically by skill name
71
- 5. Update the header line with correct counts
96
+ **Rationale:** create-skill and update-skill also write `context-snippet.md` as a build artifact, but only export-skill is the publishing gate (ADR-K). The `.export-manifest.json` file tracks which skills have passed through export-skill, preventing draft skills from leaking into the agent's passive context.
72
97
 
73
98
  ## Safety Rules
74
99
 
@@ -1,5 +1,17 @@
1
1
  # Context Snippet Format (Vercel-Aligned Indexed Format)
2
2
 
3
+ ## Platform Root Path Mapping
4
+
5
+ The snippet `root:` path must reflect the platform-specific skills directory:
6
+
7
+ | Platform | Root Path Prefix |
8
+ |----------|-----------------|
9
+ | `claude` | `.claude/skills/` |
10
+ | `cursor` | `.cursor/skills/` |
11
+ | `copilot` | `.agents/skills/` |
12
+
13
+ The root path in context-snippet.md on disk uses the **first platform in `target_platforms`** (the first entry from config.yaml IDE mapping, or the explicit `--platform` flag value if provided). When assembling managed sections for other platforms, step-04 rewrites root paths to match the target platform.
14
+
3
15
  ## Format Rules
4
16
 
5
17
  - Indexed pipe-delimited format per skill β€” retrieval instruction + file map + inline gotchas
@@ -13,7 +25,7 @@
13
25
  ## Single Skill Snippet Template
14
26
 
15
27
  ```markdown
16
- [{skill-name} v{version}]|root: skills/{skill-name}/
28
+ [{skill-name} v{version}]|root: {platform_root}{skill-name}/
17
29
  |IMPORTANT: {skill-name} v{version} β€” read SKILL.md before writing {skill-name} code. Do NOT rely on training data.
18
30
  |quick-start:{SKILL.md#quick-start}
19
31
  |api: {top exports with () for functions, comma-separated}
@@ -21,7 +33,7 @@
21
33
  |gotchas: {2-3 most critical pitfalls or breaking changes, inline}
22
34
  ```
23
35
 
24
- - **Line 1:** Skill name + version + root path β€” version signals training data staleness
36
+ - **Line 1:** Skill name + version + platform-aware root path β€” version signals training data staleness
25
37
  - **Line 2 (IMPORTANT):** Retrieval instruction β€” always present
26
38
  - **Line 3 (quick-start):** Anchor pointer to Quick Start section
27
39
  - **Line 4 (api):** Top exports from metadata.json `exports` array (up to 10, with `()` for functions)
@@ -31,7 +43,7 @@
31
43
  ## Stack Skill Snippet Template
32
44
 
33
45
  ```markdown
34
- [{project}-stack v{version}]|root: skills/{project}-stack/
46
+ [{project}-stack v{version}]|root: {platform_root}{project}-stack/
35
47
  |IMPORTANT: {project}-stack β€” read SKILL.md before writing integration code. Do NOT rely on training data.
36
48
  |stack: {dep-1}@{v1}, {dep-2}@{v2}, {dep-3}@{v3}
37
49
  |integrations: {pattern-1}, {pattern-2}
@@ -48,4 +60,4 @@
48
60
  - If fewer exports than the limit, list all available
49
61
  - If no exports data available, omit the api line
50
62
  - Section anchors must be verified against actual SKILL.md headings during generation. For split-body skills (where `references/` exists and `## Full` headings are stubs), if a heading is missing from SKILL.md, rewrite the anchor to point to the reference file path (preferred). Omit the anchor line only if the heading cannot be found in either SKILL.md or `references/*.md`
51
- - Skill path is relative to project root
63
+ - Skill path is relative to project root and uses the platform-specific root prefix (see Platform Root Path Mapping above)