Skip to content

Commit 8d2797d

Browse files
authored
docs: add presets reference page and rename pack_id to preset_id (#2243)
- New docs/presets.md: command reference for all 9 specify preset commands and 3 specify preset catalog commands, file resolution stack with Mermaid diagrams, catalog resolution order, and FAQ - src/specify_cli/__init__.py: rename pack_id to preset_id across all preset CLI commands so --help shows PRESET_ID matching the docs - docs/toc.yml: add Presets under Reference section - README.md: update presets link to published docs site
1 parent 076bb40 commit 8d2797d

File tree

4 files changed

+275
-49
lines changed

4 files changed

+275
-49
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ specify preset add <preset-name>
526526

527527
For example, presets could restructure spec templates to require regulatory traceability, adapt the workflow to fit the methodology you use (e.g., Agile, Kanban, Waterfall, jobs-to-be-done, or domain-driven design), add mandatory security review gates to plans, enforce test-first task ordering, or localize the entire workflow to a different language. The [pirate-speak demo](https://github.com/mnriem/spec-kit-pirate-speak-preset-demo) shows just how deep the customization can go. Multiple presets can be stacked with priority ordering.
528528

529-
See the [Presets README](./presets/README.md) for the full guide, including resolution order, priority, and how to create your own.
529+
See the [Presets reference](https://github.github.io/spec-kit/presets.html) for the full command guide, including resolution order and priority stacking.
530530

531531
### When to Use Which
532532

docs/presets.md

Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
# Presets
2+
3+
Presets customize how Spec Kit works — overriding templates, commands, and terminology without changing any tooling. They let you enforce organizational standards, adapt the workflow to your methodology, or localize the entire experience. Multiple presets can be stacked with priority ordering.
4+
5+
## Search Available Presets
6+
7+
```bash
8+
specify preset search [query]
9+
```
10+
11+
| Option | Description |
12+
| ---------- | -------------------- |
13+
| `--tag` | Filter by tag |
14+
| `--author` | Filter by author |
15+
16+
Searches all active catalogs for presets matching the query. Without a query, lists all available presets.
17+
18+
## Install a Preset
19+
20+
```bash
21+
specify preset add [<preset_id>]
22+
```
23+
24+
| Option | Description |
25+
| ---------------- | -------------------------------------------------------- |
26+
| `--dev <path>` | Install from a local directory (for development) |
27+
| `--from <url>` | Install from a custom URL instead of the catalog |
28+
| `--priority <N>` | Resolution priority (default: 10; lower = higher precedence) |
29+
30+
Installs a preset from the catalog, a URL, or a local directory. Preset commands are automatically registered with the currently installed AI coding agent integration.
31+
32+
> **Note:** All preset commands require a project already initialized with `specify init`.
33+
34+
## Remove a Preset
35+
36+
```bash
37+
specify preset remove <preset_id>
38+
```
39+
40+
Removes an installed preset and cleans up its registered commands.
41+
42+
## List Installed Presets
43+
44+
```bash
45+
specify preset list
46+
```
47+
48+
Lists installed presets with their versions, descriptions, template counts, and current status.
49+
50+
## Preset Info
51+
52+
```bash
53+
specify preset info <preset_id>
54+
```
55+
56+
Shows detailed information about an installed or available preset, including its templates, metadata, and tags.
57+
58+
## Resolve a File
59+
60+
```bash
61+
specify preset resolve <name>
62+
```
63+
64+
Shows which file will be used for a given name by tracing the full resolution stack. Useful for debugging when multiple presets provide the same file.
65+
66+
## Enable / Disable a Preset
67+
68+
```bash
69+
specify preset enable <preset_id>
70+
specify preset disable <preset_id>
71+
```
72+
73+
Disable a preset without removing it. Disabled presets are skipped during file resolution but their commands remain registered. Re-enable with `enable`.
74+
75+
## Set Preset Priority
76+
77+
```bash
78+
specify preset set-priority <preset_id> <priority>
79+
```
80+
81+
Changes the resolution priority of an installed preset. Lower numbers take precedence. When multiple presets provide the same file, the one with the lowest priority number wins.
82+
83+
## Catalog Management
84+
85+
Preset catalogs control where `search` and `add` look for presets. Catalogs are checked in priority order (lower number = higher precedence).
86+
87+
### List Catalogs
88+
89+
```bash
90+
specify preset catalog list
91+
```
92+
93+
Shows all active catalogs with their priorities and install permissions.
94+
95+
### Add a Catalog
96+
97+
```bash
98+
specify preset catalog add <url>
99+
```
100+
101+
| Option | Description |
102+
| -------------------------------------------- | -------------------------------------------------- |
103+
| `--name <name>` | Required. Unique name for the catalog |
104+
| `--priority <N>` | Priority (default: 10; lower = higher precedence) |
105+
| `--install-allowed / --no-install-allowed` | Whether presets can be installed from this catalog (default: discovery only) |
106+
| `--description <text>` | Optional description |
107+
108+
Adds a catalog to the project's `.specify/preset-catalogs.yml`.
109+
110+
### Remove a Catalog
111+
112+
```bash
113+
specify preset catalog remove <name>
114+
```
115+
116+
Removes a catalog from the project configuration.
117+
118+
### Catalog Resolution Order
119+
120+
Catalogs are resolved in this order (first match wins):
121+
122+
1. **Environment variable**`SPECKIT_PRESET_CATALOG_URL` overrides all catalogs
123+
2. **Project config**`.specify/preset-catalogs.yml`
124+
3. **User config**`~/.specify/preset-catalogs.yml`
125+
4. **Built-in defaults** — official catalog + community catalog
126+
127+
Example `.specify/preset-catalogs.yml`:
128+
129+
```yaml
130+
catalogs:
131+
- name: "my-org-presets"
132+
url: "https://example.com/preset-catalog.json"
133+
priority: 5
134+
install_allowed: true
135+
description: "Our approved presets"
136+
```
137+
138+
## File Resolution
139+
140+
Presets can provide command files, template files (like `plan-template.md`), and script files. These are resolved at runtime using a **replace** strategy — the first match in the priority stack wins and is used entirely. Each file is looked up independently, so different files can come from different layers.
141+
142+
> **Note:** Additional composition strategies (`append`, `prepend`, `wrap`) are planned for a future release.
143+
144+
The resolution stack, from highest to lowest precedence:
145+
146+
1. **Project-local overrides** — `.specify/templates/overrides/`
147+
2. **Installed presets** — sorted by priority (lower = checked first)
148+
3. **Installed extensions** — sorted by priority
149+
4. **Spec Kit core** — `.specify/templates/`
150+
151+
Commands are registered at install time (not resolved through the stack at runtime).
152+
153+
### Resolution Stack
154+
155+
```mermaid
156+
flowchart TB
157+
subgraph stack [" "]
158+
direction TB
159+
A["⬆ Highest precedence<br/><br/>1. Project-local overrides<br/>.specify/templates/overrides/"]
160+
B["2. Presets — by priority<br/>.specify/presets/‹id›/"]
161+
C["3. Extensions — by priority<br/>.specify/extensions/‹id›/"]
162+
D["4. Spec Kit core<br/>.specify/templates/<br/><br/>⬇ Lowest precedence"]
163+
end
164+
165+
A --> B --> C --> D
166+
167+
style A fill:#4a9,color:#fff
168+
style B fill:#49a,color:#fff
169+
style C fill:#a94,color:#fff
170+
style D fill:#999,color:#fff
171+
```
172+
173+
Within each layer, files are organized by type:
174+
175+
| Type | Subdirectory | Override path |
176+
| --------- | -------------- | ------------------------------------------ |
177+
| Templates | `templates/` | `.specify/templates/overrides/` |
178+
| Commands | `commands/` | `.specify/templates/overrides/` |
179+
| Scripts | `scripts/` | `.specify/templates/overrides/scripts/` |
180+
181+
### Resolution in Action
182+
183+
```mermaid
184+
flowchart TB
185+
A["File requested:<br/>plan-template.md"] --> B{"Project-local override?"}
186+
B -- Found --> Z["✓ Use this file"]
187+
B -- Not found --> C{"Preset: compliance<br/>(priority 5)"}
188+
C -- Found --> Z
189+
C -- Not found --> D{"Preset: team-workflow<br/>(priority 10)"}
190+
D -- Found --> Z
191+
D -- Not found --> E{"Extension files?"}
192+
E -- Found --> Z
193+
E -- Not found --> F["Spec Kit core"]
194+
F --> Z
195+
```
196+
197+
### Example
198+
199+
```bash
200+
specify preset add compliance --priority 5
201+
specify preset add team-workflow --priority 10
202+
```
203+
204+
For any file that both provide, `compliance` wins (priority 5 < 10). For files only one provides, that one is used. For files neither provides, the core default is used.
205+
206+
## FAQ
207+
208+
### Can I use multiple presets at the same time?
209+
210+
Yes. Presets stack by priority — each file is resolved independently from the highest-priority source that provides it. Use `specify preset set-priority` to control the order.
211+
212+
### How do I see which file is actually being used?
213+
214+
Run `specify preset resolve <name>` to trace the resolution stack and see which file wins.
215+
216+
### What's the difference between disabling and removing a preset?
217+
218+
**Disabling** (`specify preset disable`) keeps the preset installed but excludes its files from the resolution stack. Commands the preset registered remain available in your AI coding agent. This is useful for temporarily testing behavior without a preset, or comparing output with and without it. Re-enable anytime with `specify preset enable`.
219+
220+
**Removing** (`specify preset remove`) fully uninstalls the preset — deletes its files, unregisters its commands from your AI coding agent, and removes it from the registry.
221+
222+
### Who maintains presets?
223+
224+
Most presets are independently created and maintained by their respective authors. The Spec Kit maintainers do not review, audit, endorse, or support preset code. Review a preset's source code before installing and use at your own discretion. For issues with a specific preset, contact its author or file an issue on the preset's repository.

docs/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
href: integrations.md
2020
- name: Extensions
2121
href: extensions.md
22+
- name: Presets
23+
href: presets.md
2224

2325
# Development workflows
2426
- name: Development

0 commit comments

Comments
 (0)