Skip to content

feat(hooks): prepend built-in guards instead of replace#136

Merged
RyderFreeman4Logos merged 2 commits intomainfrom
feat/guard-prepend-builtins
Feb 17, 2026
Merged

feat(hooks): prepend built-in guards instead of replace#136
RyderFreeman4Logos merged 2 commits intomainfrom
feat/guard-prepend-builtins

Conversation

@RyderFreeman4Logos
Copy link
Owner

Summary

  • Built-in prompt guards (branch-protection, dirty-tree-reminder) now prepend to user-defined guards instead of being silently replaced
  • Users defining [[prompt_guard]] in hooks.toml get builtins + their own guards stacked
  • builtin_guards = false still disables builtins entirely
  • Added hooks configuration section (Step 7) to skill.md

Test plan

  • test_builtin_guards_prepended_to_user_config — verifies 2 builtins + 1 user = 3 total
  • test_builtin_guards_disabled_with_user_config — verifies disable + user = 1 only
  • All 18 existing config tests pass
  • Full test suite: 1118 passed, 0 failed
  • just pre-commit passes

🤖 Generated with Claude Code

RyderFreeman4Logos and others added 2 commits February 17, 2026 08:38
Previously, defining any [[prompt_guard]] in hooks.toml would silently
replace all built-in guards (branch-protection, dirty-tree-reminder).
Now built-in guards are prepended as the base layer, and user-defined
guards are appended after them. `builtin_guards = false` still disables.

Also adds hooks configuration section to skill.md (Step 7) documenting
guard stacking, custom guard creation, and lifecycle hook events.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update `builtin_guards` field doc comment to reflect prepend semantics
- Fix skill.md dirty-tree-reminder description (fires on any dirty tree,
  not only session resume)

Addresses codex review findings #1 and #2 (P3).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@RyderFreeman4Logos
Copy link
Owner Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. More of your lovely PRs please.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@RyderFreeman4Logos RyderFreeman4Logos merged commit 30220d0 into main Feb 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant