20 of the best prompts for aligning code with style guides, step by step across 4 stages. Works with ChatGPT, Claude, and Gemini.
20 of the best prompts for aligning code with style guides, step by step across 4 stages. Works with ChatGPT, Claude, and Gemini.
Published June 28, 2026
GitHub Copilot sometimes generates code that ignores ESLint, Prettier, or project-specific style conventions, leading to inconsistent codebases. This inconsistency can cause integration issues and make collaboration difficult. These prompts help developers ensure Copilot-generated code adheres to their style guides, maintaining consistency and quality. 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.
Identify the specific style guide or configuration that is being ignored.
Identify Ignored Rules
Please analyze my ESLint configuration provided below: [PASTE CONTENT]. Identify and list the specific rules that were ignored in the last code suggestion. For each ignored rule, provide a brief explanation of why it is important and how following it can improve code quality. Additionally, suggest possible changes to the code suggestion that would align it with the ESLint rules.
Check Prettier Compliance
Please review my Prettier configuration provided below: [PASTE CONTENT]. Analyze the latest code suggestion I received and identify any formatting rules from the Prettier configuration that were not applied. For each rule that was violated, provide a brief explanation of the rule and how it should be correctly implemented in the code. Additionally, suggest specific changes to ensure compliance with the Prettier formatting standards.
Review Project Style Guide
Please review the following project-specific style guide: [PASTE CONTENT]. Analyze the code I generated and identify any specific guidelines from the style guide that were overlooked or not followed. Provide detailed feedback on each guideline that was missed, including examples from the code where applicable. Additionally, suggest improvements to align the code with the style guide standards.
Analyze Code Style Deviation
Analyze the following code snippet: [PASTE CODE]. Identify and list any deviations from the ESLint and Prettier configurations specified in the following guidelines: [PASTE ESLINT CONFIG] and [PASTE PRETTIER CONFIG]. For each deviation, provide a brief explanation of why it does not conform to the specified styles and suggest possible corrections to align the code with the configurations. Format your response in a clear, structured manner, highlighting each deviation and its corresponding suggestion.
Evaluate Style Consistency
Please evaluate the following code for consistency with my style guide: [PASTE CODE]. Identify and highlight any inconsistencies you find, including issues related to naming conventions, indentation, spacing, and comments. Additionally, provide suggestions on how to improve the code to align better with the specified style guide. Format your feedback in a clear and organized manner, categorizing the inconsistencies by type.
Focus on correcting the specific style issues identified in the diagnostic stage.
Apply ESLint Rules
Reformat the following code to ensure it complies with the ESLint rules specified in my configuration. The code is: [PASTE CODE]. Please provide a detailed explanation of the changes made, including any specific rules that were violated and how they were addressed. Additionally, ensure that the final output is clean and follows best practices for readability and maintainability.
Enforce Prettier Formatting
Reformat the following code snippet to ensure it adheres to my Prettier configuration: [PASTE CODE]. Please check for consistent indentation, spacing, and line breaks according to the Prettier rules. Additionally, ensure that all quotes are consistent and that the code is properly organized for readability. Provide the reformatted code in a clear and structured format.
Correct Style Guide Violations
Please review the following code snippet: [PASTE CODE] and identify any style guide violations based on my project’s specific style guide. Provide a corrected version of the code that adheres to the style guidelines, including any necessary changes to formatting, naming conventions, and structure. Additionally, explain the changes made and why they are important for maintaining code quality and consistency within the project.
Resolve Specific Rule Breach
Please review the following code snippet: [PASTE CODE]. Identify and resolve the specific ESLint rule violation related to: [RULE NAME]. Ensure that the corrected code adheres to the established coding standards and provide a brief explanation of the changes made. Format the output by presenting the original code alongside the corrected version for clarity.
Fix Formatting Errors
Please review the following code for any formatting errors: [PASTE CODE]. Identify specific issues related to indentation, spacing, and line breaks, and provide corrected code that adheres to standard formatting conventions. Additionally, explain the changes made and why they improve the readability and maintainability of the code. Ensure that the final output is well-structured and easy to follow.
Ensure the fixes have been applied correctly and the code now adheres to the style guides.
Confirm ESLint Compliance
Please review the following code for compliance with the specified ESLint configuration: [PASTE CODE]. Identify any remaining issues that do not meet the ESLint standards and provide a detailed list of these issues along with suggestions for how to resolve them. Additionally, confirm whether all previously identified issues have been addressed and resolved. Format your response in a clear and organized manner, highlighting specific lines of code that need attention.
Verify Prettier Formatting
Please verify that the following code is formatted according to my Prettier configuration: [PASTE CODE]. Provide a detailed analysis of any formatting issues found, including specific lines that do not comply with the Prettier rules. Additionally, suggest the necessary changes to ensure the code adheres to the specified formatting standards. If the code is already compliant, confirm that it meets all Prettier guidelines.
Validate Style Guide Adherence
Please validate that the following code adheres to my style guide: [PASTE CODE]. Analyze the code for any potential violations of the specified style guide, including formatting, naming conventions, and structure. Provide a detailed report highlighting any areas where the code does not comply with the style guide, along with suggestions for corrections. Ensure that your feedback is clear and actionable, so I can easily make the necessary adjustments.
Check for Remaining Issues
Please analyze the following code for any remaining style issues: [PASTE CODE]. Identify any violations of coding standards or style guidelines that have not yet been addressed. Provide a detailed report that includes the specific issues found, suggestions for corrections, and a summary of the overall code quality. Ensure that the analysis covers aspects such as indentation, naming conventions, and any other relevant style guidelines.
Ensure Consistent Formatting
Please review the following code for consistent formatting: [PASTE CODE]. Ensure it adheres to the specified coding style guidelines, including indentation, spacing, and line length. Provide a detailed report on any discrepancies found and suggest corrections to align the code with the required formatting standards. Additionally, confirm that the code maintains readability and follows best practices for clarity and maintainability.
Create reusable artefacts to ensure future code suggestions adhere to style guides.
Create ESLint Rule Reminder
Please draft a reminder to include in my CLAUDE.md that emphasizes the importance of adhering to ESLint rules in our codebase. The reminder should cover the key reasons why maintaining consistent code style is crucial for readability, maintainability, and collaboration among team members. Include specific examples of common ESLint rules that should be prioritized, and suggest a process for regularly reviewing and updating these rules to prevent recurrence of style issues. Format the reminder as a clear, concise paragraph that can be easily referenced by the team.
Draft Prettier Formatting Note
Draft a note for my CLAUDE.md file that emphasizes the importance of using Prettier for code formatting. The note should explain why consistent code style is crucial for maintainability and collaboration among team members. Include specific benefits such as improved readability, reduced merge conflicts, and adherence to coding standards. Aim for a length of about 150 words, and make it clear and engaging to encourage team members to adopt Prettier in their workflow.
Add Style Guide Checklist
Please create a detailed checklist for my CLAUDE.md that outlines all the style guide rules that should be followed in future code submissions. The checklist should include specific categories such as naming conventions, code formatting, documentation standards, and best practices for writing clean and maintainable code. Each item should be clear and actionable, allowing developers to easily verify compliance with the style guide. Format the checklist in bullet points for easy readability and ensure it covers common pitfalls to avoid.
Develop Naming Convention Rule
Create a comprehensive naming convention rule for my CLAUDE.md document to ensure consistency and prevent style deviations. Include specific guidelines for naming variables, functions, classes, and files, along with examples for each category. The rule should also address common pitfalls to avoid and the rationale behind the chosen conventions. Format the output as a clear, structured document that I can easily reference and implement.
Formulate Project Guard
Help me formulate a project guard rule for my CLAUDE.md file to ensure consistent style adherence across the project. The rule should specify the coding standards and formatting guidelines that must be followed, including naming conventions, indentation styles, and commenting practices. Additionally, outline the consequences for non-compliance and how the rule will be enforced during code reviews. Please provide the exact text for the rule, formatted clearly for easy implementation.
GitHub Copilot generates suggestions based on its training data and may not always align with specific ESLint configurations. Providing explicit context in the chat can help guide it to follow your rules.
Include your Prettier configuration in the chat context when requesting code suggestions. This helps Copilot understand and apply your formatting preferences.
Reinforce your style guide by including it in the chat context and creating reminders or rules in your CLAUDE.md to guide Copilot's suggestions.
While Copilot doesn't learn from individual projects, providing detailed context and feedback in the chat can help it align more closely with your style preferences.
Use chat prompts to specify style requirements and verify each suggestion against your style guide to ensure consistency.
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
Claude Code generates code that ignores ESLint, Prettier, or project-specific style conventions, leading to inconsistent codebases.
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 prompts