-
Notifications
You must be signed in to change notification settings - Fork 6.2k
fix: wire after_tasks and after_implement hook events into command templates #1702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -136,3 +136,29 @@ You **MUST** consider the user input before proceeding (if not empty). | |||||||||
| - Report final status with summary of completed work | ||||||||||
|
|
||||||||||
| 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. | ||||||||||
|
|
||||||||||
| 10. **Check for extension hooks**: After completion validation, check if `.specify/extensions.yml` exists in the project root. | ||||||||||
| - If it exists, read it and look for entries under the `hooks.after_implement` key | ||||||||||
| - Filter to only hooks where `enabled: true` | ||||||||||
| - For each remaining hook, evaluate any `condition` value; skip the hook if the condition is not met | ||||||||||
|
||||||||||
| - For each remaining hook, evaluate any `condition` value; skip the hook if the condition is not met | |
| - For each remaining hook, do **not** attempt to interpret complex `condition` expressions: | |
| - If the hook has no `condition` field, or it is null/empty, treat the hook as executable | |
| - If the hook defines a non-empty `condition`, skip the hook for now and leave condition evaluation to the HookExecutor implementation |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -63,6 +63,32 @@ You **MUST** consider the user input before proceeding (if not empty). | |||||||||||||||||
| - Suggested MVP scope (typically just User Story 1) | ||||||||||||||||||
| - Format validation: Confirm ALL tasks follow the checklist format (checkbox, ID, labels, file paths) | ||||||||||||||||||
|
|
||||||||||||||||||
| 6. **Check for extension hooks**: After tasks.md is generated, check if `.specify/extensions.yml` exists in the project root. | ||||||||||||||||||
| - If it exists, read it and look for entries under the `hooks.after_tasks` key | ||||||||||||||||||
| - Filter to only hooks where `enabled: true` | ||||||||||||||||||
| - For each remaining hook, evaluate any `condition` value; skip the hook if the condition is not met | ||||||||||||||||||
|
||||||||||||||||||
| - For each remaining hook, evaluate any `condition` value; skip the hook if the condition is not met | |
| - Do not attempt to interpret or evaluate hook `condition` expressions; if a hook has a non-null `condition` value, skip it and assume the HookExecutor will handle condition evaluation |
Copilot
AI
Feb 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The template doesn't provide guidance for handling malformed YAML or parsing errors when reading .specify/extensions.yml. Consider adding a note about gracefully handling parse failures, for example: "If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally."
| - Filter to only hooks where `enabled: true` | |
| - For each remaining hook, evaluate any `condition` value; skip the hook if the condition is not met | |
| - For each executable hook, output the following based on its `optional` flag: | |
| - **Optional hook** (`optional: true`): | |
| - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally | |
| - Filter to only hooks where `enabled: true` | |
| - For each remaining hook, evaluate any `condition` value; skip the hook if the condition is not met | |
| - For each executable hook, output the following based on its `optional` flag: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The template doesn't provide guidance for handling malformed YAML or parsing errors when reading
.specify/extensions.yml. Consider adding a note about gracefully handling parse failures, for example: "If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally."