Skip to content

add --require-spec to check-prerequisites - #4367

Open
HuzaifaChaudary wants to merge 1 commit into
github:mainfrom
HuzaifaChaudary:fix/check-prerequisites-require-spec
Open

add --require-spec to check-prerequisites#4367
HuzaifaChaudary wants to merge 1 commit into
github:mainfrom
HuzaifaChaudary:fix/check-prerequisites-require-spec

Conversation

@HuzaifaChaudary

Copy link
Copy Markdown

Closes #4364

problem

check-prerequisites validates FEATURE_DIR, plan.md, and tasks.md under --require-tasks, each with an error naming the command to run. it resolves FEATURE_SPEC, exports it in the json payload and prints it in text mode, but never checks that the file exists.

analyze and converge both call it and then read spec.md directly. with the spec missing the prerequisite check exits 0, and the failure surfaces later without the "run specify first" guidance the script gives for everything else, which is the thing this script exists to prevent.

fix

a --require-spec flag, shaped exactly like --require-tasks:

ERROR: spec.md not found in specs/001-my-feature
Run /speckit.specify first to create the feature specification.

it is opt in, as suggested in the issue, so nothing changes for callers that do not read the spec. analyze and converge pass it because they do.

all three variants

the flag is in bash, powershell and python. that is not gold plating, the parity tests compare help text, json output and error shapes across the three, so adding it to one would have broken them.

file change
scripts/bash/check-prerequisites.sh --require-spec
scripts/powershell/check-prerequisites.ps1 -RequireSpec
scripts/python/check_prerequisites.py --require-spec
templates/commands/analyze.md passes the flag, sh and ps
templates/commands/converge.md passes the flag, sh and ps

tests

test_python_require_spec_matches_bash covers three states across bash and python:

  • spec missing and no flag, both exit 0, so the opt in stays opt in
  • spec missing with the flag, both exit 1 with byte identical stderr
  • spec present with the flag, both exit 0 with identical json

it fails on main with ERROR: Unknown option '--require-spec'.

verification

check result
new test on main fails
new test with the change passes
full suite before 10 failed, 7135 passed
full suite after 10 failed, 7137 passed
new failures introduced none, i diffed the two failure lists
ruff check scripts tests all checks passed

the 10 pre existing failures are the composed template parity tests and are unrelated to this.


disclaimer: this contribution was prepared with the assistance of an ai agent. i reproduced the gap first, checked which callers actually read the spec, and ran the parity suite locally before opening this.

the script resolves FEATURE_SPEC and reports it but never checks that the file
is there, so analyze and converge pass the prerequisite check and then fail
later reading a spec that does not exist, without the run specify first
guidance the script gives for every other artifact

the flag is opt in so nothing changes for callers that do not read the spec.
analyze and converge pass it because they do

added to all three script variants because the parity tests compare their help
text and error output against each other
Copilot AI balanced review requested due to automatic review settings August 28, 2026 19:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

[Bug]: check-prerequisites.sh never validates spec.md although it resolves and exports FEATURE_SPEC

2 participants