Skip to content

Shell scripts: paths-only validates branch and setup-plan can overwrite plan.md #2653

@flamerged

Description

@flamerged

I found two shell-script behaviors in current main at 51e6a14 while vendoring Spec Kit into a repo and testing the generated Claude integration.

1. check-prerequisites.sh --paths-only still validates branch name

The help text says --paths-only should output path variables with no prerequisite validation. The Claude /speckit-clarify skill also calls:

.specify/scripts/bash/check-prerequisites.sh --json --paths-only

But check_feature_branch "$CURRENT_BRANCH" "$HAS_GIT" runs before the PATHS_ONLY early exit. In a normal non-Spec branch, --paths-only can fail before returning paths.

Suggested fix: move branch validation after the PATHS_ONLY block.

2. setup-plan.sh overwrites existing plan.md

setup-plan.sh unconditionally copies the plan template to $IMPL_PLAN:

cp "$TEMPLATE" "$IMPL_PLAN"

On reruns this can overwrite an already authored implementation plan.

Suggested fix: only copy/touch when $IMPL_PLAN does not exist, unless an explicit force mode is added. Also send status messages to stderr in --json mode so stdout remains parseable JSON.

I tested equivalent local patches in a temp Spec Kit directory:

  • check-prerequisites.sh --json --paths-only returns JSON on a normal branch.
  • setup-plan.sh --json preserves an existing plan.md.
  • setup-plan.sh --json creates a missing plan.md and still emits parseable JSON.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions