Skip to content

brycewang-stanford/Auto-Empirical-Research-Skills / skills/33-Galaxy-Dawn-claude-scholar/skills/code-review-excellence

code-review-excellence

Verified

This skill should be used when the user asks to review a diff or pull request, write review comments, audit code quality, establish review standards, or improve how a team performs code review.

scripts/pr-analyzer.py

View on GitHub
#!/usr/bin/env python3
from __future__ import annotations

import argparse
import subprocess
from pathlib import Path


def parse_args() -> argparse.Namespace:
    parser = argparse.ArgumentParser(description='Summarize git diff size for review planning.')
    parser.add_argument('--repo', default='.', help='Repository path')
    parser.add_argument('--base', default='HEAD~1', help='Base revision')
    parser.add_argument('--head', default='HEAD', help='Head revision')
    return parser.parse_args()


def main() -> int:
    args = parse_args()
    repo = Path(args.repo).resolve()
    result = subprocess.run(
        ['git', '-C', str(repo), 'diff', '--numstat', args.base, args.head],
        capture_output=True,
        text=True,
        check=False,
    )
    if result.returncode != 0:
        print(result.stderr.strip() or 'git diff failed')
        return result.returncode
    files = 0
    added = 0
    deleted = 0
    for line in result.stdout.splitlines():
        parts = line.split('	')
        if len(parts) != 3:
            continue
        a, d, _ = parts
        if a.isdigit():
            added += int(a)
        if d.isdigit():
            deleted += int(d)
        files += 1
    print(f'files={files}')
    print(f'added={added}')
    print(f'deleted={deleted}')
    return 0


if __name__ == '__main__':
    raise SystemExit(main())
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall