Skip to content

mvp-0.0.1

mvp-0.0.1 #16

# .github/workflows/claude-code-review.yml
name: Claude code review (strict)
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
concurrency:
group: claude-review-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
claude-review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Load CLAUDE.md rules
id: rules
shell: bash
run: |
echo 'guidelines<<EOF' >> "$GITHUB_OUTPUT"
sed -n '1,6000p' CLAUDE.md >> "$GITHUB_OUTPUT"
echo 'EOF' >> "$GITHUB_OUTPUT"
- name: Run Claude (repo-wide checklist, file-by-file)
id: claude
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
prompt: |
You are a STRICT reviewer. Enforce every rule in CLAUDE.md across the entire repo.
Build a YES/NO checklist for each rule per file. Include focused patch suggestions.
Scope:
- Enumerate Scala/SBT files: git ls-files '*.scala' '*.sbt'
- Also consider configs affecting Scala builds: git ls-files '.scalafmt.conf' 'build.sbt' 'project/*.scala' 'project/*.sbt' 'project/build.properties'
- Apply ALL rules from CLAUDE.md to each discovered file (not just PR diffs).
Output:
- One markdown report grouped by file
- For each rule: ✅ PASS or ❌ FAIL with a minimal diff/patch
- A short "Top 10 Fixes" summary
- Final line MUST be exactly:
CLAUDE_RULES_STATUS: PASS # or FAIL
Rules to enforce:
---
${{ steps.rules.outputs.guidelines }}
---
# Use GA-style CLI flags; give Claude deterministic tools for repo-wide scans.
claude_args: >-
--allowedTools
"Read"
"Edit"
"MultiEdit"
"Bash(git ls-files:*)"
"Bash(rg:*)"
"Bash(find:*)"
"Bash(sed:*)"
"Bash(xargs:*)"
"Bash(gh pr view:*)"
"Bash(gh pr comment:*)"
--max-turns 10
--verbose
env:
GH_TOKEN: ${{ github.token }}
- name: Fail the job unless all rules passed
if: always()
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
pr="${{ github.event.pull_request.number }}"
# Aggregate all comments and look for the sentinel line.
body="$(gh pr view "$pr" --json comments -q '.comments[].body' || true)"
echo "=== Tail of PR comments ==="
echo "$body" | tail -n 40 || true
echo "$body" | grep -q 'CLAUDE_RULES_STATUS: PASS'