docs: clarify hook priority validation semantics#3594
Open
WOLIKIMCHENG wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Clarifies hook priority validation and fallback behavior.
Changes:
- Distinguishes manifest validation from stored-hook sorting.
- Documents the default priority of
10.
Show a summary per file
| File | Description |
|---|---|
docs/reference/extensions.md |
Updates hook priority semantics; fallback wording needs correction. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Medium
| | `condition` | Optional expression evaluated by `HookExecutor` (using `config.<path>` or `env.<VAR>` with `is set`, `==`, or `!=`). Current command templates do not evaluate conditions and skip hooks with a non-empty condition. | | ||
| Hook event names identify when a hook is invoked. They generally use `before_<command>` or `after_<command>`, such as `before_implement`, `after_implement`, `before_tasks`, and `after_tasks`. | ||
|
|
||
| Extension manifests reject invalid hook priorities during installation. If an existing `.specify/extensions.yml` file contains a missing or corrupted `priority` value, `HookExecutor.get_hooks_for_event()` treats that entry as priority `10` when sorting. |
mnriem
requested changes
Jul 21, 2026
mnriem
left a comment
Collaborator
There was a problem hiding this comment.
Please address Copilot feedback. If not applicable, please explain why
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Clarifies the hook
prioritydocs so they distinguish two separate paths:.specify/extensions.ymlhook entries with missing or corruptedpriorityvalues are treated as priority10whenHookExecutor.get_hooks_for_event()sorts themTesting
.venv/bin/python -m pytest tests/test_extensions.py::TestExtensionManifest::test_hook_priority_field_validation tests/test_extensions.py::TestHookExecutorRegistration::test_register_hooks_single_mapping_back_compat tests/test_extensions.py::TestHookExecutorRegistration::test_get_hooks_for_event_treats_missing_priority_as_default -qgit diff --check -- docs/reference/extensions.md