You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/upgrade.md
+75-69Lines changed: 75 additions & 69 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@
12
12
|**CLI Tool — pin a version**|`specify self upgrade --tag vX.Y.Z[suffix]`| Upgrade to a specific release tag instead of the latest stable. Suffixes are limited to dev, alpha/beta/rc, and/or build metadata forms. |
13
13
|**CLI Tool — manual fallback**|`uv tool install specify-cli --force --from git+https://github.com/github/spec-kit.git@vX.Y.Z`| When `specify self upgrade` isn't available (older installs) or when you want explicit control. |
14
14
|**CLI Tool — manual fallback (pipx)**|`pipx install --force git+https://github.com/github/spec-kit.git@vX.Y.Z`| Same as above, for pipx installs. |
15
-
|**Project Files**|`specify init --here --force --integration <your-agent>`| Update slash commands, templates, and scripts in your project |
15
+
|**Project Files**|`specify integration upgrade <key>`+ `specify extension update`| Refresh installed integration files and extensions in your project |
16
16
|**Both**| Run CLI upgrade, then project update | Recommended for major version updates |
17
17
18
18
---
@@ -89,91 +89,94 @@ specify self check
89
89
90
90
## Part 2: Updating Project Files
91
91
92
-
When Spec Kit releases new features (like new slash commands or updated templates), you need to refresh your project's Spec Kit files.
92
+
When Spec Kit releases new features (like new slash commands, updated templates, or extension changes), you need to refresh the Spec Kit files that were installed into your project.
93
93
94
94
### What gets updated?
95
95
96
-
Running `specify init --here --force` will update:
96
+
For existing Spec Kit projects, use the manifest-aware upgrade path first:
- ✅ **Managed shared scripts and templates** (`.specify/scripts/`, `.specify/templates/`) when they are unchanged from the previous managed copy
100
+
- ✅ **Installed extensions** when you run `specify extension update`
101
+
102
+
The integration upgrade command uses the install manifest to detect local edits. If a managed integration file was modified after install, the command stops and asks you to inspect the change or rerun with `--force`.
102
103
103
104
### What stays safe?
104
105
105
-
These files are **never touched** by the upgrade—the template packages don't even contain them:
106
+
These files are **never touched** by the manifest-aware integration/extension upgrade path:
Replace `<your-agent>` with your AI coding agent. Refer to this list of [Supported AI Coding Agent Integrations](reference/integrations.md)
124
+
This reports the default integration, all installed integrations, and any modified or missing managed files. You can also inspect `.specify/integration.json`; installed integrations are listed under `installed_integrations`.
123
125
124
-
**Example:**
126
+
### 2. Upgrade each installed integration
127
+
128
+
Run this inside your project directory:
125
129
126
130
```bash
127
-
specify init --here --force --integration copilot
131
+
specify integration upgrade <key>
128
132
```
129
133
130
-
### Understanding the `--force` flag
134
+
Replace `<key>` with an installed integration key such as `copilot`, `claude`, or `codex`. In projects with multiple installed integrations, run the command once per installed key.
131
135
132
-
Without `--force`, the CLI warns you and asks for confirmation:
136
+
**Example:**
133
137
134
-
```text
135
-
Warning: Current directory is not empty (25 items)
136
-
Template files will be merged with existing content and may overwrite existing files
137
-
Proceed? [y/N]
138
+
```bash
139
+
specify integration upgrade claude
140
+
specify integration upgrade codex
138
141
```
139
142
140
-
With `--force`, it skips the confirmation and proceeds immediately. It also **overwrites shared infrastructure files** (`.specify/scripts/` and `.specify/templates/`) with the latest versions from the installed Spec Kit release.
143
+
See the [integration reference](reference/integrations.md#upgrade-an-integration) for options such as `--script`, `--integration-options`, and `--force`.
141
144
142
-
Without `--force`, shared infrastructure files that already exist are skipped — the CLI will print a warning listing the skipped files so you know which ones were not updated.
145
+
### 3. Update installed extensions
143
146
144
-
**Important: Your `specs/` directory is always safe.** The `--force` flag only affects template files (commands, scripts, templates, memory). Your feature specifications, plans, and tasks in `specs/` are never included in upgrade packages and cannot be overwritten.
145
-
146
-
---
147
+
Run:
147
148
148
-
## ⚠️ Important Warnings
149
+
```bash
150
+
specify extension update
151
+
```
149
152
150
-
### 1. Constitution file will be overwritten
153
+
With no extension name, this updates all installed extensions. Use `specify extension update <name>` to update only one extension. See the [extensions reference](reference/extensions.md#update-extensions) for details.
151
154
152
-
**Known issue:**`specify init --here --force` currently overwrites `.specify/memory/constitution.md` with the default template, erasing any customizations you made.
155
+
### Fallback: re-run init
153
156
154
-
**Workaround:**
157
+
If a project predates manifests, has missing integration metadata, or needs a broader recovery, you can still re-run init:
Use this as an escape hatch rather than the default project-file upgrade path. It refreshes the selected integration and shared project scaffolding, but it does not use the same per-integration manifest checks before overwriting files.
### 1. Constitution file and memory customizations
168
168
169
-
```bash
170
-
# After upgrade, restore from git history
171
-
git restore .specify/memory/constitution.md
172
-
```
169
+
`specify integration upgrade <key>` does not update `.specify/memory/constitution.md`.
170
+
171
+
The fallback `specify init --here --force --integration <your-agent>` path also preserves an existing `.specify/memory/constitution.md`; if the file is missing, init creates it from the current constitution template. You do not need a constitution backup/restore step for the manifest-aware upgrade path.
173
172
174
-
### 2. Custom script or template modifications
173
+
As with any broad fallback refresh, commit or back up local customizations before using `init --here --force` so you can review the resulting diff.
175
174
176
-
If you customized files in `.specify/scripts/` or `.specify/templates/`, the `--force` flag will overwrite them. Back them up first:
175
+
### 2. Custom integration, script, or template modifications
176
+
177
+
`specify integration upgrade <key>` blocks when manifest-tracked integration files were modified locally, unless you pass `--force`.
178
+
179
+
Shared scripts and templates are refreshed when they still match the previously recorded managed copy. Local customizations are preserved unless you explicitly use a force/refresh option that overwrites them. If you customized files in `.specify/scripts/` or `.specify/templates/`, commit or back them up first:
177
180
178
181
```bash
179
182
# Back up custom templates and scripts
@@ -215,29 +218,29 @@ Restart your IDE to refresh the command list.
215
218
# Upgrade CLI (auto-detects uv tool vs pipx install)
216
219
specify self upgrade
217
220
218
-
#Update project files to get new commands
219
-
specify init --here --force --integration copilot
221
+
#Inspect installed integrations
222
+
specify integration status
220
223
221
-
# Restore your constitution if customized
222
-
git restore .specify/memory/constitution.md
224
+
# Update project files to get new commands
225
+
specify integration upgrade <key>
226
+
specify extension update
223
227
```
224
228
225
229
### Scenario 2: "I customized templates and constitution"
- Some agents need workspace restart or cache clearing
317
320
318
-
### "I lost my constitution customizations"
321
+
### "Will init overwrite my constitution customizations?"
322
+
323
+
Current `specify init --here --force` preserves an existing `.specify/memory/constitution.md`; it creates the file from the template only when it is missing.
319
324
320
-
**Fix:** Restore from git or backup:
325
+
If you previously lost constitution changes through an older workflow or manual replacement, restore from git or backup:
**Prevention:**Always commit or back up `constitution.md` before upgrading.
335
+
**Prevention:**Use `specify integration upgrade <key>` for routine project-file updates. If you need the fallback `specify init --here --force` path, commit first so you can review the full diff afterward.
331
336
332
337
### "Warning: Current directory is not empty"
333
338
@@ -354,7 +359,7 @@ Only Spec Kit infrastructure files:
### "Do I need to run specify every time I open my project?"
420
425
421
-
**Short answer:** No, you only run `specify init` once per project (or when upgrading).
426
+
**Short answer:** No, you only run `specify init` once per project, or later as a fallback recovery path.
422
427
423
428
**Explanation:**
424
429
425
430
The `specify` CLI tool is used for:
426
431
427
432
-**Initial setup:**`specify init` to bootstrap Spec Kit in your project
428
-
-**Upgrades:**`specify init --here --force` to update templates and commands
433
+
-**Routine project-file upgrades:**`specify integration upgrade <key>` and `specify extension update`
434
+
-**Fallback recovery:**`specify init --here --force` when integration metadata is missing or the manifest-aware path cannot be used
429
435
-**Diagnostics:**`specify check` to verify tool installation
430
436
431
437
Once you've run `specify init`, the slash commands (like `/speckit.specify`, `/speckit.plan`, etc.) are **permanently installed** in your project's agent folder (`.claude/`, `.github/prompts/`, `.pi/prompts/`, `.omp/commands/`, etc.). Your AI coding agent reads these command files directly—no need to run `specify` again.
0 commit comments