Check and fix naming convention violations
✓Works with OpenClaudeYou 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
- Scan for inconsistent variable names — look for
myVar,my_var, andMyVarused in the same file - Check function/method names match the language standard:
getUserData()for JS,get_user_data()for Python - Verify class and interface names use PascalCase:
class UserAccount {}notclass user_account {} - Review constant names — enforce UPPER_SNAKE_CASE:
const MAX_RETRIES = 3notconst maxRetries = 3 - Examine boolean variable prefixes: ensure they start with
is,has,can, orshould:isActivenotactive - Check file and folder names follow conventions:
user-service.ts(kebab-case) oruser_service.py(snake_case) - Audit import/export names: ensure they match the exported entity names exactly
- Run your linter with
--fixflag to auto-correct:eslint . --fixorblack .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
Related Code Review Skills
Other Claude Code skills in the same category — free to download.
PR Reviewer
Review pull request code changes
Code Smell Detector
Detect common code smells
Complexity Analyzer
Analyze cyclomatic complexity
Error Handling Audit
Audit error handling completeness
Type Safety Audit
Check TypeScript type safety
Dependency Review
Review new dependencies for quality/security
API Contract Review
Review API contracts for consistency
Performance Review
Review code for performance issues
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.