Skip to content

[Bug]: specify init --here --force does not update existing .specify/scripts or .specify/templates files (upgrade instructions misleading) #2319

@brooke-hamilton

Description

@brooke-hamilton

Bug Description

When following the upgrade guide and running:

specify init --here --force --ai copilot

...the CLI does NOT update any existing files under .specify/scripts/ or .specify/templates/, even if there are newer versions of scripts/templates available. Only missing files are added. This contradicts the upgrade documentation, which instructs users to use init as the mechanism to update project files after an upgrade.

This leads to users being stuck on old scripts and templates, without an obvious way to safely receive updates from new releases unless they manually delete/replace directories.

Steps to Reproduce

  1. Install/upgrade to specify-cli 0.7.4 (latest)

  2. In a project with existing .specify/scripts/ and/or .specify/templates/, run:

    specify init --here --force --ai copilot

  3. Observe that files in those folders are not changed (no updates from the latest release)

  4. Compare contents of .specify/scripts/ or .specify/templates/ to a newly created project (or reference repo) and see that old files remained.

Expected Behavior

Running the upgrade instructions (specify init --here --force --ai copilot) should update all managed/shared infrastructure files to the latest version—including all .specify/scripts and .specify/templates files, so projects receive improvements and fixes in those scripts and templates after upgrading Spec Kit. At the least, the docs should reflect what will (and won't) update, and provide a migration path for shared infra.

Actual Behavior

Existing files in .specify/scripts/ and .specify/templates/ are not overwritten or updated—no matter what. Only new (missing) files are added, and existing ones are skipped.

There is no CLI flag or documented mechanism to force a refresh of those files (without manual deletion). The upgrade documentation does not warn users about this, leading to confusion and missed bugfixes or features that are distributed via shared scripts/templates.

Specify CLI Version

0.7.4

AI Agent

GitHub Copilot

Operating System

Linux

Python Version

3.12.3

Error Logs

Additional Context

Root cause: The _install_shared_infra() function (used by init) explicitly skips copying over any script or template file if it already exists, regardless of the --force flag. Only missing files are installed. See src/specify_cli/__init__.py.

This means users cannot receive upstream fixes, enhancements, or bugfixes to shared scripts or templates after their first project initialization (unless they delete those folders/files manually). The specify integration upgrade command also does not update shared infra, only integration-managed files.

Suggestion:

  • Either:
    • Document the current behavior clearly and provide users a safe refresh workaround
    • Or, provide a new CLI flag (e.g., --force-shared or --overwrite-shared-infra) to allow overwriting shared scripts/templates on upgrade/init
  • Optionally, add a warning during init/upgrade when skipping out-of-date files so users know they missed an update

Reference: see conversation and analysis in issue creation

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