AI-powered code style enforcement
ESLint has a wide lead for enforcing code style against a team's standards.
It depends
For teams seeking a custom linter that learns their stylistic preferences, CodeRabbit AI is the usual answer.
Since Jul 7Updated Nov 12, 2026Based on 65 AI answers
Reviewed by Dimitry Apollonsky
Brands AI mentions
AI code review with line-by-line feedback on pull requests.
Project-specific styling standards through Custom Instructions.
Also mentioned rarely: Claude Code Action, Pylint, Checkstyle, SonarQube, Biome, Claude Code, Semgrep, gptlint, Squire AI, Black · readthedocs.io, Continue, GitHub, RuboCop, Claude, Windsurf, DeepLint, Visual Studio Marketplace, LintConfig, OpenAI, GPT-4o, Autter, AWS CodeWhisperer, Bito, ChatGPT Linter, clang-format, Visual Studio Code, Code Conventions AI, CodeSage, DeepSource, golangci-lint, Lint.ai, Lintrule, Sourcery, Tabnine, Archgate, Black · github.com, sloppylint, PR-Agent, GitLab · gitlab.com, Gitlab · gitlab.io, Graphite Agent, Graphite, GroundRules, Continuedev, Moraine, High-Taste, SonarQube for IDE, Sourcegraph Cody, Aikido, Anthropic, Autofix.ai, Aviator, Azure OpenAI Service, Bitbucket, Bloop, Bugbot, Casspr, clang-tidy, Cline, Codacy, Codacy Guardrails, Code Llama, CodeAnt, CodeGeeX, Codesona, Codium, Cursor Bugbot, Databricks Quick Fix, DeepSeek Coder, Factory AI, Fallow, Fireworks.ai, Gemini, pgvector, STYLE-ANALYZER, Spotless, Go, JetBrains AI, Kodus, Meta AI, GenAIScript, Mypy, OpenAI GPT-4, OpenAI Codex, ktlint, PostgreSQL, Code Context, Qodo Merge, Quack AI, Repowise, Revix AI, Clippy, Scrubby, Stylelint, Styler, Tabby, ThinkPrompt, Together AI, TypeScript, Husky, Uber, Visual Studio, Windsurf Editor
- ESLintChatGPTGoogle AI Mode
- CodeRabbit AIChatGPTGoogle AI Mode
- CursorChatGPTGoogle AI Mode
- RuffChatGPTGoogle AI Mode
- GitHub CopilotChatGPTGoogle AI Mode
ESLint leads this topic, but GitHub Copilot leads AI Developer Productivity Tools overall. Here, answers recommend GitHub Copilot for project-specific styling standards through Custom Instructions.
Questions and answers
Google AI ModeNov 10, 2026
Setting up an AI tool to absorb your team's unique flavor, naming quirks, architecture patterns, and PR feedback loops doesn't require training a custom foundational model from scratch. Instead, it relies on context ingestion, explicit rule files, and feedback loops.
Step-by-Step Setup Guide
1. Codify Your Style Explicitly (The Foundation)
AI tools are literal-minded. Before expecting an AI to "infer" your taste from 10,000 old PRs, write down what you actually want.
- Create a Rules File: Drop a markdown instruction file into your repo root (e.g.,
.cursorrulesfor Cursor,AGENTS.mdfor general agents, or a.coderabbit.yaml/ custom prompt file for review bots like CodeRabbit). - Be Specific Instead of Vague:
- Bad: "Write clean Python code."
- Good: "Use Pydantic v2 models for request validation. Prefer
pathliboveros.path. Do not useprint()statements; use our structuredstructloglogger."
- Link to Reference Files: Point the AI directly to "golden standard" files in your repo (e.g., "See
src/services/user_service.pyas the canonical pattern for error handling").
2. Connect an AI Code Reviewer with RAG / Knowledge Base
Modern AI code review and generation tools (such as CodeRabbit, GitHub Copilot Workspace, or cloud engineering agents) index your active repository via Retrieval-Augmented Generation (RAG).
- Index Past PRs and Issues: Configure the tool to scan your historical pull requests and closed/merged PR comments. Many modern reviewers actively parse past human reviewer feedback (e.g., "Oh, the team always asks to memoize this").
- Enable Auto-Learning / Feedback Interactions: When the AI leaves a PR comment that misses the mark, reply to it directly in the PR thread (e.g., "We don't use lodash in this package; use native ES6/ES2020 array methods instead" ). Tools like CodeRabbit and various copilot agents adapt based on these inline re-corrections.
3. Integrate Linters, Formatters, and Static Analysis
AI does not replace deterministic tools—it complements them. If you want the AI to respect formatting and style, let the machine do the heavy lifting first:
- Keep strict ESLint, Prettier, RuboCop, Ruff, or Black configurations in your CI/CD pipeline.
- Feed the output of your linters and type-checkers (TypeScript, MyPy) into the AI's context window. If the AI proposes code that fails
npm run lint, feed the linter error right back into its prompt loop so it self-corrects.
4. Establish a Feedback Loop (The "PR Correction" Habit)
Treat the AI like a junior engineer on day one:
- Don't just fix its code silently: If an AI assistant (like Cursor, Cody, or an agent) generates a component that violates your folder structure or naming convention, hit
Ctrl/Cmd + Kor reply in chat: "Remember, our components live infeatures/notcomponents/and use named exports." - Review its PR reviews: If your AI code reviewer is being too noisy or pedantic about rules you don’t care about, tune its severity or explicitly disable those rules in your
.yamlconfiguration.
Popular Tools to Consider
To help you map out the exact setup, tell me:
- What version control and CI/CD platform do you use (GitHub, GitLab, Bitbucket)?
- Which primary programming languages make up your codebase?
- Are you looking for in-IDE assistance (while typing) or an automated PR reviewer (post-commit)?
Pages cited in this answer2
ChatGPTNov 10, 2026
The best way to do this is to build an AI-powered coding standards assistant that learns from your existing codebase, historical pull requests, code review comments, and team conventions.
Rather than simply giving an AI your coding standards document, you want it to identify patterns in how your team actually writes and reviews code, then apply those patterns when analyzing new pull requests.
I'd recommend a system with five components:
- Codebase analysis – Understand your architecture, naming conventions, design patterns, and preferred implementations.
- PR history analysis – Learn which changes your team accepts, rejects, or requests modifications to.
- Team preference extraction – Convert recurring review feedback into explicit coding rules.
- AI-powered PR reviews – Automatically evaluate new pull requests against those rules.
- Continuous learning – Update the team's coding profile as new reviews and decisions happen.
1. Recommended architecture
Your existing engineering knowledge
Source code · Git history · Merged PRs · Review comments · Documentation
AI analysis and extraction
Identify patterns, conventions, architectural decisions, and recurring feedback
Team Coding Profile
Versioned rules · Preferred patterns · Anti-patterns · Review preferences
AI pull request reviewer
Analyze diffs · Identify violations · Suggest fixes · Explain recommendations
Human feedback loop
Developers accept, reject, or modify suggestions; approved feedback updates the profile
2. Extract your team's coding preferences
This is the most important part of the system.
I would build an initial analysis job that examines:
Data source What the AI should learn Existing source code Naming, structure, abstractions, error handling Merged PRs Patterns your team accepts Review comments What reviewers repeatedly ask developers to change Rejected suggestions What your team considers unnecessary or undesirable PR discussions Architectural reasoning and trade-offs Existing documentation Explicit technical requirements A critical distinction
Don't assume every merged PR represents your team's preferred style.
For example:
- A reviewer repeatedly requests dependency injection rather than directly constructing services.
- Several PRs demonstrate a preference for early returns over deeply nested conditions.
- Reviewers consistently request unit tests for business logic.
- A reviewer rejects unnecessary abstractions that make simple code harder to understand.
The AI should identify these as potential preferences, but distinguish between:
- Hard rules: Must always be followed.
- Strong preferences: Usually expected.
- Contextual preferences: Appropriate in particular modules or situations.
- Personal preferences: Reviewer-specific opinions that aren't necessarily team standards.
I'd also have it record evidence for every extracted rule: example PR, file, review comment, and frequency.
Example of an extracted team profile
yamlcoding_preferences: architecture: - Prefer dependency injection for services. - Keep business logic outside controllers. - Avoid unnecessary abstraction layers. typescript: - Prefer explicit types for public interfaces. - Avoid using any. - Use async/await instead of promise chains. error_handling: - Use centralized error handling. - Avoid silently swallowing exceptions. testing: - Add unit tests for business logic. - Include edge cases for validation. - Avoid brittle tests that depend on implementation details. code_review: - Prioritize correctness over formatting. - Avoid suggesting refactors unrelated to the PR. - Explain why a proposed change matters.These are illustrative rules, not assumptions about your actual team.
3. Create a persistent team knowledge base
I would not start with model fine-tuning.
Instead, use a combination of:
- Repository instruction files for stable, high-priority rules.
- A searchable knowledge base for historical PR examples.
- AI context retrieval for relevant code and review discussions.
- A structured preference profile that evolves over time.
This is easier to maintain and allows developers to see exactly why the AI recommends something.
A practical repository structure could look like this:
your-repository/ │ ├── AGENTS.md │ ├── .github/ │ ├── copilot-instructions.md │ └── instructions/ │ ├── backend.instructions.md │ ├── frontend.instructions.md │ └── testing.instructions.md │ ├── engineering-standards/ │ ├── coding-preferences.yaml │ ├── architecture.md │ ├── review-guidelines.md │ └── examples/ │ ├── preferred-patterns.md │ └── anti-patterns.md │ └── src/The advantage is that the knowledge becomes version-controlled, reviewable, and reusable by different AI coding tools.
For example, Codex supports repository-level and directory-specific
AGENTS.mdguidance. GitHub Copilot supports repository-wide and path-specific review instructions.4. Automate AI-powered pull request reviews
Once the profile exists, connect the system to your GitHub pull request workflow.
Example: A developer opens a PR
PR #248 — Refactor payment service
AI checks the following:
- Analyze the changed files and understand their surrounding code.
- Retrieve relevant team conventions and historical PR examples.
- Compare the implementation against established preferences.
- Identify bugs, architectural inconsistencies, and missing tests.
- Publish only actionable review comments.
Example AI review feedback
1. Architecture consistency
This service directly instantiates
PaymentRepository. Our existing payment services use dependency injection. Consider following that pattern.Evidence: Similar implementation in previous approved payment service PRs.
2. Test coverage
The new validation logic has no tests for invalid payment amounts.
Evidence: Team testing convention requires edge-case coverage for business logic.
3. Scope
No unnecessary refactoring detected.
(Review completed)
The important thing is that the AI should explain the reasoning behind each recommendation, ideally linking it to an actual historical example.
Tools worth considering
1. OpenAI Codex
Strong option if you want an AI reviewer that follows repository-specific instructions and can incorporate your engineering conventions.
- Uses
AGENTS.md. - Supports automatic GitHub PR reviews.
- Supports custom review rules.
- Can reference repository context.
2. GitHub Copilot
Convenient if your engineering workflow already revolves around GitHub.
- Repository-wide instructions.
- Directory-specific coding standards.
- Automated PR reviews.
- Integration with existing GitHub workflows.
Copilot code review documentation
3. Qodo
Worth evaluating if you want a dedicated PR review platform with configurable review behavior and automated feedback.
My recommendation: start with Codex or Copilot before building a completely custom AI platform. Both already provide mechanisms for applying repository-specific instructions. The custom extraction and learning layer can be added afterward.
5. Build a continuous learning feedback loop
This is what makes the system genuinely valuable over time.
Every time a developer interacts with an AI review, capture the outcome.
Developer action What the system learns Accepts suggestion Potentially useful recommendation Rejects suggestion Potentially incorrect or irrelevant recommendation Modifies suggestion Better version of the recommendation Adds review comment Potential new team preference Repeatedly requests same change Candidate rule for permanent inclusion I would implement this as a separate background process rather than allowing the AI to rewrite its own instructions automatically.
For example:
- AI notices that reviewers repeatedly request explicit transaction boundaries.
- It identifies 12 relevant PR discussions.
- It proposes a new team coding rule.
- A senior engineer reviews and approves it.
- The rule is added to the team's coding profile.
- Future PR reviews use the new rule.
This prevents one developer's personal preference from accidentally becoming an organization-wide standard.
OpenAI's guidance for Codex similarly recommends turning recurring review feedback into durable repository rules and refining those rules based on false positives.
6. A practical implementation roadmap
Here's how I would approach building this.
-
Phase 1 — Historical analysis
(Start here)
- Connect to GitHub.
- Retrieve approximately 100–300 representative merged PRs.
- Extract code diffs, review comments, and discussion outcomes.
- Analyze the existing codebase.
- Generate an initial team coding profile.
-
Phase 2 — Knowledge generation
- Categorize preferences by language, framework, and architecture.
- Identify recurring patterns.
- Associate rules with historical evidence.
- Have senior developers validate the results.
- Generate
AGENTS.mdand supporting instruction files.
-
Phase 3 — PR integration
- Connect the AI reviewer to GitHub.
- Analyze incoming PR diffs.
- Retrieve relevant team conventions.
- Publish actionable comments.
- Require human approval for merging.
-
Phase 4 — Continuous improvement
- Collect developer feedback.
- Identify repeated review patterns.
- Suggest new coding standards.
- Version and approve updated standards.
- Periodically evaluate review accuracy.
7. The initial AI analysis prompt
You can use a prompt like this to start extracting your team's conventions from an existing repository and its PR history.
:::writing{variant="document" id="62831"}
Engineering Team Coding Standards Analysis
You are an engineering standards analyst.
Your task is to analyze our existing software repository and historical GitHub pull requests to identify the coding conventions, architectural preferences, and engineering practices followed by our team.
Data to analyze
- Existing source code and project structure.
- Historical merged pull requests.
- Pull request code review comments.
- Requested changes and reviewer discussions.
- Existing engineering documentation.
- Rejected or modified implementation approaches where available.
Analysis objectives
Identify:
- Naming conventions.
- Code organization and modularity.
- Preferred design patterns.
- Error handling practices.
- Dependency injection conventions.
- API design preferences.
- Testing expectations.
- Documentation practices.
- Performance considerations.
- Security expectations.
- Patterns reviewers repeatedly reject.
- Common architectural decisions.
Classification
Classify each identified preference as:
- Mandatory: Explicit engineering requirement.
- Strong preference: Repeatedly demonstrated team convention.
- Contextual: Applies only to specific modules or circumstances.
- Individual preference: Associated with an individual reviewer rather than the entire team.
- Uncertain: Insufficient evidence to establish a reliable convention.
Evidence requirements
For every proposed rule:
- Include supporting PR references.
- Include relevant review comments where available.
- Identify the affected files or modules.
- Estimate how frequently the pattern occurs.
- Identify conflicting examples.
- Explain confidence in the conclusion.
Never invent conventions or assume that a merged PR means every implementation choice was approved.
Deliverables
Generate:
- Executive summary of the team's engineering practices.
- Structured coding preferences in YAML.
- Repository-level coding instructions.
- Directory-specific coding instructions where appropriate.
- Preferred implementation examples.
- Anti-pattern examples.
- Unresolved questions requiring senior engineer input.
The resulting standards must reflect demonstrated team behavior rather than generic industry best practices.
Do not modify production code or automatically enforce proposed rules. All newly extracted standards must be reviewed by an engineering lead before adoption. :::
8. How to measure whether it's working
I would track these metrics from the beginning:
Metric What it tells you Accepted AI suggestions Whether recommendations are useful Rejected AI suggestions Whether the AI is generating noise False-positive rate Whether it misunderstands conventions Repeated human review comments Whether it misses established rules Review time saved Whether it improves developer productivity Rule adoption Whether extracted standards are useful One particularly important metric is the percentage of AI review comments that developers consider actionable.
You don't want an AI that produces 40 comments per PR. You want an AI that identifies the 2–3 things an experienced team reviewer would actually care about.
My recommendation: Build a team-specific coding intelligence layer
If I were designing this for an engineering organization, I'd separate it into three distinct systems:
Knowledge extraction
Learns conventions from code and historical PRs.
Team knowledge
Stores approved engineering preferences and examples.
AI reviewer
Applies those conventions to every new PR.
The key architectural decision is to keep the team's knowledge independent of the underlying AI model. That way, you can change from Codex to another model or review platform without losing the engineering knowledge you've accumulated.
A few questions that would help me design the right solution
The implementation can look quite different depending on your environment.
1. Where is your source code hosted?
GitHub
GitLab
Bitbucket
Azure DevOps
2. What technologies does your codebase use?
Java / Spring Boot
C# / .NET
TypeScript / React / Node.js
Python
Multiple languages and frameworks
3. What do you want the AI to do?
Analyze existing code and extract standards
Automatically review new PRs
Both: learn standards and review PRs
4. What implementation approach do you prefer?
Build our own AI-powered solution
Configure existing AI tools
Hybrid: existing AI models with our own learning engine
Not sure yet
[Design my implementation architecture]
With those details, I can lay out a concrete architecture, including the Git integration, PR ingestion pipeline, AI analysis prompts, knowledge storage, and continuous-learning mechanism.
Pages cited in this answer7
- learn.chatgpt.comCustom instructions with AGENTS.md | ChatGPT Learn
- docs.github.comUsing GitHub Copilot code review - GitHub Docs
- docs.github.comGitHub Copilot code review - GitHub Docs
- learn.chatgpt.comReview GitHub pull requests with Codex | ChatGPT Learn
- developers.openai.comCustom Code Review rules for Codex | OpenAI Developers
- qodo.aiAI Code Review – Qodo: Deploy with confidence
- learn.chatgpt.comCustomization | ChatGPT Learn
- Create a Rules File: Drop a markdown instruction file into your repo root (e.g.,
ChatGPTSep 25, 2026
If you mean a linter that learns your team's conventions rather than only enforcing a fixed standard, you’re looking for an AI-powered adaptive code linter (sometimes called an AI code reviewer or convention learner). A few approaches/tools fit:
- greptile.com — AI code review that can use repository context, custom rules, and feedback signals to adapt reviews to a team's standards. It is closer to an AI reviewer than a traditional AST-based linter.
- codeconventions.ai — focuses on enforcing team-specific conventions from files such as
CONVENTIONS.md, covering higher-level practices that traditional linters often cannot express. - graphite.com — supports custom AI review rules and exclusions so reviews align with team coding standards.
- groundrules.ai — a more experimental approach that derives coding rules from how developers correct AI-generated code.
A common architecture for building your own is:
- Collect examples
- Existing codebase
- Accepted/rejected pull request comments
- Style corrections from senior reviewers
- Existing lint configs
- Extract rules
-
Convert patterns into explicit rules:
-
“Prefer early returns over nested conditionals”
-
“Use repository service classes instead of direct database calls”
-
“Errors should include operation context”
-
“React components should use hooks in this order”
- Run an AI review layer
- Feed diffs plus repository context to an LLM.
- Ask it to identify violations and suggest fixes.
- Store accepted/rejected feedback to refine rules.
- Keep deterministic linters for mechanical rules
- ESLint, Ruff, Pylint, RuboCop, Checkstyle, etc. are still better for things like formatting, unused imports, naming regexes, and complexity limits.
- AI is most useful for judgment-heavy conventions.
If you want something you can build internally, a practical stack is:
- Existing linter (ESLint/Ruff/etc.) for hard rules
- A
CONVENTIONS.mdor.teamrulesfile as the source of truth - An AI review bot on pull requests
- Feedback loop that updates rules based on reviewer decisions
There are also research systems exploring learned linters: for example, MLinter investigated learning coding practices from examples, and Google researchers described AutoCommenter, an LLM-backed system for learning and enforcing review practices at scale.
For most teams today, the sweet spot is AI reviewer + conventional linter, not replacing the linter entirely.
Pages cited in this answer6
- greptile.comLearning & Custom Context | Greptile - AI Code Review That Adapts
- codeconventions.aiCode Conventions (AI)
- graphite.comCustomization - Graphite
- groundrules.aiGroundRules Beta
- arxiv.org[2301.10082] MLinter: Learning Coding Practices from Examples-Dream or Reality?
- arxiv.org[2405.13565] AI-Assisted Assessment of Coding Practices in Modern Code Review
Google AI ModeSep 25, 2026
While traditional AST-based linters (like ESLint, Pylint, or RuboCop) are deterministic and absolute , they require you to manually write and maintain explicit syntax rules. For style guides that rely on nuanced, semantic preferences, AI-powered code reviewers act as dynamic, custom linters. Instead of hardcoding a regex or abstract syntax tree rule, you feed them your team's custom style guide in natural language, and they analyze code changes against those guidelines.
Popular tools and patterns used to achieve this include:
- CodeRabbit : An AI-powered PR reviewer that allows you to configure custom instructions and rules in natural language. It learns your repository's context and can flag style and design violations during pull requests. Explore options on CodeRabbit.
- Qodo (formerly CodiumAI) : Focuses heavily on code integrity, behavior, and adhering to specific development standards and team guidelines during the review phase. Check out features on Qodo.
- Custom LLM GitHub Actions : Many engineering teams build or deploy lightweight, customized GitHub Actions (powered by GPT-4 or Claude) with a dedicated
style-guide.mdor system prompt injected into the CI/CD pipeline. On every pull request, the action reviews the diff strictly against your text-based conventions and posts inline comments. - Semgrep (with AI/Custom Rules) : While Semgrep is a traditional static analysis tool, it bridges the gap by letting you write custom rules using concrete code syntax rather than complex AST nodes, and it increasingly incorporates AI-assisted rule generation to match specific patterns you feed it. Learn more at Semgrep.
The Hybrid Best Practice
Relying solely on an LLM as a hard gate can sometimes introduce non-deterministic results. The most robust approach is a hybrid stack:
- Deterministic Linters (ESLint / Ruff / Prettier) for objective spacing, naming conventions, and syntax formatting.
- AI Code Reviewer / Custom Prompt Action plugged into your CI pipeline to catch the higher-level, nuanced stylistic preferences, architectural choices, and voice/pattern guidelines that standard linters miss.
If you'd like to narrow this down, tell me:
- What programming languages is your team using?
- Do you want the linter to block merges in CI/CD or just give feedback during PR reviews?
I can recommend the best integration approach or help you draft a custom prompt/ruleset.
Also asked as
- What steps are involved in training an AI on our repository and PR history to recognize and apply our team's coding preferences?
- What is the procedure for configuring an AI to study our codebase and PR history to adopt our team's coding style?