Skip to content

Commit 5ec7882

Browse files
fix(extensions): tell agent to run mandatory hooks, not just emit the directive
In agent-direct invocations nothing watches agent output for the EXECUTE_COMMAND: directive, so a mandatory hook that is only emitted never runs and the failure is silent (#2730). Add one line after each mandatory-hook block instructing the agent to actually invoke the hook and wait for it before continuing. The instruction points at the command shown in the block (the `Executing:` line) rather than hardcoding `/{command}`, so it stays correct under skills-mode invocations (e.g. `$speckit-*` or `/skill:speckit-*`) where the rendered command differs. Fixes #2730
1 parent f846d65 commit 5ec7882

10 files changed

Lines changed: 20 additions & 0 deletions

File tree

templates/commands/analyze.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ 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 Goal.
4747
```
48+
After emitting the block above you MUST actually invoke the hook using the command shown in that block (the `Executing:` line) and wait for it to finish before continuing. Emitting the block alone does not run the hook.
4849
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
4950
5051
## Goal
@@ -228,6 +229,7 @@ After reporting, check if `.specify/extensions.yml` exists in the project root.
228229
Executing: `/{command}`
229230
EXECUTE_COMMAND: {command}
230231
```
232+
After emitting the block above you MUST actually invoke the hook using the command shown in that block (the `Executing:` line) and wait for it to finish before continuing. Emitting the block alone does not run the hook.
231233
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
232234
233235
## Operating Principles

templates/commands/checklist.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ You **MUST** consider the user input before proceeding (if not empty).
6666
6767
Wait for the result of the hook command before proceeding to the Execution Steps.
6868
```
69+
After emitting the block above you MUST actually invoke the hook using the command shown in that block (the `Executing:` line) and wait for it to finish before continuing. Emitting the block alone does not run the hook.
6970
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
7071
7172
## Execution Steps
@@ -363,4 +364,5 @@ Check if `.specify/extensions.yml` exists in the project root.
363364
Executing: `/{command}`
364365
EXECUTE_COMMAND: {command}
365366
```
367+
After emitting the block above you MUST actually invoke the hook using the command shown in that block (the `Executing:` line) and wait for it to finish before continuing. Emitting the block alone does not run the hook.
366368
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently

templates/commands/clarify.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ You **MUST** consider the user input before proceeding (if not empty).
4949
5050
Wait for the result of the hook command before proceeding to the Outline.
5151
```
52+
After emitting the block above you MUST actually invoke the hook using the command shown in that block (the `Executing:` line) and wait for it to finish before continuing. Emitting the block alone does not run the hook.
5253
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
5354
5455
## Outline
@@ -251,6 +252,7 @@ Check if `.specify/extensions.yml` exists in the project root.
251252
Executing: `/{command}`
252253
EXECUTE_COMMAND: {command}
253254
```
255+
After emitting the block above you MUST actually invoke the hook using the command shown in that block (the `Executing:` line) and wait for it to finish before continuing. Emitting the block alone does not run the hook.
254256
- **Optional hook** (`optional: true`):
255257
```
256258
## Extension Hooks

templates/commands/constitution.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ You **MUST** consider the user input before proceeding (if not empty).
4646
4747
Wait for the result of the hook command before proceeding to the Outline.
4848
```
49+
After emitting the block above you MUST actually invoke the hook using the command shown in that block (the `Executing:` line) and wait for it to finish before continuing. Emitting the block alone does not run the hook.
4950
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
5051
5152
## Outline
@@ -147,4 +148,5 @@ Check if `.specify/extensions.yml` exists in the project root.
147148
Executing: `/{command}`
148149
EXECUTE_COMMAND: {command}
149150
```
151+
After emitting the block above you MUST actually invoke the hook using the command shown in that block (the `Executing:` line) and wait for it to finish before continuing. Emitting the block alone does not run the hook.
150152
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently

templates/commands/converge.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ You **MUST** consider the user input before proceeding (if not empty).
4949
5050
Wait for the result of the hook command before proceeding to the Goal.
5151
```
52+
After emitting the block above you MUST actually invoke the hook using the command shown in that block (the `Executing:` line) and wait for it to finish before continuing. Emitting the block alone does not run the hook.
5253
5354
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
5455
@@ -266,5 +267,6 @@ After producing the result, check if `.specify/extensions.yml` exists in the pro
266267
Executing: `/{command}`
267268
EXECUTE_COMMAND: {command}
268269
```
270+
After emitting the block above you MUST actually invoke the hook using the command shown in that block (the `Executing:` line) and wait for it to finish before continuing. Emitting the block alone does not run the hook.
269271
270272
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently

templates/commands/implement.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ 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+
After emitting the block above you MUST actually invoke the hook using the command shown in that block (the `Executing:` line) and wait for it to finish before continuing. Emitting the block alone does not run the hook.
4849
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
4950
5051
## Outline
@@ -192,6 +193,7 @@ Check if `.specify/extensions.yml` exists in the project root.
192193
Executing: `/{command}`
193194
EXECUTE_COMMAND: {command}
194195
```
196+
After emitting the block above you MUST actually invoke the hook using the command shown in that block (the `Executing:` line) and wait for it to finish before continuing. Emitting the block alone does not run the hook.
195197
- **Optional hook** (`optional: true`):
196198
```
197199
## Extension Hooks

templates/commands/plan.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ 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+
After emitting the block above you MUST actually invoke the hook using the command shown in that block (the `Executing:` line) and wait for it to finish before continuing. Emitting the block alone does not run the hook.
5657
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
5758
5859
## Outline
@@ -91,6 +92,7 @@ Check if `.specify/extensions.yml` exists in the project root.
9192
Executing: `/{command}`
9293
EXECUTE_COMMAND: {command}
9394
```
95+
After emitting the block above you MUST actually invoke the hook using the command shown in that block (the `Executing:` line) and wait for it to finish before continuing. Emitting the block alone does not run the hook.
9496
- **Optional hook** (`optional: true`):
9597
```
9698
## Extension Hooks

templates/commands/specify.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ You **MUST** consider the user input before proceeding (if not empty).
5050
5151
Wait for the result of the hook command before proceeding to the Outline.
5252
```
53+
After emitting the block above you MUST actually invoke the hook using the command shown in that block (the `Executing:` line) and wait for it to finish before continuing. Emitting the block alone does not run the hook.
5354
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
5455
5556
## Outline
@@ -253,6 +254,7 @@ Check if `.specify/extensions.yml` exists in the project root.
253254
Executing: `/{command}`
254255
EXECUTE_COMMAND: {command}
255256
```
257+
After emitting the block above you MUST actually invoke the hook using the command shown in that block (the `Executing:` line) and wait for it to finish before continuing. Emitting the block alone does not run the hook.
256258
- **Optional hook** (`optional: true`):
257259
```
258260
## Extension Hooks

templates/commands/tasks.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ 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+
After emitting the block above you MUST actually invoke the hook using the command shown in that block (the `Executing:` line) and wait for it to finish before continuing. Emitting the block alone does not run the hook.
5758
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
5859
5960
## Outline
@@ -111,6 +112,7 @@ Check if `.specify/extensions.yml` exists in the project root.
111112
Executing: `/{command}`
112113
EXECUTE_COMMAND: {command}
113114
```
115+
After emitting the block above you MUST actually invoke the hook using the command shown in that block (the `Executing:` line) and wait for it to finish before continuing. Emitting the block alone does not run the hook.
114116
- **Optional hook** (`optional: true`):
115117
```
116118
## Extension Hooks

templates/commands/taskstoissues.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ You **MUST** consider the user input before proceeding (if not empty).
4646
4747
Wait for the result of the hook command before proceeding to the Outline.
4848
```
49+
After emitting the block above you MUST actually invoke the hook using the command shown in that block (the `Executing:` line) and wait for it to finish before continuing. Emitting the block alone does not run the hook.
4950
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
5051
5152
## Outline
@@ -100,4 +101,5 @@ Check if `.specify/extensions.yml` exists in the project root.
100101
Executing: `/{command}`
101102
EXECUTE_COMMAND: {command}
102103
```
104+
After emitting the block above you MUST actually invoke the hook using the command shown in that block (the `Executing:` line) and wait for it to finish before continuing. Emitting the block alone does not run the hook.
103105
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently

0 commit comments

Comments
 (0)