Reviews and improves **names** in code — variables, functions, classes, modules, parameters — for clarity, intent, and consistency with language/team conventions. Triggers when asked to review names, rename things, improve code readability, clean up confusing code, or when examining code with generic/vague names like "data", "info", "manager", "temp", "util". Does NOT trigger for general code review unrelated to naming, architecture design, debugging, or performance optimization. Identifies naming anti-patterns (generic names, misleading names, type-encoding, abbreviations), suggests role-based names that reveal intent, checks consistency with project/domain vocabulary, and flags misalignment with language culture.
91
90%
Does it follow best practices?
Impact
94%
1.05xAverage score across 5 eval scenarios
Passed
No known issues
| Anti-Pattern | Example | Problem |
|---|---|---|
| Generic names | data, info, stuff, temp, manager, util, helper, processor | No purpose revealed |
| Misleading names | getData() that writes to a file, isActive() returning a string | Lies to the reader |
| Type-encoding | strName, intCount, objList, IMyInterface | Redundant type noise |
| Over-abbreviation | calcTotalAmtForCust() | Clarity lost |
| Inconsistent style | getUser(), fetch_profile(), loadData() in the same project | Broken expectations |
| Meaningless context | order.orderDate, customer.customerName | Redundant prefix |
| Verb-noun mismatch | dataValidation() vs validateData() | Wrong grammatical role |
| Cultural mismatch | i for a string variable in Clojure, or snake_case in JavaScript | Non-idiomatic |
# BEFORE: generic names, no intent
def process(d):
tmp = []
for x in d:
if x['amt'] > 0:
tmp.append({'id': x['id'], 'total': x['amt'] * x['qty']})
return tmp
# AFTER: names reveal role and intent
def calculate_order_totals(orders):
completed_orders = []
for order in orders:
if order['amount'] > 0:
completed_orders.append({
'order_id': order['order_id'],
'total': order['amount'] * order['quantity']
})
return completed_orders// BEFORE: generic state, vague handler
function UserProfile({ info }: { info: any }) {
const [data, setData] = useState<any>(null)
const [flag, setFlag] = useState(false)
function handle() {
if (flag) { setFlag(false); sendEmail(data.email) }
setFlag(true)
}
return <div onClick={handle}>{data?.name}</div>
}
// AFTER: descriptive names reveal intent
function UserProfile({ userInfo }: { userInfo: UserInfo }) {
const [profile, setProfile] = useState<UserProfile | null>(null)
const [isEmailSent, setIsEmailSent] = useState(false)
function handleClick() {
if (isEmailSent) { setIsEmailSent(false); sendEmail(profile.email) }
setIsEmailSent(true)
}
return <div onClick={handleClick}>{profile?.name}</div>
}Classify the target: variable, function, class, module, parameter, or constant.
Name the role: motivation, responsibility, distinguishing behavior, collaborators, and reading context.
If the role is unclear, consider redesigning before renaming.
Each language ecosystem has established conventions. Consult the reference for the target language in references/<language>.md.
| Language | Convention | Reference File |
|---|---|---|
| Python | snake_case, PascalCase | references/python.md |
| TypeScript | camelCase, PascalCase | references/typescript.md |
| Rust | snake_case, PascalCase, SCREAMING_SNAKE | references/rust.md |
| Go | camelCase (exported = PascalCase) | references/golang.md |
| C++ | Varies (project convention matters most) | references/cpp.md |
If there's no glossary, suggest starting one (even informally).
Apply the principles:
buyer > user, applyDiscount > deductPercentFunction naming guide:
| Prefix | Meaning |
|---|---|
get / set | Accessor / mutator (no side effects for get) |
is / has / can | Boolean predicate |
find / search / lookup | May return nothing (return Optional/nullable) |
create / build / make | Factory / constructor |
validate / ensure | Checks invariants, throws on failure |
to | Conversion (e.g., toString()) |
as | Type casting / view (e.g., asJson()) |
After suggesting/proposing a rename:
getData to fetchOrders, are there other get* methods nearby that should follow the same pattern?