Skip to content

Commit 01d1bda

Browse files
mvanhornclaude
andcommitted
Fix hook enablement to default true when field is absent
Matches HookExecutor.get_hooks_for_event() semantics where hooks without an explicit enabled field are treated as enabled. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent a8693c7 commit 01d1bda

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎templates/commands/plan.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ You **MUST** consider the user input before proceeding (if not empty).
3030
- Check if `.specify/extensions.yml` exists in the project root.
3131
- If it exists, read it and look for entries under the `hooks.before_plan` key
3232
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
33-
- Filter to only hooks where `enabled: true`
33+
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
3434
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
3535
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
3636
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
@@ -78,7 +78,7 @@ You **MUST** consider the user input before proceeding (if not empty).
7878
5. **Check for extension hooks**: After reporting, check if `.specify/extensions.yml` exists in the project root.
7979
- If it exists, read it and look for entries under the `hooks.after_plan` key
8080
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
81-
- Filter to only hooks where `enabled: true`
81+
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
8282
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
8383
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
8484
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation

‎templates/commands/specify.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ You **MUST** consider the user input before proceeding (if not empty).
2727
- Check if `.specify/extensions.yml` exists in the project root.
2828
- If it exists, read it and look for entries under the `hooks.before_specify` key
2929
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
30-
- Filter to only hooks where `enabled: true`
30+
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
3131
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
3232
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
3333
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
@@ -213,7 +213,7 @@ Given that feature description, do this:
213213
8. **Check for extension hooks**: After reporting completion, check if `.specify/extensions.yml` exists in the project root.
214214
- If it exists, read it and look for entries under the `hooks.after_specify` key
215215
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
216-
- Filter to only hooks where `enabled: true`
216+
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
217217
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
218218
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
219219
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation

0 commit comments

Comments
 (0)