Skip to content

Feat/4156 Revise Specs - #4158

Draft
harsha09 wants to merge 12 commits into
github:mainfrom
harsha09:feat/4156-living-spec-revise
Draft

Feat/4156 Revise Specs#4158
harsha09 wants to merge 12 commits into
github:mainfrom
harsha09:feat/4156-living-spec-revise

Conversation

@harsha09

Copy link
Copy Markdown

Addresses #4156

Description

We kept hitting the same mess: requirements change after /speckit.specify (sometimes after implement), and the agent "fixes" it by rewriting spec.md and regenerating tasks.md. History disappears. You can't tell what was dropped, and if we already shipped, nothing says "remove the old code."

/speckit.specify always opens a new feature folder. /speckit.clarify asks questions I already know the answer to. /speckit.converge assumes the spec didn't move. None of those is "this AC is no longer valid" or "SSO instead of password."

This PR adds /speckit.revise. Same feature directory. It does not rewrite spec/plan/tasks. Old FRs/ACs stay on the page, marked SUPERSEDED (replaced by a new ID) or RETIRED (gone, nothing replaces them). New requirements get new IDs. revisions.md is only a dated list of those IDs, not a second spec.

If plan.md / tasks.md exist, it only appends. After implement, that means tasks to add the new code and/or remove the old code. Revise does not touch application code; you run /speckit.implement for that. Open tasks for a dead ID get cancelled/superseded; finished [x] tasks stay.

Implement, analyze, and taskstoissues skip those dead lines. Git gets before_revise / after_revise.

The command prompt is short on purpose. First drafts were huge and would have eaten tokens every run.

Testing

  • Tested locally with uv run specify --help
  • Ran existing tests with uv sync && uv run pytest
    (focused: revise contracts, command-template py scripts, git extension, init inventories, Claude/Alquimia hints. Green. I didn't sit through the full suite.)
  • Tested with a sample project

specify init /tmp/speckit-revise-test --integration grok --script py from this branch. Same folder specs/001-user-login/ the whole way. No 002-.

Manual test results

Agent: Grok | OS/Shell: macOS/zsh

Command tested Notes
/speckit.specify specs/001-user-login/spec.md; no second feature dir
/speckit.plan plan.md added in the same folder
/speckit.tasks T001–T006 for email/password login
/speckit.implement src/auth login + session; T001–T006 checked
/speckit.revise (add expired-session AC) same folder; FR-004 + US1/AC3; T007 appended; revisions R1; spec/tasks not rewritten
/speckit.revise (password no longer valid) FR-001 SUPERSEDED by FR-005; AC2 RETIRED; T008 remove password, T009–T010 SSO; [x] tasks kept; R2
/speckit.implement (cleanup) password sign_in removed; SSO path works; expired session rejected
/speckit.analyze live spec is SSO + expiry; retired password IDs not flagged as gaps

Test selection reasoning

Changed file Affects Test Why
templates/commands/revise.md /speckit.revise T4 T5 new command
templates/commands/specify.md /speckit.specify T1 points known deltas at revise
templates/commands/implement.md /speckit.implement T3 T6 skip SUPERSEDED/CANCELLED
templates/commands/analyze.md /speckit.analyze T7 live spec vs retired IDs
templates/commands/taskstoissues.md /speckit.taskstoissues skipped skip dead tasks; not run this pass
templates/commands/converge.md /speckit.converge skipped not run this pass
templates/commands/clarify.md /speckit.clarify skipped not run this pass
src/specify_cli/** specify init install core command list; speckit-revise skill present
extensions/git/** git hooks skipped git extension not installed in the sample project

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (describe below)

Grok helped explore the repo, draft the command, and run the sample-project walkthrough. I set the rules and reviewed the diffs. Commits have Assisted-by: Grok (model: grok-4.6, supervised).

Add a core slash command that applies a known requirement delta
(add/remove/reword ACs, FRs, stories) to the current feature spec
without opening a new specs/ directory. Cascade into plan.md and
tasks.md when those files exist, record the change in revisions.md,
and teach implement/taskstoissues to skip cancelled tasks.

Assisted-by: Grok (model: grok-4.6, supervised)
Register /speckit.revise in the core command order, skill
descriptions, Copilot core set, and Claude/Alquimia argument
hints so specify init actually installs it everywhere. Update
integration file-inventory tests and align post-hooks with
sister commands.

Assisted-by: Grok (model: grok-4.6, supervised)
List /speckit.revise in the post-init command inventory and
extension hook catalog. Send known deltas from clarify/analyze
to revise, emit a single completion report after hooks, and
note that lean still uses the core revise command.

Assisted-by: Grok (model: grok-4.6, supervised)
Keep living-spec checklist marker updates in the same commit as
the spec delta when the git extension auto-commits after_revise.

Assisted-by: Grok (model: grok-4.6, supervised)
spec.md stays the only contract. revisions.md is IDs plus a date.
Re-running the same add/remove, or adding what the spec already
says, writes nothing and does not bump R{N}.

Assisted-by: Grok (model: grok-4.6, supervised)
When a delta contradicts a live FR/AC/SC, mark the old line
SUPERSEDED by a new ID and add the replacement. Pure drops
are RETIRED in place. Tasks get SUPERSEDED → new T0xx or
CANCELLED. implement/analyze skip those lines.

Assisted-by: Grok (model: grok-4.6, supervised)
Keep the same rules (in-place edit, supersede/retire, no-op
duplicates, cascade, hooks) in a ~150-line prompt instead of
~385 so each /speckit.revise call sends less to the model.

Assisted-by: Grok (model: grok-4.6, supervised)
Same behavior, spoken as a briefing instead of a spec: what this
is, how to classify the delta, what to write, when to stop.

Assisted-by: Grok (model: grok-4.6, supervised)
…ment

Requirement changes must supersede or retire old IDs, not restyle
the same line. plan.md and tasks.md are only appended. After
implementation, new work is add-code tasks and invalid work is
remove-code tasks.

Assisted-by: Grok (model: grok-4.6, supervised)
The tasks handoff no longer rebuilds tasks.md after a revision.
Converge inventories only live IDs and waits for open Revision
tasks. Lean implement skips cancelled work. Specify stops before
mkdir. Implemented is per-ID; plan_status is a real report field.

Assisted-by: Grok (model: grok-4.6, supervised)
First-generation tasks inventory only live IDs. Persist
plan_status on revisions.md and send needs-rebuild to plan.
Clarify and checklist no longer overwrite living-spec history.
Init lists /speckit.revise.

Assisted-by: Grok (model: grok-4.6, supervised)
Do not rewrite the evolving-specs steps or persistence model.
Add a single line pointing at /speckit.revise and leave the
original clarify / plan / tasks loop in place.

Assisted-by: Grok (model: grok-4.6, supervised)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant