Skip to content

Commit 29f29a8

Browse files
committed
docs: document manifest-aware project upgrades
Assisted-by: OpenAI Codex (model: GPT-5, autonomous)
1 parent bba473c commit 29f29a8

1 file changed

Lines changed: 75 additions & 69 deletions

File tree

docs/upgrade.md

Lines changed: 75 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
| **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. |
1313
| **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. |
1414
| **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 |
1616
| **Both** | Run CLI upgrade, then project update | Recommended for major version updates |
1717

1818
---
@@ -89,91 +89,94 @@ specify self check
8989

9090
## Part 2: Updating Project Files
9191

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.
9393

9494
### What gets updated?
9595

96-
Running `specify init --here --force` will update:
96+
For existing Spec Kit projects, use the manifest-aware upgrade path first:
9797

98-
-**Slash command files** (`.claude/commands/`, `.github/prompts/`, etc.)
99-
-**Script files** (`.specify/scripts/`) — **only with `--force`**; without it, only missing files are added
100-
-**Template files** (`.specify/templates/`) — **only with `--force`**; without it, only missing files are added
101-
-**Shared memory files** (`.specify/memory/`) - **⚠️ See warnings below**
98+
-**Integration command/skill files** (`.claude/commands/`, `.github/prompts/`, `.agents/skills/`, etc.)
99+
-**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`.
102103

103104
### What stays safe?
104105

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:
106107

107108
-**Your specifications** (`specs/001-my-feature/spec.md`, etc.) - **CONFIRMED SAFE**
108109
-**Your implementation plans** (`specs/001-my-feature/plan.md`, `tasks.md`, etc.) - **CONFIRMED SAFE**
110+
-**Your constitution** (`.specify/memory/constitution.md`) when using `specify integration upgrade`
109111
-**Your source code** - **CONFIRMED SAFE**
110112
-**Your git history** - **CONFIRMED SAFE**
111113

112114
The `specs/` directory is completely excluded from template packages and will never be modified during upgrades.
113115

114-
### Update command
116+
### 1. Check installed integrations
115117

116118
Run this inside your project directory:
117119

118120
```bash
119-
specify init --here --force --integration <your-agent>
121+
specify integration status
120122
```
121123

122-
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`.
123125

124-
**Example:**
126+
### 2. Upgrade each installed integration
127+
128+
Run this inside your project directory:
125129

126130
```bash
127-
specify init --here --force --integration copilot
131+
specify integration upgrade <key>
128132
```
129133

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.
131135

132-
Without `--force`, the CLI warns you and asks for confirmation:
136+
**Example:**
133137

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
138141
```
139142

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`.
141144

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
143146

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:
147148

148-
## ⚠️ Important Warnings
149+
```bash
150+
specify extension update
151+
```
149152

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.
151154

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
153156

154-
**Workaround:**
157+
If a project predates manifests, has missing integration metadata, or needs a broader recovery, you can still re-run init:
155158

156159
```bash
157-
# 1. Back up your constitution before upgrading
158-
cp .specify/memory/constitution.md .specify/memory/constitution-backup.md
160+
specify init --here --force --integration <your-agent>
161+
```
159162

160-
# 2. Run the upgrade
161-
specify init --here --force --integration copilot
163+
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.
162164

163-
# 3. Restore your customized constitution
164-
mv .specify/memory/constitution-backup.md .specify/memory/constitution.md
165-
```
165+
## ⚠️ Important Warnings
166166

167-
Or use git to restore it:
167+
### 1. Constitution file and memory customizations
168168

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.
173172

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.
175174

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:
177180

178181
```bash
179182
# Back up custom templates and scripts
@@ -215,29 +218,29 @@ Restart your IDE to refresh the command list.
215218
# Upgrade CLI (auto-detects uv tool vs pipx install)
216219
specify self upgrade
217220

218-
# Update project files to get new commands
219-
specify init --here --force --integration copilot
221+
# Inspect installed integrations
222+
specify integration status
220223

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
223227
```
224228

225229
### Scenario 2: "I customized templates and constitution"
226230

227231
```bash
228-
# 1. Back up customizations
229-
cp .specify/memory/constitution.md /tmp/constitution-backup.md
232+
# 1. Commit or back up customizations
233+
git status
230234
cp -r .specify/templates /tmp/templates-backup
231235

232236
# 2. Upgrade CLI
233237
specify self upgrade
234238

235-
# 3. Update project
236-
specify init --here --force --integration copilot
239+
# 3. Use the manifest-aware project update first
240+
specify integration upgrade <key>
241+
specify extension update
237242

238-
# 4. Restore customizations
239-
mv /tmp/constitution-backup.md .specify/memory/constitution.md
240-
# Manually merge template changes if needed
243+
# 4. If the upgrade reports modified managed files, inspect the diff before using --force
241244
```
242245

243246
### Scenario 3: "I see duplicate slash commands in my IDE"
@@ -262,14 +265,14 @@ rm speckit.old-command-name.md
262265
The git extension is now opt-in, so upgrades do not install it unless you add it explicitly.
263266

264267
```bash
265-
# Manually back up files you customized
266-
cp .specify/memory/constitution.md .specify/memory/constitution.backup.md
268+
# Upgrade CLI
269+
specify self upgrade
267270

268-
# Run upgrade
269-
specify init --here --force --integration copilot
271+
# Refresh integration files and installed extensions
272+
specify integration upgrade <key>
273+
specify extension update
270274

271-
# Restore customizations
272-
mv .specify/memory/constitution.backup.md .specify/memory/constitution.md
275+
# The git extension is not added unless you run `specify extension add git`
273276
```
274277

275278
If you later decide you want the git extension's commands and hooks, install it explicitly:
@@ -315,19 +318,21 @@ Alternatively, run the `/speckit.specify` command which creates `.specify/featur
315318
- Codex requires `CODEX_HOME` environment variable
316319
- Some agents need workspace restart or cache clearing
317320

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.
319324

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:
321326

322327
```bash
323-
# If you committed before upgrading
328+
# If you committed the customized constitution
324329
git restore .specify/memory/constitution.md
325330

326331
# If you backed up manually
327332
cp /tmp/constitution-backup.md .specify/memory/constitution.md
328333
```
329334

330-
**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.
331336

332337
### "Warning: Current directory is not empty"
333338

@@ -354,7 +359,7 @@ Only Spec Kit infrastructure files:
354359
- Agent command files (`.claude/commands/`, `.github/prompts/`, etc.)
355360
- Scripts in `.specify/scripts/`
356361
- Templates in `.specify/templates/`
357-
- Memory files in `.specify/memory/` (including constitution)
362+
- Missing memory files such as `.specify/memory/constitution.md` may be created from templates; an existing constitution is preserved
358363

359364
**What stays untouched:**
360365

@@ -365,7 +370,7 @@ Only Spec Kit infrastructure files:
365370

366371
**How to respond:**
367372

368-
- **Type `y` and press Enter** - Proceed with the merge (recommended if upgrading)
373+
- **Type `y` and press Enter** - Proceed with the merge when using the fallback init path
369374
- **Type `n` and press Enter** - Cancel the operation
370375
- **Use `--force` flag** - Skip this confirmation entirely:
371376

@@ -375,11 +380,11 @@ Only Spec Kit infrastructure files:
375380

376381
**When you see this warning:**
377382

378-
-**Expected** when upgrading an existing Spec Kit project
383+
-**Expected** when using the fallback init path in an existing Spec Kit project
379384
-**Expected** when adding Spec Kit to an existing codebase
380385
- ⚠️ **Unexpected** if you thought you were creating a new project in an empty directory
381386

382-
**Prevention tip:** Before upgrading, commit or back up your `.specify/memory/constitution.md` if you customized it.
387+
**Prevention tip:** Before using the fallback init path, commit your current work so any refreshed files are easy to review or restore.
383388

384389
### "CLI upgrade doesn't seem to work"
385390

@@ -418,14 +423,15 @@ uv tool install specify-cli --from git+https://github.com/github/spec-kit.git
418423

419424
### "Do I need to run specify every time I open my project?"
420425

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.
422427

423428
**Explanation:**
424429

425430
The `specify` CLI tool is used for:
426431

427432
- **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
429435
- **Diagnostics:** `specify check` to verify tool installation
430436

431437
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

Comments
 (0)