Skip to content

Commit 5339123

Browse files
fix(extensions): emit EXECUTE_COMMAND_INVOCATION in template hook examples
The dispatch-contract bullet tells the agent to self-dispatch using the EXECUTE_COMMAND_INVOCATION line, but the mandatory-hook example blocks in the templates (and the API-reference example) never emitted that line and hardcoded `Executing: /{command}`. In skills-mode sessions /{command} isn't a runnable form, so the instruction wasn't self-contained. - All 9 templates (pre- and post-hook example blocks, 18 total): emit `EXECUTE_COMMAND_INVOCATION: {invocation}` and use {invocation} for the Executing line. Define {invocation} as the environment-correct command form (usually /{command}; skills mode renders /skill:speckit-* or $speckit-*) so the placeholder is self-explaining. - EXTENSION-API-REFERENCE.md: mandatory-hook example now shows the INVOCATION line and explains {invocation}. - Test: count emitted EXECUTE_COMMAND_INVOCATION directive lines (indented, inside the fence) and require one per EXECUTE_COMMAND block, so a prose mention can't mask a missing line and templates can't regress to emitting only EXECUTE_COMMAND. Follow-up to #2730.
1 parent 6768f2b commit 5339123

11 files changed

Lines changed: 96 additions & 45 deletions

File tree

extensions/EXTENSION-API-REFERENCE.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,10 +631,14 @@ Or for mandatory hooks:
631631
632632
```markdown
633633
**Automatic Hook**: {extension}
634-
Executing: `/{command}`
634+
Executing: `{invocation}`
635635
EXECUTE_COMMAND: {command}
636+
EXECUTE_COMMAND_INVOCATION: {invocation}
636637
```
637638
639+
Here `{invocation}` is the environment-correct command form: usually `/{command}`, but
640+
skills-mode sessions render it as e.g. `/skill:speckit-*` or `$speckit-*`.
641+
638642
> **Dispatch contract**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI
639643
> orchestrators that watch agent output — emitting it does not execute anything by
640644
> itself. Because the agent cannot reliably tell whether such an orchestrator is

templates/commands/analyze.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ You **MUST** consider the user input before proceeding (if not empty).
4040
## Extension Hooks
4141
4242
**Automatic Pre-Hook**: {extension}
43-
Executing: `/{command}`
43+
Executing: `{invocation}`
4444
EXECUTE_COMMAND: {command}
45+
EXECUTE_COMMAND_INVOCATION: {invocation}
4546
4647
Wait for the result of the hook command before proceeding to the Goal.
4748
```
48-
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself, using the invocation shown on the `EXECUTE_COMMAND_INVOCATION:` line (which is the correct command form for this environment — skills mode may render it as `/skill:speckit-*` or `$speckit-*` rather than `/<command>`), and wait for its result before proceeding.
49+
- Here `{invocation}` is the command form for the current environment: usually `/{command}`, but skills-mode sessions render it differently (e.g. `/skill:speckit-*` or `$speckit-*`). Use the same value for both the `Executing:` and `EXECUTE_COMMAND_INVOCATION:` lines.
50+
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself using `{invocation}` (the value on the `EXECUTE_COMMAND_INVOCATION:` line) and wait for its result before proceeding.
4951
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
5052
5153
## Goal
@@ -226,10 +228,12 @@ After reporting, check if `.specify/extensions.yml` exists in the project root.
226228
## Extension Hooks
227229
228230
**Automatic Hook**: {extension}
229-
Executing: `/{command}`
231+
Executing: `{invocation}`
230232
EXECUTE_COMMAND: {command}
233+
EXECUTE_COMMAND_INVOCATION: {invocation}
231234
```
232-
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself, using the invocation shown on the `EXECUTE_COMMAND_INVOCATION:` line (which is the correct command form for this environment — skills mode may render it as `/skill:speckit-*` or `$speckit-*` rather than `/<command>`), and wait for its result before reporting completion.
235+
- Here `{invocation}` is the command form for the current environment: usually `/{command}`, but skills-mode sessions render it differently (e.g. `/skill:speckit-*` or `$speckit-*`). Use the same value for both the `Executing:` and `EXECUTE_COMMAND_INVOCATION:` lines.
236+
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself using `{invocation}` (the value on the `EXECUTE_COMMAND_INVOCATION:` line) and wait for its result before reporting completion.
233237
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
234238
235239
## Operating Principles

templates/commands/checklist.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,14 @@ You **MUST** consider the user input before proceeding (if not empty).
6161
## Extension Hooks
6262
6363
**Automatic Pre-Hook**: {extension}
64-
Executing: `/{command}`
64+
Executing: `{invocation}`
6565
EXECUTE_COMMAND: {command}
66+
EXECUTE_COMMAND_INVOCATION: {invocation}
6667
6768
Wait for the result of the hook command before proceeding to the Execution Steps.
6869
```
69-
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself, using the invocation shown on the `EXECUTE_COMMAND_INVOCATION:` line (which is the correct command form for this environment — skills mode may render it as `/skill:speckit-*` or `$speckit-*` rather than `/<command>`), and wait for its result before proceeding.
70+
- Here `{invocation}` is the command form for the current environment: usually `/{command}`, but skills-mode sessions render it differently (e.g. `/skill:speckit-*` or `$speckit-*`). Use the same value for both the `Executing:` and `EXECUTE_COMMAND_INVOCATION:` lines.
71+
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself using `{invocation}` (the value on the `EXECUTE_COMMAND_INVOCATION:` line) and wait for its result before proceeding.
7072
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
7173
7274
## Execution Steps
@@ -361,8 +363,10 @@ Check if `.specify/extensions.yml` exists in the project root.
361363
## Extension Hooks
362364
363365
**Automatic Hook**: {extension}
364-
Executing: `/{command}`
366+
Executing: `{invocation}`
365367
EXECUTE_COMMAND: {command}
368+
EXECUTE_COMMAND_INVOCATION: {invocation}
366369
```
367-
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself, using the invocation shown on the `EXECUTE_COMMAND_INVOCATION:` line (which is the correct command form for this environment — skills mode may render it as `/skill:speckit-*` or `$speckit-*` rather than `/<command>`), and wait for its result before reporting completion.
370+
- Here `{invocation}` is the command form for the current environment: usually `/{command}`, but skills-mode sessions render it differently (e.g. `/skill:speckit-*` or `$speckit-*`). Use the same value for both the `Executing:` and `EXECUTE_COMMAND_INVOCATION:` lines.
371+
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself using `{invocation}` (the value on the `EXECUTE_COMMAND_INVOCATION:` line) and wait for its result before reporting completion.
368372
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently

templates/commands/clarify.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,14 @@ You **MUST** consider the user input before proceeding (if not empty).
4444
## Extension Hooks
4545
4646
**Automatic Pre-Hook**: {extension}
47-
Executing: `/{command}`
47+
Executing: `{invocation}`
4848
EXECUTE_COMMAND: {command}
49+
EXECUTE_COMMAND_INVOCATION: {invocation}
4950
5051
Wait for the result of the hook command before proceeding to the Outline.
5152
```
52-
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself, using the invocation shown on the `EXECUTE_COMMAND_INVOCATION:` line (which is the correct command form for this environment — skills mode may render it as `/skill:speckit-*` or `$speckit-*` rather than `/<command>`), and wait for its result before proceeding.
53+
- Here `{invocation}` is the command form for the current environment: usually `/{command}`, but skills-mode sessions render it differently (e.g. `/skill:speckit-*` or `$speckit-*`). Use the same value for both the `Executing:` and `EXECUTE_COMMAND_INVOCATION:` lines.
54+
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself using `{invocation}` (the value on the `EXECUTE_COMMAND_INVOCATION:` line) and wait for its result before proceeding.
5355
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
5456
5557
## Outline
@@ -249,10 +251,12 @@ Check if `.specify/extensions.yml` exists in the project root.
249251
## Extension Hooks
250252
251253
**Automatic Hook**: {extension}
252-
Executing: `/{command}`
254+
Executing: `{invocation}`
253255
EXECUTE_COMMAND: {command}
256+
EXECUTE_COMMAND_INVOCATION: {invocation}
254257
```
255-
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself, using the invocation shown on the `EXECUTE_COMMAND_INVOCATION:` line (which is the correct command form for this environment — skills mode may render it as `/skill:speckit-*` or `$speckit-*` rather than `/<command>`), and wait for its result before reporting completion.
258+
- Here `{invocation}` is the command form for the current environment: usually `/{command}`, but skills-mode sessions render it differently (e.g. `/skill:speckit-*` or `$speckit-*`). Use the same value for both the `Executing:` and `EXECUTE_COMMAND_INVOCATION:` lines.
259+
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself using `{invocation}` (the value on the `EXECUTE_COMMAND_INVOCATION:` line) and wait for its result before reporting completion.
256260
- **Optional hook** (`optional: true`):
257261
```
258262
## Extension Hooks

templates/commands/constitution.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ You **MUST** consider the user input before proceeding (if not empty).
4141
## Extension Hooks
4242
4343
**Automatic Pre-Hook**: {extension}
44-
Executing: `/{command}`
44+
Executing: `{invocation}`
4545
EXECUTE_COMMAND: {command}
46+
EXECUTE_COMMAND_INVOCATION: {invocation}
4647
4748
Wait for the result of the hook command before proceeding to the Outline.
4849
```
49-
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself, using the invocation shown on the `EXECUTE_COMMAND_INVOCATION:` line (which is the correct command form for this environment — skills mode may render it as `/skill:speckit-*` or `$speckit-*` rather than `/<command>`), and wait for its result before proceeding.
50+
- Here `{invocation}` is the command form for the current environment: usually `/{command}`, but skills-mode sessions render it differently (e.g. `/skill:speckit-*` or `$speckit-*`). Use the same value for both the `Executing:` and `EXECUTE_COMMAND_INVOCATION:` lines.
51+
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself using `{invocation}` (the value on the `EXECUTE_COMMAND_INVOCATION:` line) and wait for its result before proceeding.
5052
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
5153
5254
## Outline
@@ -145,8 +147,10 @@ Check if `.specify/extensions.yml` exists in the project root.
145147
## Extension Hooks
146148
147149
**Automatic Hook**: {extension}
148-
Executing: `/{command}`
150+
Executing: `{invocation}`
149151
EXECUTE_COMMAND: {command}
152+
EXECUTE_COMMAND_INVOCATION: {invocation}
150153
```
151-
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself, using the invocation shown on the `EXECUTE_COMMAND_INVOCATION:` line (which is the correct command form for this environment — skills mode may render it as `/skill:speckit-*` or `$speckit-*` rather than `/<command>`), and wait for its result before reporting completion.
154+
- Here `{invocation}` is the command form for the current environment: usually `/{command}`, but skills-mode sessions render it differently (e.g. `/skill:speckit-*` or `$speckit-*`). Use the same value for both the `Executing:` and `EXECUTE_COMMAND_INVOCATION:` lines.
155+
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself using `{invocation}` (the value on the `EXECUTE_COMMAND_INVOCATION:` line) and wait for its result before reporting completion.
152156
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently

templates/commands/implement.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ You **MUST** consider the user input before proceeding (if not empty).
4040
## Extension Hooks
4141
4242
**Automatic Pre-Hook**: {extension}
43-
Executing: `/{command}`
43+
Executing: `{invocation}`
4444
EXECUTE_COMMAND: {command}
45+
EXECUTE_COMMAND_INVOCATION: {invocation}
4546
4647
Wait for the result of the hook command before proceeding to the Outline.
4748
```
48-
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself, using the invocation shown on the `EXECUTE_COMMAND_INVOCATION:` line (which is the correct command form for this environment — skills mode may render it as `/skill:speckit-*` or `$speckit-*` rather than `/<command>`), and wait for its result before proceeding.
49+
- Here `{invocation}` is the command form for the current environment: usually `/{command}`, but skills-mode sessions render it differently (e.g. `/skill:speckit-*` or `$speckit-*`). Use the same value for both the `Executing:` and `EXECUTE_COMMAND_INVOCATION:` lines.
50+
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself using `{invocation}` (the value on the `EXECUTE_COMMAND_INVOCATION:` line) and wait for its result before proceeding.
4951
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
5052
5153
## Outline
@@ -190,10 +192,12 @@ Check if `.specify/extensions.yml` exists in the project root.
190192
## Extension Hooks
191193
192194
**Automatic Hook**: {extension}
193-
Executing: `/{command}`
195+
Executing: `{invocation}`
194196
EXECUTE_COMMAND: {command}
197+
EXECUTE_COMMAND_INVOCATION: {invocation}
195198
```
196-
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself, using the invocation shown on the `EXECUTE_COMMAND_INVOCATION:` line (which is the correct command form for this environment — skills mode may render it as `/skill:speckit-*` or `$speckit-*` rather than `/<command>`), and wait for its result before reporting completion.
199+
- Here `{invocation}` is the command form for the current environment: usually `/{command}`, but skills-mode sessions render it differently (e.g. `/skill:speckit-*` or `$speckit-*`). Use the same value for both the `Executing:` and `EXECUTE_COMMAND_INVOCATION:` lines.
200+
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself using `{invocation}` (the value on the `EXECUTE_COMMAND_INVOCATION:` line) and wait for its result before reporting completion.
197201
- **Optional hook** (`optional: true`):
198202
```
199203
## Extension Hooks

templates/commands/plan.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,14 @@ You **MUST** consider the user input before proceeding (if not empty).
4848
## Extension Hooks
4949
5050
**Automatic Pre-Hook**: {extension}
51-
Executing: `/{command}`
51+
Executing: `{invocation}`
5252
EXECUTE_COMMAND: {command}
53+
EXECUTE_COMMAND_INVOCATION: {invocation}
5354
5455
Wait for the result of the hook command before proceeding to the Outline.
5556
```
56-
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself, using the invocation shown on the `EXECUTE_COMMAND_INVOCATION:` line (which is the correct command form for this environment — skills mode may render it as `/skill:speckit-*` or `$speckit-*` rather than `/<command>`), and wait for its result before proceeding.
57+
- Here `{invocation}` is the command form for the current environment: usually `/{command}`, but skills-mode sessions render it differently (e.g. `/skill:speckit-*` or `$speckit-*`). Use the same value for both the `Executing:` and `EXECUTE_COMMAND_INVOCATION:` lines.
58+
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself using `{invocation}` (the value on the `EXECUTE_COMMAND_INVOCATION:` line) and wait for its result before proceeding.
5759
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
5860
5961
## Outline
@@ -89,10 +91,12 @@ Check if `.specify/extensions.yml` exists in the project root.
8991
## Extension Hooks
9092
9193
**Automatic Hook**: {extension}
92-
Executing: `/{command}`
94+
Executing: `{invocation}`
9395
EXECUTE_COMMAND: {command}
96+
EXECUTE_COMMAND_INVOCATION: {invocation}
9497
```
95-
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself, using the invocation shown on the `EXECUTE_COMMAND_INVOCATION:` line (which is the correct command form for this environment — skills mode may render it as `/skill:speckit-*` or `$speckit-*` rather than `/<command>`), and wait for its result before reporting completion.
98+
- Here `{invocation}` is the command form for the current environment: usually `/{command}`, but skills-mode sessions render it differently (e.g. `/skill:speckit-*` or `$speckit-*`). Use the same value for both the `Executing:` and `EXECUTE_COMMAND_INVOCATION:` lines.
99+
- **Dispatch contract for mandatory hooks**: the `EXECUTE_COMMAND:` line is only a dispatch signal for CLI orchestrators that watch agent output — emitting it does not run anything. You MUST then invoke the hook yourself using `{invocation}` (the value on the `EXECUTE_COMMAND_INVOCATION:` line) and wait for its result before reporting completion.
96100
- **Optional hook** (`optional: true`):
97101
```
98102
## Extension Hooks

0 commit comments

Comments
 (0)