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
fix(commands): align hook filtering with HookExecutor defaults
Updated the prompt to treat omitted `enabled` flags as true and pass all hooks (including those with `condition` fields) to the HookExecutor, correctly addressing the PR review feedback.
Copy file name to clipboardExpand all lines: templates/commands/plan.md
+6-8Lines changed: 6 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,10 +30,9 @@ You **MUST** consider the user input before proceeding (if not empty).
30
30
- Check if `.specify/extensions.yml` exists in the project root.
31
31
- If it exists, read it and look for entries under the `hooks.before_plan` key
32
32
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
33
-
- Filter to only hooks where `enabled: true`
34
-
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
35
-
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
36
-
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
33
+
- Treat hooks as enabled unless they explicitly specify `enabled: false`
34
+
- For each enabled hook, do **not** attempt to interpret or evaluate hook `condition` expressions yourself; condition evaluation is handled by the HookExecutor implementation
35
+
- Treat all enabled hooks as executable for the purposes of this plan, regardless of whether they define a `condition`
37
36
- For each executable hook, output the following based on its `optional` flag:
38
37
-**Optional hook** (`optional: true`):
39
38
```
@@ -80,10 +79,9 @@ You **MUST** consider the user input before proceeding (if not empty).
80
79
5. **Check for extension hooks**: After reporting completion, check if `.specify/extensions.yml` exists in the project root.
81
80
- If it exists, read it and look for entries under the `hooks.after_plan` key
82
81
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
83
-
- Filter to only hooks where `enabled: true`
84
-
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
85
-
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
86
-
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
82
+
- From the discovered hooks, ignore only those where `enabled` is explicitly set to `false`. If `enabled` is omitted, treat the hook as enabled.
83
+
- Do **not** attempt to interpret or evaluate hook `condition` expressions, and do **not** filter hooks based on the presence or contents of `condition`. Condition evaluation is handled by the `HookExecutor.should_execute_hook` implementation.
84
+
- Treat all hooks that are not explicitly disabled (that is, all hooks where `enabled` is not `false`) as executable candidates.
87
85
- For each executable hook, output the following based on its `optional` flag:
Copy file name to clipboardExpand all lines: templates/commands/specify.md
+3-5Lines changed: 3 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,10 +27,9 @@ You **MUST** consider the user input before proceeding (if not empty).
27
27
- Check if `.specify/extensions.yml` exists in the project root.
28
28
- If it exists, read it and look for entries under the `hooks.before_specify` key
29
29
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
30
-
- Filter to only hooks where `enabled: true`
31
-
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
32
-
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
33
-
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
30
+
- Treat hooks as enabled unless they explicitly specify `enabled: false`
31
+
- For each enabled hook, do **not** attempt to interpret or evaluate hook `condition` expressions yourself; condition evaluation is handled by the HookExecutor implementation
32
+
- Treat all enabled hooks as executable for the purposes of this plan, regardless of whether they define a `condition`
34
33
- For each executable hook, output the following based on its `optional` flag:
35
34
-**Optional hook** (`optional: true`):
36
35
```
@@ -219,7 +218,6 @@ Given that feature description, do this:
219
218
- Do **not** attempt to interpret or evaluate hook `condition` expressions, and do **not** filter hooks based on the presence or contents of `condition`. Condition evaluation is handled by the `HookExecutor.should_execute_hook` implementation.
220
219
- Treat all hooks that are not explicitly disabled (that is, all hooks where `enabled` is not `false`) as executable candidates.
221
220
- For each executable hook, output the following based on its `optional` flag:
0 commit comments