by softaworks
一个适用于 Claude、Codex 和 Claude Code 的 AI 技能
1. 打开 Claude 聊天界面
2. 点击下方 "📋 复制" 按钮
3. 粘贴到 Claude 聊天框中并发送
4. 输入 "使用 naming-analyzer 技能" 开始使用
=== naming-analyzer 技能 === 作者: softaworks 描述: 一个适用于 Claude、Codex 和 Claude Code 的 AI 技能 使用方法: 1. 调用技能: "使用 naming-analyzer 技能" 2. 提供相关信息: 根据技能要求提供必要参数 3. 查看结果: 技能会返回处理结果 示例: "使用 naming-analyzer 技能,帮我分析一下这段代码"
这种方法适用于所有 Claude 用户,不需要安装额外工具。
productivity
medium
A skill for Claude Code that analyzes code naming conventions and suggests better variable, function, class, and other identifier names based on context and industry standards.
Good naming is one of the most important aspects of readable, maintainable code. This skill helps developers:
Poor naming leads to bugs, confusion, and wasted time. This skill acts as an expert code reviewer focused specifically on naming quality.
Use this skill when you want to:
Trigger phrases:
Analysis Phase: The skill examines all identifiers in the target code:
Issue Detection: Each identifier is evaluated for common problems:
data, info, temp, x)usrCfg, calcTtl)camelCase and snake_case)getUser that also updates data)active instead of isActive)Convention Checking: The skill validates against language-specific standards:
Report Generation: A structured report is produced with:
Understands naming conventions for JavaScript, TypeScript, Python, Java, Go, and more. Automatically adapts recommendations to the language being analyzed.
Issues are categorized by impact:
| Severity | Description | Example |
|---|---|---|
| Critical | Misleading names that could cause bugs | getUser() that also modifies data |
| Major | Unclear names requiring mental effort to understand | proc(data) instead of processApiResponse(response) |
| Minor | Convention violations that affect consistency | API_url instead of API_URL |
Enforces clear boolean prefixes:
is for state: isActive, isVisible, isEnabledhas for possession: hasPermission, hasError, hasChildrencan for ability: canEdit, canDelete, canAccessshould for decisions: shouldRender, shouldValidate, shouldRefreshIdentifies unnamed numeric literals and suggests meaningful constant names:
// Before
if (age > 18) { }
setTimeout(callback, 3600000);
// After
const LEGAL_AGE = 18;
const ONE_HOUR_IN_MS = 60 * 60 * 1000;
if (age > LEGAL_AGE) { }
setTimeout(callback, ONE_HOUR_IN_MS);
Can generate refactoring scripts to apply naming changes across the codebase while maintaining git history.
Analyze a single file:
@naming-analyzer UserService.js
Analyze an entire directory:
@naming-analyzer src/
Show naming conventions reference:
@naming-analyzer --conventions
Analyze and suggest fixes for all issues:
@naming-analyzer --fix-all
General invocation:
@naming-analyzer
Then provide the code or file path when prompted.
The skill produces a detailed markdown report containing:
## Summary
- Items analyzed: 156
- Issues found: 23
- Critical: 5 (misleading names)
- Major: 12 (unclear/vague)
- Minor: 6 (convention violations)
Each issue includes:
Prioritized list of all recommended changes:
userConfig not usrCfgemailAddress not strisEnabled, hasPermissionTIMEOUT_MS, MAX_SIZE_MBi, j, k)data, info, temp, x, resultcalculateTotal not calcTtlSome abbreviations are well-known and acceptable:
html, api, url, id, db, io, uimin, max, src, dest, config, envreq, res (in HTTP context)err (in error handling context)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 - not every short name is badhtml, api, url, id are universally understoodView Count
0
Download Count
0
Favorite Count
0
Quality Score
50