Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Replace runtime `typeof` checks and ad-hoc empty-string checks with `lodash-es` predicates.
.claude/skills/bilal140202-lodash-es-runtime-guards/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-09 | ✗→✓ | ▲ Improved | 37% | 0% |
| case-01 | ✗→✓ | ▲ Improved | -7% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 6% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -11% | 0% |
| case-07 | ✗→✓ | ▲ Improved | -32% | 0% |
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:tsimport { isString, isNumber, isObjectLike, isEmpty } from 'lodash-es';
bashrg -n "typeof\s+[^\n]+(?:===|!==)\s*'" src
typeof remains:bashrg -n "\btypeof\b" src
bashnpm run type-check
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-09 | fail→pass | 4,850 | 2,898 | -40% | 1 | 1 | 0% | 900 | 1,229 | +37% | 0 | 0 | — |
case-01 | fail→pass | 18,012 | 13,656 | -24% | 1 | 1 | 0% | 4,215 | 3,925 | -7% | 0 | 0 | — |
case-02 | fail→fail | 15,698 | 6,867 | -56% | 1 | 1 | 0% | 3,918 | 1,878 | -52% | 0 | 0 | — |
case-03 | fail→pass | 12,172 | 10,115 | -17% | 1 | 1 | 0% | 2,965 | 3,131 | +6% | 0 | 0 | — |
case-04 | fail→pass | 12,671 | 8,361 | -34% | 1 | 1 | 0% | 2,743 | 2,446 | -11% | 0 | 0 | — |
case-05 | pass→pass | 10,260 | 6,498 | -37% | 1 | 1 | 0% | 2,244 | 2,045 | -9% | 0 | 0 | — |
case-06 | pass→pass | 10,123 | 9,381 | -7% | 1 | 1 | 0% | 2,512 | 2,724 | +8% | 0 | 0 | — |
case-07 | fail→pass | 15,734 | 6,886 | -56% | 1 | 1 | 0% | 3,143 | 2,148 | -32% | 0 | 0 | — |
case-08 | fail→pass | 8,033 | 3,875 | -52% | 1 | 1 | 0% | 1,891 | 1,647 | -13% | 0 | 0 | — |
case-10 | fail→pass | 8,347 | 3,626 | -57% | 1 | 1 | 0% | 1,823 | 1,369 | -25% | 0 | 0 | — |
case-11 | pass→pass | 13,872 | 9,214 | -34% | 1 | 1 | 0% | 3,356 | 3,162 | -6% | 0 | 0 | — |
case-12 | pass→pass | 7,231 | 4,549 | -37% | 1 | 1 | 0% | 1,505 | 1,567 | +4% | 0 | 0 | — |
case-13 | pass→pass | 6,952 | 3,387 | -51% | 1 | 1 | 0% | 1,453 | 1,222 | -16% | 0 | 0 | — |
case-14 | pass→pass | 8,997 | 9,793 | +9% | 1 | 1 | 0% | 2,423 | 3,123 | +29% | 0 | 0 | — |
case-15 | fail→pass | 11,423 | 7,078 | -38% | 1 | 1 | 0% | 2,609 | 2,494 | -4% | 0 | 0 | — |
case-16 | fail→pass | 7,140 | 5,522 | -23% | 1 | 1 | 0% | 1,708 | 1,878 | +10% | 0 | 0 | — |
case-17 | fail→pass | 16,680 | 6,305 | -62% | 1 | 1 | 0% | 4,040 | 1,958 | -52% | 0 | 0 | — |
case-18 | pass→pass | 8,369 | 7,849 | -6% | 1 | 1 | 0% | 1,796 | 2,458 | +37% | 0 | 0 | — |
case-19 | fail→pass | 7,407 | 2,726 | -63% | 1 | 1 | 0% | 1,869 | 1,142 | -39% | 0 | 0 | — |
case-20 | fail→pass | 8,766 | 5,815 | -34% | 1 | 1 | 0% | 2,110 | 1,936 | -8% | 0 | 0 | — |
case-21 | fail→pass | 7,679 | 5,653 | -26% | 1 | 1 | 0% | 1,901 | 1,835 | -3% | 0 | 0 | — |
case-22 | fail→pass | 7,077 | 4,542 | -36% | 1 | 1 | 0% | 1,522 | 1,536 | +1% | 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 +64 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is 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.