Skip to content

feat: integrate Claude Code @simili-bot for AI-assisted PR fixes#106

Merged
Kavirubc merged 2 commits intomainfrom
feat/claude-code-integration
Mar 11, 2026
Merged

feat: integrate Claude Code @simili-bot for AI-assisted PR fixes#106
Kavirubc merged 2 commits intomainfrom
feat/claude-code-integration

Conversation

@Kavirubc
Copy link
Copy Markdown
Contributor

@Kavirubc Kavirubc commented Mar 11, 2026

Description

Integrates Claude Code into simili-bot so PR authors and org members can comment @simili-bot <query> to trigger AI-assisted code changes.

Type of Change

  • ✨ New feature (non-breaking change that adds functionality)

Related Issues

Closes #105

Changes Made

Go Code

  • internal/steps/claude_code_handler.go (new): Parses @simili-bot queries, validates author_association (OWNER/MEMBER/COLLABORATOR only), detects -opus flag, writes GitHub Actions outputs
  • internal/steps/command_handler.go: Detects @simili-bot trigger before slash-commands
  • internal/core/pipeline/pipeline.go: Added CommentAuthorAssociation to Issue struct
  • cmd/simili/commands/process.go: Extracts author_association from GitHub event JSON

Action & Workflow

  • action.yml: Added 3 outputs (claude_code_triggered, claude_code_query, claude_code_model_override)
  • .github/workflows/triage.yml: Added conditional claude-code-action step after simili-bot

Docs

  • DOCS/examples/single-repo/workflow.yml: Updated example with Claude Code step
  • DOCS/single-repo-setup.md: Added Step 4 for enabling Claude Code
  • CLAUDE.md: Repo context file for Claude Code

How It Works

  1. User comments @simili-bot fix the errors on a PR
  2. Go code validates the author is an org member
  3. Writes GitHub Actions outputs signaling Claude Code should run
  4. Conditional workflow step invokes claude-code-action
  5. Claude makes changes and pushes a commit

Testing

  • I have run go build ./... successfully
  • I have run go test ./... successfully
  • I have run go vet ./... successfully
  • YAML lint passes on all workflow files

Usage

@simili-bot Fix the error handling issues    (uses latest Sonnet)
@simili-bot -opus Refactor this module       (uses Opus)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • New Features

    • Claude Code integration via @simili-bot comments for AI-assisted code fixes, with optional model override.
    • Comment-based trigger respects commenter role (only authorized associations can invoke).
    • Workflows now respond to issue_comment and pull_request_review_comment events and include new outputs for conditional steps.
    • Action reference updated to main branch for workflow steps.
  • Documentation

    • New CLAUDE.md and updated setup guides with authentication and usage instructions.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 11, 2026

Warning

Rate limit exceeded

@Kavirubc has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 14 minutes and 22 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 72378856-2a88-487e-aa52-458d861934e8

📥 Commits

Reviewing files that changed from the base of the PR and between 2db4e38 and bf181a0.

📒 Files selected for processing (10)
  • .github/workflows/triage.yml
  • CLAUDE.md
  • DOCS/examples/multi-repo/shared-workflow.yml
  • DOCS/examples/single-repo/workflow.yml
  • DOCS/single-repo-setup.md
  • action.yml
  • cmd/simili/commands/process.go
  • internal/core/pipeline/pipeline.go
  • internal/steps/claude_code_handler.go
  • internal/steps/command_handler.go
📝 Walkthrough

Walkthrough

Adds Claude Code support: workflow trigger and permission changes, new Claude Code handler that validates commenter association and emits GitHub Actions outputs, command routing to the handler, Issue model enrichment for comment author association, action outputs, and related documentation and workflow examples.

Changes

Cohort / File(s) Summary
Workflows & Examples
.github/workflows/triage.yml, DOCS/examples/single-repo/workflow.yml, DOCS/examples/multi-repo/shared-workflow.yml
Added pull_request_review_comment trigger, expanded permissions (contents: write, id-token: write, actions: read), excluded additional bot actors, switched action refs to @main and added id: simili; introduced conditional Claude Code step in example workflows.
Action Outputs
action.yml
Added outputs: claude_code_triggered, claude_code_query, claude_code_model_override.
Claude Code Handler & Integration
internal/steps/claude_code_handler.go, internal/steps/command_handler.go
New handler that checks commenter association, parses @simili-bot queries and optional -opus override, writes GITHUB_OUTPUT variables (supports multi-line), signals to skip triage; command handler now early-routes @simili-bot comments to this handler.
Data Model / Enrichment
internal/core/pipeline/pipeline.go, cmd/simili/commands/process.go
Added CommentAuthorAssociation string to Issue struct and populated it from comment payload during event enrichment.
Documentation & Setup
CLAUDE.md, DOCS/single-repo-setup.md
Introduced CLAUDE.md; expanded single-repo setup with optional Claude Code setup, OAuth token guidance, and usage examples.

Sequence Diagram

sequenceDiagram
    actor Author as PR Author
    participant GitHub
    participant Workflow as GitHub Workflow
    participant Simili as Simili Bot
    participant Handler as Claude Code Handler
    participant GOut as GITHUB_OUTPUT
    participant Claude as Claude Code Action

    Author->>GitHub: Post comment "@simili-bot <query>"
    GitHub->>Workflow: issue_comment / pull_request_review_comment trigger
    Workflow->>Simili: Run Simili Bot step
    Simili->>Handler: Detect `@simili-bot` trigger
    Handler->>Handler: Validate author association (OWNER/MEMBER/COLLABORATOR)
    alt Unauthorized
        Handler->>GitHub: Post warning comment
        Handler->>Workflow: Signal skip triage
    else Authorized
        Handler->>Handler: Parse query and optional model override (-opus)
        Handler->>GOut: Write claude_code_triggered, claude_code_query, claude_code_model_override
        Workflow->>Claude: Run Claude Code Action with OAuth token & query
        Claude->>GitHub: Push commit / update PR
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested labels

automation, ci/cd

Poem

🐇 I nibble code by moonlit bytes,

simili-bot< summons clever lights,
I parse the note and hop to fix,
With Claude's soft hum and tiny tricks,
A rabbit's patch—soft, swift delights.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately reflects the main objective of integrating Claude Code into simili-bot for AI-assisted PR fixes via @simili-bot comments.
Linked Issues check ✅ Passed The PR implements all core objectives from issue #105: trigger validation, authorization checks (OWNER/MEMBER/COLLABORATOR), GitHub Actions outputs, conditional workflow integration, OAuth token support, and documentation.
Out of Scope Changes check ✅ Passed All changes are directly related to integrating Claude Code functionality. No unrelated refactoring, dependency updates, or out-of-scope modifications are present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/claude-code-integration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@gh-simili-bot
Copy link
Copy Markdown
Contributor

Simili Triage Report

Note

Quality Score: 9.8/10 (Excellent)
The issue is well-described.

Classification

Category Value
Labels
Quality Improvements
  • Consider providing example queries for @simili-bot to illustrate common usage scenarios.
  • Briefly describe the expected output format or application method of the AI-assisted fixes (e.g., direct commit, suggested changes, new PR).
Similar Threads
Similarity Type Thread Status
87% 📝 #105 feat: Add Claude Code GitHub Action for AI-assi... Open
84% 🔀 #39 Similar Issue
83% 🔀 #62 fix: prevent infinite bot comment loop Open

Warning

Possible Duplicate (Confidence: 98%)
This pull request might be a duplicate of #105.
Reason: The current issue, 'feat: integrate Claude Code @simili-bot for AI-assisted PR fixes', explicitly states 'Closes #105'. Issue #105 is titled 'feat: Add Claude Code GitHub Action for AI-assisted PR fixes via @simili-bot comments'. Both titles describe the exact same feature request. The current issue is the implementation that resolves and fulfills the request in #105, meaning fixing the current issue fully resolves #105. Therefore, #105 is a duplicate.
Also related to: #39 (Similar Issue)

This pull request will be automatically closed in 72 hours if no objections are raised. If you believe this is not a duplicate, please leave a comment explaining why.


Generated by Simili Bot

- Add claude_code_handler.go: parses @simili-bot queries, validates
  author association (OWNER/MEMBER/COLLABORATOR), writes GitHub Actions
  outputs (claude_code_triggered, claude_code_query, claude_code_model_override)
- Modify command_handler.go: detect @simili-bot trigger before slash-commands
- Add CommentAuthorAssociation to pipeline Issue struct
- Extract author_association from GitHub event JSON in process.go
- Update action.yml with Claude Code outputs
- Update triage.yml with conditional claude-code-action step
- Update example workflow and setup docs
- Add CLAUDE.md for repo context

Users just add one extra step to their existing simili workflow +
the CLAUDE_CODE_OAUTH_TOKEN secret. No separate workflow file needed.

Closes #105

Signed-off-by: Kavirubc <hapuarachchikaviru@gmail.com>
@Kavirubc Kavirubc force-pushed the feat/claude-code-integration branch from 2db4e38 to ec77be0 Compare March 11, 2026 09:52
…nd docs

Signed-off-by: Kavirubc <hapuarachchikaviru@gmail.com>
@Kavirubc Kavirubc merged commit a42a602 into main Mar 11, 2026
4 checks passed
@Kavirubc Kavirubc deleted the feat/claude-code-integration branch March 11, 2026 09:56
@Kavirubc Kavirubc restored the feat/claude-code-integration branch March 11, 2026 12:26
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.

feat: Add Claude Code GitHub Action for AI-assisted PR fixes via @simili-bot comments

2 participants