Skip to content

Conversation

@ANcpLua
Copy link
Owner

@ANcpLua ANcpLua commented Jan 7, 2026

Summary

Remove Claude plugin hooks since they don't work with --dangerously-skip-permissions mode.

Removed

  • hooks/hooks.json
  • hooks/scripts/pre-commit-gate.sh (PreToolUse - bypassed in skip-permissions mode)
  • hooks/scripts/phase-end-check.sh (Stop - uncertain behavior)

Kept

  • scripts/install-git-hook.sh - Native git pre-commit hook (works in ALL modes)
  • scripts/integrity-check.sh - Detection logic (used by git hook)

Test plan

  • Git hook still works: bash scripts/install-git-hook.sh
  • Plugin validates without hooks reference

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a Git pre-commit hook installer and an enforced pre-commit check that can block commits for integrity violations (with install/uninstall guidance).
  • Chores
    • Removed legacy plugin hook configurations and related runtime scripts.
    • Updated documentation and changelog entries to reflect the new pre-commit workflow and removed hook behavior.

✏️ Tip: You can customize this high-level summary in your review settings.

Claude hooks don't work with --dangerously-skip-permissions mode.
Keep only the git pre-commit hook which works in all modes.

Removed:
- hooks/hooks.json
- hooks/scripts/pre-commit-gate.sh (PreToolUse - bypassed)
- hooks/scripts/phase-end-check.sh (Stop - uncertain)

Kept:
- scripts/install-git-hook.sh (native git hook)
- scripts/integrity-check.sh (detection logic)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Copilot AI review requested due to automatic review settings January 7, 2026 23:07
@coderabbitai
Copy link

coderabbitai bot commented Jan 7, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Replaces hook-based enforcement with a repository-installed Git pre-commit hook: removes plugin hook declarations and hook scripts, adds an installer and pre-commit hook script, and updates documentation and changelog to document the new install path and behavior.

Changes

Cohort / File(s) Summary
Plugin Manifest
plugins/completion-integrity/.claude-plugin/plugin.json
Removed the hooks field; file now only declares skills
Removed Hook Config & Scripts
plugins/completion-integrity/hooks/hooks.json, plugins/completion-integrity/hooks/scripts/pre-commit-gate.sh, plugins/completion-integrity/hooks/scripts/phase-end-check.sh
Deleted hook configuration and two hook execution scripts (pre-commit gate and phase-end response check)
New Installer & Hook
plugins/completion-integrity/scripts/install-git-hook.sh
Added installer that writes a Git pre-commit hook to detect integrity violations in staged changes and block commits
Documentation & Skill Metadata
plugins/completion-integrity/README.md, plugins/completion-integrity/skills/completion-integrity/SKILL.md, CHANGELOG.md
Updated text to describe a Git pre-commit hook, added install instructions, removed hook-based scoring/docs, updated changelog entry

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer (git client)
  participant Hook as pre-commit hook (repo/.git/hooks/pre-commit)
  participant Installer as install-git-hook.sh
  participant Checker as integrity check logic (hook script)

  Note over Installer, Hook: Installation flow
  Dev->>Installer: run install-git-hook.sh
  Installer-->>Dev: writes `pre-commit` to repo/.git/hooks, backs up existing hook

  Note over Dev, Hook: Commit-time flow (new)
  Dev->>Hook: git commit (pre-commit triggered)
  Hook->>Checker: analyze staged files (exclude docs/scripts)
  alt Violations found
    Checker-->>Hook: report violations (colorized output)
    Hook-->>Dev: exit non-zero (blocks commit)
  else No violations
    Checker-->>Hook: success
    Hook-->>Dev: exit 0 (allow commit)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: removing Claude plugin hooks while preserving the git hook implementation as the sole mechanism.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/remove-completion-integrity-hooks

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 921352e and 9848f1f.

📒 Files selected for processing (8)
  • CHANGELOG.md
  • plugins/completion-integrity/.claude-plugin/plugin.json
  • plugins/completion-integrity/README.md
  • plugins/completion-integrity/hooks/hooks.json
  • plugins/completion-integrity/hooks/scripts/phase-end-check.sh
  • plugins/completion-integrity/hooks/scripts/pre-commit-gate.sh
  • plugins/completion-integrity/scripts/install-git-hook.sh
  • plugins/completion-integrity/skills/completion-integrity/SKILL.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello @ANcpLua, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the completion integrity plugin by eliminating problematic Claude-specific hooks that interfered with certain operational modes. The change consolidates the integrity checking mechanism to solely rely on a robust native Git pre-commit hook, ensuring consistent and reliable enforcement of code quality standards regardless of the plugin's execution context. This streamlines the plugin's architecture and improves its compatibility.

Highlights

  • Removed Claude Plugin Hooks: The pull request removes the Claude-specific plugin hooks, including hooks/hooks.json, hooks/scripts/pre-commit-gate.sh, and hooks/scripts/phase-end-check.sh. These hooks were causing issues with the --dangerously-skip-permissions mode.
  • Retained Git Pre-Commit Hook: The native Git pre-commit hook (scripts/install-git-hook.sh) and its underlying detection logic (scripts/integrity-check.sh) are retained, as they function reliably across all operational modes.
  • Updated Documentation: The README.md and SKILL.md files have been updated to reflect the removal of the Claude-specific hooks, clarify the solution as a Git pre-commit hook, and streamline the installation instructions and integrity check descriptions.
  • Simplified Plugin Configuration: The plugin.json file has been modified to remove the reference to hooks/hooks.json, simplifying the plugin's configuration.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively simplifies the completion-integrity plugin by removing the Claude-specific hooks, which were causing issues with certain modes, and retaining only the more robust native git pre-commit hook. The changes are logical and the updates to the documentation in README.md and SKILL.md correctly reflect this simplification. I have one suggestion to improve the clarity of the installation instructions. Additionally, please note that the repository style guide (lines 20, 109) requires updating CHANGELOG.md for non-trivial changes like this one.

/plugin install completion-integrity@ancplua-claude-plugins

# Install the git hook in your repo
bash scripts/install-git-hook.sh

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The installation path scripts/install-git-hook.sh is ambiguous. It assumes the user is running the command from within the plugins/completion-integrity/ directory. To ensure the command works correctly for users at the repository root and to prevent confusion, it's better to provide the full path from the repository root.

Suggested change
bash scripts/install-git-hook.sh
bash plugins/completion-integrity/scripts/install-git-hook.sh

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes Claude Code plugin hooks (hooks.json, pre-commit-gate.sh, phase-end-check.sh) that don't work with --dangerously-skip-permissions mode, while attempting to keep the native git pre-commit hook functionality. The changes update documentation to reflect that only the git hook mechanism is used going forward.

Key changes:

  • Removes Claude plugin hook infrastructure that relied on PreToolUse and Stop events
  • Updates documentation to describe the plugin as using only git hooks
  • Simplifies the plugin.json by removing the hooks reference

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
plugins/completion-integrity/.claude-plugin/plugin.json Removes hooks reference from plugin manifest
plugins/completion-integrity/README.md Updates solution description and installation instructions to reference git hooks only; removes phase-end scoring documentation
plugins/completion-integrity/skills/completion-integrity/SKILL.md Updates description, adds installation section, removes hooks documentation, updates failure conditions
plugins/completion-integrity/hooks/hooks.json Deletes Claude plugin hooks configuration
plugins/completion-integrity/hooks/scripts/pre-commit-gate.sh Deletes PreToolUse hook script
plugins/completion-integrity/hooks/scripts/phase-end-check.sh Deletes Stop hook script

Comment on lines +23 to +24
# Install the git hook in your repo
bash scripts/install-git-hook.sh
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation references a script that does not exist. The file scripts/install-git-hook.sh is not present in the repository. Either this script needs to be added, or the documentation should be updated to reflect the actual installation process. According to the PR description, this script was supposed to be kept, but it appears to be missing from the codebase.

Suggested change
# Install the git hook in your repo
bash scripts/install-git-hook.sh
# Install the git pre-commit hook in your repo (from the repo root)
cat > .git/hooks/pre-commit << 'EOF'
#!/usr/bin/env bash
set -euo pipefail
bash scripts/integrity-check.sh
EOF
chmod +x .git/hooks/pre-commit

Copilot uses AI. Check for mistakes.
Comment on lines +12 to +13
```bash
bash "${CLAUDE_PLUGIN_ROOT}/scripts/install-git-hook.sh"
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation references a script that does not exist. The file scripts/install-git-hook.sh is not present in the repository. Either this script needs to be added, or the documentation should be updated to reflect the actual installation process. According to the PR description, this script was supposed to be kept, but it appears to be missing from the codebase.

Suggested change
```bash
bash "${CLAUDE_PLUGIN_ROOT}/scripts/install-git-hook.sh"
Create (or update) `.git/hooks/pre-commit` in your repository to run the integrity check, then make it executable:
```bash
# .git/hooks/pre-commit
#!/usr/bin/env bash
set -euo pipefail
CLAUDE_PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-plugins/completion-integrity}"
bash "${CLAUDE_PLUGIN_ROOT}/scripts/integrity-check.sh"

Copilot uses AI. Check for mistakes.
/plugin install completion-integrity@ancplua-claude-plugins

# Install the git hook in your repo
bash scripts/install-git-hook.sh
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The installation instructions are inconsistent between README.md and SKILL.md. README.md uses bash scripts/install-git-hook.sh (relative path), while SKILL.md uses bash "${CLAUDE_PLUGIN_ROOT}/scripts/install-git-hook.sh" (environment variable path). These should use the same approach for consistency. Since SKILL.md is used within the Claude Code context where CLAUDE_PLUGIN_ROOT is available, the SKILL.md version is appropriate for its context, but the README.md version is more appropriate for general use. Both need to be fixed to reference an actual existing script first.

Suggested change
bash scripts/install-git-hook.sh
bash "${CLAUDE_PLUGIN_ROOT}/scripts/install-git-hook.sh"

Copilot uses AI. Check for mistakes.
# Completion Integrity

This plugin enforces honest task completion by detecting and blocking shortcuts.
Git pre-commit hook that blocks commits with integrity violations.
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description "Git pre-commit hook that blocks commits with integrity violations" is incomplete. This plugin is described as providing both the git hook AND the integrity check script, but the description only mentions the git hook. Consider revising to something like "Detects and blocks integrity violations in commits using a git pre-commit hook" or "Provides integrity checking for commits to prevent shortcuts and cheating".

Suggested change
Git pre-commit hook that blocks commits with integrity violations.
Detects and blocks integrity violations in commits using a git pre-commit hook and a manual integrity check script.

Copilot uses AI. Check for mistakes.
- Add scripts/install-git-hook.sh (was missing from PR)
- Update CHANGELOG to reflect git-hook-only approach
- Address reviewer feedback from Copilot/Gemini

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@ANcpLua ANcpLua merged commit 6fc2582 into main Jan 7, 2026
10 of 12 checks passed
@ANcpLua ANcpLua deleted the fix/remove-completion-integrity-hooks branch January 7, 2026 23:15
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.

2 participants