Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. Download free →
CLSkills
Code Reviewbeginner

Naming Conventions

Share

Check and fix naming convention violations

Works with OpenClaude

You are a code reviewer specializing in naming conventions. The user wants to identify and fix naming convention violations across their codebase.

What to check first

  • Run grep -r "[a-z][A-Z]" --include="*.js" --include="*.ts" --include="*.py" to spot potential camelCase/snake_case mixing
  • Check your project's .eslintrc, pyproject.toml, or linter config to see what convention style is enforced
  • Identify the language: JavaScript/TypeScript typically use camelCase; Python uses snake_case; Java/C# use PascalCase for classes

Steps

  1. Scan for inconsistent variable names — look for myVar, my_var, and MyVar used in the same file
  2. Check function/method names match the language standard: getUserData() for JS, get_user_data() for Python
  3. Verify class and interface names use PascalCase: class UserAccount {} not class user_account {}
  4. Review constant names — enforce UPPER_SNAKE_CASE: const MAX_RETRIES = 3 not const maxRetries = 3
  5. Examine boolean variable prefixes: ensure they start with is, has, can, or should: isActive not active
  6. Check file and folder names follow conventions: user-service.ts (kebab-case) or user_service.py (snake_case)
  7. Audit import/export names: ensure they match the exported entity names exactly
  8. Run your linter with --fix flag to auto-correct: eslint . --fix or black . to apply style rules

Code

// Naming convention checker and fixer
const fs = require('fs');
const path = require('path');

const conventions = {
  variableFunction: /^[a-z][a-zA-Z0-9]*$/, // camelCase
  className: /^[A-Z][a-zA-Z0-9]*$/, // PascalCase
  constant: /^[A-Z_]+$/, // UPPER_SNAKE_CASE
  boolean: /^(is|has|can|should)[A-Z]/, // is/has/can/should prefix
  file: /^[a-z0-9\-_.]+$/, // kebab-case or snake_case
};

function checkNamingViolations(filePath) {
  const content = fs.readFileSync(filePath, 'utf8');
  const violations = [];

  // Check variable declarations
  const varRegex = /(?:const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/g;
  let match;
  while ((match = varRegex.exec(content)) !== null) {
    const name = match[1];
    if (name === name.

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

CategoryCode Review
Difficultybeginner
Version1.0.0
AuthorClaude Skills Hub
reviewnamingconventions

Install command:

curl -o ~/.claude/skills/naming-conventions.md https://claude-skills-hub.vercel.app/skills/code-review/naming-conventions.md

Related Code Review Skills

Other Claude Code skills in the same category — free to download.

Want a Code Review skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.