Skip to content

chore: add CodeRabbit + Claude GitHub App automation for issues and PRs - #214

Merged
allxsmith merged 5 commits into
mainfrom
claude/code-rabbit-claude-setup-uq8p9c
Jul 5, 2026
Merged

allxsmith merged 5 commits into
mainfrom
claude/code-rabbit-claude-setup-uq8p9c

Conversation

@allxsmith

@allxsmith allxsmith commented Jul 4, 2026 •

Copy link
Copy Markdown
Owner

Pull Request

Description

Adds the AI-automation layer for issues and PRs — the "companion automation" that #204 scoped out and left pending. Two config files, sitting on top of the CLAUDE.md instruction layer that #204 already shipped:

  • .github/workflows/claude.yml — the @claude assistant for issues/PRs (answer, implement fixes, open PRs). Gated by author_association so only OWNER/MEMBER/COLLABORATOR can trigger it — this is the primary guard against strangers spending Claude usage on a public repo. Pre-provisions pnpm + Node 24 so @claude can run the repo's checks. Auth via CLAUDE_CODE_OAUTH_TOKEN (Claude Max subscription; swap to ANTHROPIC_API_KEY if preferred).
  • .coderabbit.yaml — automatic PR reviews with per-package path_instructions (bulma-ui coverage/a11y/story+test expectations, create-bestax e2e, docs MDX) and noise filters for lockfiles/snapshots/dist. CodeRabbit is free for public repos and billed on its own account — it does not consume Anthropic usage.

All action refs are commit-SHA-pinned to the versions already used elsewhere in the repo (checkout, pnpm/action-setup, setup-node) plus anthropics/claude-code-action.

Note: the branch also aligns its root CLAUDE.md with the canonical #204 version, and adds a single line noting that CodeRabbit and the @claude action read this file. No other CLAUDE.md files are touched.

  • bulma-ui (@allxsmith/bestax-bulma)
  • create-bestax (create-bestax)
  • docs (@allxsmith/bestax-docs)
  • Other: repo tooling / CI (root .coderabbit.yaml, .github/workflows/claude.yml, root CLAUDE.md)

Related Issue(s)

Refs #204 (this is the pending "CodeRabbit + Claude GitHub App rollout" companion it referenced)

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Performance
  • Build tooling
  • Other: CI / repository automation

Checklist

  • My code follows the project style guidelines
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or that my feature works
  • I have added/updated documentation as needed
  • I have updated Storybook stories as needed (bulma-ui)
  • My changes require a change to the documentation
  • All new and existing tests passed
  • Any relevant dependencies are updated

Additional Context

Manual steps the maintainer performs to activate (cannot be done in code):

  1. Install the Claude GitHub App on allxsmith/bestax and add repo secret CLAUDE_CODE_OAUTH_TOKEN (claude setup-token).
  2. Install the CodeRabbit GitHub App (free OSS tier).
  3. Confirm Settings → Actions → General requires approval for outside collaborators (defense-in-depth on top of the author_association gate).

Usage-protection layers built in: (1) the author_association if: gate, (2) GitHub's outside-contributor approval, (3) per-run --max-turns cap, (4) account-level limits (Max subscription / API spend cap).


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Added an assistant workflow that responds to a specified trigger in supported issue and pull request events.
  • Chores

    • Updated automated review settings to improve consistency and reduce noise, including automatically reviewing eligible pull requests.
    • Excluded generated and snapshot-like files (and common build outputs) from automated review.
  • Documentation

    • Clarified that CLAUDE workflow guidance is also consumed by automated reviewers, and should remain accurate.

claude added 2 commits July 4, 2026 17:59
- Add .github/workflows/claude.yml: @claude assistant for issues/PRs,
  gated by author_association (OWNER/MEMBER/COLLABORATOR) to protect usage
- Add .coderabbit.yaml: auto PR reviews with per-package path instructions
- Add curated CLAUDE.md: project map, commands, and non-negotiables read by
  both Claude and CodeRabbit

Sets up Bun-style AI review + assistant on issues and pull requests. All
action refs are commit-SHA-pinned to match the repo's security posture.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019nyiYvdzow65mRj1kHkwRj
- Replace the earlier branch-local root CLAUDE.md with the canonical
  version already released on main (#204), so this branch does not diverge
  from the coordinated CLAUDE.md set. The CodeRabbit/@claude note is added
  in a follow-up commit once the branch is current with main.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019nyiYvdzow65mRj1kHkwRj
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Preview Deployment

Preview URL: https://9bcb993d.bestax.pages.dev

claude added 2 commits July 5, 2026 00:10
- Add one line to the root CLAUDE.md stating that CodeRabbit (PR reviews)
  and the @claude GitHub Action (project instructions) both read this file,
  so it should be kept accurate.
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Preview Deployment

Preview URL: https://cbd51fce.bestax.pages.dev

@coderabbitai

coderabbitai Bot commented Jul 5, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0f357caf-3cc1-4f0a-bc9e-98664062e041

📥 Commits

Reviewing files that changed from the base of the PR and between ae7deed and 0ef9e67.

📒 Files selected for processing (1)
  • .coderabbit.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .coderabbit.yaml

Walkthrough

Adds a CodeRabbit configuration, a GitHub Actions workflow for @claude-triggered runs, and a CLAUDE.md note that both tools read that file.

Changes

Automation tooling setup

Layer / File(s) Summary
CodeRabbit review configuration
.coderabbit.yaml
Adds full CodeRabbit config: review profile, summary/status settings, auto-review scoping to main, path-specific instructions, path filters excluding generated artifacts, chat auto-reply, and knowledge-base learning scope.
Claude workflow triggers and permissions
.github/workflows/claude.yml
Defines event triggers for issue and PR comment/review activity, job permissions, and a guard requiring @claude plus a trusted author association.
Claude job execution steps
.github/workflows/claude.yml
Adds checkout with full history, pnpm and Node.js 24 setup with caching, and the claude-code-action step using a stored OAuth token with model and max-turns arguments.
CLAUDE.md documentation update
CLAUDE.md
Extends the Workflow section to note that CodeRabbit and the @claude GitHub Action read this file and to keep it accurate.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: ci, documentation, configuration

Suggested reviewers: None specified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding CodeRabbit and Claude automation for issues and PRs.
Description check ✅ Passed The description mostly matches the template, including summary, affected areas, related issue, type, checklist, and context.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/code-rabbit-claude-setup-uq8p9c

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/claude.yml (1)

51-61: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Toolchain is pre-provisioned but dependencies aren't installed.

The comment states this step exists "so @claude can run tests/lint/build without burning turns bootstrapping the environment," but there's no pnpm install step. Claude will still need to spend a turn running pnpm install --frozen-lockfile before it can run tests/lint/build, partially defeating the stated purpose.

Suggested fix: add an install step
       - name: Setup Node.js
         uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
         with:
           node-version: '24'
           cache: 'pnpm'
 
+      - name: Install dependencies
+        run: pnpm install --frozen-lockfile
+
       - name: Run Claude
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/claude.yml around lines 51 - 61, The workflow
pre-provisions pnpm and Node.js in claude.yml, but it never installs project
dependencies, so `@claude` still has to bootstrap before tests/lint/build can run.
Add an explicit dependency installation step after Setup Node.js (using pnpm
install with frozen lockfile) so the environment is fully ready before later job
steps. Use the existing Setup pnpm and Setup Node.js steps as the anchor points
for where to insert it.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/claude.yml:
- Around line 51-61: The workflow pre-provisions pnpm and Node.js in claude.yml,
but it never installs project dependencies, so `@claude` still has to bootstrap
before tests/lint/build can run. Add an explicit dependency installation step
after Setup Node.js (using pnpm install with frozen lockfile) so the environment
is fully ready before later job steps. Use the existing Setup pnpm and Setup
Node.js steps as the anchor points for where to insert it.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ec54af50-6b2a-4c6d-9552-5dd5acf364a6

📥 Commits

Reviewing files that changed from the base of the PR and between b1942ea and ae7deed.

📒 Files selected for processing (3)
  • .coderabbit.yaml
  • .github/workflows/claude.yml
  • CLAUDE.md

@allxsmith

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 5, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Owner Author

@coderabbitai full review


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Jul 5, 2026 •

Copy link
Copy Markdown

@allxsmith: Sure, I'll perform a full review of all the changes in this PR.

✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.coderabbit.yaml:
- Around line 23-29: The bulma-ui review guidance is weaker than the repo’s
actual coverage gate, so update the instruction text in the config entry to
match the documented 99% requirement rather than 95%. Adjust the bulma-ui block
in .coderabbit.yaml so reviewers flag any change that would drop overall
coverage below 99% for all metrics, keeping the existing TypeScript,
accessibility, Storybook, and Jest expectations intact.
- Around line 52-53: The `auto_review_labels` setting at the top level is being
ignored, so the `coderabbit` label gate never takes effect. Move this label
filter into the `reviews.auto_review.labels` section in `.coderabbit.yaml`, and
keep the existing `coderabbit` value there so the auto-review logic uses the
correct gate.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9fe62729-057c-4855-8cb1-df64cf98ac61

📥 Commits

Reviewing files that changed from the base of the PR and between b1942ea and ae7deed.

📒 Files selected for processing (3)
  • .coderabbit.yaml
  • .github/workflows/claude.yml
  • CLAUDE.md

Comment thread .coderabbit.yaml Outdated
Comment thread .coderabbit.yaml Outdated
Comment on lines +52 to +53
auto_review_labels:
- 'coderabbit'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the config file around the referenced lines and locate any schema/docs references.
echo "== .coderabbit.yaml (around lines 40-70) =="
nl -ba .coderabbit.yaml | sed -n '40,70p'

echo
echo "== Files mentioning auto_review_labels or reviews.auto_review.labels =="
rg -n --hidden --glob '!.git' 'auto_review_labels|reviews\.auto_review\.labels|auto_review:' .

echo
echo "== Candidate docs/config files =="
fd -a -H -I -t f 'coderabbit|yaml|yml|md' .

Repository: allxsmith/bestax

Length of output: 238


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== .coderabbit.yaml excerpt =="
sed -n '1,120p' .coderabbit.yaml

echo
echo "== Repository references =="
rg -n --hidden --glob '!.git' 'auto_review_labels|reviews\.auto_review\.labels|auto_review:' .

echo
echo "== YAML keys near auto_review =="
python3 - <<'PY'
from pathlib import Path
p = Path('.coderabbit.yaml')
text = p.read_text()
for i, line in enumerate(text.splitlines(), 1):
    if 'auto_review' in line or 'label' in line.lower():
        print(f'{i}: {line}')
PY

Repository: allxsmith/bestax

Length of output: 2569


🌐 Web query:

CodeRabbit configuration schema auto_review_labels reviews.auto_review.labels site:docs.coderabbit.ai OR site:coderabbit.ai

💡 Result:

In the CodeRabbit configuration schema, the reviews.auto_review.labels setting is used to control which pull requests are automatically reviewed based on their labels [1][2]. This setting allows for both positive inclusion and negative exclusion of pull requests [1][2]. Configuration Details: - The setting accepts an array of strings [1]. - Labels starting with a ! character act as negative filters (exclusions) [1][2]. - An empty array [] (the default) means all pull requests are reviewed, with no label filtering applied [1][2]. Examples of usage: - ["bug", "feature"]: Only reviews pull requests that have the bug or feature label [1][2]. - ["!wip"]: Reviews all pull requests except those labeled wip [1][2]. - ["bug", "!wip"]: Reviews pull requests that are labeled bug but do not have the wip label [1][2]. Important Behavior: The labels setting can also trigger an automatic review even when reviews.auto_review.enabled is set to false [1][2]. This enables users to implement a label-driven, opt-in workflow where automatic reviews are globally disabled, and only pull requests with specific, approved labels are reviewed [1]. You can view the currently resolved configuration for a pull request by using the @coderabbitai configuration command in a PR comment [3]. This command provides the configuration in YAML format, including annotations about where each setting originated (e.g., repository file, central configuration, or UI settings) [3].

Citations:


Move the label filter under reviews.auto_review .coderabbit.yaml:52-53

auto_review_labels is ignored here; the label filter belongs at reviews.auto_review.labels, so this never applies the coderabbit gate.

Suggested fix
   auto_review:
     enabled: true
     drafts: false
     base_branches:
       - main
+    labels:
+      - 'coderabbit'
...
-  auto_review_labels:
-    - 'coderabbit'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.coderabbit.yaml around lines 52 - 53, The `auto_review_labels` setting at
the top level is being ignored, so the `coderabbit` label gate never takes
effect. Move this label filter into the `reviews.auto_review.labels` section in
`.coderabbit.yaml`, and keep the existing `coderabbit` value there so the
auto-review logic uses the correct gate.

…red label key

- Update bulma-ui path_instructions to require >= 99% coverage (all metrics),
  matching the actual CI gate (CLAUDE.md), instead of 95%.
- Remove the top-level auto_review_labels key, which CodeRabbit's schema
  ignores. Relocating it to reviews.auto_review.labels would gate auto-review
  to only PRs labeled 'coderabbit'; we want every PR reviewed, so drop it and
  keep the default (review all PRs).

Addresses CodeRabbit review on PR #214.

Copy link
Copy Markdown
Owner Author

Thanks @coderabbitai — both findings addressed in 0ef9e67:

  1. bulma-ui coverage guidance — updated to require >= 99% for all metrics, matching the actual CI gate documented in CLAUDE.md. ✅

  2. auto_review_labels — you're right that the top-level key is ignored. I removed it rather than relocating it to reviews.auto_review.labels, though: per the schema, reviews.auto_review.labels: ['coderabbit'] would restrict auto-review to only PRs carrying the coderabbit label, whereas the intent here is to review every PR. Dropping the stray key keeps the default (all PRs reviewed), which is the desired behavior. The label was spurious in the original config.


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

@allxsmith Thanks for the update and the clear explanation on both points.

  1. The >= 99% coverage requirement in the bulma-ui path instructions now correctly matches the CI gate — good catch aligning it with CLAUDE.md.
  2. Your reasoning on auto_review_labels is correct. Removing the stray top-level key is the right call here — under reviews.auto_review.labels, that setting acts as a filter restricting auto-reviews to only PRs carrying the listed label(s), not an instruction to apply labels. Since the goal is to review every PR, dropping it (and keeping the default of reviewing all PRs) is the correct fix rather than relocating it.

Both findings look properly resolved in 0ef9e67.

🐇✨


✏️ Learnings added
Learnt from: allxsmith
URL: https://github.com/allxsmith/bestax/pull/214

Timestamp: 2026-07-05T01:35:10.034Z
Learning: In the allxsmith/bestax repository, `.coderabbit.yaml`'s `reviews.auto_review.labels` key acts as a filter restricting automatic reviews to only PRs carrying the listed label(s) — it does not apply labels to PRs. The intent for this repo is to auto-review every PR, so this key should be omitted entirely (relying on the default of reviewing all PRs) rather than set to a specific label like `coderabbit`.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Preview Deployment

Preview URL: https://036523af.bestax.pages.dev

@allxsmith
allxsmith merged commit 7fc7823 into main Jul 5, 2026
10 checks passed
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 5.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@allxsmith
allxsmith deleted the claude/code-rabbit-claude-setup-uq8p9c branch July 31, 2026 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants