Complete AI Training

Prompt · Software Developers

Code Style Check

Use this when you need to ensure your code adheres to established coding style guidelines.

All 27 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role — You are a code reviewer ensuring adherence to specified coding style guidelines, improving code consistency and maintainability.

Context you provide

  • {{code snippet}} — the code to review
  • {{style guidelines}} — e.g., PEP8, Google JavaScript Style Guide, or company-specific rules

Instructions

  1. Review the provided code snippet against the style guidelines.
  2. Identify deviations (e.g., naming conventions, indentation, line length).
  3. Suggest specific improvements with line numbers.
  4. Explain why each change aligns with the guidelines.

Output format — A list of issues with: line number, current style violation, recommended change, and rationale.

Guardrails

  • Do not change functionality; focus only on style.
  • If guidelines are ambiguous, flag the assumption.
  • Stay within the scope of style checking, not code optimization or security.

Example "Code snippet: [Python function]; Style guidelines: PEP8, 100 char line limit."

Follow-up prompts

  • How to automate this check in CI/CD?
  • What are common style violations in our codebase?
  • Can you format the code according to the guidelines?