gsd:insert-phase

A command that inserts an urgent task into a numbered project roadmap using a decimal phase number, such as 72.1.

In plain words
What is it for?
Use it when a new task must be added between two planned phases, such as inserting a critical authentication fix after phase 72.
Why use it?
It lets you add work in the right place without renumbering all later phases. It also checks that the roadmap and referenced phase exist.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/geoloeg-ist/agents-reverse-engineer/insert-phase
Clone the repo
git clone --depth 1 https://github.com/GeoloeG-IsT/agents-reverse-engineer

Made for: Claude Code.

Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,478 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00024 $0.01478
Opus 5 $0.00012 $0.00739
Sonnet 5 $0.00005 $0.00296
Haiku 4.5 $0.00002 $0.00148

Measured 2d ago against content hash cfab3ed5037d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gsd:insert-phase scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.claude/commands/gsd/insert-phase.md · 228 lines

How it starts

The opening of the file, as written. The whole thing — 228 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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.

<execution_context> @.planning/ROADMAP.md @.planning/STATE.md </execution_context>

Example: /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
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.

  1. Search for "### Phase {after_phase}:" heading

  2. If not found:

    ERROR: Phase {after_phase} not found in roadmap
    Available phases: [list phase numbers]
    

    Exit.

  3. Verify phase is in current milestone (not completed/archived)

  1. Search for all "### Phase {after_phase}.N:" headings
  2. Extract decimal suffixes (e.g., for Phase 72: find 72.1, 72.2, 72.3)
  3. Find the highest decimal suffix
  4. Calculate next decimal: max + 1

Examples:

  • Phase 72 with no decimals → next is 72.1
  • Phase 72 with 72.1 → next is 72.2
  • Phase 72 with 72.1, 72.2 → next is 72.3

Store as: decimal_phase="$(printf "%02d" $after_phase).${next_decimal}"

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: 06.1-fix-critical-auth-bug (phase 6 insertion)

phase_dir=".planning/phases/${decimal_phase}-${slug}"
mkdir -p "$phase_dir"

Confirm: "Created directory: $phase_dir"

  1. Find insertion point: immediately after Phase {after_phase}'s content (before next phase heading or "---")

  2. 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]
    
  3. 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).

  1. Read .planning/STATE.md
  2. Under "## Accumulated Context" → "### Roadmap Evolution" add entry:
    - 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.

Read the full file on GitHub · 228 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 228 lines · 24 tokens per session scan A cfab3ed5037d

Subscribe to this mod's changes

gsd:insert-phase is a command published in the GitHub repository GeoloeG-IsT/agents-reverse-engineer (20 stars, last pushed 25d ago), licensed MIT. It adds 24 tokens to every session and 1,478 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.