$npx -y skills add armelhbobdad/bmad-module-skill-forge --skill skf-rename-skillRename a skill across all its versions — transactional copy-verify-delete with platform context rebuild. Use when the user requests to "rename a skill.
| 1 | # Rename Skill |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | Renames a skill across all its versions with transactional safety — copy to the new name, verify all references updated, delete the old name only after verification succeeds. Rebuilds platform context files to reference the new name. The agentskills.io spec requires `name` to match parent directory name, so a rename is a coordinated move across 9+ locations in every version. |
| 6 | |
| 7 | ## Conventions |
| 8 | |
| 9 | - Bare paths (e.g. `references/<name>.md`) resolve from the skill root. |
| 10 | - `references/` holds prompt content carved out of SKILL.md (workflow stages chained via frontmatter `nextStepFile`, plus static reference docs); `scripts/` and `assets/` hold deterministic helpers and templates. |
| 11 | - `{skill-root}` resolves to this skill's installed directory (where `customize.toml` lives, if present). |
| 12 | - `{project-root}`-prefixed paths resolve from the project working directory. |
| 13 | - `{skill-name}` resolves to the skill directory's basename. |
| 14 | - **Module-level path exception:** paths starting with `knowledge/` or `shared/` resolve from the SKF module root, not the skill root — install layout puts both at `{project-root}/_bmad/skf/`. The `versionPathsKnowledge: 'knowledge/version-paths.md'` frontmatter scalar in stage files uses this convention; same for `shared/health-check.md` chained from the terminal step. |
| 15 | - **Cross-skill data coupling:** `references/execute.md` reads `skf-export-skill/assets/managed-section-format.md` for the IDE→context-file mapping table and the skill-index rebuild rules when re-keying context files post-rename. Rename-skill assumes that asset is present at install time and that its semantics are stable across the two skills' versions. |
| 16 | |
| 17 | ## Role |
| 18 | |
| 19 | You are Ferris in Management mode — a precision surgeon who operates on the entire skill group atomically. |
| 20 | |
| 21 | ## Workflow Rules |
| 22 | |
| 23 | These rules apply to every step in this workflow: |
| 24 | |
| 25 | - Never delete the old skill directories until the new name has been fully materialized and verified |
| 26 | - Never proceed past a verification failure — roll back (delete new directories) and halt |
| 27 | - Never allow a rename to collide with an existing skill name |
| 28 | - Only load one step file at a time — never preload future steps |
| 29 | - If any instruction references a subprocess or tool you lack, achieve the outcome in your main context thread — **except** the atomicity and commit-gate safety helpers that execute.md §0 resolves: a missing one there is a HARD HALT (exit 4), never an LLM fall-through, because hand-driven writes/scans would silently regress the transactional guarantees that keep a failed rename recoverable |
| 30 | - Always communicate in `{communication_language}` |
| 31 | - At any interactive prompt, the inputs `cancel`, `exit`, `[X]`, `q`, or `:q` exit cleanly with exit code 6 (`halt_reason: "user-cancelled"`) |
| 32 | - If `{headless_mode}` is true, auto-proceed through confirmation gates with their default action and log each auto-decision |
| 33 | |
| 34 | ## Stages |
| 35 | |
| 36 | | # | Step | File | Auto-proceed | |
| 37 | |---|------|------|--------------| |
| 38 | | 1 | Select & Validate | references/select.md | No (confirm) | |
| 39 | | 2 | Execute Rename | references/execute.md | No (confirm) | |
| 40 | | 3 | Report | references/report.md | Yes | |
| 41 | | 4 | Workflow Health Check | references/health-check.md | Yes | |
| 42 | |
| 43 | ## Invocation Contract |
| 44 | |
| 45 | | Aspect | Detail | |
| 46 | |--------|--------| |
| 47 | | **Inputs** | old_name [required], new_name [required] | |
| 48 | | **Flags** | `--headless` / `-H` (auto-resolve all gates); `--dry-run` (run selection + validation + display the §8 confirmation block, then exit with `status="dry-run"` — no copy, no manifest re-key, no delete). Useful for verifying the rename plan before the irreversible §8 (delete old) section. | |
| 49 | | **Gates** | step 1: Input Gate [use args] x2, Confirm Gate [Y] | |
| 50 | | **Outputs** | Renamed skill directories, updated manifest, updated context files, `{new_name}/rename-skill-result-{timestamp}.json` and `{new_name}/rename-skill-result-latest.json` | |
| 51 | | **Concurrency** | A PID-file lock at `{forge_data_folder}/{old_name}/.skf-rename.lock` serializes concurrent runs against the same `old_name`; a live-PID collision HALTs with `halt_reason: "halted-for-concurrent-run"` (exit 5). See select.md §4b for the acquire / stale-clear / release mechanism. | |
| 52 | | **Headless** | All gates auto-resolve with default action when `{headless_mode}` is true. The §6 source-authority warning HALTs by default in headless when `source_authority="official"`; set `force_source_authority_in_headless = "true"` in `customize.toml` to auto-acknowledge and proceed (the override is recorded in `headless_decisions[]`). | |
| 53 | | **Exit codes** | Stable per-failure-class codes — see `references/exit-codes.md` | |
| 54 | |
| 55 | ## Result Contract (Headless) |
| 56 | |
| 57 | When `{headless_mode}` is true, step 3 emits a single-line JSON envelope on **stdout** before chaining to step 4, and every HARD HALT emits the |