claude-skills/engineering-team/skills/code-reviewer
Claude 7b1abd5e8a
fix: close remaining v2.14.0 audit P2 items
- Rewrite code-reviewer, self-improving-agent, session-handoff, handoff and
  si:remember descriptions to lead with the user's ask; trigger evals go from
  1/24 to 15/28 positive hits with no false fires.
- Move OWASP references from Top 10:2021 to Top 10:2025 (pen-testing scanner,
  checklist, report example, secops/backend/security references) with a
  2021-to-2025 mapping table and new A10 Mishandling of Exceptional Conditions.
- Replace deprecated datetime.utcnow() in 15 scripts and hooks with identical
  output, and block it in CI.
- Make gate G9 blocking as a ratchet over a 240-tool legacy baseline.
- Fix INSTALLATION.md drift (Vibe flat layout, Codex advice, skill counts),
  add install lines to 35 plugin READMEs, regenerate all 20 agent-harness
  manifests and the docs site.
- Bump the 43 changed plugins to 2.14.2.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HXynYUKMCEpmhMQjyTx8J
2026-10-26 12:56:55 +00:00
..
assets feat(code-reviewer): C-specific smell detector + fixtures 2026-05-28 14:27:26 +00:00
expected_outputs feat(code-reviewer): C-specific smell detector + fixtures 2026-05-28 14:27:26 +00:00
languages feat(code-reviewer): add C, C++, Rust, Ruby, PHP, and Dart/Flutter language support (#769) 2026-05-28 08:26:14 +02:00
rules refactor(code-reviewer): — universal rules + per-language files 2026-05-25 13:15:37 +01:00
scripts feat(code-reviewer): C-specific smell detector + fixtures 2026-05-28 14:27:26 +00:00
README.md feat(code-reviewer): C-specific smell detector + fixtures 2026-05-28 14:27:26 +00:00
SKILL.md fix: close remaining v2.14.0 audit P2 items 2026-10-26 12:56:55 +00:00

code-reviewer

Code review automation for TypeScript, JavaScript, Python, Go, Swift, Kotlin, C#, .NET, Java, C, C++, Rust, Ruby, PHP, and Dart/Flutter. Analyzes PRs for complexity and risk, checks code quality for SOLID violations and code smells, and generates review reports.

The full skill spec is SKILL.md. This README is a quick reference for the 3 bundled scripts.


How to use

Quick install check

python scripts/pr_analyzer.py --help
python scripts/code_quality_checker.py --help
python scripts/review_report_generator.py --help

All three scripts are stdlib-only — no pip install required.

Example 1 — review a pull request

# From inside the repo you want to analyze:
python /path/to/skills/code-reviewer/scripts/pr_analyzer.py . --base main --head HEAD

Outputs: complexity score (1-10), risk categorization (critical / high / medium / low), prioritized review order, commit-message validation.

Example 2 — score a directory's code quality

python scripts/code_quality_checker.py /path/to/code

# Filter by language
python scripts/code_quality_checker.py /path/to/code --language csharp

# Machine-readable
python scripts/code_quality_checker.py /path/to/code --json

Outputs: quality score (0-100), letter grade, detected code smells, SOLID violations.

Example 3 — combine into a review report

python scripts/review_report_generator.py /path/to/repo --format markdown --output review.md

Outputs: review verdict (approve / request changes / block), score, prioritized action items.


Examples bundled with the skill

File Purpose
assets/sample_csharp_smells.cs C# file with every C#-specific pattern this skill detects, labelled inline
assets/sample_csharp_clean.cs Same code refactored per rules/universal.md + languages/csharp.md
assets/sample_java_smells.java Java file with every Java-specific pattern this skill detects, labelled inline
assets/sample_java_clean.java Same code refactored per rules/universal.md + languages/java.md
assets/sample_c_smells.c C file with every C-specific pattern this skill detects, labelled inline
assets/sample_c_clean.c Same code refactored per rules/universal.md + languages/c.md
expected_outputs/*.json Expected code_quality_checker.py --json output for each fixture

Use them as a regression-detection harness:

python scripts/code_quality_checker.py assets/sample_java_smells.java --json > /tmp/check.json
diff /tmp/check.json expected_outputs/sample_java_smells_quality.json
# silence means the detector still behaves as documented

What it detects

See SKILL.md for the full pattern list, severity tiers, and references. Quick summary:

  • PR Analyzer (scripts/pr_analyzer.py): hardcoded secrets / connection strings, SQL injection, debug statements (console.* / System.out / printStackTrace), analyzer suppressions (ESLint / Roslyn / @SuppressWarnings), any / dynamic overuse, TODO/FIXME, unsafe blocks, null-forgiving !, async void, blocking on Task.
  • Code Quality Checker (scripts/code_quality_checker.py): long methods, large files, god classes, deep nesting, too many parameters, high cyclomatic complexity, swallowed exceptions, missing await, undisposed IDisposable, new HttpClient() in method body, unused using directives. Language-specific smell packs for C# (async void, blocking on Task), Java (empty catch, printStackTrace, swallowed InterruptedException, unclosed resources, per-call ObjectMapper / Gson), and C (banned functions gets/strcpy/strcat/sprintf/vsprintf, format-string vulnerability printf(var), unbounded scanf("%s"), malloc-without-NULL-check, free-without-zeroing, system() with non-literal argument).
  • Review Report Generator (scripts/review_report_generator.py): combines the above into a single markdown or JSON verdict.

Review rules

Rules are split so every review loads exactly two files — the cross-language baseline plus one language guide (see the dispatch table in SKILL.md):

  • rules/universal.md — cross-language rules: security, async/concurrency, resource management, exception handling, performance
  • languages/ — one self-contained guide per language (python, typescript, go, swift, kotlin, csharp, java, c, cpp, rust, ruby, php, dart), each with Security / Async / Resource Management / Exception Handling / Performance / Idioms sections