Skip to content

feat(cli): add specify resume command for session continuation#1892

Closed
mvanhorn wants to merge 1 commit intogithub:mainfrom
mvanhorn:osc/feat-specify-resume
Closed

feat(cli): add specify resume command for session continuation#1892
mvanhorn wants to merge 1 commit intogithub:mainfrom
mvanhorn:osc/feat-specify-resume

Conversation

@mvanhorn
Copy link
Contributor

Summary

Adds specify resume - a CLI command that detects the current SDD workflow state for each feature and generates an agent-ready continuation prompt. When an agent crashes mid-workflow or a user returns after a break, this command tells them exactly where they left off and what to do next.

Why this matters

Agent crashes and context loss during spec-driven development workflows are a common pain point. Users must manually inspect feature directories, parse task files, and figure out which /speckit.* command to run next.

Source Evidence Engagement
#1801 Users confused about what phase they're in (smaller models skip phases) 4 comments
#1742 Agent executing speckit.implement instead of speckit.tasks 3 comments
#1862 Verification Spec for Automated Agent Loops - reliability gap 1 comment with detailed analysis
Reddit r/ClaudeCode "SDD frameworks vs AI Plan Mode" discussion 8 upvotes, 29 comments

These issues share a common root cause: no way to programmatically determine where a feature stands in the SDD lifecycle.

Changes

  • Added specify resume command to the CLI (src/specify_cli/__init__.py)
  • Three helper functions: _detect_feature_state(), _find_features(), _generate_resume_prompt()
  • State detection: scans specs/NNN-*/ directories for spec.md, plan.md, tasks.md, checklists/
  • Task parsing: counts - [x] vs - [ ] items to determine completion percentage
  • Phase logic: specify -> plan -> tasks -> implement -> complete
  • Prompt generation: produces agent-ready text with the correct next /speckit.* command
  • Options: --feature (target specific feature), --copy (clipboard), --agent (override agent type)
  • 15 unit tests in tests/test_resume.py covering all state detection, discovery, and prompt generation paths

Testing

$ .venv/bin/python -m pytest tests/test_resume.py -v
15 passed in 0.14s

$ .venv/bin/python -m pytest tests/ -v
397 passed in 2.15s

Sample output:

Feature Status

Feature          Spec  Plan  Tasks  Progress  Phase
003-user-auth     ✓     ✓     ✓      5/8      implement

╭─── Resume Prompt: 003-user-auth ───╮
│ Continue working on feature         │
│ "003-user-auth".                    │
│                                     │
│ Current state:                      │
│ - Spec: complete                    │
│ - Plan: complete                    │
│ - Tasks: complete                   │
│ - Progress: 5/8 tasks complete,     │
│   3 remaining                       │
│                                     │
│ Remaining tasks:                    │
│ - [ ] Add password reset flow       │
│ - [ ] Write integration tests       │
│ - [ ] Update API documentation      │
│                                     │
│ Next action: /speckit.implement     │
│ Continue implementing remaining     │
│ tasks starting with: Add password   │
│ reset flow.                         │
╰─────────────────────────────────────╯

This contribution was developed with AI assistance (Claude Code).

Adds a new CLI command that scans the project for active features and
generates an agent-ready prompt to continue work where the previous
session left off. Detects spec/plan/tasks completion status and suggests
the appropriate next /speckit.* command.

Options: --feature (target specific feature), --copy (clipboard),
--agent (override agent type)

Includes 15 unit tests covering state detection, feature discovery,
and prompt generation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mvanhorn mvanhorn requested a review from mnriem as a code owner March 18, 2026 14:54
Copy link
Collaborator

@mnriem mnriem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you deliver this as an extension?

@mvanhorn
Copy link
Contributor Author

Got it - will repackage these as an extension. Closing these and will submit a PR with a bundled extension that provides resume, doctor, and validate as extension commands.

@mvanhorn mvanhorn closed this Mar 18, 2026
mvanhorn added a commit to mvanhorn/spec-kit that referenced this pull request Mar 18, 2026
…lidate

Packages three SDD utility commands as an extension per maintainer
feedback on PRs github#1892, github#1893, github#1894.

Commands:
- speckit.speckit-utils.resume: detect feature state, suggest next command
- speckit.speckit-utils.doctor: validate project health (templates, agent
  config, scripts, constitution, feature artifacts)
- speckit.speckit-utils.validate: verify spec-to-task traceability and
  check that completed tasks produced expected files

Hooks into after_specify (doctor) and after_plan (validate) optionally.

This contribution was developed with AI assistance (Claude Code).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

2 participants