20 of the best prompts for ensuring code style compliance, step by step across 4 stages. Works with ChatGPT, Claude, and Gemini.
20 of the best prompts for ensuring code style compliance, step by step across 4 stages. Works with ChatGPT, Claude, and Gemini.
Published June 28, 2026
Claude Code generates code that ignores ESLint, Prettier, or project-specific style conventions, leading to inconsistent codebases. This results in increased technical debt and potential integration issues. These prompts help developers ensure that Claude Code adheres to the project's coding standards consistently. Built across 4 distinct stages covering Diagnose the Wall, Isolate and Fix, Verify the Resolution and more, this guide gives you one expert prompt per step so you never have to write from scratch or guess what the AI needs. The prompts work in ChatGPT, Claude, and Gemini and are designed to get usable output on the first try.
Check the CLAUDE.md file and any style configuration files for adherence to project rules.
Identify Style Violations
Please review the following CLAUDE.md file content: [PASTE CONTENT]. Identify any style violations present in the document and provide a detailed explanation for each rule that was not followed. For each violation, include the specific style rule that was missed, the section of the content where the violation occurs, and suggestions for how to correct these issues. Aim for a comprehensive analysis that helps me understand the importance of each style rule and how to improve my writing accordingly.
Check ESLint Configuration
Please review the following ESLint configuration from my .eslintrc file: [PASTE CONTENT]. Analyze the rules specified in this configuration and identify which of these rules are not being adhered to in the generated code. For each rule that is violated, provide a brief explanation of how it applies to the code and suggest specific changes to ensure compliance with the ESLint standards. Additionally, summarize any common patterns or issues that may arise from the current code style that conflict with these rules.
Analyze Prettier Settings
Please analyze the contents of my .prettierrc file provided below: [PASTE CONTENT]. I would like you to identify any discrepancies between the formatting rules specified in this file and the output you are generating. Specifically, highlight which rules are being ignored and provide suggestions on how to align the output with the specified settings. Additionally, explain the potential impact of these discrepancies on the overall code quality and maintainability.
Review Project Style Guide
Please review my project style guide, which is as follows: [PASTE CONTENT]. Identify the specific sections that are not being followed in the current project. For each overlooked guideline, provide a brief explanation of how it differs from the established standards and suggest ways to align the project with the style guide. Additionally, summarize the overall impact of these discrepancies on the project's consistency and quality.
Examine Recent Changes
Please review the recent changes made to the codebase. Identify any style rules from the CLAUDE.md documentation or configuration files that were not applied in these changes. Provide a detailed list of the specific rules that were overlooked, along with examples from the code where these rules should have been implemented. Additionally, suggest how to correct these issues to ensure compliance with the established coding standards.
Focus on correcting the specific style violations identified in the diagnosis phase.
Correct ESLint Violations
Please review the following ESLint violations: [LIST VIOLATIONS]. For each violation, provide a detailed explanation of the issue and the specific rule from the .eslintrc file that it violates. Then, present the corrected code for each violation, ensuring that it adheres to the specified coding standards. Additionally, summarize any potential impacts of these violations on code quality and maintainability.
Apply Prettier Formatting
Reformat the following code according to the Prettier settings specified in the .prettierrc file. Ensure that all lines adhere to the formatting rules, including indentation, line length, and spacing. Provide a clear before-and-after comparison of the code, highlighting any changes made to improve readability and maintain consistency with the defined style guidelines. The output should be well-structured and easy to follow for someone reviewing the modifications.
Fix Style Guide Deviations
Please review the following code snippet for adherence to the specified style guide rules: [LIST RULES]. Identify any deviations from these guidelines and provide corrections to ensure the code aligns with the style standards. Additionally, explain the changes made and why they are necessary for compliance. Format the response to include the original code, the corrected version, and a brief rationale for each correction.
Revisit CLAUDE.md Rules
Please review the rules outlined in the CLAUDE.md file and identify any that may have been overlooked in the recent code changes. For each rule, provide a summary of its importance and how it should be applied to the current codebase. Then, list the specific code changes that need to be adjusted to comply with these rules, explaining the rationale behind each adjustment. Finally, ensure that all revised code adheres to the standards set forth in CLAUDE.md and is clearly documented for future reference.
Update Code for Consistency
Please review the entire codebase for [PROJECT NAME] and identify areas where the code does not align with the established style conventions. Provide a detailed list of the inconsistencies you find, including specific examples and the recommended changes for each. Additionally, update the code to ensure that it adheres to the project's style guidelines, focusing on aspects such as naming conventions, indentation, and comment formatting. Finally, summarize the changes made and explain how they improve the overall consistency of the codebase.
Ensure the code now adheres to all style conventions and passes any style checks.
Run ESLint Checks
Please run ESLint checks on the codebase for [PROJECT NAME] and provide the output of the analysis. Ensure that all code style violations are identified and report any remaining issues that need to be addressed. Additionally, confirm whether there are any violations left unresolved, and if so, list them along with their locations in the code. Format the results in a clear and organized manner for easy review.
Verify Prettier Compliance
Please analyze the codebase for formatting compliance with Prettier. Provide a detailed report of any formatting issues found, including specific lines or sections of code that do not meet Prettier's standards. Additionally, confirm whether all identified issues have been resolved and summarize any changes made to achieve compliance. Include recommendations for maintaining formatting consistency in future code contributions.
Confirm Style Guide Adherence
Please review the following code snippet: [INSERT CODE SNIPPET HERE]. Check it against the specified style guide: [INSERT STYLE GUIDE HERE]. Confirm that all sections of the code adhere to the guidelines, and provide specific feedback on any areas that still require adjustments. Additionally, summarize the overall compliance and suggest any improvements if necessary.
Review Code Changes
Please review the code changes I made in the following files: [FILE NAMES]. For each file, provide a detailed description of the modifications implemented to ensure compliance with the coding style guidelines. Additionally, confirm that all relevant style rules have been adhered to and specify any rules that were particularly challenging to follow or required exceptions. If applicable, suggest improvements or best practices for future code changes to enhance style compliance.
Reproduce Original Scenario
Please recreate the original scenario that led to the style issues in the code. Describe the specific conditions and inputs that triggered the problem, including any relevant code snippets or configurations. After reproducing the scenario, confirm whether the style issues still occur or if they have been resolved. Provide a detailed explanation of your findings, including any changes made to address the problem and the current status of the code style.
Implement measures to ensure future adherence to style conventions.
Create CLAUDE.md Rule
Please draft a new rule for the CLAUDE.md file aimed at preventing style violations in future coding sessions. The rule should clearly outline specific coding standards and best practices to follow, including naming conventions, formatting guidelines, and any other relevant criteria that should be adhered to. Additionally, provide examples of both compliant and non-compliant code snippets to illustrate the differences. Ensure the rule is structured in a way that is easy to understand and implement for all team members.
Develop Style Compliance Checklist
Create a comprehensive style compliance checklist that can be used at the beginning of each coding session. The checklist should include specific items such as naming conventions, indentation rules, comment guidelines, and formatting standards. Additionally, include checks for consistency in code structure, use of whitespace, and adherence to any relevant style guides. Format the checklist in a clear and organized manner, making it easy to follow and implement. Ensure that the checklist is thorough enough to cover all essential aspects of style compliance.
Add Code Comment Warnings
Please add a comment above the affected functions in the code to warn about specific style constraints that should be followed. The comment should clearly outline the style guidelines that need to be adhered to, including any formatting rules, naming conventions, or best practices relevant to this codebase. Make sure the comment is concise yet informative, so that any developer or AI assistant reviewing the code understands the importance of these constraints. Format the comment in a way that it stands out, using appropriate syntax for comments in [PROGRAMMING LANGUAGE].
Draft Session Opener
Please draft a session opener that emphasizes the importance of checking style configurations prior to generating or modifying code. The opener should include a brief overview of why adhering to style guidelines is crucial for code quality and maintainability. Additionally, provide a checklist of key style configurations to verify, such as naming conventions, formatting rules, and documentation standards. Aim for a concise yet engaging introduction that sets a positive tone for the session and encourages best practices among participants.
Establish Project Convention
Help me establish a project convention for our coding standards that will be documented in the CLAUDE.md file. This convention should outline the mandatory style checks that must be completed before any code is finalized. Include specific guidelines on what aspects of the code should be checked for style consistency, such as indentation, naming conventions, and comment formatting. Additionally, suggest a process for how these checks will be implemented and enforced within the team, including any tools or methods to be used for style verification. Format this as a clear and structured document that can be easily followed by all team members.
Claude Code may not be referencing your .eslintrc file correctly. Ensure the file is in the project root and that all rules are explicitly defined. Use prompts to verify adherence.
Make sure your .prettierrc file is correctly configured and located in the project root. Use prompts to enforce Prettier formatting on generated code.
Ensure the style guide is referenced in the CLAUDE.md file. Use prompts to highlight specific sections that must be followed.
Add specific rules to the CLAUDE.md file and create a session checklist to review style compliance before code generation.
Yes, by using prompts to instruct Claude Code to apply ESLint and Prettier rules, it can automatically correct style issues.
AI Prompts for Ensure Code Style Compliance
Generated code that ignores ESLint, Prettier, or project-specific style conventions can lead to inconsistent code quality and readability issues.
See promptsAI Prompts for Ensuring Code Style Compliance
Cursor-generated code sometimes ignores ESLint, Prettier, or project-specific style conventions, leading to inconsistent codebases.
See promptsAI Prompts for Ensuring Code Style Compliance
Generated code ignores ESLint, Prettier, or project-specific style conventions, leading to inconsistent code quality.
See prompts