Skip to content

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

Description

@privaloops

Bug Description

scripts/bash/check-prerequisites.sh validates FEATURE_DIR, plan.md, and — under --require-taskstasks.md, each with an actionable error naming the command to run:

echo "ERROR: plan.md not found in $FEATURE_DIR" >&2
echo "Run /speckit-plan first to create the implementation plan." >&2

FEATURE_SPEC is resolved, exported in the JSON payload and printed in text mode (5 occurrences in the file), but its existence is never checked.

Both /speckit-analyze and /speckit-converge invoke the script as check-prerequisites.sh --json --require-tasks --include-tasks and then read the spec directly — SPEC = FEATURE_DIR/spec.md, followed by a "From spec.md" extraction section. When spec.md is missing, the prerequisite check passes and the failure surfaces later, without the "Run /speckit-specify first" guidance the script provides for every other artifact.

For accuracy: /speckit-implement does not read spec.md, so this affects analyze and converge.

Steps to Reproduce

  1. Create a feature, then generate plan.md and tasks.md.
  2. Delete or rename specs/<feature>/spec.md.
  3. Run .specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks.

Expected Behavior

The same treatment as plan.md and tasks.md: an explicit error pointing at /speckit-specify. If spec.md is legitimately optional for some callers, gating it behind a --require-spec flag would keep the check opt-in while still making it available to analyze and converge.

Actual Behavior

Exit 0, with FEATURE_SPEC reported as a path that does not exist. analyze and converge then fail further downstream with a less actionable error, which is precisely what this script exists to prevent.

Specify CLI Version

1.0.1 — and still present on main at the time of writing.

AI Agent

Claude (not agent-specific: the script is shared by all integrations).

Operating System

macOS — not OS-specific.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions