You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(agents): add pre-execution checks for extension hooks in all agents
- Implemented pre-execution checks for extension hooks in speckit.clarify, speckit.implement, speckit.plan, speckit.specify, speckit.tasks agents.
- Updated the outline sections to include checks for `.specify/extensions.yml` and handle optional/mandatory hooks.
- Enhanced the prompt files to reflect changes in execution requirements from GitHub Copilot to AI Assistant.
- Version bump to 1.6.1 in prompt files.
Copy file name to clipboardExpand all lines: .claude/commands/speckit.checklist.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,9 +91,10 @@ You **MUST** consider the user input before proceeding (if not empty).
91
91
- Generate unique checklist filename:
92
92
- Use short, descriptive name based on domain (e.g., `ux.md`, `api.md`, `security.md`)
93
93
- Format: `[domain].md`
94
-
- If file exists, append to existing file
95
-
- Number items sequentially starting from CHK001
96
-
- Each `/speckit.checklist` run creates a NEW file (never overwrites existing checklists)
94
+
- File handling behavior:
95
+
- If file does NOT exist: Create new file and number items starting from CHK001
96
+
- If file exists: Append new items to existing file, continuing from the last CHK ID (e.g., if last item is CHK015, start new items at CHK016)
97
+
- Never delete or replace existing checklist content - always preserve and append
97
98
98
99
**CORE PRINCIPLE - Test the Requirements, Not the Implementation**:
99
100
Every checklist item MUST evaluate the REQUIREMENTS THEMSELVES for:
@@ -205,13 +206,13 @@ You **MUST** consider the user input before proceeding (if not empty).
205
206
206
207
6.**Structure Reference**: Generate the checklist following the canonical template in `.specify/templates/checklist-template.md` for title, meta section, category headings, and ID formatting. If template is unavailable, use: H1 title, purpose/created meta lines, `##` category sections containing `- [ ] CHK### <requirement item>` lines with globally incrementing IDs starting at CHK001.
207
208
208
-
7.**Report**: Output full path to created checklist, item count, and remind user that each run creates a new file. Summarize:
209
+
7.**Report**: Output full path to checklist file, item count, and summarize whether the run created a new file or appended to an existing one. Summarize:
209
210
- Focus areas selected
210
211
- Depth level
211
212
- Actor/timing
212
213
- Any explicit user-specified must-have items incorporated
213
214
214
-
**Important**: Each `/speckit.checklist` command invocation creates a checklist file using short, descriptive names unless file already exists. This allows:
215
+
**Important**: Each `/speckit.checklist` command invocation uses a short, descriptive checklist filename and either creates a new file or appends to an existing one. This allows:
215
216
216
217
- Multiple checklists of different types (e.g., `ux.md`, `test.md`, `security.md`)
217
218
- Simple, memorable filenames that indicate checklist purpose
Copy file name to clipboardExpand all lines: .claude/commands/speckit.clarify.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,7 @@ Execution steps:
86
86
- Information is better deferred to planning phase (note internally)
87
87
88
88
3. Generate (internally) a prioritized queue of candidate clarification questions (maximum 5). Do NOT output them all at once. Apply these constraints:
89
-
- Maximum of 10 total questions across the whole session.
89
+
- Maximum of 5 total questions across the whole session.
90
90
- Each question must be answerable with EITHER:
91
91
- A short multiple‑choice selection (2–5 distinct, mutually exclusive options), OR
92
92
- A one-word / short‑phrase answer (explicitly constrain: "Answer in <=5 words").
Copy file name to clipboardExpand all lines: .claude/commands/speckit.implement.md
+82-10Lines changed: 82 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ You **MUST** adhere to the following mandatory requirements when implementing fe
10
10
-**Output:** Working code with passing tests
11
11
-**Verification:** Execute Show & Tell steps after each phase
12
12
13
-
**Base requirements:** Follow all rules in [copilot-instructions.md](/.github/copilot-instructions.md), particularly:
13
+
**Base requirements:** Follow all rules in [CLAUDE.md](/.claude/CLAUDE.md), particularly:
14
14
15
15
- Repository Tooling
16
16
- Test-Driven Development
@@ -28,10 +28,10 @@ You **MUST** adhere to the following mandatory requirements when implementing fe
28
28
Before marking implementation as complete, verify:
29
29
30
30
-[ ] All tasks in `tasks.md` are completed
31
-
-[ ] Each repository-template capability that was planned to be implemented using the skill at [.github/skills/repository-template/SKILL.md](/.github/skills/repository-template/SKILL.md) is completed
31
+
-[ ] Each repository-template capability that was planned to be implemented using the skill at [.claude/skills/repository-template/SKILL.md](/.claude/skills/repository-template/SKILL.md) is completed
32
32
-[ ] TDD was followed: tests written before implementation
33
33
-[ ] All `Show & Tell` steps executed successfully for each phase
34
-
-[ ] Repository-template capabilities are present and up to date (see [.github/skills/repository-template/SKILL.md](/.github/skills/repository-template/SKILL.md))
34
+
-[ ] Repository-template capabilities are present and up to date (see [.claude/skills/repository-template/SKILL.md](/.claude/skills/repository-template/SKILL.md))
35
35
-[ ]`make lint` and `make test` complete with zero errors and zero warnings
36
36
37
37
## User Input
@@ -42,6 +42,45 @@ $ARGUMENTS
42
42
43
43
You **MUST** consider the user input before proceeding (if not empty).
44
44
45
+
## Pre-Execution Checks
46
+
47
+
**Check for extension hooks (before implementation)**:
48
+
49
+
- Check if `.specify/extensions.yml` exists in the project root.
50
+
- If it exists, read it and look for entries under the `hooks.before_implement` key
51
+
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
52
+
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
53
+
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
54
+
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
55
+
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
56
+
- For each executable hook, output the following based on its `optional` flag:
57
+
-**Optional hook** (`optional: true`):
58
+
59
+
```
60
+
## Extension Hooks
61
+
62
+
**Optional Pre-Hook**: {extension}
63
+
Command: `/{command}`
64
+
Description: {description}
65
+
66
+
Prompt: {prompt}
67
+
To execute: `/{command}`
68
+
```
69
+
70
+
- **Mandatory hook** (`optional: false`):
71
+
72
+
```
73
+
## Extension Hooks
74
+
75
+
**Automatic Pre-Hook**: {extension}
76
+
Executing: `/{command}`
77
+
EXECUTE_COMMAND: {command}
78
+
79
+
Wait for the result of the hook command before proceeding to the Outline.
80
+
```
81
+
82
+
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
83
+
45
84
## Outline
46
85
47
86
1. Run `.specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute. For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
@@ -95,12 +134,12 @@ You **MUST** consider the user input before proceeding (if not empty).
95
134
git rev-parse --git-dir 2>/dev/null
96
135
```
97
136
98
-
- Check if Dockerfile* exists or Docker in plan.md → create/verify .dockerignore
99
-
- Check if .eslintrc* exists → create/verify .eslintignore
100
-
- Check if eslint.config.* exists → ensure the config's `ignores` entries cover required patterns
101
-
- Check if .prettierrc* exists → create/verify .prettierignore
137
+
- Check if Dockerfile\* exists or Docker in plan.md → create/verify .dockerignore
138
+
- Check if .eslintrc\* exists → create/verify .eslintignore
139
+
- Check if eslint.config.\* exists → ensure the config's `ignores` entries cover required patterns
140
+
- Check if .prettierrc\* exists → create/verify .prettierignore
102
141
- Check if .npmrc or package.json exists → create/verify .npmignore (if publishing)
103
-
- Check if terraform files (*.tf) exist → create/verify .terraformignore
142
+
- Check if terraform files (\*.tf) exist → create/verify .terraformignore
@@ -137,7 +176,7 @@ You **MUST** consider the user input before proceeding (if not empty).
137
176
138
177
6. Execute implementation following the task plan:
139
178
- **Phase-by-phase execution**: Complete each phase before moving to the next
140
-
- **Respect dependencies**: Run sequential tasks in order, parallel tasks [P] can run together
179
+
- **Respect dependencies**: Run sequential tasks in order, parallel tasks [P] can run together
141
180
- **Follow TDD approach**: Execute test tasks before their corresponding implementation tasks
142
181
- **File-based coordination**: Tasks affecting the same files must run sequentially
143
182
- **Validation checkpoints**: Verify each phase completion before proceeding
@@ -166,6 +205,39 @@ You **MUST** consider the user input before proceeding (if not empty).
166
205
167
206
Note: This command assumes a complete task breakdown exists in tasks.md. If tasks are incomplete or missing, suggest running `/speckit.tasks` first to regenerate the task list.
168
207
208
+
1. **Check for extension hooks**: After completion validation, check if `.specify/extensions.yml` exists in the project root.
209
+
- If it exists, read it and look for entries under the `hooks.after_implement` key
210
+
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
211
+
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
212
+
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
213
+
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
214
+
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
215
+
- For each executable hook, output the following based on its `optional` flag:
216
+
- **Optional hook** (`optional: true`):
217
+
218
+
```
219
+
## Extension Hooks
220
+
221
+
**Optional Hook**: {extension}
222
+
Command: `/{command}`
223
+
Description: {description}
224
+
225
+
Prompt: {prompt}
226
+
To execute: `/{command}`
227
+
```
228
+
229
+
- **Mandatory hook** (`optional: false`):
230
+
231
+
```
232
+
## Extension Hooks
233
+
234
+
**Automatic Hook**: {extension}
235
+
Executing: `/{command}`
236
+
EXECUTE_COMMAND: {command}
237
+
```
238
+
239
+
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
### AI Assistant Execution Requirement (Mandatory)
35
35
36
-
Show & Tell steps must be written so GitHub Copilot can execute and validate them without guessing.
36
+
Show & Tell steps must be written so AI Assistant can execute and validate them without guessing.
37
37
38
38
- Use explicit, runnable commands, URLs, and API calls
39
39
- Include an expected result for every step (output text, status code, or visible UI state)
40
40
- Avoid vague language such as "check it works" or "verify manually"
41
41
- State pass/fail criteria clearly so steps cannot be skipped or missed during `/speckit.implement`
42
42
43
-
During implementation, GitHub Copilot**MUST** execute every Show & Tell step and confirm the expected result before marking the phase or user story complete.
43
+
During implementation, AI Assistant**MUST** execute every Show & Tell step and confirm the expected result before marking the phase or user story complete.
44
44
45
45
## Plan Completion Checklist (Mandatory)
46
46
@@ -49,7 +49,7 @@ Before marking `plan.md` as complete, verify:
49
49
-[ ] Plan addresses all requirements from `spec.md`
50
50
-[ ] All architectural decisions have corresponding ADRs
51
51
-[ ] Toolchain versions are specified, verified online during planning, and confirmed as the latest stable releases
52
-
-[ ] Repository-template capabilities are planned using the skill at [.github/skills/repository-template/SKILL.md](/.github/skills/repository-template/SKILL.md), including at minimum:
52
+
-[ ] Repository-template capabilities are planned using the skill at [.claude/skills/repository-template/SKILL.md](/.claude/skills/repository-template/SKILL.md), including at minimum:
53
53
-[ ] Core Make System
54
54
-[ ] Pre-commit Hooks
55
55
-[ ] Secret Scanning
@@ -59,7 +59,7 @@ Before marking `plan.md` as complete, verify:
59
59
-[ ] Tool Version Management
60
60
-[ ] Each phase and user story includes a `Show & Tell` subsection
61
61
-[ ] Show & Tell subsections are placed at the end of each phase or user story
62
-
-[ ] Show & Tell steps are specific enough for GitHub Copilot to execute and validate without ambiguity
62
+
-[ ] Show & Tell steps are specific enough for AI Assistant to execute and validate without ambiguity
63
63
-[ ] Show & Tell steps define explicit expected outcomes and pass/fail criteria
64
64
65
65
## User Input
@@ -70,6 +70,45 @@ $ARGUMENTS
70
70
71
71
You **MUST** consider the user input before proceeding (if not empty).
72
72
73
+
## Pre-Execution Checks
74
+
75
+
**Check for extension hooks (before planning)**:
76
+
77
+
- Check if `.specify/extensions.yml` exists in the project root.
78
+
- If it exists, read it and look for entries under the `hooks.before_plan` key
79
+
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
80
+
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
81
+
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
82
+
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
83
+
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
84
+
- For each executable hook, output the following based on its `optional` flag:
85
+
-**Optional hook** (`optional: true`):
86
+
87
+
```
88
+
## Extension Hooks
89
+
90
+
**Optional Pre-Hook**: {extension}
91
+
Command: `/{command}`
92
+
Description: {description}
93
+
94
+
Prompt: {prompt}
95
+
To execute: `/{command}`
96
+
```
97
+
98
+
- **Mandatory hook** (`optional: false`):
99
+
100
+
```
101
+
## Extension Hooks
102
+
103
+
**Automatic Pre-Hook**: {extension}
104
+
Executing: `/{command}`
105
+
EXECUTE_COMMAND: {command}
106
+
107
+
Wait for the result of the hook command before proceeding to the Outline.
108
+
```
109
+
110
+
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
111
+
73
112
## Outline
74
113
75
114
1. **Setup**: Run `.specify/scripts/bash/setup-plan.sh --json` from repo root and parse JSON for FEATURE_SPEC, IMPL_PLAN, SPECS_DIR, BRANCH. For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
@@ -87,6 +126,39 @@ You **MUST** consider the user input before proceeding (if not empty).
87
126
88
127
4. **Stop and report**: Command ends after Phase 2 planning. Report branch, IMPL_PLAN path, and generated artifacts.
89
128
129
+
5. **Check for extension hooks**: After reporting, check if `.specify/extensions.yml` exists in the project root.
130
+
- If it exists, read it and look for entries under the `hooks.after_plan` key
131
+
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
132
+
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
133
+
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
134
+
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
135
+
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
136
+
- For each executable hook, output the following based on its `optional` flag:
137
+
- **Optional hook** (`optional: true`):
138
+
139
+
```
140
+
## Extension Hooks
141
+
142
+
**Optional Hook**: {extension}
143
+
Command: `/{command}`
144
+
Description: {description}
145
+
146
+
Prompt: {prompt}
147
+
To execute: `/{command}`
148
+
```
149
+
150
+
- **Mandatory hook** (`optional: false`):
151
+
152
+
```
153
+
## Extension Hooks
154
+
155
+
**Automatic Hook**: {extension}
156
+
Executing: `/{command}`
157
+
EXECUTE_COMMAND: {command}
158
+
```
159
+
160
+
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
161
+
90
162
## Phases
91
163
92
164
### Phase 0: Outline & Research
@@ -134,7 +206,7 @@ You **MUST** consider the user input before proceeding (if not empty).
0 commit comments