Insert urgent work as decimal phase (e.g., 72.1) between existing phases
Inserts urgent decimal-numbered phases into the roadmap to handle mid-milestone work without renumbering.
/plugin marketplace add glittercowboy/get-shit-done/plugin install get-shit-done@get-shit-done<after> <description>gsd/Uses decimal numbering (72.1, 72.2, etc.) to preserve the logical sequence of planned phases while accommodating urgent insertions.
Purpose: Handle urgent work discovered during execution without renumbering entire roadmap. </objective>
<execution_context> @.planning/ROADMAP.md @.planning/STATE.md </execution_context>
<process> <step name="parse_arguments"> Parse the command arguments: - First argument: integer phase number to insert after - Remaining arguments: phase descriptionExample: /gsd:insert-phase 72 Fix critical auth bug
→ after = 72
→ description = "Fix critical auth bug"
Validation:
if [ $# -lt 2 ]; then
echo "ERROR: Both phase number and description required"
echo "Usage: /gsd:insert-phase <after> <description>"
echo "Example: /gsd:insert-phase 72 Fix critical auth bug"
exit 1
fi
Parse first argument as integer:
after_phase=$1
shift
description="$*"
# Validate after_phase is an integer
if ! [[ "$after_phase" =~ ^[0-9]+$ ]]; then
echo "ERROR: Phase number must be an integer"
exit 1
fi
</step>
<step name="load_roadmap">
Load the roadmap file:
if [ -f .planning/ROADMAP.md ]; then
ROADMAP=".planning/ROADMAP.md"
else
echo "ERROR: No roadmap found (.planning/ROADMAP.md)"
exit 1
fi
Read roadmap content for parsing. </step>
<step name="verify_target_phase"> Verify that the target phase exists in the roadmap:Search for "### Phase {after_phase}:" heading
If not found:
ERROR: Phase {after_phase} not found in roadmap
Available phases: [list phase numbers]
Exit.
Verify phase is in current milestone (not completed/archived) </step>
Examples:
Store as: decimal_phase="${after_phase}.${next_decimal}"
</step>
slug=$(echo "$description" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//')
Phase directory name: {decimal-phase}-{slug}
Example: 72.1-fix-critical-auth-bug
</step>
phase_dir=".planning/phases/${decimal_phase}-${slug}"
mkdir -p "$phase_dir"
Confirm: "Created directory: $phase_dir" </step>
<step name="update_roadmap"> Insert the new phase entry into the roadmap:Find insertion point: immediately after Phase {after_phase}'s content (before next phase heading or "---")
Insert new phase heading with (INSERTED) marker:
### Phase {decimal_phase}: {Description} (INSERTED)
**Goal:** [Urgent work - to be planned]
**Depends on:** Phase {after_phase}
**Plans:** 0 plans
Plans:
- [ ] TBD (run /gsd:plan-phase {decimal_phase} to break down)
**Details:**
[To be added during planning]
Write updated roadmap back to file
The "(INSERTED)" marker helps identify decimal phases as urgent insertions.
Preserve all other content exactly (formatting, spacing, other phases). </step>
<step name="update_project_state"> Update STATE.md to reflect the inserted phase:.planning/STATE.md- Phase {decimal_phase} inserted after Phase {after_phase}: {description} (URGENT)
If "Roadmap Evolution" section doesn't exist, create it.
Add note about insertion reason if appropriate. </step>
<step name="completion"> Present completion summary:Phase {decimal_phase} inserted after Phase {after_phase}:
- Description: {description}
- Directory: .planning/phases/{decimal-phase}-{slug}/
- Status: Not planned yet
- Marker: (INSERTED) - indicates urgent work
Roadmap updated: {roadmap-path}
Project state updated: .planning/STATE.md
---
## ▶ Next Up
**Phase {decimal_phase}: {description}** — urgent insertion
`/gsd:plan-phase {decimal_phase}`
<sub>`/clear` first → fresh context window</sub>
---
**Also available:**
- Review insertion impact: Check if Phase {next_integer} dependencies still make sense
- Review roadmap
---
</step>
</process>
<anti_patterns>
<success_criteria> Phase insertion is complete when:
.planning/phases/{N.M}-{slug}/