Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Suggest better variable, function, and class names based on context and conventions.
.claude/skills/davila7-naming-analyzer/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 37% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 77% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 172% | 0% |
| case-22 | ✗→✓ | ▲ Improved | 27% | 0% |
| case-04 | ✓→✗ | ▼ Worse | 73% | 0% |
Suggest better variable, function, and class names based on context and conventions.
You are a naming convention expert. When invoked:
camelCasePascalCaseUPPER_SNAKE_CASE_prefixUnderscore or #privateFieldis, has, can, should prefixessnake_casePascalCaseUPPER_SNAKE_CASE_prefix_underscoreis_, has_, can_ prefixescamelCasePascalCaseUPPER_SNAKE_CASElowercasePascalCasecamelCaseHTTPServer, not HttpServer)javascript// ❌ 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;
javascript// ❌ 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; }
javascript// ❌ 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;
javascript// ❌ 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;
javascript// ❌ 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);
@naming-analyzer
@naming-analyzer src/
@naming-analyzer UserService.js
@naming-analyzer --conventions
@naming-analyzer --fix-allmarkdown# 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
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)i, j)html, api, url, id)| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 22,801 | 18,652 | -18% | 1 | 1 | 0% | 4,441 | 6,103 | +37% | 0 | 0 | — |
case-02 | fail→pass | 20,100 | 21,959 | +9% | 1 | 1 | 0% | 3,671 | 6,491 | +77% | 0 | 0 | — |
case-03 | pass→pass | 10,576 | 13,440 | +27% | 1 | 1 | 0% | 2,179 | 4,618 | +112% | 0 | 0 | — |
case-04 | pass→fail | 18,130 | 15,928 | -12% | 1 | 1 | 0% | 3,132 | 5,425 | +73% | 0 | 0 | — |
case-05 | pass→fail | 14,576 | 13,496 | -7% | 1 | 1 | 0% | 2,994 | 5,140 | +72% | 0 | 0 | — |
case-06 | pass→pass | 8,276 | 5,093 | -38% | 1 | 1 | 0% | 1,575 | 3,602 | +129% | 0 | 0 | — |
case-07 | pass→pass | 5,280 | 5,057 | -4% | 1 | 1 | 0% | 1,116 | 3,630 | +225% | 0 | 0 | — |
case-08 | pass→pass | 6,118 | 7,153 | +17% | 1 | 1 | 0% | 1,279 | 3,896 | +205% | 0 | 0 | — |
case-09 | pass→pass | 6,108 | 6,262 | +3% | 1 | 1 | 0% | 1,280 | 3,771 | +195% | 0 | 0 | — |
case-10 | pass→pass | 6,997 | 5,037 | -28% | 1 | 1 | 0% | 1,426 | 3,389 | +138% | 0 | 0 | — |
case-11 | pass→pass | 6,521 | 6,634 | +2% | 1 | 1 | 0% | 1,197 | 3,748 | +213% | 0 | 0 | — |
case-12 | pass→pass | 6,830 | 6,462 | -5% | 1 | 1 | 0% | 1,185 | 3,805 | +221% | 0 | 0 | — |
case-13 | fail→pass | 8,551 | 8,547 | -0% | 1 | 1 | 0% | 1,555 | 4,236 | +172% | 0 | 0 | — |
case-14 | pass→pass | 6,747 | 7,044 | +4% | 1 | 1 | 0% | 1,302 | 3,818 | +193% | 0 | 0 | — |
case-15 | pass→pass | 7,889 | 7,365 | -7% | 1 | 1 | 0% | 1,404 | 3,770 | +169% | 0 | 0 | — |
case-16 | pass→pass | 7,226 | 6,081 | -16% | 1 | 1 | 0% | 1,486 | 3,701 | +149% | 0 | 0 | — |
case-17 | pass→pass | 7,714 | 4,934 | -36% | 1 | 1 | 0% | 1,426 | 3,643 | +155% | 0 | 0 | — |
case-18 | pass→pass | 7,139 | 5,623 | -21% | 1 | 1 | 0% | 1,536 | 3,583 | +133% | 0 | 0 | — |
case-19 | pass→pass | 8,273 | 11,851 | +43% | 1 | 1 | 0% | 1,548 | 4,802 | +210% | 0 | 0 | — |
case-20 | pass→pass | 9,937 | 10,917 | +10% | 1 | 1 | 0% | 2,133 | 4,706 | +121% | 0 | 0 | — |
case-21 | pass→pass | 8,859 | 9,243 | +4% | 1 | 1 | 0% | 1,841 | 4,327 | +135% | 0 | 0 | — |
case-22 | fail→pass | 12,125 | 2,078 | -83% | 1 | 1 | 0% | 2,323 | 2,955 | +27% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 22 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.