{"id":48879153,"url":"https://github.com/rios0rios0/code-guru","last_synced_at":"2026-04-20T13:13:36.727Z","repository":{"id":219678362,"uuid":"614466723","full_name":"rios0rios0/code-guru","owner":"rios0rios0","description":"A CLI tool that leverages AI (Claude Code CLI or OpenAI API) to automatically review pull requests across GitHub and Azure DevOps, enforcing coding standards from configurable rule files","archived":false,"fork":false,"pushed_at":"2026-04-14T18:54:02.000Z","size":254,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-14T20:28:00.445Z","etag":null,"topics":["ai","code-review","gitlab","golang","openai"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rios0rios0.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"rios0rios0"}},"created_at":"2023-03-15T16:33:16.000Z","updated_at":"2026-04-14T18:49:56.000Z","dependencies_parsed_at":"2024-01-29T05:24:46.466Z","dependency_job_id":"1acb4773-bf8e-40dc-9bd9-ea38bd62559c","html_url":"https://github.com/rios0rios0/code-guru","commit_stats":null,"previous_names":["rios0rios0/codeguru","rios0rios0/code-guru"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/rios0rios0/code-guru","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rios0rios0%2Fcode-guru","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rios0rios0%2Fcode-guru/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rios0rios0%2Fcode-guru/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rios0rios0%2Fcode-guru/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rios0rios0","download_url":"https://codeload.github.com/rios0rios0/code-guru/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rios0rios0%2Fcode-guru/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31867712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"online","status_checked_at":"2026-04-16T02:00:06.042Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","code-review","gitlab","golang","openai"],"created_at":"2026-04-16T02:01:08.513Z","updated_at":"2026-04-16T02:01:09.645Z","avatar_url":"https://github.com/rios0rios0.png","language":"Go","funding_links":["https://github.com/sponsors/rios0rios0"],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eCode Guru\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/rios0rios0/code-guru/releases/latest\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/release/rios0rios0/code-guru.svg?style=for-the-badge\u0026logo=github\" alt=\"Latest Release\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/rios0rios0/code-guru/blob/main/LICENSE\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/license/rios0rios0/code-guru.svg?style=for-the-badge\u0026logo=github\" alt=\"License\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/rios0rios0/code-guru/actions/workflows/default.yaml\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/rios0rios0/code-guru/default.yaml?branch=main\u0026style=for-the-badge\u0026logo=github\" alt=\"Build Status\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://sonarcloud.io/summary/overall?id=rios0rios0_code-guru\"\u003e\n        \u003cimg src=\"https://img.shields.io/sonar/coverage/rios0rios0_code-guru?server=https%3A%2F%2Fsonarcloud.io\u0026style=for-the-badge\u0026logo=sonarqubecloud\" alt=\"Coverage\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://sonarcloud.io/summary/overall?id=rios0rios0_code-guru\"\u003e\n        \u003cimg src=\"https://img.shields.io/sonar/quality_gate/rios0rios0_code-guru?server=https%3A%2F%2Fsonarcloud.io\u0026style=for-the-badge\u0026logo=sonarqubecloud\" alt=\"Quality Gate\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.bestpractices.dev/projects/12023\"\u003e\n        \u003cimg src=\"https://img.shields.io/cii/level/12023?style=for-the-badge\u0026logo=opensourceinitiative\" alt=\"OpenSSF Best Practices\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nA CLI tool that leverages AI (Claude Code CLI or OpenAI API) to automatically review pull requests across GitHub and Azure DevOps, enforcing coding standards from configurable rule files.\n\n## Features\n\n- Multi-provider support via [gitforge](https://github.com/rios0rios0/gitforge): GitHub and Azure DevOps\n- Dual AI backend: Claude Code CLI (`claude --print`) or OpenAI Chat Completions API\n- Rule-based reviews using Markdown files from [guide](https://github.com/rios0rios0/guide) (or any directory)\n- YAML `frontmatter` in rules for file-glob-based filtering (e.g., `paths: [\"**/*.go\"]`)\n- Inline and general PR comments posted back via gitforge\n- Three modes: single PR review, batch review-all, and discover (list open PRs)\n\n## Installation\n\n```bash\ngo install github.com/rios0rios0/codeguru/cmd/code-guru@latest\n```\n\nOr build from source:\n\n```bash\ngit clone https://github.com/rios0rios0/code-guru.git\ncd code-guru\ngo build -o code-guru ./cmd/code-guru/\n```\n\n## Configuration\n\nCreate a `.code-guru.yaml` file (searched in `.`, `.config`, `configs`, `~`, `~/.config`):\n\n```yaml\nproviders:\n  - type: 'github'\n    token: '${GITHUB_TOKEN}'\n    organizations:\n      - 'rios0rios0'\n  - type: 'azuredevops'\n    token: '${AZURE_DEVOPS_PAT}'\n    organizations:\n      - 'MyOrg'\n\nai:\n  backend: 'claude'\n  claude:\n    binary_path: 'claude'\n    model: 'sonnet'\n    max_turns: 1\n  openai:\n    api_key: '${OPENAI_API_KEY}'\n    model: 'gpt-4o'\n\nrules:\n  path: '${HOME}/Development/github.com/rios0rios0/guide/.ai/claude/rules'\n  categories: []\n```\n\n### Token Resolution\n\nTokens support three resolution strategies:\n1. **Environment variable**: `${GITHUB_TOKEN}` expands from the environment\n2. **File path**: if the resolved string is a file path, its contents are read\n3. **Inline**: literal token string\n\n## Usage\n\n### Discover open PRs\n\n```bash\ncode-guru discover -c .code-guru.yaml\n```\n\n### Review all open PRs (batch mode)\n\n```bash\ncode-guru review-all -c .code-guru.yaml --dry-run\ncode-guru review-all -c .code-guru.yaml\n```\n\n### Review a single PR\n\n```bash\ncode-guru review https://github.com/org/repo/pull/123\ncode-guru review https://dev.azure.com/org/project/_git/repo/pullrequest/456\n```\n\n### Flags\n\n| Flag            | Description                                    |\n|-----------------|------------------------------------------------|\n| `-c, --config`  | Path to config file (default: auto-discover)   |\n| `--backend`     | AI backend: `openai`, `claude`, or `anthropic` |\n| `--rules-path`  | Path to rules directory                        |\n| `--dry-run`     | Run review without posting comments            |\n| `-v, --verbose` | Enable debug logging                           |\n\n## Supported Providers\n\n| Provider     | Type Key      | PR Comments | Inline Comments |\n|--------------|---------------|-------------|-----------------|\n| GitHub       | `github`      | Yes         | Yes             |\n| Azure DevOps | `azuredevops` | Yes         | Yes             |\n\n## AI Backends\n\n| Backend     | Key         | How It Works                                             |\n|-------------|-------------|----------------------------------------------------------|\n| Anthropic   | `anthropic` | Calls the Anthropic Messages API directly via Go SDK     |\n| Claude Code | `claude`    | Invokes `claude --print` CLI as a subprocess             |\n| OpenAI      | `openai`    | Calls the Chat Completions API with JSON response format |\n\n## AI Verdict\n\nEach review returns a verdict alongside comments:\n\n| Verdict            | Meaning                                        |\n|--------------------|------------------------------------------------|\n| `approve`          | No blocking issues, safe to merge              |\n| `request_changes`  | Error-level issues that must be fixed          |\n| `comment`          | Informational feedback only, not blocking      |\n\nThe verdict is printed as `VERDICT:\u003cvalue\u003e` for machine parsing.\n\n## Trivial PR Detection\n\nWhen trivial detection is enabled and CI has passed, PRs matching built-in adapters are handled **without calling the LLM**, saving tokens. In webhook mode, CI status is provided by the webhook event. In CLI mode, CI status detection is planned via gitforge's `GetPullRequestCheckStatus()` (not yet available).\n\nThere are two categories of trivial adapters:\n\n### Update Adapters (Dependency Updates)\n\nThese detect dependency update PRs and auto-approve them.\n\n| Adapter          | Matches When                                                  |\n|------------------|---------------------------------------------------------------|\n| `update-go`      | Only `go.mod`, `go.sum`, `CHANGELOG.md` changed              |\n| `update-node`    | Only `package.json`, lock files, `CHANGELOG.md` changed      |\n| `update-python`  | Only `pyproject.toml`, `requirements*.txt`, `CHANGELOG.md`   |\n\n### Bump Adapters (Version Bumps / Releases)\n\nThese detect version bump (release ceremony) PRs. If the repo contains an `.autobump.yaml` config file, the adapter validates that all version files declared in the config are present in the PR. Missing files result in a **reject** verdict.\n\n| Adapter          | Default Files                          | AutoBump Language Key |\n|------------------|----------------------------------------|-----------------------|\n| `bump-go`        | `CHANGELOG.md`                         | `go`                  |\n| `bump-node`      | `package.json`, `CHANGELOG.md`         | `typescript`          |\n| `bump-python`    | `*/__init__.py`, `CHANGELOG.md`        | `python`              |\n\n### Other Adapters\n\n| Adapter        | Matches When                                                    |\n|----------------|-----------------------------------------------------------------|\n| `docs-only`    | Only `*.md` files changed                                       |\n\n### Configuration\n\nConfigure in `.code-guru.yaml`:\n\n```yaml\ntrivial:\n  enabled: true\n  adapters:\n    - 'update-go'\n    - 'bump-go'\n    - 'docs-only'\n```\n\nOr via environment variables: `CODE_GURU_TRIVIAL_ADAPTERS=update-go,bump-go,docs-only`\n\n## Environment Variable Configuration\n\nFor CI/CD environments without a config file, all settings can be provided via `CODE_GURU_*` environment variables:\n\n| Variable                       | Description                       | Default              |\n|--------------------------------|-----------------------------------|----------------------|\n| `CODE_GURU_BACKEND`           | AI backend                         | `openai`             |\n| `CODE_GURU_OPENAI_API_KEY`    | OpenAI API key                     |                      |\n| `CODE_GURU_ANTHROPIC_API_KEY` | Anthropic API key                  |                      |\n| `CODE_GURU_RULES_PATH`        | Path to rules directory            |                      |\n| `CODE_GURU_PROVIDER_TOKEN`    | Git provider token                 |                      |\n| `CODE_GURU_TRIVIAL_ADAPTERS`  | Comma-separated adapter names      |                      |\n\n## Rules\n\nRules are Markdown files loaded from the configured `rules.path`. Each file represents a rule category (e.g., `security.md`, `golang.md`, `testing.md`).\n\nRules can include YAML `frontmatter` with `paths` globs for file-specific filtering:\n\n```markdown\n---\npaths:\n  - \"**/*.go\"\n---\n# Go Conventions\n\nUse `gofmt` for formatting...\n```\n\nUniversal categories (always included): `architecture`, `ci-cd`, `code-style`, `design-patterns`, `documentation`, `git-flow`, `security`, `testing`.\n\n## Contributing\n\nContributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## License\n\nSee [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frios0rios0%2Fcode-guru","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frios0rios0%2Fcode-guru","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frios0rios0%2Fcode-guru/lists"}