Skip to content

Commit cf6c7ae

Browse files
committed
fix: clarify hook condition handling and add YAML error guidance in templates
- Replace ambiguous "evaluate any condition value" instruction with explicit guidance to skip hooks with non-empty conditions, deferring evaluation to HookExecutor - Add instruction to skip hook checking silently if extensions.yml cannot be parsed or is invalid
1 parent 69ea6b8 commit cf6c7ae

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

templates/commands/implement.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,11 @@ Note: This command assumes a complete task breakdown exists in tasks.md. If task
139139
140140
10. **Check for extension hooks**: After completion validation, check if `.specify/extensions.yml` exists in the project root.
141141
- If it exists, read it and look for entries under the `hooks.after_implement` key
142+
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
142143
- Filter to only hooks where `enabled: true`
143-
- For each remaining hook, evaluate any `condition` value; skip the hook if the condition is not met
144+
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
145+
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
146+
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
144147
- For each executable hook, output the following based on its `optional` flag:
145148
- **Optional hook** (`optional: true`):
146149
```

templates/commands/tasks.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,11 @@ You **MUST** consider the user input before proceeding (if not empty).
6565

6666
6. **Check for extension hooks**: After tasks.md is generated, check if `.specify/extensions.yml` exists in the project root.
6767
- If it exists, read it and look for entries under the `hooks.after_tasks` key
68+
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
6869
- Filter to only hooks where `enabled: true`
69-
- For each remaining hook, evaluate any `condition` value; skip the hook if the condition is not met
70+
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
71+
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
72+
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
7073
- For each executable hook, output the following based on its `optional` flag:
7174
- **Optional hook** (`optional: true`):
7275
```

0 commit comments

Comments
 (0)