Lodash es runtime guards

From Draculabo/AntigravityManager · View interactive version

Lodash es runtime guards is an AI agent skill from the GitHub repository Draculabo/AntigravityManager. Runtime guard refactoring guidance for lodash-es predicates, import style and verification. Use when explicitly refactoring runtime type or empty-string guards.

How to use this skill

Skill file

lodash-es-runtime-guards

Replace runtime typeof checks and ad-hoc empty-string checks with lodash-es predicates.

When to Use

Do Not Replace

These are compile-time types and must remain as-is.

Guard Mapping

String Emptiness Pattern

Import Style

import { isString, isNumber, isObjectLike, isEmpty } from 'lodash-es';

Refactor Checklist

  1. Replace runtime checks first, preserving behavior.
  2. Keep array/object branching semantics unchanged.
  3. Re-scan:
rg -n "typeof\s+[^\n]+(?:===|!==)\s*'" src
  1. Confirm only type-level typeof remains:
rg -n "\btypeof\b" src
  1. Run verification:
pnpm run type-check
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.