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(preset): add extension hooks to all ADLC preset commands
Added before_* and after_* extension hooks to:
- adlc.spec.analyze (before_analyze, after_analyze)
- adlc.spec.checklist (before_checklist, after_checklist)
- adlc.spec.clarify (before_clarify, after_clarify)
- adlc.spec.constitution (before_constitution, after_constitution)
Fixed hook enabled logic in:
- adlc.spec.implement
- adlc.spec.plan
- adlc.spec.tasks
Changed from 'Filter to only hooks where enabled: true' to
'Filter out hooks where enabled is explicitly false. Treat hooks
without an enabled field as enabled by default.'
This matches the upstream hook pattern and allows extensions to
register hooks that work by default without requiring explicit
enabled: true in extension.yml.
Copy file name to clipboardExpand all lines: presets/agentic-sdlc/commands/adlc.spec.clarify.md
+65Lines changed: 65 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,40 @@ $ARGUMENTS
17
17
18
18
You **MUST** consider the user input before proceeding (if not empty).
19
19
20
+
## Pre-Execution Checks
21
+
22
+
**Check for extension hooks (before clarify)**:
23
+
- Check if `.specify/extensions.yml` exists in the project root.
24
+
- If it exists, read it and look for entries under the `hooks.before_clarify` key
25
+
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
26
+
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
27
+
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
28
+
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
29
+
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
30
+
- For each executable hook, output the following based on its `optional` flag:
31
+
-**Optional hook** (`optional: true`):
32
+
```
33
+
## Extension Hooks
34
+
35
+
**Optional Pre-Hook**: {extension}
36
+
Command: `/{command}`
37
+
Description: {description}
38
+
39
+
Prompt: {prompt}
40
+
To execute: `/{command}`
41
+
```
42
+
- **Mandatory hook** (`optional: false`):
43
+
```
44
+
## Extension Hooks
45
+
46
+
**Automatic Pre-Hook**: {extension}
47
+
Executing: `/{command}`
48
+
EXECUTE_COMMAND: {command}
49
+
50
+
Wait for the result of the hook command before proceeding to Outline.
51
+
```
52
+
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
53
+
20
54
## Outline
21
55
22
56
Goal: Detect and reduce ambiguity or missing decision points in the active feature specification. Validate spec against project constitution and architecture (three-pillar validation). Record clarifications directly in the spec file.
@@ -434,4 +468,35 @@ Behavior rules:
434
468
435
469
- If quota reached with unresolved high-impact categories remaining, explicitly flag them under Deferred with rationale.
436
470
471
+
9. **Check for extension hooks**
472
+
473
+
After reporting, check if `.specify/extensions.yml` exists in the project root.
474
+
- If it exists, read it and look for entries under the `hooks.after_clarify` key
475
+
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
476
+
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
477
+
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
478
+
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
479
+
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
480
+
- For each executable hook, output the following based on its `optional` flag:
481
+
- **Optional hook** (`optional: true`):
482
+
```
483
+
## Extension Hooks
484
+
485
+
**Optional Hook**: {extension}
486
+
Command: `/{command}`
487
+
Description: {description}
488
+
489
+
Prompt: {prompt}
490
+
To execute: `/{command}`
491
+
```
492
+
- **Mandatory hook** (`optional: false`):
493
+
```
494
+
## Extension Hooks
495
+
496
+
**Automatic Hook**: {extension}
497
+
Executing: `/{command}`
498
+
EXECUTE_COMMAND: {command}
499
+
```
500
+
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
Copy file name to clipboardExpand all lines: presets/agentic-sdlc/commands/adlc.spec.constitution.md
+65Lines changed: 65 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,40 @@ $ARGUMENTS
17
17
18
18
You **MUST** consider the user input before proceeding (if not empty).
19
19
20
+
## Pre-Execution Checks
21
+
22
+
**Check for extension hooks (before constitution)**:
23
+
- Check if `.specify/extensions.yml` exists in the project root.
24
+
- If it exists, read it and look for entries under the `hooks.before_constitution` key
25
+
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
26
+
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
27
+
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
28
+
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
29
+
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
30
+
- For each executable hook, output the following based on its `optional` flag:
31
+
-**Optional hook** (`optional: true`):
32
+
```
33
+
## Extension Hooks
34
+
35
+
**Optional Pre-Hook**: {extension}
36
+
Command: `/{command}`
37
+
Description: {description}
38
+
39
+
Prompt: {prompt}
40
+
To execute: `/{command}`
41
+
```
42
+
- **Mandatory hook** (`optional: false`):
43
+
```
44
+
## Extension Hooks
45
+
46
+
**Automatic Pre-Hook**: {extension}
47
+
Executing: `/{command}`
48
+
EXECUTE_COMMAND: {command}
49
+
50
+
Wait for the result of the hook command before proceeding to Outline.
51
+
```
52
+
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
53
+
20
54
## Outline
21
55
22
56
You are updating the project constitution at `{REPO_ROOT}/.specify/memory/constitution.md`. This file is a TEMPLATE containing placeholder tokens in square brackets (e.g. `[PROJECT_NAME]`, `[PRINCIPLE_1_NAME]`). Your job is to (a) collect/derive concrete values, (b) fill the template precisely, and (c) propagate any amendments across dependent artifacts.
@@ -77,6 +111,37 @@ Follow this execution flow:
77
111
- Files flagged for manual follow-up
78
112
- Suggested commit message (e.g., `docs: amend constitution to vX.Y.Z`)
79
113
114
+
10. **Check for extension hooks**
115
+
116
+
After reporting, check if `.specify/extensions.yml` exists in the project root.
117
+
- If it exists, read it and look for entries under the `hooks.after_constitution` key
118
+
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
119
+
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
120
+
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
121
+
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
122
+
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
123
+
- For each executable hook, output the following based on its `optional` flag:
124
+
- **Optional hook** (`optional: true`):
125
+
```
126
+
## Extension Hooks
127
+
128
+
**Optional Hook**: {extension}
129
+
Command: `/{command}`
130
+
Description: {description}
131
+
132
+
Prompt: {prompt}
133
+
To execute: `/{command}`
134
+
```
135
+
- **Mandatory hook** (`optional: false`):
136
+
```
137
+
## Extension Hooks
138
+
139
+
**Automatic Hook**: {extension}
140
+
Executing: `/{command}`
141
+
EXECUTE_COMMAND: {command}
142
+
```
143
+
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
144
+
80
145
## Formatting Requirements
81
146
82
147
- Use Markdown headings exactly as in template (do not change levels)
0 commit comments