finalize

A command for closing out a software feature after it has been deployed to production, meaning the live environment used by customers. It updates project documentation and GitHub release records, then archives the finished work.

In plain words
What is it for?
Use it after deployment to update the changelog and README, create a walkthrough or GitHub release, archive the feature, and clean up its branch.
Why use it?
It gathers the final record of what changed and removes completed work from active tracking. It can skip steps that were already completed when run again.

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/marcusgoll/spec-flow/finalize
Clone the repo
git clone --depth 1 https://github.com/marcusgoll/Spec-Flow

Made for: Claude Code.

Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,183 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.00023 $0.03183
Opus 5 $0.00012 $0.01591
Sonnet 5 $0.00005 $0.00637
Haiku 4.5 $0.00002 $0.00318

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

Security

Grade A, and why

finalize 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 3d 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.

.claude/commands/phases/finalize.md · 337 lines

How it starts

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

/finalize — Post-Deployment Finalization (Thin Wrapper)

v11.0 Architecture: This command spawns the isolated finalize-phase-agent via Task(). Documentation and archival runs in isolated context.

Interaction State: !cat specs/*/interaction-state.yaml 2>/dev/null | head -10 || echo "none"

Architecture (v11.0 - Phase Isolation):

/finalize → Task(finalize-phase-agent) → CHANGELOG, walkthrough, archive

Agent responsibilities:

  • Generate CHANGELOG.md entry
  • Update README.md if user-facing changes
  • Create walkthrough.md (comprehensive for epics)
  • Create GitHub release
  • Archive feature to completed/
  • Clean up feature branch

Execution model:

  • Idempotent: Safe to re-run; completed tasks are skipped
  • Deterministic: No prompts, no editors
  • Tracked: Every step logged with clear progress indicators

Workflow position: implement → optimize → validate → ship → finalize

Legacy Context (for agent reference)

<legacy_context> Current workflow state: !cat specs/*/state.yaml 2>/dev/null | grep -E '(feature\.|deployment\.production\.|version:)' | head -20

Recent production deployment: !yq -r '.deployment.production | "URL: \(.url // "N/A"), Date: \(.completed_at // "N/A"), Status: \(.status // "unknown")"' specs/*/state.yaml 2>/dev/null

Required tools check: !for c in gh jq yq git python; do command -v "$c" >/dev/null 2>&1 && echo "✅ $c" || echo "❌ $c"; done </legacy_context>

  1. Execute finalization workflow via spec-cli.py:

    python .spec-flow/scripts/spec-cli.py finalize
    

    The finalize-workflow.sh script performs:

    a. Epic workflows only (v5.0+):

    • Generate walkthrough.md with velocity metrics
    • Calculate sprint results and lessons learned
    • Run pattern detection across completed epics (if 2+ completed)
    • Auto-offer workflow healing (v10.14+):
      • Check .spec-flow/analytics/patterns.json for recommendations
      • If avg_blockers > 3 or avg_duration > 14 days, prompt user:

Read the full file on GitHub · 337 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. 3d ago First seen · 337 lines · 23 tokens per session scan A e34478f7e75b

Subscribe to this mod's changes

finalize is a command published in the GitHub repository marcusgoll/Spec-Flow (91 stars, last pushed 4mo ago), licensed MIT. It adds 23 tokens to every session and 3,183 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.