From aabc7c7ce4f78da681d1d77514836b75ca10765f Mon Sep 17 00:00:00 2001 From: Quratulain-bilal Date: Wed, 17 Jun 2026 10:48:09 +0500 Subject: [PATCH] fix(extensions): tell agent to run mandatory hooks, not just emit the directive In agent-direct invocations (a slash command run inside Claude Code, Cursor, etc.) nothing watches agent output for EXECUTE_COMMAND:, so a mandatory hook that is only emitted never runs and the failure is silent (#2730). Add one line after each mandatory-hook block in the command templates instructing the agent to actually invoke the hook and wait for it before continuing. Minimal version of the earlier broad change, per maintainer feedback: example blocks are left untouched; only a single instruction line is added per mandatory-hook block. Fixes #2730 --- templates/commands/analyze.md | 2 ++ templates/commands/checklist.md | 2 ++ templates/commands/clarify.md | 2 ++ templates/commands/constitution.md | 2 ++ templates/commands/implement.md | 2 ++ templates/commands/plan.md | 2 ++ templates/commands/specify.md | 2 ++ templates/commands/tasks.md | 2 ++ templates/commands/taskstoissues.md | 2 ++ 9 files changed, 18 insertions(+) diff --git a/templates/commands/analyze.md b/templates/commands/analyze.md index 5b521cf2a4..d9e3d954c1 100644 --- a/templates/commands/analyze.md +++ b/templates/commands/analyze.md @@ -45,6 +45,7 @@ You **MUST** consider the user input before proceeding (if not empty). Wait for the result of the hook command before proceeding to the Goal. ``` + After emitting the block above you MUST actually invoke the hook (run `/{command}`) and wait for it to finish before continuing — emitting `EXECUTE_COMMAND:` alone does not run it. - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently ## Goal @@ -228,6 +229,7 @@ After reporting, check if `.specify/extensions.yml` exists in the project root. Executing: `/{command}` EXECUTE_COMMAND: {command} ``` + After emitting the block above you MUST actually invoke the hook (run `/{command}`) and wait for it to finish before continuing — emitting `EXECUTE_COMMAND:` alone does not run it. - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently ## Operating Principles diff --git a/templates/commands/checklist.md b/templates/commands/checklist.md index 2e1b1040af..4d6fdaf49e 100644 --- a/templates/commands/checklist.md +++ b/templates/commands/checklist.md @@ -66,6 +66,7 @@ You **MUST** consider the user input before proceeding (if not empty). Wait for the result of the hook command before proceeding to the Execution Steps. ``` + After emitting the block above you MUST actually invoke the hook (run `/{command}`) and wait for it to finish before continuing — emitting `EXECUTE_COMMAND:` alone does not run it. - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently ## Execution Steps @@ -363,4 +364,5 @@ Check if `.specify/extensions.yml` exists in the project root. Executing: `/{command}` EXECUTE_COMMAND: {command} ``` + After emitting the block above you MUST actually invoke the hook (run `/{command}`) and wait for it to finish before continuing — emitting `EXECUTE_COMMAND:` alone does not run it. - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently diff --git a/templates/commands/clarify.md b/templates/commands/clarify.md index a83d52f026..20a34a7e08 100644 --- a/templates/commands/clarify.md +++ b/templates/commands/clarify.md @@ -49,6 +49,7 @@ You **MUST** consider the user input before proceeding (if not empty). Wait for the result of the hook command before proceeding to the Outline. ``` + After emitting the block above you MUST actually invoke the hook (run `/{command}`) and wait for it to finish before continuing — emitting `EXECUTE_COMMAND:` alone does not run it. - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently ## Outline @@ -251,6 +252,7 @@ Check if `.specify/extensions.yml` exists in the project root. Executing: `/{command}` EXECUTE_COMMAND: {command} ``` + After emitting the block above you MUST actually invoke the hook (run `/{command}`) and wait for it to finish before continuing — emitting `EXECUTE_COMMAND:` alone does not run it. - **Optional hook** (`optional: true`): ``` ## Extension Hooks diff --git a/templates/commands/constitution.md b/templates/commands/constitution.md index 29ae9a09e2..e7367d032c 100644 --- a/templates/commands/constitution.md +++ b/templates/commands/constitution.md @@ -46,6 +46,7 @@ You **MUST** consider the user input before proceeding (if not empty). Wait for the result of the hook command before proceeding to the Outline. ``` + After emitting the block above you MUST actually invoke the hook (run `/{command}`) and wait for it to finish before continuing — emitting `EXECUTE_COMMAND:` alone does not run it. - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently ## Outline @@ -147,4 +148,5 @@ Check if `.specify/extensions.yml` exists in the project root. Executing: `/{command}` EXECUTE_COMMAND: {command} ``` + After emitting the block above you MUST actually invoke the hook (run `/{command}`) and wait for it to finish before continuing — emitting `EXECUTE_COMMAND:` alone does not run it. - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently diff --git a/templates/commands/implement.md b/templates/commands/implement.md index c416fa7387..aae9d28076 100644 --- a/templates/commands/implement.md +++ b/templates/commands/implement.md @@ -45,6 +45,7 @@ You **MUST** consider the user input before proceeding (if not empty). Wait for the result of the hook command before proceeding to the Outline. ``` + After emitting the block above you MUST actually invoke the hook (run `/{command}`) and wait for it to finish before continuing — emitting `EXECUTE_COMMAND:` alone does not run it. - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently ## Outline @@ -192,6 +193,7 @@ Check if `.specify/extensions.yml` exists in the project root. Executing: `/{command}` EXECUTE_COMMAND: {command} ``` + After emitting the block above you MUST actually invoke the hook (run `/{command}`) and wait for it to finish before continuing — emitting `EXECUTE_COMMAND:` alone does not run it. - **Optional hook** (`optional: true`): ``` ## Extension Hooks diff --git a/templates/commands/plan.md b/templates/commands/plan.md index 44ab8403ac..cb6b6cf0c4 100644 --- a/templates/commands/plan.md +++ b/templates/commands/plan.md @@ -53,6 +53,7 @@ You **MUST** consider the user input before proceeding (if not empty). Wait for the result of the hook command before proceeding to the Outline. ``` + After emitting the block above you MUST actually invoke the hook (run `/{command}`) and wait for it to finish before continuing — emitting `EXECUTE_COMMAND:` alone does not run it. - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently ## Outline @@ -91,6 +92,7 @@ Check if `.specify/extensions.yml` exists in the project root. Executing: `/{command}` EXECUTE_COMMAND: {command} ``` + After emitting the block above you MUST actually invoke the hook (run `/{command}`) and wait for it to finish before continuing — emitting `EXECUTE_COMMAND:` alone does not run it. - **Optional hook** (`optional: true`): ``` ## Extension Hooks diff --git a/templates/commands/specify.md b/templates/commands/specify.md index 4558b922ae..b4f7582ac7 100644 --- a/templates/commands/specify.md +++ b/templates/commands/specify.md @@ -50,6 +50,7 @@ You **MUST** consider the user input before proceeding (if not empty). Wait for the result of the hook command before proceeding to the Outline. ``` + After emitting the block above you MUST actually invoke the hook (run `/{command}`) and wait for it to finish before continuing — emitting `EXECUTE_COMMAND:` alone does not run it. - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently ## Outline @@ -253,6 +254,7 @@ Check if `.specify/extensions.yml` exists in the project root. Executing: `/{command}` EXECUTE_COMMAND: {command} ``` + After emitting the block above you MUST actually invoke the hook (run `/{command}`) and wait for it to finish before continuing — emitting `EXECUTE_COMMAND:` alone does not run it. - **Optional hook** (`optional: true`): ``` ## Extension Hooks diff --git a/templates/commands/tasks.md b/templates/commands/tasks.md index f863e7787f..f0d24bbd51 100644 --- a/templates/commands/tasks.md +++ b/templates/commands/tasks.md @@ -54,6 +54,7 @@ You **MUST** consider the user input before proceeding (if not empty). Wait for the result of the hook command before proceeding to the Outline. ``` + After emitting the block above you MUST actually invoke the hook (run `/{command}`) and wait for it to finish before continuing — emitting `EXECUTE_COMMAND:` alone does not run it. - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently ## Outline @@ -111,6 +112,7 @@ Check if `.specify/extensions.yml` exists in the project root. Executing: `/{command}` EXECUTE_COMMAND: {command} ``` + After emitting the block above you MUST actually invoke the hook (run `/{command}`) and wait for it to finish before continuing — emitting `EXECUTE_COMMAND:` alone does not run it. - **Optional hook** (`optional: true`): ``` ## Extension Hooks diff --git a/templates/commands/taskstoissues.md b/templates/commands/taskstoissues.md index b24e84ee14..332d2411c0 100644 --- a/templates/commands/taskstoissues.md +++ b/templates/commands/taskstoissues.md @@ -46,6 +46,7 @@ You **MUST** consider the user input before proceeding (if not empty). Wait for the result of the hook command before proceeding to the Outline. ``` + After emitting the block above you MUST actually invoke the hook (run `/{command}`) and wait for it to finish before continuing — emitting `EXECUTE_COMMAND:` alone does not run it. - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently ## Outline @@ -97,4 +98,5 @@ Check if `.specify/extensions.yml` exists in the project root. Executing: `/{command}` EXECUTE_COMMAND: {command} ``` + After emitting the block above you MUST actually invoke the hook (run `/{command}`) and wait for it to finish before continuing — emitting `EXECUTE_COMMAND:` alone does not run it. - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently