|
| 1 | +name: 📝 CLAUDE.md Audit |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: [opened, ready_for_review, synchronize] |
| 6 | + paths-ignore: |
| 7 | + - "docs/**" |
| 8 | + - ".changeset/**" |
| 9 | + - ".server-changes/**" |
| 10 | + - "**/*.md" |
| 11 | + - "references/**" |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: claude-md-audit-${{ github.event.pull_request.number }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +jobs: |
| 18 | + audit: |
| 19 | + if: github.event.pull_request.draft == false |
| 20 | + runs-on: ubuntu-latest |
| 21 | + permissions: |
| 22 | + contents: read |
| 23 | + pull-requests: write |
| 24 | + issues: write |
| 25 | + id-token: write |
| 26 | + steps: |
| 27 | + - name: Checkout repository |
| 28 | + uses: actions/checkout@v4 |
| 29 | + with: |
| 30 | + fetch-depth: 0 |
| 31 | + |
| 32 | + - name: Run Claude Code |
| 33 | + id: claude |
| 34 | + uses: anthropics/claude-code-action@v1 |
| 35 | + with: |
| 36 | + claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} |
| 37 | + use_sticky_comment: true |
| 38 | + |
| 39 | + claude_args: | |
| 40 | + --max-turns 15 |
| 41 | + --allowedTools "Read,Glob,Grep,Bash(git diff:*)" |
| 42 | +
|
| 43 | + prompt: | |
| 44 | + You are reviewing a PR to check whether any CLAUDE.md files or .claude/rules/ files need updating. |
| 45 | +
|
| 46 | + ## Your task |
| 47 | +
|
| 48 | + 1. Run `git diff origin/main...HEAD --name-only` to see which files changed in this PR. |
| 49 | + 2. For each changed directory, check if there's a CLAUDE.md in that directory or a parent directory. |
| 50 | + 3. Determine if any CLAUDE.md or .claude/rules/ file should be updated based on the changes. Consider: |
| 51 | + - New files/directories that aren't covered by existing documentation |
| 52 | + - Changed architecture or patterns that contradict current CLAUDE.md guidance |
| 53 | + - New dependencies, services, or infrastructure that Claude should know about |
| 54 | + - Renamed or moved files that are referenced in CLAUDE.md |
| 55 | + - Changes to build commands, test patterns, or development workflows |
| 56 | +
|
| 57 | + ## Response format |
| 58 | +
|
| 59 | + If NO updates are needed, respond with exactly: |
| 60 | + ✅ CLAUDE.md files look current for this PR. |
| 61 | +
|
| 62 | + If updates ARE needed, respond with a short list: |
| 63 | + 📝 **CLAUDE.md updates suggested:** |
| 64 | + - `path/to/CLAUDE.md`: [what should be added/changed] |
| 65 | + - `.claude/rules/file.md`: [what should be added/changed] |
| 66 | +
|
| 67 | + Keep suggestions specific and brief. Only flag things that would actually mislead Claude in future sessions. |
| 68 | + Do NOT suggest updates for trivial changes (bug fixes, small refactors within existing patterns). |
| 69 | + Do NOT suggest creating new CLAUDE.md files - only updates to existing ones. |
0 commit comments