name: speckit-refine-update description: Update an existing spec.md in-place based on new requirements or feedback compatibility: Requires spec-kit project structure with .specify/ directory metadata: author: github-spec-kit source: refine:commands/speckit.refine.update.md
Refine Specification
Update an existing specification in-place without creating a new feature branch. Use this when requirements change, feedback arrives, or you need to iterate on an existing spec.
User Input
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty). The user input describes what to change in the existing specification.
Prerequisites
- Verify a spec-kit project exists by checking for
.specify/directory - Identify the current feature by checking for an active feature branch (pattern:
###-feature-nameorYYYYMMDD-HHMMSS-feature-name) - If no feature branch is detected, look for the most recently modified
specs/*/spec.md - If no spec.md is found, inform the user and suggest running
/speckit.specifyfirst
Outline
-
Locate the spec: Find the current feature's spec.md:
- Check git branch name for feature number/prefix
- Map to
specs/{branch-name}/spec.md - If not on a feature branch, prompt the user to select from available specs in
specs/*/spec.md
-
Read current artifacts: Load the following files from the feature directory:
- Required:
spec.md(the specification to refine) - Optional:
plan.md,tasks.md,research.md,data-model.md,contracts/ - Note which optional artifacts exist — they will need propagation later
- Required:
-
Understand the change request: Analyze the user's input to determine:
- Which sections of spec.md are affected
- Whether this is an additive change (new requirements), a modification (changed requirements), or a removal (dropped requirements)
- Whether the change affects user stories, requirements, success criteria, or assumptions
-
Apply the update: Modify spec.md in-place:
- Preserve all existing sections and formatting
- Update only the sections affected by the change request
- If adding a new user story, assign the next priority number (P4, P5, etc.)
- If modifying requirements, update both the requirement and any affected user stories
- If removing requirements, mark them as
~~removed~~with a brief reason rather than deleting - Update the
**Status**field toRefinedand add a refinement note:**Refined**: [DATE] — [Brief description of what changed]
-
Mark downstream artifacts as stale: After updating spec.md, check which downstream artifacts exist and append a staleness warning to each:
- If
plan.mdexists, prepend:> ⚠️ **STALE**: spec.md was refined on [DATE]. Run `/speckit.refine.propagate` to update this plan. - If
tasks.mdexists, prepend the same warning - This ensures no one accidentally implements from outdated artifacts
- If
-
Report: Output a summary:
- What sections were updated in spec.md
- Which downstream artifacts are now stale
- Suggest next step:
/speckit.refine.propagateto cascade changes, or/speckit.refine.diffto preview impact first
Rules
- Never create a new feature branch — refine works on the current branch
- Never delete content — mark removed items with strikethrough and a reason
- Preserve formatting — match the existing spec.md style exactly
- Preserve section order — do not reorder sections
- Track changes — always add a refinement note with date and description
- Mark staleness — always warn downstream artifacts about spec changes