feat(cli): add native agent hook installer#452
Open
aidenybai wants to merge 5 commits into
Open
Conversation
Adds opt-in Claude Code and Cursor lifecycle hooks alongside the existing skill and Git hook installer so agents can surface React Doctor regressions after edits.
|
✅ No new issues Reviewed by reactreview for commit 089d024. Configure here. |
Adds a regression test showing Git's relative hook path resolves to the repository hook directory when install runs below the repo root.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b3c6b2e. Configure here.
Applies repository formatting so CI format checks pass for the new agent hook utility.
Anchors generated Claude Code and Cursor hooks to the project root before resolving the local React Doctor binary or running diff scans.
Covers real Git hook execution paths, CI install behavior, generated agent hook fallbacks, and hardens malformed hook input handling.
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
react-doctor install --agent-hooksfor project-level Claude Code and Cursor hooks that surface React Doctor findings after agent edits.Test plan
nr test -- tests/install-agent-hooks.test.ts tests/install-skill.test.ts tests/install-action.test.tsnr typechecknr lintNote
Medium Risk
Adds file-writing installers for Git hooks and agent hook configs/scripts, which can affect developer workflows if paths/merging logic misbehaves. Changes are localized to the
installcommand and are covered by new integration-style tests.Overview
Extends
react-doctor installwith an--agent-hooksoption that installs native, non-blocking post-edit hooks for Claude Code and Cursor, generating areact-doctorrunner script and updating each agent’s hook config without duplicating entries.Adds an optional dependency-free Git
pre-commithook installer: detects the correct hook location (includingcore.hooksPath), writes a managed.react-doctor/hooks/pre-commitrunner that scans staged files with--fail-on none, and merges/updates a managed block into an existing hook while preserving user content.Updates README/CLI help and expands test coverage to validate option forwarding, hook config merging, executable permissions, Git target detection, and real
git commitbehavior.Reviewed by Cursor Bugbot for commit 089d024. Bugbot is set up for automated code reviews on this repo. Configure here.