-
-
Notifications
You must be signed in to change notification settings - Fork 827
chore(agents): Add lint-fixer agent configuration #794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add Claude Code agent configuration for automated linting and fixing. This agent will help identify and resolve linting issues in the codebase by running npm run lint and making appropriate corrections.
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughA new documentation file adds the “lint-fixer” agent specification and operational workflow, detailing analysis, context gathering, fixing strategy, implementation, verification, communication, and QA guidelines. No code or public API changes are introduced. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant Agent as Lint-Fixer Agent
participant Git as git
participant Lint as npm run lint / ESLint
participant Search as rg (ripgrep)
participant Tests as Test Runner
Dev->>Agent: Invoke lint-fixer
Agent->>Lint: Run lint
Lint-->>Agent: Lint reports (errors/warnings)
Agent->>Git: git diff (recent changes)
Git-->>Agent: Diff context
Agent->>Search: Pattern searches
Search-->>Agent: Matches
Agent->>Agent: Plan fixes by priority (critical/style/format)
Agent->>Agent: Apply incremental fixes (preserve intent)
Agent->>Lint: Re-run lint
Lint-->>Agent: Updated reports
Agent->>Tests: Run tests
Tests-->>Agent: Test results
Agent->>Dev: Summarize fixes, rationale, follow-ups
note over Agent: Document non-obvious fixes and edge cases
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes ✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @yamadashy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request introduces a new automated agent, lint-fixer
, within the Claude Code agent system. Its primary purpose is to streamline and standardize the process of identifying and resolving linting issues in the codebase. The agent is configured to ensure code quality and consistency by following established project guidelines, ultimately aiming to maintain a clean and compliant codebase with minimal manual intervention.
Highlights
- New Agent Configuration: A new file,
.claude/agents/lint-fixer.md
, has been added to configure a dedicated Claude Code agent for automated linting and fixing. - Automated Linting and Fixing Workflow: The agent is designed to automate the process of identifying and resolving linting issues by running
npm run lint
, analyzing output, gathering context, and systematically applying fixes. - Prioritized Fix Application: The agent prioritizes fixes based on severity, addressing critical errors first, followed by style violations and minor formatting issues.
- Adherence to Coding Standards: The configuration emphasizes adherence to project coding standards, specifically mentioning the Airbnb JavaScript Style Guide and ensuring all comments remain in English.
- Verification and Safety Checks: Built-in safety checks include running
npm run test
after fixes and reviewing changes withgit diff
to ensure no functionality is broken and changes are appropriate.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
Deploying repomix with
|
Latest commit: |
3010a97
|
Status: | ✅ Deploy successful! |
Preview URL: | https://86920141.repomix.pages.dev |
Branch Preview URL: | https://chore-claude-lint-agent.repomix.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new Claude agent configuration for automated linting and fixing functionality. The agent is designed to systematically identify and resolve linting issues while maintaining code quality and consistency with project standards.
- Introduces a comprehensive lint-fixer agent with structured workflow for handling ESLint issues
- Provides detailed guidance for prioritizing fixes by severity and maintaining code functionality
- Includes verification steps and quality assurance measures to ensure fixes are appropriate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a new agent configuration for fixing linting issues. The configuration is well-structured, but there are a few inaccuracies regarding the project's tooling. I've pointed out references to .eslintrc
, the Airbnb style guide, and a non-existent lint:fix
script, which should be corrected to align with the project's use of Biome for linting and formatting. These changes will ensure the agent operates correctly within the repository's environment.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #794 +/- ##
=======================================
Coverage 88.59% 88.59%
=======================================
Files 110 110
Lines 6192 6192
Branches 1282 1282
=======================================
Hits 5486 5486
Misses 706 706 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (10)
.claude/agents/lint-fixer.md (10)
3-3
: Use English-only examples in description and keep wording concise.The examples in the YAML front matter include Japanese text. Given the guideline “Ensure all comments remain in English,” it’s safer to keep examples in English here too. Also, keeping the description concise improves readability.
Apply this diff to replace the examples with English-only phrasing (content preserved, just localized and tightened):
-description: Use this agent when you need to run npm run lint to identify and fix linting issues in the codebase. The agent will analyze the diff and implementation context to make proper corrections that align with the project's coding standards. Examples:\n\n<example>\nContext: The user wants to fix linting issues after making code changes.\nuser: "npm run lintを実行して修正して"\nassistant: "I'll use the lint-fixer agent to run the linter and fix any issues found."\n<commentary>\nSince the user is asking to run lint and fix issues, use the Task tool to launch the lint-fixer agent.\n</commentary>\n</example>\n\n<example>\nContext: After implementing a new feature, linting errors need to be resolved.\nuser: "新しい機能を追加したけど、lintエラーが出てるから修正して"\nassistant: "I'll launch the lint-fixer agent to analyze and fix the linting errors in your new code."\n<commentary>\nThe user has linting errors after adding new features, so use the lint-fixer agent to resolve them.\n</commentary>\n</example> +description: Use this agent to run npm run lint, identify issues, and apply fixes that align with the project's coding standards. Examples:\n\n<example>\nContext: The user wants to fix linting issues after making code changes.\nuser: "Run npm run lint and fix the issues."\nassistant: "I'll use the lint-fixer agent to run the linter and fix any issues found."\n<commentary>\nSince the user is asking to run lint and fix issues, use the Task tool to launch the lint-fixer agent.\n</commentary>\n</example>\n\n<example>\nContext: After implementing a new feature, linting errors need to be resolved.\nuser: "I added a new feature, but lint errors are showing. Please fix them."\nassistant: "I'll launch the lint-fixer agent to analyze and fix the linting errors in your new code."\n<commentary>\nThe user has linting errors after adding new features, so use the lint-fixer agent to resolve them.\n</commentary>\n</example>
7-7
: Minor grammar: add article “a”.-You are an expert code quality engineer specializing in JavaScript/TypeScript linting and code style enforcement. Your primary responsibility is to identify and fix linting issues while maintaining deep understanding of the codebase and its patterns. +You are an expert code quality engineer specializing in JavaScript/TypeScript linting and code style enforcement. Your primary responsibility is to identify and fix linting issues while maintaining a deep understanding of the codebase and its patterns.
11-15
: Monorepo/workspaces nuance for lint scripts.Add guidance for running lint in the correct scope in monorepos/workspaces.
1. **Initial Analysis** - First, run `npm run lint` to identify all current linting issues - Capture and analyze the complete output, noting error types, locations, and severity - Group related issues to understand patterns of problems + - In monorepos/workspaces, run lint in the affected package(s) (and/or at the repo root) as defined by the project scripts
19-19
: Provide fallback if ripgrep is unavailable.Not all environments ship with rg. Suggest a fallback.
- - Check for similar patterns in the codebase using `rg` to ensure consistency + - Check for similar patterns in the codebase using `rg` (or `git grep` if `rg` is unavailable) to ensure consistency
36-36
: Defer to project ESLint config instead of hardcoding Airbnb.Airbnb is fine if the repo extends it, but the agent should follow whatever the project config actually enforces.
- - Follow the Airbnb JavaScript Style Guide as specified in the project guidelines + - Follow the project's ESLint configuration and existing conventions (e.g., Airbnb rules if the project extends them)
50-51
: Add fallback when lint:fix script is missing.Make the guidance resilient across repos that don’t define a lint:fix script.
- - **Handle auto-fixable vs manual fixes**: Use `npm run lint:fix` for auto-fixable issues when appropriate, but review the changes + - **Handle auto-fixable vs manual fixes**: Use `npm run lint:fix` (if available) or `eslint --fix` for auto-fixable issues when appropriate, and review the changes
47-50
: Scope fixes to linting-related changes.Prevent broad refactors that go beyond lint signals unless explicitly requested.
- **Never make blind fixes**: Always understand why a linting error occurs before fixing it - **Preserve functionality**: Linting fixes should never change the behavior of the code - **Maintain consistency**: Look for similar patterns in the codebase and apply consistent fixes +- **Scope of changes**: Keep changes tightly focused on linting issues; avoid unrelated refactors unless requested and reviewed
67-67
: Soften/verify the 250-line file-size rule.Unless this is an enforced project standard, phrase it conditionally.
-- Ensure all fixes align with the project's coding guidelines -- Verify that file sizes remain under 250 lines as per project standards +- Ensure all fixes align with the project's coding guidelines +- Verify that file sizes remain under 250 lines if required by project standardsIf this rule is documented elsewhere (e.g., .agents/rules/base.md or CONTRIBUTING), ignore this change.
1-6
: YAML front matter: consider multiline block for description.The long, newline-escaped description is valid but hard to read and easy to break with colons. Consider switching to a block scalar (|) for clarity. No change required if your tooling expects a single-line value.
I can provide a safe rewrite to a block scalar if you want to adopt it.
1-72
: Cross-check with base project rules.Per our learnings, ensure alignment with .agents/rules/base.md (project-specific guidance). In particular, confirm:
- English-only requirement applies to examples in frontmatter
- ESLint config truly extends Airbnb (or adjust wording as suggested)
- Any file-size constraints and commit conventions
I can scan and reconcile this agent with .agents/rules/base.md and open a follow-up PR if mismatches exist.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.claude/agents/lint-fixer.md
(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-06-30T16:07:18.316Z
Learnt from: CR
PR: yamadashy/repomix#0
File: .cursorrules:0-0
Timestamp: 2025-06-30T16:07:18.316Z
Learning: Applies to .agents/rules/base.md : Check the rules written in `.agents/rules/base.md` as they contain important project-specific guidelines and instructions.
Applied to files:
.claude/agents/lint-fixer.md
🪛 LanguageTool
.claude/agents/lint-fixer.md
[grammar] ~7-~7: There might be a mistake here.
Context: ...o identify and fix linting issues while maintaining deep understanding of the codebase and ...
(QB_NEW_EN)
[style] ~7-~7: Consider a different adjective to strengthen your wording.
Context: ...nd fix linting issues while maintaining deep understanding of the codebase and its p...
(DEEP_PROFOUND)
[grammar] ~11-~11: There might be a mistake here.
Context: ...our Core Workflow 1. Initial Analysis - First, run npm run lint
to identify al...
(QB_NEW_EN)
[grammar] ~16-~16: There might be a mistake here.
Context: ...erns of problems 2. Context Gathering - Before making fixes, examine the affecte...
(QB_NEW_EN)
[grammar] ~22-~22: There might be a mistake here.
Context: ...nfiguration files 3. Strategic Fixing - Prioritize fixes based on: - Critic...
(QB_NEW_EN)
[grammar] ~23-~23: There might be a mistake here.
Context: ...Fixing** - Prioritize fixes based on: - Critical errors that break functionality...
(QB_NEW_EN)
[grammar] ~24-~24: There might be a mistake here.
Context: ...Critical errors that break functionality - Style violations that affect code readab...
(QB_NEW_EN)
[grammar] ~25-~25: There might be a mistake here.
Context: ... violations that affect code readability - Minor formatting issues - For each fi...
(QB_NEW_EN)
[grammar] ~26-~26: There might be a mistake here.
Context: ...adability - Minor formatting issues - For each fix, ensure you understand: ...
(QB_NEW_EN)
[grammar] ~27-~27: There might be a mistake here.
Context: ... - For each fix, ensure you understand: - Why the linting rule exists - The c...
(QB_NEW_EN)
[grammar] ~28-~28: There might be a mistake here.
Context: ...tand: - Why the linting rule exists - The correct way to fix it according to p...
(QB_NEW_EN)
[grammar] ~29-~29: There might be a mistake here.
Context: ...to fix it according to project standards - Any potential side effects of the fix 4...
(QB_NEW_EN)
[grammar] ~32-~32: There might be a mistake here.
Context: ... effects of the fix 4. Implementation - Apply fixes incrementally, testing after...
(QB_NEW_EN)
[grammar] ~39-~39: There might be a mistake here.
Context: ...nts remain in English 5. Verification - After fixing, run npm run lint
again t...
(QB_NEW_EN)
[grammar] ~51-~51: There might be a mistake here.
Context: ...Be careful with fixes that might affect: - Type definitions and interfaces - Asyn...
(QB_NEW_EN)
[grammar] ~52-~52: There might be a mistake here.
Context: ...ect: - Type definitions and interfaces - Async/await patterns - Import/export s...
(QB_NEW_EN)
[grammar] ~53-~53: There might be a mistake here.
Context: ... and interfaces - Async/await patterns - Import/export statements - Dependency ...
(QB_NEW_EN)
[grammar] ~54-~54: There might be a mistake here.
Context: ...it patterns - Import/export statements - Dependency injection patterns ## Commun...
(QB_NEW_EN)
[style] ~60-~60: Consider using a different verb for a more formal wording.
Context: ...them - If multiple approaches exist for fixing an issue, explain your choice - Alert t...
(FIX_RESOLVE)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Test (windows-latest, 24.x)
- GitHub Check: Build and run (macos-latest, 21.x)
- GitHub Check: Build and run (windows-latest, 24.x)
- GitHub Check: Test (windows-latest, 21.x)
- GitHub Check: Test (windows-latest, 22.x)
- GitHub Check: Cloudflare Pages
🔇 Additional comments (1)
.claude/agents/lint-fixer.md (1)
1-72
: Well-scoped addition.Solid agent spec: clear workflow, safety checks, and verification. No runtime/code changes; aligns with PR objectives.
Address review feedback from Copilot and Gemini code assistants: - Replace Japanese text examples with English versions for consistency - Update .eslintrc references to biome.json (actual linting configuration) - Replace Airbnb style guide reference with biome.json configuration - Clarify npm run lint includes TypeScript checks and secret detection - Fix auto-fix command reference to use correct npm scripts This ensures the agent configuration accurately reflects the project's actual tooling and follows the English-only comment guideline.
Add Claude Code agent configuration for automated linting and fixing. This agent specializes in identifying and resolving linting issues in the codebase while maintaining code quality and project standards.
Changes
.claude/agents/lint-fixer.md
with comprehensive agent configurationnpm run lint
and systematically fixing issuesFeatures
Checklist
npm run test
npm run lint