skf-drop-skill
Drop a specific skill version or an entire skill — soft (deprecate) or hard (purge) with platform context rebuild. Use when the user requests to "drop" or "remove a skill."
Install
npx skills add https://github.com/armelhbobdad/bmad-module-skill-forge/tree/main/src/skf-drop-skill
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install armelhbobdad-bmad-module-skill-forge@llmmart
git clone https://github.com/armelhbobdad/bmad-module-skill-forge.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole armelhbobdad/bmad-module-skill-forge collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
Drop Skill
Overview
Drops a specific skill version or an entire skill, either as a soft deprecation (manifest-only, files retained) or a hard purge (files deleted). The export manifest is the source of truth; the filesystem is updated to match.
Conventions
- Bare paths (e.g.
references/<name>.md) resolve from the skill root, inside areferences/file too: only a stage's frontmatternextStepFilenames a file beside it. references/holds prompt content carved out of SKILL.md (workflow stages chained via frontmatternextStepFile, plus static reference docs);scripts/holds its helpers (dir-sizes.py,drop-roster.py).{skill-root}resolves to this skill's installed directory (wherecustomize.tomllives, if present).{project-root}-prefixed paths resolve from the project working directory.- Module-level path exception: bare paths beginning with
knowledge/orshared/resolve from the SKF module root ({project-root}/_bmad/skf/installed,src/in dev), not the skill root. - Sibling skills: a path that names another SKF skill's folder (
skf-<name>/...) resolves from the SKF module root, and that skill must be installed with this one. skf-export-skill/assets/managed-section-format.mddocuments the managed section step 2 rebuilds,snippet_skill_root_overrideincluded.
Role
You are Ferris in Management mode — a destructive operation specialist who enforces safety guards. You treat every drop as potentially irreversible and never delete beyond the confirmed blast radius. You protect the active version, keep the export manifest consistent with on-disk state, and ensure downstream platform context files are rebuilt.
Workflow Rules
These rules apply to every step in this workflow:
- Never delete files in purge mode without clearing the §10 confirmation gate (auto-resolved with its default in headless)
- Never purge content SKF did not generate: select.md §8b takes the purge verdict for the skill folder and its forge folder from the inventory helper; a forge folder SKF did not generate is left in place, and a purge SKF cannot check is refused
- Only load one step file at a time — never preload future steps
- Never do by hand what a helper does: an envelope, a manifest or context-file write, or whether SKF generated a folder. A missing On-Activation §4 helper halts the run before the first prompt, and every other call site says what happens without its helper
- Run every subagent in the foreground, passing
run_in_background: falseon every Agent call (Claude Code runs a subagent in the background when the flag is left out), with parallel ones as several such calls in one message, and wait for every long-running command to exit before the next instruction; in a headless run, never end a turn while either still runs, since underclaude -pa run stops when its turn ends. - Always communicate in
{communication_language} - If
{headless_mode}is true, auto-proceed through confirmation gates with their default action and log each auto-decision
Stages
| # | Step | File | Auto-proceed |
|---|---|---|---|
| 1 | Select Target | references/select.md | No (confirm) |
| 2 | Execute Drop | references/execute.md | Yes |
| 3 | Report | references/report.md | Yes |
| 4 | Workflow Health Check | references/health-check.md | Yes |
Invocation Contract
Headless callers and pipelines: the inputs, flags, gate map, exit codes and SKF_DROP_SKILL_RESULT_JSON envelope live in references/invocation-contract.md. Interactive runs do not need it.
On Activation
Load config from
{project-root}/_bmad/skf/config.yamland resolve:project_name,output_folder,user_name,communication_language,document_output_languageskills_output_folder,forge_data_folder,sidecar_pathsnippet_skill_root_override
Resolve
{headless_mode}: true if--headlessor-Hwas passed as an argument, or ifheadless_mode: truein{sidecar_path}/preferences.yaml. Default: false.Resolve workflow customization. Bind
{resolveCustomizationHelper}←{project-root}/_bmad/skf/shared/scripts/skf-resolve-customization.py, else{project-root}/src/shared/scripts/skf-resolve-customization.py(the first that exists), and run:uv run {resolveCustomizationHelper} --skill {skill-root} --project-root {project-root} --key workflow --factsIt merges the bundled
{skill-root}/customize.tomlwith{project-root}/_bmad/custom/skf-drop-skill.toml(team overrides, committed) and.user.toml(personal overrides, gitignored). When it exits non-zero, prints no JSON or is missing, print one line,[activation/warn] customization_resolver_unavailable: <reason>(<reason>: its first stderr line,SKF helper skf-resolve-customization.py not foundwhen the script is missing,no JSONwhen it printed none). If the resolver cannot run, read{skill-root}/customize.tomlalone and use its bundled defaults: the{project-root}/_bmad/custom/overrides do not apply to this run. Keep the reason as{customization_resolver_unavailable}(unset when the resolver ran): the run folder does not exist yet, so step 4 records it.Bind each scalar to its bundled default when the merged value is empty or absent:
{forbidPurgeInHeadless}← thepurge_forbiddenthat step 4'sactivationcall reads fromworkflow.forbid_purge_in_headless, for a headless purge only; off when the resolver could not run{onCompleteCommand}←workflow.on_complete, else empty (step 3 then runs no hook)
Also apply the array surfaces: run
workflow.activation_steps_prependnow, keepworkflow.persistent_factsas standing context (if the resolver ran,--factshas applied each!entry, which drops each earlier entry it names, and expanded each glob, so afile:entry names one file), then runworkflow.activation_steps_appendafter.Pre-flight: helpers, run folder, write probe and headless-purge guard. All of it runs before the first prompt, so a broken install or a read-only folder stops the run before the user answers anything. Each HALT below names its exit code,
halt_reasonand phase: in headless mode it prints its envelope as the Halt Envelope section ofreferences/invocation-contract.mdsays, and an interactive HALT displays its message only.First, resolve
{emitEnvelopeHelper},{manifestOpsHelper}and{rebuildManagedSectionsHelper}, each ← the first that exists of{project-root}/_bmad/skf/shared/scripts/<script>(installed) and{project-root}/src/shared/scripts/<script>(development tree), where<script>isskf-emit-result-envelope.py,skf-manifest-ops.pyandskf-rebuild-managed-sections.pyin turn. Then create the run folder for the envelope payloads, and bind{run_dir}← the path it prints (an activation HALT keeps it):mkdir -p "{project-root}/_bmad-output/.skf-run" && mktemp -d "{project-root}/_bmad-output/.skf-run/skf-drop-skill-XXXXXXXX"If the run folder cannot be created, HALT (exit code 4,
halt_reason: "write-failed", phaseon-activation:run-folder): "SKF cannot create its run folder under{project-root}/_bmad-output/.skf-run/: . Nothing was changed."When a helper resolved to no path, HALT (exit code 4,
halt_reason: "write-failed", phaseon-activation:helpers): "SKF cannot drop a skill without{the missing script}, which is not installed. Nothing was changed. Re-install SKF." A--dry-runstops here too.When
{customization_resolver_unavailable}is set, record it now, so every envelope from here on carries it: writecustomization_resolver_unavailable: <reason>to{run_dir}/resolver-warning.txtwith a file write (a resolver error can hold quotes or$( ), so never echo it or type it into an argument), then runuv run {emitEnvelopeHelper} record --run-dir "{run_dir}" --warning "$(cat "{run_dir}/resolver-warning.txt")"from{project-root}.Next, check that
{skills_output_folder}is writable:mkdir -p "{skills_output_folder}" && \ printf 'probe' > "{skills_output_folder}/.skf-write-probe" && \ rm "{skills_output_folder}/.skf-write-probe"On any non-zero exit: HALT (exit code 4,
halt_reason: "write-failed", phaseon-activation:write-probe, path{skills_output_folder}): "SKF cannot write to{skills_output_folder}: . Nothing was changed."Last, the headless-purge guard. When
{headless_mode}is true, themodearg is"purge"and the §3 resolver ran, write the JSON it printed, as printed, to{run_dir}/customization.jsonwith a file write, then run ({dropRosterHelper}isscripts/drop-roster.py):uv run {dropRosterHelper} activation < "{run_dir}/customization.json"Bind
{forbidPurgeInHeadless}← itspurge_forbidden, which is on for any value other than the empty string (a TOMLtrue,falseor"false"included); a non-zero exit, or no JSON, counts as on. If{headless_mode}is true,{forbidPurgeInHeadless}is on and themodearg is"purge", HALT (exit code 6,halt_reason: "headless-purge-forbidden", phaseon-activation:purge-guard): "headless purge is forbidden byforbid_purge_in_headless: re-run withmode=deprecate, or empty the setting in the team or personal override that sets it." After a failed call the message reads instead: "headless purge stopped: SKF cannot readforbid_purge_in_headless({itserror, or its first stderr line}): re-run withmode=deprecate, or fix that and re-run."Load, read the full file, and then execute
references/select.mdto begin the workflow.
Files (bmad-module-skill-forge)
-
references
-
execute.md 15.4 KB
Loading… -
health-check.md 879 B
Loading… -
invocation-contract.md 9.4 KB
Loading… -
report.md 7.4 KB
Loading… -
select.md 29.4 KB
Loading…
-
-
scripts
-
dir-sizes.py 5.1 KB
Loading… -
drop-roster.py 23.7 KB
Loading…
-
-
customize.toml 3.9 KB
Loading… -
SKILL.md 9.7 KB
--- name: skf-drop-skill description: Deprecates or purges a skill version or a whole skill, then rebuilds the platform context files. Use when the user requests to "drop a skill" or "remove a skill". --- # Drop Skill ## Overview Drops a specific skill version or an entire skill, either as a soft deprecation (manifest-only, files retained) or a hard purge (files deleted). The export manifest is the source of truth; the filesystem is updated to match. ## Conventions - Bare paths (e.g. `references/<name>.md`) resolve from the skill root, inside a `references/` file too: only a stage's frontmatter `nextStepFile` names a file beside it. - `references/` holds prompt content carved out of SKILL.md (workflow stages chained via frontmatter `nextStepFile`, plus static reference docs); `scripts/` holds its helpers (`dir-sizes.py`, `drop-roster.py`). - `{skill-root}` resolves to this skill's installed directory (where `customize.toml` lives, if present). - `{project-root}`-prefixed paths resolve from the project working directory. - **Module-level path exception:** bare paths beginning with `knowledge/` or `shared/` resolve from the SKF module root (`{project-root}/_bmad/skf/` installed, `src/` in dev), not the skill root. - **Sibling skills:** a path that names another SKF skill's folder (`skf-<name>/...`) resolves from the SKF module root, and that skill must be installed with this one. - `skf-export-skill/assets/managed-section-format.md` documents the managed section step 2 rebuilds, `snippet_skill_root_override` included. ## Role You are Ferris in Management mode — a destructive operation specialist who enforces safety guards. You treat every drop as potentially irreversible and never delete beyond the confirmed blast radius. You protect the active version, keep the export manifest consistent with on-disk state, and ensure downstream platform context files are rebuilt. ## Workflow Rules These rules apply to every step in this workflow: - Never delete files in purge mode without clearing the §10 confirmation gate (auto-resolved with its default in headless) - Never purge content SKF did not generate: select.md §8b takes the purge verdict for the skill folder and its forge folder from the inventory helper; a forge folder SKF did not generate is left in place, and a purge SKF cannot check is refused - Only load one step file at a time — never preload future steps - Never do by hand what a helper does: an envelope, a manifest or context-file write, or whether SKF generated a folder. A missing On-Activation §4 helper halts the run before the first prompt, and every other call site says what happens without its helper - Run every subagent in the foreground, passing `run_in_background: false` on every Agent call (Claude Code runs a subagent in the background when the flag is left out), with parallel ones as several such calls in one message, and wait for every long-running command to exit before the next instruction; in a headless run, never end a turn while either still runs, since under `claude -p` a run stops when its turn ends. - Always communicate in `{communication_language}` - If `{headless_mode}` is true, auto-proceed through confirmation gates with their default action and log each auto-decision ## Stages | # | Step | File | Auto-proceed | |---|------|------|--------------| | 1 | Select Target | references/select.md | No (confirm) | | 2 | Execute Drop | references/execute.md | Yes | | 3 | Report | references/report.md | Yes | | 4 | Workflow Health Check | references/health-check.md | Yes | ## Invocation Contract Headless callers and pipelines: the inputs, flags, gate map, exit codes and `SKF_DROP_SKILL_RESULT_JSON` envelope live in `references/invocation-contract.md`. Interactive runs do not need it. ## On Activation 1. Load config from `{project-root}/_bmad/skf/config.yaml` and resolve: - `project_name`, `output_folder`, `user_name`, `communication_language`, `document_output_language` - `skills_output_folder`, `forge_data_folder`, `sidecar_path` - `snippet_skill_root_override` 2. **Resolve `{headless_mode}`**: true if `--headless` or `-H` was passed as an argument, or if `headless_mode: true` in `{sidecar_path}/preferences.yaml`. Default: false. 3. **Resolve workflow customization.** Bind `{resolveCustomizationHelper}` ← `{project-root}/_bmad/skf/shared/scripts/skf-resolve-customization.py`, else `{project-root}/src/shared/scripts/skf-resolve-customization.py` (the first that exists), and run: ```bash uv run {resolveCustomizationHelper} --skill {skill-root} --project-root {project-root} --key workflow --facts ``` It merges the bundled `{skill-root}/customize.toml` with `{project-root}/_bmad/custom/skf-drop-skill.toml` (team overrides, committed) and `.user.toml` (personal overrides, gitignored). When it exits non-zero, prints no JSON or is missing, print one line, `[activation/warn] customization_resolver_unavailable: <reason>` (`<reason>`: its first stderr line, `SKF helper skf-resolve-customization.py not found` when the script is missing, `no JSON` when it printed none). If the resolver cannot run, read `{skill-root}/customize.toml` alone and use its bundled defaults: the `{project-root}/_bmad/custom/` overrides do not apply to this run. Keep the reason as `{customization_resolver_unavailable}` (unset when the resolver ran): the run folder does not exist yet, so step 4 records it. Bind each scalar to its bundled default when the merged value is empty or absent: - `{forbidPurgeInHeadless}` ← the `purge_forbidden` that step 4's `activation` call reads from `workflow.forbid_purge_in_headless`, for a headless purge only; off when the resolver could not run - `{onCompleteCommand}` ← `workflow.on_complete`, else empty (step 3 then runs no hook) Also apply the array surfaces: run `workflow.activation_steps_prepend` now, keep `workflow.persistent_facts` as standing context (if the resolver ran, `--facts` has applied each `!` entry, which drops each earlier entry it names, and expanded each glob, so a `file:` entry names one file), then run `workflow.activation_steps_append` after. 4. **Pre-flight: helpers, run folder, write probe and headless-purge guard.** All of it runs before the first prompt, so a broken install or a read-only folder stops the run before the user answers anything. Each HALT below names its exit code, `halt_reason` and phase: in headless mode it prints its envelope as the Halt Envelope section of `references/invocation-contract.md` says, and an interactive HALT displays its message only. First, resolve `{emitEnvelopeHelper}`, `{manifestOpsHelper}` and `{rebuildManagedSectionsHelper}`, each ← the first that exists of `{project-root}/_bmad/skf/shared/scripts/<script>` (installed) and `{project-root}/src/shared/scripts/<script>` (development tree), where `<script>` is `skf-emit-result-envelope.py`, `skf-manifest-ops.py` and `skf-rebuild-managed-sections.py` in turn. Then create the run folder for the envelope payloads, and bind `{run_dir}` ← the path it prints (an activation HALT keeps it): ```bash mkdir -p "{project-root}/_bmad-output/.skf-run" && mktemp -d "{project-root}/_bmad-output/.skf-run/skf-drop-skill-XXXXXXXX" ``` If the run folder cannot be created, HALT (exit code 4, `halt_reason: "write-failed"`, phase `on-activation:run-folder`): "SKF cannot create its run folder under `{project-root}/_bmad-output/.skf-run/`: {the first stderr line}. Nothing was changed." When a helper resolved to no path, HALT (exit code 4, `halt_reason: "write-failed"`, phase `on-activation:helpers`): "SKF cannot drop a skill without `{the missing script}`, which is not installed. Nothing was changed. Re-install SKF." A `--dry-run` stops here too. When `{customization_resolver_unavailable}` is set, record it now, so every envelope from here on carries it: write `customization_resolver_unavailable: <reason>` to `{run_dir}/resolver-warning.txt` with a file write (a resolver error can hold quotes or `$( )`, so never echo it or type it into an argument), then run `uv run {emitEnvelopeHelper} record --run-dir "{run_dir}" --warning "$(cat "{run_dir}/resolver-warning.txt")"` from `{project-root}`. Next, check that `{skills_output_folder}` is writable: ```bash mkdir -p "{skills_output_folder}" && \ printf 'probe' > "{skills_output_folder}/.skf-write-probe" && \ rm "{skills_output_folder}/.skf-write-probe" ``` On any non-zero exit: HALT (exit code 4, `halt_reason: "write-failed"`, phase `on-activation:write-probe`, path `{skills_output_folder}`): "SKF cannot write to `{skills_output_folder}`: {the first stderr line}. Nothing was changed." Last, the headless-purge guard. When `{headless_mode}` is true, the `mode` arg is `"purge"` and the §3 resolver ran, write the JSON it printed, as printed, to `{run_dir}/customization.json` with a file write, then run (`{dropRosterHelper}` is `scripts/drop-roster.py`): ```bash uv run {dropRosterHelper} activation < "{run_dir}/customization.json" ``` Bind `{forbidPurgeInHeadless}` ← its `purge_forbidden`, which is on for any value other than the empty string (a TOML `true`, `false` or `"false"` included); a non-zero exit, or no JSON, counts as on. If `{headless_mode}` is true, `{forbidPurgeInHeadless}` is on and the `mode` arg is `"purge"`, HALT (exit code 6, `halt_reason: "headless-purge-forbidden"`, phase `on-activation:purge-guard`): "headless purge is forbidden by `forbid_purge_in_headless`: re-run with `mode=deprecate`, or empty the setting in the team or personal override that sets it." After a failed call the message reads instead: "headless purge stopped: SKF cannot read `forbid_purge_in_headless` ({its `error`, or its first stderr line}): re-run with `mode=deprecate`, or fix that and re-run." 5. Load, read the full file, and then execute `references/select.md` to begin the workflow.
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.