Back to Workflow & Productivity

naming-analyzer

code qualitynaming conventionsrefactoringcode styledeveloper toolstypescriptjavascriptpython
⭐ 2.0kπŸ“„ MITπŸ•’ 2026-03-05Source β†—

Install this skill

npx skills add softaworks/agent-toolkit

Works across Claude Code, Cursor, Codex, Copilot & Antigravity

The naming-analyzer evaluates your codebase for linguistic clarity and architectural consistency. It inspects identifiers across various layers including variables, class structures, database schemas, and API endpoints. By identifying ambiguous, misleading, or non-idiomatic naming choices, it helps enforce project-wide standards such as camelCase or snake_case depending on the target language. The skill detects common flaws like overly broad variable names, concealed side effects in function identifiers, and improper boolean prefixes. Beyond mere linting, it provides actionable alternatives with clear justifications, helping developers maintain high-quality documentation through code itself. It bridges the gap between functional logic and readable, maintainable software by ensuring that every symbol explicitly communicates its purpose, scope, and behavior to future maintainers, effectively reducing technical debt caused by unclear naming conventions.

When to Use This Skill

  • β€’Refactoring a legacy codebase with inconsistent naming patterns
  • β€’Onboarding new team members by establishing clear code readability standards
  • β€’Reviewing public APIs to ensure endpoint and parameter names follow industry norms
  • β€’Preparing code for a major release to minimize maintenance confusion

How to Invoke This Skill

Example prompts that trigger this skill in Claude Code, Cursor, or Antigravity:

  • β€œAnalyze naming conventions in this directory
  • β€œFind unclear function names in my service layer
  • β€œSuggest better names for the variables in this file
  • β€œCheck for naming consistency across the project
  • β€œIdentify misleading names in the current module

Pro Tips

  • πŸ’‘Integrate Early: Run the Naming Analyzer frequently during development, not just at the end, to catch issues proactively.
  • πŸ’‘Customize for Project: Educate the skill on your project's specific custom conventions for highly tailored suggestions.
  • πŸ’‘Review Reasoning: Pay attention to the 'Reasoning for each suggestion' provided by the skill to learn and understand best practices.

What this skill does

  • β€’Identifies misleading function names that mask hidden side effects
  • β€’Detects language-specific convention violations for JS, TS, Python, Java, and Go
  • β€’Highlights vague or single-letter identifiers in broad scopes
  • β€’Suggests context-aware replacements for ambiguous constants and magic numbers
  • β€’Enforces standardized boolean prefixing like 'is', 'has', or 'should'

When not to use it

  • βœ•When working in highly obfuscated code where renaming would break external dynamic bindings
  • βœ•For projects where domain-specific nomenclature deviates intentionally from standard industry conventions

Example workflow

  1. Invoke the analyzer on a target directory or specific file
  2. Review the generated report for critical and major naming issues
  3. Examine the specific lines flagged for misleading behavior or convention violations
  4. Apply the suggested renaming recommendations to the codebase
  5. Verify that the new names accurately reflect function side effects and logic

Prerequisites

  • –A local file path or directory containing the source code
  • –Read/Write access to the files targeted for analysis

Pitfalls & limitations

  • !Renaming functions or variables may break external integrations or reflection-based code
  • !Automated renaming suggestions might conflict with strict serialization requirements or DB mappings
  • !The tool focuses on naming, not architectural design, and cannot fix bad program logic

FAQ

Can it fix my code automatically?
Yes, it supports a flag to apply recommended changes directly to your files.
Does it support languages other than JavaScript and Python?
The skill includes specialized convention sets for Java and Go in addition to JS, TS, and Python.
Why does it flag my function as misleading?
If your function name suggests a simple read operation but contains side effects like data mutations, the analyzer identifies this mismatch as a critical clarity issue.

How it compares

Unlike a standard linter that only enforces style syntax, this tool analyzes the semantic intent of names to catch logical discrepancies like misleading function labels.

Source & trust

⭐ 2.0k starsπŸ“„ MITπŸ•’ Updated 2026-03-05
πŸ“„ Full skill instructions β€” original source: softaworks/agent-toolkit
# Naming Analyzer Skill

Suggest better variable, function, and class names based on context and conventions.

## Instructions

You are a naming convention expert. When invoked:

1. **Analyze Existing Names**:
- Variables, constants, functions, methods
- Classes, interfaces, types
- Files and directories
- Database tables and columns
- API endpoints

2. **Identify Issues**:
- Unclear or vague names
- Abbreviations that obscure meaning
- Inconsistent naming conventions
- Misleading names (name doesn't match behavior)
- Too short or too long names
- Hungarian notation misuse
- Single-letter variables outside loops

3. **Check Conventions**:
- Language-specific conventions (camelCase, snake_case, PascalCase)
- Framework conventions (React components, Vue props)
- Project-specific patterns
- Industry standards

4. **Provide Suggestions**:
- Better alternative names
- Reasoning for each suggestion
- Consistency improvements
- Contextual appropriateness

## Naming Conventions by Language

### JavaScript/TypeScript
- Variables/functions: camelCase
- Classes/interfaces: PascalCase
- Constants: UPPER_SNAKE_CASE
- Private fields: _prefixUnderscore or #privateField
- Boolean: is, has, can, should prefixes

### Python
- Variables/functions: snake_case
- Classes: PascalCase
- Constants: UPPER_SNAKE_CASE
- Private: _prefix_underscore
- Boolean: is_, has_, can_ prefixes

### Java
- Variables/methods: camelCase
- Classes/interfaces: PascalCase
- Constants: UPPER_SNAKE_CASE
- Packages: lowercase

### Go
- Exported: PascalCase
- Unexported: camelCase
- Acronyms: All caps (HTTPServer, not HttpServer)

## Common Naming Issues

### Too Vague
// ❌ Bad - Too generic
function process(data) { }
const info = getData();
let temp = x;

// βœ“ Good - Specific and clear
function processPayment(transaction) { }
const userProfile = getUserProfile();
let previousValue = x;


### Misleading Names
// ❌ Bad - Name doesn't match behavior
function getUser(id) {
const user = fetchUser(id);
user.lastLogin = Date.now();
saveUser(user); // Side effect! Not just "getting"
return user;
}

// βœ“ Good - Name reflects actual behavior
function fetchAndUpdateUserLogin(id) {
const user = fetchUser(id);
user.lastLogin = Date.now();
saveUser(user);
return user;
}


### Abbreviations
// ❌ Bad - Unclear abbreviations
const usrCfg = loadConfig();
function calcTtl(arr) { }

// βœ“ Good - Clear and readable
const userConfig = loadConfig();
function calculateTotal(amounts) { }

// βœ“ Acceptable - Well-known abbreviations
const htmlElement = document.getElementById('main');
const apiUrl = process.env.API_URL;


### Boolean Naming
// ❌ Bad - Unclear state
const login = user.authenticated;
const status = checkUser();

// βœ“ Good - Clear boolean intent
const isLoggedIn = user.authenticated;
const isUserValid = checkUser();
const hasPermission = user.roles.includes('admin');
const canEditPost = isOwner || isAdmin;
const shouldShowNotification = isEnabled && hasUnread;


### Magic Numbers
// ❌ Bad - Unnamed constants
if (age > 18) { }
setTimeout(callback, 3600000);

// βœ“ Good - Named constants
const LEGAL_AGE = 18;
const ONE_HOUR_IN_MS = 60 * 60 * 1000;

if (age > LEGAL_AGE) { }
setTimeout(callback, ONE_HOUR_IN_MS);


## Usage Examples

@naming-analyzer
@naming-analyzer src/
@naming-analyzer UserService.js
@naming-analyzer --conventions
@naming-analyzer --fix-all


## Report Format

# Naming Analysis Report

## Summary
- Items analyzed: 156
- Issues found: 23
- Critical: 5 (misleading names)
- Major: 12 (unclear/vague)
- Minor: 6 (convention violations)

---

## Critical Issues (5)

### src/services/UserService.js:45
**Current**: getUser(id)
**Issue**: Function name implies read-only but has side effects (updates lastLogin)
**Severity**: Critical - Misleading
**Suggestion**: fetchAndUpdateUserLogin(id)
**Reason**: Name should reflect the mutation

### src/utils/helpers.js:23
**Current**: validate(x)
**Issue**: Generic parameter name, unclear what's being validated
**Severity**: Critical - Too vague
**Suggestion**: validateEmail(emailAddress)
**Reason**: Specific names improve clarity

---

## Major Issues (12)

### src/components/DataList.jsx:12
**Current**: const d = new Date()
**Issue**: Single-letter variable in large scope
**Severity**: Major
**Suggestion**: const currentDate = new Date()
**Reason**: Clarity and searchability

### src/api/client.js:67
**Current**: function proc(data) {}
**Issue**: Abbreviated function name
**Severity**: Major
**Suggestion**: function processApiResponse(data) {}
**Reason**: Full words are more readable

### src/models/User.js:34
**Current**: user.active
**Issue**: Boolean property without prefix
**Severity**: Major
**Suggestion**: user.isActive
**Reason**: Follow boolean naming convention

### src/utils/format.js:89
**Current**: const MAX = 100
**Issue**: Generic constant name
**Severity**: Major
**Suggestion**: const MAX_RETRY_ATTEMPTS = 100
**Reason**: Specific purpose is clearer

---

## Minor Issues (6)

### src/config/settings.js:12
**Current**: const API_url = '...'
**Issue**: Inconsistent casing (mixing UPPER and lower)
**Severity**: Minor
**Suggestion**: const API_URL = '...' or const apiUrl = '...'
**Reason**: Consistency in convention

### src/helpers/string.js:45
**Current**: function strToNum(s) {}
**Issue**: Abbreviated function and parameter
**Severity**: Minor
**Suggestion**: function stringToNumber(value) {}
**Reason**: Clarity over brevity

---

## Convention Violations

### Inconsistent Boolean Prefixes
**Locations**: 8 files
**Issue**: Mixed use of is, has, can vs no prefix
**Recommendation**: Standardize on boolean prefixes
- Use is for state: isActive, isVisible
- Use has for possession: hasPermission, hasError
- Use can for ability: canEdit, canDelete
- Use should for decisions: shouldRender, shouldValidate

### Mixed Naming Conventions
**Location**: src/legacy/
**Issue**: Mix of camelCase and snake_case in JavaScript
**Recommendation**: Convert all to camelCase for consistency

---

## Suggested Renaming

### High Priority (Misleading or Critical)
1. getUser β†’ fetchAndUpdateUserLogin (src/services/UserService.js:45)
2. validate β†’ validateEmail (src/utils/helpers.js:23)
3. process β†’ processPaymentTransaction (src/payment/processor.js:67)

### Medium Priority (Clarity)
1. d β†’ currentDate (7 locations)
2. temp β†’ previousValue (4 locations)
3. data β†’ apiResponse or more specific (12 locations)
4. arr β†’ items, values, or more specific (8 locations)

### Low Priority (Convention)
1. active β†’ isActive (12 locations)
2. error β†’ hasError (6 locations)
3. API_url β†’ API_URL (3 locations)

---

## Naming Patterns to Follow

### Functions/Methods
- Verbs: get, set, create, update, delete, fetch, calculate, validate
- Clear action: sendEmail(), parseJSON(), formatCurrency()

### Classes
- Nouns: UserService, PaymentProcessor, EmailValidator
- Avoid generic: Don't use Manager, Helper, Utility unless necessary

### Variables
- Nouns or noun phrases: user, emailAddress, totalAmount
- Descriptive: userList not list, activeUsers not users2

### Constants
- All caps with underscores: MAX_RETRY_ATTEMPTS, DEFAULT_TIMEOUT
- Include units: CACHE_DURATION_MS, MAX_FILE_SIZE_MB

### Booleans
- Question form: isValid, hasPermission, canEdit
- Affirmative: isEnabled not isDisabled (prefer positive)

---

## Refactoring Script

Would you like me to create a refactoring script to apply these changes?
This will:
1. Rename all suggested items
2. Update all references
3. Maintain git history
4. Generate migration guide

---

## Best Practices

βœ“ **DO**:
- Use full words over abbreviations
- Be specific and descriptive
- Follow language conventions
- Use consistent patterns
- Make booleans obvious
- Include units in constants

βœ— **DON'T**:
- Use single letters (except in loops: i, j, k)
- Use vague names (data, info, temp, x)
- Mix naming conventions
- Use misleading names
- Over-abbreviate
- Use Hungarian notation in modern code


## Naming Decision Tree

Is it a boolean?
β”œβ”€ Yes β†’ Use is/has/can/should prefix
└─ No β†’ Is it a function?
β”œβ”€ Yes β†’ Use verb phrase (action)
└─ No β†’ Is it a class?
β”œβ”€ Yes β†’ Use noun (PascalCase)
└─ No β†’ Is it a constant?
β”œβ”€ Yes β†’ Use UPPER_SNAKE_CASE
└─ No β†’ Use descriptive noun (camelCase/snake_case)


## Notes

- Prioritize clarity over brevity
- Context matters (loop counters can be i, j)
- Well-known abbreviations are okay (html, api, url, id)
- Consistency within a project is more important than perfect naming
- Refactor names as understanding improves
- Use IDE rename refactoring to safely update all references

How to Use This Skill Unit

Option A: Project-Specific (Recommended)

  1. Click "Download" above
  2. In your project, create the directory: .agent/skills/naming-analyzer/
  3. Save the file as SKILL.md
  4. The agent will automatically discover the skill based on its description.

Option B: Global Installation (All Agents)

Save the file to these locations to make it available across all projects:

  • Claude Code: ~/.claude/skills/softaworks/agent-toolkit/naming-analyzer/SKILL.md
  • Cursor: ~/.cursor/skills/softaworks/agent-toolkit/naming-analyzer/SKILL.md
  • Antigravity: ~/.gemini/antigravity/skills/softaworks/agent-toolkit/naming-analyzer/SKILL.md

πŸš€ Install with CLI:
npx skills add softaworks/agent-toolkit

Read the Master Guide: Mastering Agent Skills β†’

Recommended Rules

View more rules β†’

Recommended Workflows

View more workflows β†’

Recommended MCP Servers

View more MCP servers β†’

Take It Further

Maximize your productivity with these powerful resources

πŸ“‹

Define Your Standards

Set up coding standards to ensure this workflow produces consistent, high-quality results.

Browse Rules Library
πŸ“–

Master Workflows

Learn how to create custom workflows, use Turbo Mode, and build your automation library.

Complete Guide

How to use this Skill in Claude Code & Cursor

For Claude Code (CLI)

To use this skill in Claude Code, copy the rule content into your project's custom instructions or follow our Add-Skill CLI guide. This ensures Claude follows your standards during every code generation.

For Cursor & Windsurf

For Cursor or Windsurf, individual skills are best used in the "Rules for AI" section. This specific unit helps the agent avoid workflow & productivity issues, leading to cleaner, more efficient code.

Why the skill format matters: the standardized Agent Skills format lets your AI agent load detailed instructions only when they are relevant, keeping your prompt clean while improving results.

Source & attribution

This skill is categorized under Workflow & Productivity and is published by Softaworks, maintained in softaworks/agent-toolkit.

← Browse All Agent Skills
Sponsored AI assistant. Recommendations may be paid.