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
{{ message }}
Repository navigation
Commit 219c013
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/reference/extensions.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -327,6 +327,8 @@ Extension manifests reject invalid hook priorities during installation. For exis
327
327
328
328
Core commands run two hook dispatchers, one before and one after their main work, using the project's selected `sh`, `ps`, or `py` script type. Each variant resolves hooks independently and returns JSON containing the event and an ordered `hooks` array (`extension`, `command`, `optional`, `description`, `prompt`, `priority`). An absent configuration or event returns an empty array. An unreadable or invalid configuration returns an `error` and a nonzero exit code; agents must report that no hooks were checked, including mandatory hooks, and thencontinue the core command. The dispatchers determine the order but do not execute agent commands. The Python variant needs Python 3 with PyYAML when `.specify/extensions.yml` exists; Bash and PowerShell do not use Python or PyYAML.
329
329
330
+
All three dispatchers validate hook fields across every configured event before returning the requested event. Priorities are truncated to integers in the range `1` through `2147483647`; values outside this range, booleans, and non-integer strings fall back to `10`. Quoted integer strings are accepted, but quoted decimal strings are not.
331
+
330
332
The native Bash and PowerShell resolvers support the CLI's pretty-printed `.specify/extensions.yml` layout: a `hooks:` mapping, event names indented two spaces, list items under each event, and single-line scalar fields (including quoted strings and common escapes). Other YAML constructs such as anchors, flow-style hook lists, and block scalars are not supported; these variants reject them explicitly rather than silently skipping hooks. The CLI writes hook configuration in this canonical layout without wrapping long scalar values; installing or upgrading shared infrastructure rewrites existing valid YAML to this layout so configurations produced by older versions remain usable (YAML comments and formatting are not retained). The Python variant accepts general YAML through PyYAML. A hook `condition` must be a string or null in all variants.
0 commit comments