From 5985e47386141f0054832c9556bd97648d48fcfa Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 4 Jan 2026 18:31:24 +0000 Subject: [PATCH] Add automated Claude Code PR review workflow Configure GitHub Action to automatically review PRs using Claude Opus 4.5. Reviews check for methodology correctness, code quality, tech debt, testing, and security considerations specific to the diff-diff library. --- .github/workflows/claude-code-review.yml | 81 ++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/claude-code-review.yml diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml new file mode 100644 index 0000000..745c3b5 --- /dev/null +++ b/.github/workflows/claude-code-review.yml @@ -0,0 +1,81 @@ +name: Claude Code PR Review + +on: + pull_request: + types: [opened, synchronize, reopened] + +permissions: + contents: read + pull-requests: write + +jobs: + claude-code-review: + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Run Claude Code Review + uses: anthropics/claude-code-action@v1 + with: + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + model: claude-opus-4-5-20251101 + prompt: | + Perform a comprehensive code review of the changes in this PR. Provide actionable feedback with specific line references. + + ## Review Criteria + + ### 1. Methodology & Best Practices + - Statistical/econometric correctness for DiD estimators + - Proper implementation of causal inference methods + - Correct standard error calculations and inference + - Appropriate handling of panel data structures + - Valid assumptions and edge case handling + + ### 2. Code Quality + - Adherence to the sklearn-like API pattern (fit/transform methods) + - Consistent with existing codebase patterns + - Clear, readable code with appropriate naming + - Proper type hints where used in the codebase + - Adequate error handling and input validation + + ### 3. Technical Debt Minimization + - No duplicated logic that should be extracted + - Appropriate abstractions (not over/under-engineered) + - Clean separation of concerns + - No hardcoded values that should be configurable + - No commented-out code or debug statements + + ### 4. Testing & Documentation + - Adequate test coverage for new functionality + - Edge cases and error conditions tested + - Tests follow existing patterns in tests/ + - Docstrings for public APIs + - Updates to relevant documentation if needed + + ### 5. Security & Performance + - No potential security vulnerabilities + - Efficient algorithms for large datasets + - Memory-conscious implementations + - No unnecessary dependencies + + ## Output Format + + Provide your review in this structure: + + **Overall Recommendation**: [APPROVE / REQUEST CHANGES / COMMENT] + + **Summary**: Brief overview of the changes and overall assessment. + + **Detailed Findings**: + For each issue found, provide: + - File and line number + - Severity: 🔴 Critical / 🟡 Suggestion / 🟢 Nitpick + - Description of the issue + - Recommended fix + + **Positive Observations**: Note any particularly well-implemented aspects.