bmad-module-skill-forge 0.8.3 → 0.9.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.
- package/README.md +9 -4
- package/docs/bmad-synergy.md +183 -0
- package/docs/concepts.md +60 -2
- package/docs/examples.md +70 -17
- package/docs/getting-started.md +23 -1
- package/docs/how-it-works.md +143 -29
- package/docs/index.md +1 -1
- package/docs/workflows.md +45 -5
- package/package.json +1 -1
- package/src/README.md +47 -0
- package/src/agents/forger.agent.yaml +9 -0
- package/src/knowledge/agentskills-spec.md +3 -0
- package/src/knowledge/overview.md +1 -0
- package/src/knowledge/provenance-tracking.md +3 -0
- package/src/knowledge/skf-knowledge-index.csv +1 -0
- package/src/knowledge/skill-lifecycle.md +19 -7
- package/src/knowledge/version-paths.md +243 -0
- package/src/module-help.csv +2 -0
- package/src/workflows/README.md +9 -1
- package/src/workflows/analyze-source/data/skill-brief-schema.md +4 -0
- package/src/workflows/audit-skill/steps-c/step-01-init.md +10 -6
- package/src/workflows/audit-skill/steps-c/step-02-re-index.md +1 -1
- package/src/workflows/audit-skill/steps-c/step-03-structural-diff.md +1 -1
- package/src/workflows/audit-skill/steps-c/step-04-semantic-diff.md +1 -1
- package/src/workflows/audit-skill/steps-c/step-05-severity-classify.md +1 -1
- package/src/workflows/audit-skill/steps-c/step-06-report.md +1 -1
- package/src/workflows/brief-skill/data/skill-brief-schema.md +11 -0
- package/src/workflows/brief-skill/steps-c/step-01-gather-intent.md +28 -4
- package/src/workflows/brief-skill/steps-c/step-02-analyze-target.md +10 -0
- package/src/workflows/brief-skill/steps-c/step-04-confirm-brief.md +9 -0
- package/src/workflows/brief-skill/steps-c/step-05-write-brief.md +14 -1
- package/src/workflows/create-skill/data/skill-sections.md +2 -0
- package/src/workflows/create-skill/data/source-resolution-protocols.md +40 -4
- package/src/workflows/create-skill/steps-c/step-03-extract.md +1 -1
- package/src/workflows/create-skill/steps-c/step-05-compile.md +1 -0
- package/src/workflows/create-skill/steps-c/step-07-generate-artifacts.md +48 -32
- package/src/workflows/create-skill/steps-c/step-08-report.md +8 -7
- package/src/workflows/create-stack-skill/data/compose-mode-rules.md +12 -6
- package/src/workflows/create-stack-skill/steps-c/step-01-init.md +4 -1
- package/src/workflows/create-stack-skill/steps-c/step-02-detect-manifests.md +11 -5
- package/src/workflows/create-stack-skill/steps-c/step-04-parallel-extract.md +1 -1
- package/src/workflows/create-stack-skill/steps-c/step-05-detect-integrations.md +1 -1
- package/src/workflows/create-stack-skill/steps-c/step-07-generate-output.md +40 -23
- package/src/workflows/create-stack-skill/steps-c/step-08-validate.md +6 -3
- package/src/workflows/create-stack-skill/steps-c/step-09-report.md +5 -3
- package/src/workflows/drop-skill/steps-c/step-01-select.md +298 -0
- package/src/workflows/drop-skill/steps-c/step-02-execute.md +290 -0
- package/src/workflows/drop-skill/steps-c/step-03-report.md +135 -0
- package/src/workflows/drop-skill/workflow.md +63 -0
- package/src/workflows/export-skill/data/managed-section-format.md +33 -8
- package/src/workflows/export-skill/data/snippet-format.md +16 -4
- package/src/workflows/export-skill/steps-c/step-01-load-skill.md +46 -7
- package/src/workflows/export-skill/steps-c/step-02-package.md +2 -2
- package/src/workflows/export-skill/steps-c/step-03-generate-snippet.md +39 -7
- package/src/workflows/export-skill/steps-c/step-04-update-context.md +185 -13
- package/src/workflows/export-skill/steps-c/step-05-token-report.md +2 -2
- package/src/workflows/export-skill/steps-c/step-06-summary.md +26 -7
- package/src/workflows/quick-skill/steps-c/step-01-resolve-target.md +10 -0
- package/src/workflows/quick-skill/steps-c/step-03-quick-extract.md +2 -0
- package/src/workflows/quick-skill/steps-c/step-05-validate.md +1 -1
- package/src/workflows/quick-skill/steps-c/step-06-write.md +30 -14
- package/src/workflows/refine-architecture/steps-c/step-01-init.md +8 -3
- package/src/workflows/rename-skill/steps-c/step-01-select.md +281 -0
- package/src/workflows/rename-skill/steps-c/step-02-execute.md +391 -0
- package/src/workflows/rename-skill/steps-c/step-03-report.md +132 -0
- package/src/workflows/rename-skill/workflow.md +64 -0
- package/src/workflows/test-skill/steps-c/step-01-init.md +17 -11
- package/src/workflows/test-skill/steps-c/step-02-detect-mode.md +1 -1
- package/src/workflows/update-skill/data/remote-source-resolution.md +18 -4
- package/src/workflows/update-skill/steps-c/step-01-init.md +15 -8
- package/src/workflows/update-skill/steps-c/step-06-write.md +43 -13
- package/src/workflows/update-skill/steps-c/step-07-report.md +7 -5
- package/src/workflows/verify-stack/steps-c/step-01-init.md +8 -3
- package/tools/cli/lib/installer.js +1 -0
- package/tools/cli/lib/ui.js +24 -2
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'step-01-select'
|
|
3
|
+
description: 'Select skill, version(s), and drop mode (deprecate/purge)'
|
|
4
|
+
nextStepFile: './step-02-execute.md'
|
|
5
|
+
versionPathsKnowledge: '../../../knowledge/version-paths.md'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Step 1: Select Drop Target
|
|
9
|
+
|
|
10
|
+
## STEP GOAL:
|
|
11
|
+
|
|
12
|
+
Identify exactly what the user wants to drop — which skill, which version(s), and whether the drop is a soft deprecation (manifest-only) or a hard purge (files deleted). Enforce the active version guard, gather the list of affected directories, and obtain explicit user confirmation before any write or delete operation is scheduled.
|
|
13
|
+
|
|
14
|
+
## MANDATORY EXECUTION RULES (READ FIRST):
|
|
15
|
+
|
|
16
|
+
### Universal Rules:
|
|
17
|
+
|
|
18
|
+
- 🛑 NEVER schedule a destructive operation without explicit user confirmation
|
|
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
|
+
- 📋 YOU ARE A FACILITATOR, not a content generator
|
|
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 Ferris in Management mode — a destructive operation specialist
|
|
28
|
+
- ✅ Safety first, confirmation required
|
|
29
|
+
- ✅ You protect the active version and enforce the active version guard
|
|
30
|
+
- ✅ You treat every drop as potentially irreversible — soft drops are recoverable, hard drops are not
|
|
31
|
+
|
|
32
|
+
### Step-Specific Rules:
|
|
33
|
+
|
|
34
|
+
- 🎯 Focus only on selection, validation, and confirmation
|
|
35
|
+
- 🚫 FORBIDDEN to proceed without explicit user confirmation at the final gate
|
|
36
|
+
- 🚫 FORBIDDEN to modify the manifest or delete any files in this step — execution happens in step-02
|
|
37
|
+
- 🚫 FORBIDDEN to drop an active version when other non-deprecated versions exist
|
|
38
|
+
- 💬 Present selections clearly so the user can verify scope, mode, and blast radius before committing
|
|
39
|
+
|
|
40
|
+
## EXECUTION PROTOCOLS:
|
|
41
|
+
|
|
42
|
+
- 🎯 Load version-paths knowledge and the export manifest (if present) alongside an on-disk skill scan
|
|
43
|
+
- 💾 Gather all selection decisions into context for step-02
|
|
44
|
+
- 📖 Show version lists, statuses, and directory paths clearly so the user understands what will be affected
|
|
45
|
+
- 🚫 Halt only if neither the manifest nor an on-disk scan yields any skill — a missing manifest is not fatal for purge mode because draft skills (created but never exported) can still be legitimately hard-dropped from disk
|
|
46
|
+
|
|
47
|
+
## CONTEXT BOUNDARIES:
|
|
48
|
+
|
|
49
|
+
- Available: Export manifest v2, SKF module config variables, on-disk skill directory listing
|
|
50
|
+
- Focus: Selection, validation, and user confirmation
|
|
51
|
+
- Limits: Do not write to the manifest, do not delete any files — execution is deferred to step-02
|
|
52
|
+
- Dependencies: At least one skill must exist in either the export manifest or on disk under `{skills_output_folder}/`; otherwise the workflow halts. Draft skills (on disk but not in the manifest) are eligible for purge mode only
|
|
53
|
+
|
|
54
|
+
## MANDATORY SEQUENCE
|
|
55
|
+
|
|
56
|
+
**CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
|
|
57
|
+
|
|
58
|
+
### 1. Load Knowledge
|
|
59
|
+
|
|
60
|
+
Read `{versionPathsKnowledge}` completely and extract:
|
|
61
|
+
|
|
62
|
+
- Path templates: `{skill_package}`, `{skill_group}`, `{forge_version}`, `{forge_group}`
|
|
63
|
+
- Export manifest v2 schema (`schema_version`, `exports`, `active_version`, `versions` map, `status` field values)
|
|
64
|
+
- Skill management operations (Drop section — soft vs hard, active version guard, skill-level drop)
|
|
65
|
+
|
|
66
|
+
You will use these templates and rules to build directory paths and enforce safety guards in the following sections.
|
|
67
|
+
|
|
68
|
+
### 2. Read Export Manifest
|
|
69
|
+
|
|
70
|
+
Load `{skills_output_folder}/.export-manifest.json` if it exists.
|
|
71
|
+
|
|
72
|
+
**If the file is missing, empty, or contains no `exports` entries:** Treat as an empty manifest — proceed to section 3 and rely on the on-disk directory scan. Draft skills (created by `[CS]`/`[QS]`/`[SS]` but never exported) can still be hard-dropped in purge mode. Store `manifest_exists = false` so section 8 (Ask Mode) can restrict the options to purge only. Soft-deprecate is meaningless without a manifest to record the deprecation against.
|
|
73
|
+
|
|
74
|
+
**If the file exists with entries:** Parse JSON and verify `schema_version` is `"2"`. If the manifest is v1 (no `schema_version` field), note this but continue — treat every entry as having a single active version derived from its current state. Store `manifest_exists = true`.
|
|
75
|
+
|
|
76
|
+
**Hard halt condition:** If the file exists but is malformed (not valid JSON), halt with: "**Export manifest is corrupt** at `{skills_output_folder}/.export-manifest.json` — fix or remove the file before dropping."
|
|
77
|
+
|
|
78
|
+
### 3. List Available Skills
|
|
79
|
+
|
|
80
|
+
Build and display a summary of every skill available to drop. Start with the manifest (if any), then augment with an on-disk scan.
|
|
81
|
+
|
|
82
|
+
For each skill in the manifest's `exports` (only if `manifest_exists = true` and entries exist):
|
|
83
|
+
|
|
84
|
+
1. Read `active_version` from the manifest entry
|
|
85
|
+
2. List every entry in the skill's `versions` map with its `status` field
|
|
86
|
+
3. Mark the active version with a trailing `*`
|
|
87
|
+
4. Sort versions in descending order (newest first) where possible
|
|
88
|
+
|
|
89
|
+
Also scan `{skills_output_folder}/` for any top-level directories that are NOT present in the manifest's `exports` object. Record these as "(not in manifest)" — they represent draft or orphaned skills eligible for purge mode only. When the manifest is missing or empty, every on-disk skill appears in this category.
|
|
90
|
+
|
|
91
|
+
**If the combined list is empty** (no manifest entries AND no on-disk skill directories): halt with "**Drop Skill — nothing to drop.** No skills found in `{skills_output_folder}/` and no entries in `.export-manifest.json`. Run `[CS] Create Skill` first."
|
|
92
|
+
|
|
93
|
+
Display the combined list:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
**Drop Skill — select target**
|
|
97
|
+
|
|
98
|
+
Available skills:
|
|
99
|
+
1. cognee
|
|
100
|
+
- 0.1.0 (deprecated)
|
|
101
|
+
- 0.5.0 (archived)
|
|
102
|
+
- 0.6.0 (active) *
|
|
103
|
+
2. express
|
|
104
|
+
- 4.18.0 (active) *
|
|
105
|
+
3. legacy-helper (not in manifest — purge only)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### 4. Ask Which Skill
|
|
109
|
+
|
|
110
|
+
"**Which skill would you like to drop?**
|
|
111
|
+
Enter the skill name or its number from the list above."
|
|
112
|
+
|
|
113
|
+
Wait for user input. Accept either the numeric index or the skill name (exact match).
|
|
114
|
+
|
|
115
|
+
**If the user's input does not match any listed skill:** Re-display the list and ask again.
|
|
116
|
+
|
|
117
|
+
Store the selection as `target_skill`. Also store `target_in_manifest = true` if the selected skill has an entry in the manifest, `false` otherwise — subsequent sections use this flag to restrict the available drop options.
|
|
118
|
+
|
|
119
|
+
### 5. Display Version Details
|
|
120
|
+
|
|
121
|
+
**If `target_in_manifest = true`**, display every version with its full metadata from the manifest:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
**{target_skill} — versions:**
|
|
125
|
+
|
|
126
|
+
| Version | Status | Last Exported | Platforms |
|
|
127
|
+
|---------|------------|---------------|------------------------|
|
|
128
|
+
| 0.1.0 | deprecated | 2026-01-15 | claude |
|
|
129
|
+
| 0.5.0 | archived | 2026-03-15 | claude |
|
|
130
|
+
| 0.6.0 | active * | 2026-04-04 | claude, copilot |
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**If `target_in_manifest = false`** (draft skill discovered only by on-disk scan), display the on-disk version directories instead and note the constraint:
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
**{target_skill} — on-disk versions (not in manifest):**
|
|
137
|
+
|
|
138
|
+
{list version subdirectories found under {skills_output_folder}/{target_skill}/, or "(flat layout)" if no version nesting is present}
|
|
139
|
+
|
|
140
|
+
**Note:** This skill has no manifest entry, so soft-deprecate is not available. Only a skill-level hard purge can be performed — the drop will delete the entire on-disk skill group and forge group.
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### 6. Ask Scope
|
|
144
|
+
|
|
145
|
+
**If `target_in_manifest = false`:** Skip this prompt — draft skills can only be dropped as a whole. Set `target_versions = "all"` and `is_skill_level = true`, then proceed to section 7.
|
|
146
|
+
|
|
147
|
+
**If `target_in_manifest = true`:**
|
|
148
|
+
|
|
149
|
+
"**Drop which version(s)?**
|
|
150
|
+
|
|
151
|
+
- **[N]** Specific version — soft deprecate or hard purge a single version
|
|
152
|
+
- **[A]** All versions — drops the entire skill (skill-level operation)"
|
|
153
|
+
|
|
154
|
+
Wait for user selection.
|
|
155
|
+
|
|
156
|
+
**If [N] Specific version:**
|
|
157
|
+
|
|
158
|
+
"**Which version?** Enter the version string (e.g. `0.5.0`)."
|
|
159
|
+
|
|
160
|
+
Wait for user input. Validate that the version exists in the manifest's `versions` map for `target_skill`. If not, repeat the prompt.
|
|
161
|
+
|
|
162
|
+
Set `target_versions = [<selected version>]` and `is_skill_level = false`.
|
|
163
|
+
|
|
164
|
+
**If [A] All versions:**
|
|
165
|
+
|
|
166
|
+
Set `target_versions = "all"` and `is_skill_level = true`.
|
|
167
|
+
|
|
168
|
+
### 7. Active Version Guard
|
|
169
|
+
|
|
170
|
+
**Does not apply when `target_in_manifest = false`:** A draft skill has no manifest-recorded active version, so the guard is a no-op. Proceed to section 8.
|
|
171
|
+
|
|
172
|
+
**Applies only when `target_in_manifest = true` AND `is_skill_level = false` (specific version selected):**
|
|
173
|
+
|
|
174
|
+
1. Read the selected version's `status` field from the manifest
|
|
175
|
+
2. If `status != "active"` → skip this guard, the version is safe to drop
|
|
176
|
+
3. If `status == "active"`:
|
|
177
|
+
a. Count the number of OTHER versions in the `versions` map with `status != "deprecated"` (i.e., `active`, `archived`, or `draft`)
|
|
178
|
+
b. If that count is `> 0` → REFUSE the drop:
|
|
179
|
+
|
|
180
|
+
"**Cannot drop the active version `{version}`.**
|
|
181
|
+
Other non-deprecated versions of `{target_skill}` still exist. To proceed, either:
|
|
182
|
+
|
|
183
|
+
**(a)** Switch the active version to another version first by re-running `[EX] Export Skill` with a different version selected, then return here to drop `{version}`, OR
|
|
184
|
+
|
|
185
|
+
**(b)** Use the `[A] All versions` option to drop every version of `{target_skill}` at once."
|
|
186
|
+
|
|
187
|
+
HALT the workflow. Do not proceed.
|
|
188
|
+
|
|
189
|
+
c. If the count is `0` → the active version is the ONLY version; allow the drop to continue (it is functionally equivalent to a skill-level drop on a single-version skill)
|
|
190
|
+
|
|
191
|
+
### 8. Ask Mode
|
|
192
|
+
|
|
193
|
+
**If `target_in_manifest = false`:** Skip this prompt — soft-deprecate is meaningless without a manifest entry to mark. Force `drop_mode = "purge"` and inform the user: "**Mode forced to purge** — `{target_skill}` has no manifest entry, so there is nothing to deprecate. The skill's on-disk directories will be deleted."
|
|
194
|
+
|
|
195
|
+
**If `target_in_manifest = true`:**
|
|
196
|
+
|
|
197
|
+
"**How should this be dropped?**
|
|
198
|
+
|
|
199
|
+
- **[D]** Deprecate (soft) — Mark the version as `deprecated` in the manifest. Files remain on disk. Export-skill will exclude it from all platform context files. Reversible by editing the manifest.
|
|
200
|
+
- **[P]** Purge (hard) — Deprecate AND delete files from disk (`{skill_package}` and `{forge_version}`, or full `{skill_group}` and `{forge_group}` for a skill-level drop). **Irreversible.**"
|
|
201
|
+
|
|
202
|
+
Wait for user selection.
|
|
203
|
+
|
|
204
|
+
Set `drop_mode` to `"deprecate"` (on D) or `"purge"` (on P).
|
|
205
|
+
|
|
206
|
+
### 9. Compute Affected Directories
|
|
207
|
+
|
|
208
|
+
Using the templates from `{versionPathsKnowledge}`, resolve the list of directories that would be affected:
|
|
209
|
+
|
|
210
|
+
**If `is_skill_level = false` (version-level drop):**
|
|
211
|
+
|
|
212
|
+
- `{skill_package}` = `{skills_output_folder}/{target_skill}/{version}/{target_skill}/`
|
|
213
|
+
- The enclosing version directory = `{skills_output_folder}/{target_skill}/{version}/`
|
|
214
|
+
- `{forge_version}` = `{forge_data_folder}/{target_skill}/{version}/`
|
|
215
|
+
|
|
216
|
+
**If `is_skill_level = true` (skill-level drop):**
|
|
217
|
+
|
|
218
|
+
- `{skill_group}` = `{skills_output_folder}/{target_skill}/`
|
|
219
|
+
- `{forge_group}` = `{forge_data_folder}/{target_skill}/`
|
|
220
|
+
|
|
221
|
+
Store the list as `affected_directories`.
|
|
222
|
+
|
|
223
|
+
If `drop_mode == "deprecate"`, record the list but present it as "retained" in the confirmation output — no deletion will occur.
|
|
224
|
+
|
|
225
|
+
### 10. Confirmation Gate
|
|
226
|
+
|
|
227
|
+
Display the full operation summary:
|
|
228
|
+
|
|
229
|
+
```
|
|
230
|
+
**About to drop:**
|
|
231
|
+
|
|
232
|
+
Skill: {target_skill}
|
|
233
|
+
Version: {version or "ALL versions"}
|
|
234
|
+
Mode: {Deprecate (soft) | Purge (hard)}
|
|
235
|
+
Files:
|
|
236
|
+
{for each path in affected_directories, list one per line}
|
|
237
|
+
{or "(retained on disk — soft drop)" if drop_mode == "deprecate"}
|
|
238
|
+
|
|
239
|
+
{if drop_mode == "purge":}
|
|
240
|
+
⚠️ This operation cannot be undone. Files will be permanently deleted.
|
|
241
|
+
{else:}
|
|
242
|
+
Files remain on disk. Reversible by manually editing the manifest.
|
|
243
|
+
|
|
244
|
+
Proceed? [Y/N]
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Wait for explicit user response.
|
|
248
|
+
|
|
249
|
+
- **If `Y`** → proceed to section 11
|
|
250
|
+
- **If `N`** → "**Cancelled.** No changes were made." HALT the workflow
|
|
251
|
+
- **Any other input** → re-display the confirmation and ask again
|
|
252
|
+
|
|
253
|
+
### 11. Store Decisions in Context
|
|
254
|
+
|
|
255
|
+
Store the following decisions in workflow context for step-02:
|
|
256
|
+
|
|
257
|
+
- `target_skill` — the skill name
|
|
258
|
+
- `target_in_manifest` — boolean (true if the skill has a manifest entry, false if it was discovered only by on-disk scan)
|
|
259
|
+
- `target_versions` — list of version strings (`[<version>]`) or the literal string `"all"`
|
|
260
|
+
- `drop_mode` — `"deprecate"` or `"purge"` (always `"purge"` when `target_in_manifest = false`)
|
|
261
|
+
- `is_skill_level` — boolean (true if all versions; always true when `target_in_manifest = false`)
|
|
262
|
+
- `affected_directories` — list of absolute directory paths that step-02 will delete in purge mode (or retain in deprecate mode)
|
|
263
|
+
|
|
264
|
+
### 12. Load Next Step
|
|
265
|
+
|
|
266
|
+
Load, read the full file, and then execute `{nextStepFile}`.
|
|
267
|
+
|
|
268
|
+
## CRITICAL STEP COMPLETION NOTE
|
|
269
|
+
|
|
270
|
+
ONLY WHEN the user has confirmed with `Y` at the confirmation gate AND all selection decisions have been stored in context, will you then load and read fully `{nextStepFile}` to execute the drop.
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
|
|
275
|
+
|
|
276
|
+
### ✅ SUCCESS:
|
|
277
|
+
|
|
278
|
+
- Version-paths knowledge loaded and applied via templates (no hardcoded paths)
|
|
279
|
+
- Export manifest read if present; on-disk scan augments the list; halt only if both are empty
|
|
280
|
+
- Complete skill and version list displayed with statuses, active marker, and on-disk-only entries flagged "(not in manifest — purge only)"
|
|
281
|
+
- Skill, version(s), and mode selected by explicit user input; mode forced to purge for not-in-manifest skills
|
|
282
|
+
- Active version guard enforced for manifest-tracked skills — refused to drop an active version with surviving non-deprecated peers
|
|
283
|
+
- Affected directories computed from templates
|
|
284
|
+
- Explicit user confirmation (`Y`) received at the confirmation gate
|
|
285
|
+
- All selection decisions stored in context for step-02 (including `target_in_manifest`)
|
|
286
|
+
|
|
287
|
+
### ❌ SYSTEM FAILURE:
|
|
288
|
+
|
|
289
|
+
- Proceeding without reading version-paths knowledge
|
|
290
|
+
- Halting when the manifest is missing but on-disk skills exist — the fallback scan MUST be attempted before any "nothing to drop" halt
|
|
291
|
+
- Offering soft-deprecate for a skill that has no manifest entry
|
|
292
|
+
- Hardcoding directory paths instead of using `{skill_package}`, `{skill_group}`, `{forge_version}`, `{forge_group}` templates
|
|
293
|
+
- Allowing a drop of the active version when other non-deprecated versions exist
|
|
294
|
+
- Modifying the manifest or deleting files in this step (execution belongs to step-02)
|
|
295
|
+
- Skipping the confirmation gate or proceeding on any response other than `Y`
|
|
296
|
+
- Not storing decisions in context for step-02
|
|
297
|
+
|
|
298
|
+
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE. No destructive action proceeds without explicit user confirmation.
|
|
@@ -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.
|