Runtime guard refactoring guidance for lodash-es predicates, import style and verification. Use when explicitly refactoring runtime type or empty-string guards.
88%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Replace runtime typeof checks and ad-hoc empty-string checks with lodash-es predicates.
typeof value === 'string'.value && typeof value === 'object'.value.trim() !== '' or value.trim() === ''.typeof (TypeScript only), for example:
ReturnType<typeof fn>keyof typeof CONST_MAPz.infer<typeof Schema>These are compile-time types and must remain as-is.
typeof x === 'string' -> isString(x)typeof x !== 'string' -> !isString(x)typeof x === 'number' -> isNumber(x)typeof x === 'boolean' -> isBoolean(x)typeof x === 'function' -> isFunction(x)typeof x === 'undefined' -> isUndefined(x)x && typeof x === 'object' -> isObjectLike(x)typeof x === 'object' && x !== null -> isObjectLike(x)typeof x === 'object' && !Array.isArray(x) -> isObjectLike(x) && !isArray(x)isEmpty(value.trim())value.trim() === ''value.trim() !== ''value.trim().length === 0lodash-es:import { isString, isNumber, isObjectLike, isEmpty } from 'lodash-es';rg -n "typeof\s+[^\n]+(?:===|!==)\s*'" srctypeof remains:rg -n "\btypeof\b" srcpnpm run type-checkDraculabo/AntigravityManager
4ab6408
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.