Summary
A project can end up with a current integration wrapper but a stale vendored copy of .specify/scripts/bash/update-agent-context.sh (and related shared scripts). In that state, newer integrations like pi appear installed and supported by the CLI, but update-context still fails inside the project because the repo-local shared script is older and does not recognize the integration key.
What I observed
In a project initialized with the pi integration:
specify integration list showed pi as installed and supported
.specify/integrations/pi/scripts/update-context.sh existed and delegated to:
.specify/scripts/bash/update-agent-context.sh pi
- but the repo-local
.specify/scripts/bash/update-agent-context.sh was an older vendored copy that did not include pi in its supported agent list
Result:
.specify/integrations/pi/scripts/update-context.sh
# ...
# ERROR: Unknown agent type 'pi'
The installed CLI/core pack already supported pi; the failure was caused by the project's vendored shared scripts being out of sync with the CLI version.
Why this is surprising
A user can reasonably expect one of these to repair the project:
specify integration install pi
specify integration switch pi
- reinstalling/upgrading
specify
But the shared infra installer explicitly merges missing files without overwriting existing ones. So if .specify/scripts/bash/update-agent-context.sh already exists, it is preserved even if it is stale. That leaves the project in a partially upgraded state:
- integration metadata/wrapper: new
- shared vendored
.specify/scripts/*: old
Impact
update-context can fail for newly added integrations
- behavior can diverge from the installed
specify CLI version
- users may think the integration itself is broken when the real issue is stale shared infra in the project
Reproduction shape
I don't have a minimal public repro repo, but the failure mode is roughly:
- Create/init a project with an older vendored
.specify/scripts/bash/update-agent-context.sh
- Upgrade/install a newer
specify CLI that supports a new integration such as pi
- Have the project contain the current
pi integration wrapper under .specify/integrations/pi/scripts/update-context.sh
- Run:
.specify/integrations/pi/scripts/update-context.sh
- Observe
Unknown agent type 'pi' from the stale repo-local shared script
Expected behavior
Spec Kit should provide a supported way to avoid or repair this drift. Examples:
-
Drift detection
- warn when project vendored shared infra is older/incompatible with the installed CLI/integration set
-
Refresh command or flag
- e.g. a supported command to refresh shared
.specify/scripts and templates from the current core pack
- or a
--refresh-shared-infra / --overwrite-shared-infra option for integration install/switch
-
Compatibility guard
- before running an integration wrapper, detect when the delegated shared script does not support the current integration key and emit a more actionable error
Related issues
This seems adjacent to, but not the same as:
Those cover switching/docs/script bugs, but not the specific stale vendored shared infra causing new integrations to fail despite CLI support case.
Suggested direction
At minimum, it would help to document clearly that integration install/switch does not overwrite existing shared infra and can leave stale project-local .specify/scripts/* in place. A first-class refresh/drift-check mechanism would be even better.
Summary
A project can end up with a current integration wrapper but a stale vendored copy of
.specify/scripts/bash/update-agent-context.sh(and related shared scripts). In that state, newer integrations likepiappear installed and supported by the CLI, butupdate-contextstill fails inside the project because the repo-local shared script is older and does not recognize the integration key.What I observed
In a project initialized with the
piintegration:specify integration listshowedpias installed and supported.specify/integrations/pi/scripts/update-context.shexisted and delegated to:.specify/scripts/bash/update-agent-context.sh pi.specify/scripts/bash/update-agent-context.shwas an older vendored copy that did not includepiin its supported agent listResult:
The installed CLI/core pack already supported
pi; the failure was caused by the project's vendored shared scripts being out of sync with the CLI version.Why this is surprising
A user can reasonably expect one of these to repair the project:
specify integration install pispecify integration switch pispecifyBut the shared infra installer explicitly merges missing files without overwriting existing ones. So if
.specify/scripts/bash/update-agent-context.shalready exists, it is preserved even if it is stale. That leaves the project in a partially upgraded state:.specify/scripts/*: oldImpact
update-contextcan fail for newly added integrationsspecifyCLI versionReproduction shape
I don't have a minimal public repro repo, but the failure mode is roughly:
.specify/scripts/bash/update-agent-context.shspecifyCLI that supports a new integration such aspipiintegration wrapper under.specify/integrations/pi/scripts/update-context.shUnknown agent type 'pi'from the stale repo-local shared scriptExpected behavior
Spec Kit should provide a supported way to avoid or repair this drift. Examples:
Drift detection
Refresh command or flag
.specify/scriptsand templates from the current core pack--refresh-shared-infra/--overwrite-shared-infraoption for integration install/switchCompatibility guard
Related issues
This seems adjacent to, but not the same as:
update-agent-contextbugsThose cover switching/docs/script bugs, but not the specific stale vendored shared infra causing new integrations to fail despite CLI support case.
Suggested direction
At minimum, it would help to document clearly that integration install/switch does not overwrite existing shared infra and can leave stale project-local
.specify/scripts/*in place. A first-class refresh/drift-check mechanism would be even better.