gentleman-guardian-angel  by Gentleman-Programming

AI code review for enforcing coding standards

Created 1 month ago
469 stars

Top 64.8% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides an AI-powered code review tool that integrates as a Git pre-commit hook. It aims to enforce coding standards automatically on every commit, addressing the common issue of team members overlooking or ignoring established guidelines. By leveraging various AI providers like Claude, Gemini, Codex, and Ollama, it offers a flexible and robust solution for maintaining code quality before code even reaches the repository, benefiting developers and teams seeking consistent adherence to standards.

How It Works

Gentleman Guardian Angel (gga) is implemented in pure Bash, requiring zero external dependencies beyond the chosen AI provider's command-line interface (CLI). It functions as a Git pre-commit hook, triggered automatically before each commit. The tool reads project-specific coding rules from an AGENTS.md file and uses the configured AI provider's CLI to analyze staged code files against these rules. It features smart caching to skip reviews of unchanged files, significantly speeding up the process, and can be configured to fail commits in strict mode if the AI's response is ambiguous.

Quick Start & Requirements

  • Primary install: brew install gentleman-programming/tap/gga (recommended) or manual installation via git clone and ./install.sh.
  • Prerequisites: While the tool itself has zero dependencies (pure Bash), it requires the CLI tools for your chosen AI provider (e.g., claude, gemini, ollama) to be installed and accessible in your PATH.
  • Setup: Initialize with gga init, create your rules in AGENTS.md, and install the hook with gga install.
  • Links: Installation and usage details are comprehensively covered within the README.

Highlighted Details

  • Provider-agnostic: Supports Claude, Gemini, Codex, Ollama, and potentially others via their CLIs.
  • Zero dependencies: Pure Bash script, runs on most systems without needing Node.js, Python, or Go.
  • Git native: Installs as a standard pre-commit hook.
  • Highly configurable: Supports custom file patterns, exclusions, and rules files.
  • Strict mode: Can be configured to fail CI builds on ambiguous AI responses.
  • Smart caching: Improves performance by skipping unchanged files.

Maintenance & Community

The README does not specify notable contributors, sponsorships, partnerships, or community channels (like Discord/Slack). Contributions are welcomed via pull requests.

Licensing & Compatibility

The project is released under the MIT License, permitting commercial use and integration into closed-source projects.

Limitations & Caveats

The effectiveness and performance are dependent on the user's setup and configuration of the chosen AI provider's CLI. Reviewing very large files might impact performance if not appropriately excluded via configuration. Strict mode requires the AI to adhere to a specific output format ("STATUS: PASSED" or "STATUS: FAILED").

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
15
Issues (30d)
10
Star History
487 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.