Skip to content

feat: implement read-only what-if analysis command#2182

Open
DevAbdullah90 wants to merge 2 commits intogithub:mainfrom
DevAbdullah90:feat/what-if-analysis
Open

feat: implement read-only what-if analysis command#2182
DevAbdullah90 wants to merge 2 commits intogithub:mainfrom
DevAbdullah90:feat/what-if-analysis

Conversation

@DevAbdullah90
Copy link
Copy Markdown

Description

This PR implements a new /speckit.whatif command that provides a read-only "What-if" analysis for requirement changes. This feature enables teams to preview the downstream impact (complexity, effort, tasks, and risks) of a specification change before committing any changes to the project files.

Key Features:

  • Complexity Delta: Calculates a heuristic-based complexity score (1-100) comparing the current state to the simulated post-change state.
  • Effort Estimation: Provides a person-hour estimate to implement the proposed change.
  • Task Diff: Identifies which tasks would be [ADDED], [REMOVED], or [CHANGED] based on the new requirements.
  • Risk Assessment: Highlights potential technical debt, breaking changes, or conflicts with the project's constitution.
  • Side-by-Side Preview: Generates a simulated diff preview for the most significantly impacted artifacts.

Testing

  • Tested locally with specify version and specify init.
  • Verified that the new /speckit.whatif command appears correctly in the Enhancement Commands panel during project setup.
  • Verified that command templates (e.g., speckit.whatif.agent.md) are correctly generated in the agent's integration folder.
  • Confirmed the execution is strictly read-only and does not modify any local files.

AI Disclosure

  • I did use AI assistance (Antigravity) for this contribution.
  • Description: The AI helped design the prompt logic for the whatif.md template, updated the Python CLI metadata for command registration, and assisted in revising the documentation to include the new command.

Fixes #2176

@DevAbdullah90 DevAbdullah90 requested a review from mnriem as a code owner April 11, 2026 22:09
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.

[Feature]: What-if analysis for spec requirement changes

1 participant