Skip to content

Commit 26eb793

Browse files
committed
feat: align extension hooks documentation and templates for specify/plan (#1788)
- Update EXTENSION-API-REFERENCE.md to reflect current hook implementation status. - Add before_tasks and before_implement hooks to EXTENSION-DEVELOPMENT-GUIDE.md. - Standardize CRITICAL execution instructions for mandatory hooks across all templates (specify, plan, tasks, implement). - Sync documentation versions and pyproject.toml to 0.2.1 to match upstream. - Update Last Updated dates in extension guides.
1 parent 4064b02 commit 26eb793

8 files changed

Lines changed: 62 additions & 33 deletions

File tree

extensions/EXTENSION-API-REFERENCE.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,12 @@ Examples:
539539

540540
```yaml
541541
hooks:
542+
before_specify:
543+
command: "speckit.research.pre-spec"
544+
optional: true
545+
prompt: "Perform pre-specification research?"
546+
description: "Search context before writing spec"
547+
542548
after_tasks:
543549
command: "speckit.jira.specstoissues"
544550
optional: true
@@ -551,17 +557,30 @@ hooks:
551557

552558
Standard events (defined by core):
553559

560+
- `before_specify` - Before specification generation
561+
- `after_specify` - After specification generation
562+
- `before_plan` - Before implementation planning
563+
- `after_plan` - After implementation planning
564+
- `before_tasks` - Before task generation
554565
- `after_tasks` - After task generation
566+
- `before_implement` - Before implementation
555567
- `after_implement` - After implementation
556-
- `before_commit` - Before git commit
557-
- `after_commit` - After git commit
568+
- `before_commit` - Before git commit (future)
569+
- `after_commit` - After git commit (future)
558570

559571
### Hook Configuration
560572

561573
**In `.specify/extensions.yml`**:
562574

563575
```yaml
564576
hooks:
577+
before_specify:
578+
- extension: research
579+
command: speckit.research.pre-spec
580+
enabled: true
581+
optional: true
582+
prompt: "Perform pre-specification research?"
583+
565584
after_tasks:
566585
- extension: jira
567586
command: speckit.jira.specstoissues
@@ -591,6 +610,8 @@ Or for mandatory hooks:
591610
**Automatic Hook**: {extension}
592611
Executing: `/{command}`
593612
EXECUTE_COMMAND: {command}
613+
614+
**CRITICAL**: You MUST execute the command above immediately after outputting it. Do not end the response until the hook has been triggered.
594615
```
595616

596617
---
@@ -811,6 +832,6 @@ satisfied = version_satisfies("1.2.3", ">=1.0.0,<2.0.0") # bool
811832

812833
---
813834

814-
*Last Updated: 2026-01-28*
835+
*Last Updated: 2026-03-13*
815836
*API Version: 1.0*
816-
*Spec Kit Version: 0.1.0*
837+
*Spec Kit Version: 0.2.1*

extensions/EXTENSION-DEVELOPMENT-GUIDE.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ Available hook points:
203203
- `before_tasks`: Before `/speckit.tasks` starts
204204
- `after_tasks`: After `/speckit.tasks` completes
205205
- `before_implement`: Before `/speckit.implement` starts
206-
- `after_implement`: After `/speckit.implement` completes (future)
206+
- `after_implement`: After `/speckit.implement` completes
207207

208208
Hook object:
209209

@@ -645,11 +645,25 @@ echo "Using endpoint: $endpoint"
645645

646646
### Extension with Hooks
647647

648-
Extension that runs automatically:
648+
Extension that runs automatically at different lifecycle stages:
649649

650650
```yaml
651651
# extension.yml
652652
hooks:
653+
# Pre-hook: runs before specification starts
654+
before_specify:
655+
command: "speckit.research.pre-spec"
656+
optional: true
657+
prompt: "Perform pre-specification research?"
658+
description: "Gather context from codebase before writing spec"
659+
660+
# Post-hook: runs after planning completes
661+
after_plan:
662+
command: "speckit.architect.validate"
663+
optional: false # Mandatory execution
664+
description: "Validate architecture against project standards"
665+
666+
# Post-hook: runs after task generation
653667
after_tasks:
654668
command: "speckit.auto.analyze"
655669
optional: false # Always run

extensions/EXTENSION-USER-GUIDE.md

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ Extensions are modular packages that add new commands and functionality to Spec
4040

4141
### Prerequisites
4242

43-
- Spec Kit version 0.1.0 or higher
43+
- Spec Kit version 0.2.1 or higher
4444
- A spec-kit project (directory with `.specify/` folder)
4545

4646
### Check Your Version
4747

4848
```bash
4949
specify version
50-
# Should show 0.1.0 or higher
50+
# Should show 0.2.1 or higher
5151
```
5252

5353
### First Extension
@@ -388,28 +388,6 @@ settings:
388388
389389
# Hook configuration
390390
hooks:
391-
before_specify:
392-
- extension: contextual-research
393-
command: speckit.research.pre-spec
394-
enabled: true
395-
optional: true
396-
prompt: "Perform pre-specification research?"
397-
after_specify:
398-
- extension: linter
399-
command: speckit.linter.check-spec
400-
enabled: true
401-
optional: false
402-
before_plan:
403-
- extension: setup-env
404-
command: speckit.env.prepare
405-
enabled: true
406-
optional: false
407-
after_plan:
408-
- extension: architect
409-
command: speckit.architect.validate-plan
410-
enabled: true
411-
optional: true
412-
prompt: "Validate architecture before proceeding?"
413391
after_tasks:
414392
- extension: jira
415393
command: speckit.jira.specstoissues
@@ -988,5 +966,5 @@ After creating tasks, sync to Jira:
988966

989967
---
990968

991-
*Last Updated: 2026-01-28*
992-
*Spec Kit Version: 0.1.0*
969+
*Last Updated: 2026-03-13*
970+
*Spec Kit Version: 0.2.1*

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "specify-cli"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
description = "Specify CLI, part of GitHub Spec Kit. A tool to bootstrap your projects for Spec-Driven Development (SDD)."
55
requires-python = ">=3.11"
66
dependencies = [

templates/commands/implement.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ You **MUST** consider the user input before proceeding (if not empty).
4545
4646
Wait for the result of the hook command before proceeding to the Outline.
4747
```
48+
49+
**CRITICAL**: You MUST execute the command above immediately after outputting it. Do not proceed until the hook has been triggered.
4850
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
4951
5052
## Outline
@@ -198,4 +200,6 @@ Note: This command assumes a complete task breakdown exists in tasks.md. If task
198200
Executing: `/{command}`
199201
EXECUTE_COMMAND: {command}
200202
```
203+
204+
**CRITICAL**: You MUST execute the command above immediately after outputting it. Do not end the response until the hook has been triggered.
201205
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently

templates/commands/plan.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ You **MUST** consider the user input before proceeding (if not empty).
5656
5757
Wait for the result of the hook command before proceeding to the Outline.
5858
```
59+
60+
**CRITICAL**: You MUST execute the command above immediately after outputting it. Do not proceed until the hook has been triggered.
5961
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
6062
6163
## Outline
@@ -102,6 +104,8 @@ You **MUST** consider the user input before proceeding (if not empty).
102104
Executing: `/{command}`
103105
EXECUTE_COMMAND: {command}
104106
```
107+
108+
**CRITICAL**: You MUST execute the command above immediately after outputting it. Do not end the response until the hook has been triggered.
105109
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
106110
107111
## Phases

templates/commands/specify.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ You **MUST** consider the user input before proceeding (if not empty).
5353
5454
Wait for the result of the hook command before proceeding to the Outline.
5555
```
56+
57+
**CRITICAL**: You MUST execute the command above immediately after outputting it. Do not proceed until the hook has been triggered.
5658
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
5759
5860
## Outline
@@ -237,6 +239,8 @@ Given that feature description, do this:
237239
Executing: `/{command}`
238240
EXECUTE_COMMAND: {command}
239241
```
242+
243+
**CRITICAL**: You MUST execute the command above immediately after outputting it. Do not end the response until the hook has been triggered.
240244
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
241245
242246
**NOTE:** The script creates and checks out the new branch and initializes the spec file before writing.

templates/commands/tasks.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ You **MUST** consider the user input before proceeding (if not empty).
5454
5555
Wait for the result of the hook command before proceeding to the Outline.
5656
```
57+
58+
**CRITICAL**: You MUST execute the command above immediately after outputting it. Do not proceed until the hook has been triggered.
5759
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
5860
5961
## Outline
@@ -124,6 +126,8 @@ You **MUST** consider the user input before proceeding (if not empty).
124126
Executing: `/{command}`
125127
EXECUTE_COMMAND: {command}
126128
```
129+
130+
**CRITICAL**: You MUST execute the command above immediately after outputting it. Do not end the response until the hook has been triggered.
127131
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
128132
129133
Context for task generation: {ARGS}

0 commit comments

Comments
 (0)