Add project hooks guarding invariants, main, and hotRun contention - #43
Merged
Merged
Conversation
- guard-invariants (PreToolUse Write|Edit): asks before an edit adds fallbackToDestructiveMigration, rememberSaveableBackStack, an iosX64 target, or kotlin-parcelize. Matches call syntax only, so KDoc that names them passes. - guard-main-branch (PreToolUse Bash): denies git commit/push on main or a push targeting main. Only a real push's own arguments count, so a commit message that mentions main does not trip it. - warn-hotrun-race (PreToolUse Bash): warns when a Gradle build starts while `:desktopApp:hotRun --auto` is running, since its continuous build makes concurrent builds fail in untouched modules. - check-build-credentials (SessionStart): warns when MEALDB_API_KEY or gpr.user/gpr.key (or GITHUB_ACTOR/GITHUB_TOKEN) are missing. Checks presence only and never prints a value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Four hooks in
.claude/settings.json, each backed by a script in.claude/hooks/. The existing ktfmt and/verify-reminder hooks are unchanged. Hook messages point at the.claude/rules/files from #42.guard-invariants.shfallbackToDestructiveMigration(,rememberSaveableBackStack(, aniosX64target, or kotlin-parcelize. The prompt gives the reason and the rule file.guard-main-branch.shgit commit/git pushwhile onmain, or a push targetingmainfrom any branch.warn-hotrun-race.sh./gradlewrun starts while:desktopApp:hotRun --autois running. That continuous build makes concurrent builds fail with errors in untouched modules.check-build-credentials.shMEALDB_API_KEYorgpr.user/gpr.key(orGITHUB_ACTOR/GITHUB_TOKEN) is missing. It checks presence only and never prints a value.Notes:
BrowserHistoryEffect.web.ktthat mentionsrememberSaveableBackStackpasses.ProjectExt.ktfor the API key,settings.gradle.ktsfor GitHub Packages.hotMcpServer, which compiles nothing, does not trigger the hotRun warning.Test plan
.kt/.kts/.tomlfile through it, and none were flagged; synthetic Room andiosX64edits prompt as expectedmain,origin main,HEAD:main,-C dir … mainand compound commands; allows feature branches,maintenance, and commit messages that mention main (a false positive during development, now fixed)hotRun --autoprocess; silent without one and forhotRun/reloadthemselvesHOME🤖 Generated with Claude Code