一键导入
prefer-set-has
Prefer Set.has() over Array.includes() for constant allowlists/blocklists. Read this when reviewing or writing membership checks in TypeScript files.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Prefer Set.has() over Array.includes() for constant allowlists/blocklists. Read this when reviewing or writing membership checks in TypeScript files.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Enforce import boundaries inside the devtools scope. Use for any work in "devtools/**".
Official Ledger wallet-cli - USB-based CLI for Ledger hardware wallet flows (account discover, receive, balances, operations, send, swap quote/execute/status, genuine-check, assets token / token-by-id). Use for any wallet-cli command execution and for mapping informal requests to the right command.
Handle batches of Jira tickets through shared analysis, per-ticket feature-dev, Lumen UI guardrails, changesets, and draft PRs. Use when the user provides multiple Jira tickets or asks to deliver tickets one by one with PRs.
Trigger the on-demand production build workflows on LedgerHQ/ledger-live-build (Desktop, Android APK, iOS) for a ledger-live branch, then post a PR comment. Use when asked to "run builds", "produce a build", "build the app(s)", or "make an APK/iOS/desktop build" for a PR/branch.
Guided feature development with codebase understanding and architecture focus
Rules and layout for coin module packages under libs/coin-modules/. Read when adding or modifying a coin module.
| name | prefer-set-has |
| description | Prefer Set.has() over Array.includes() for constant allowlists/blocklists. Read this when reviewing or writing membership checks in TypeScript files. |
When checking membership in a constant list of known values (allowlists, blocklists, enum-like sets), use a Set with .has() instead of an array with .includes().
// ❌ BAD
const ALLOWED = ["a", "b", "c"];
if (ALLOWED.includes(value)) { … }
// ✅ GOOD
const ALLOWED = new Set(["a", "b", "c"]);
if (ALLOWED.has(value)) { … }
Why: Set.has() is O(1) vs .includes() O(n), communicates "membership test" intent more clearly, and avoids accidental mutation of the backing array.
When .includes() is fine: Searching within a dynamic or short-lived array (e.g. function parameters, user input) where creating a Set would add noise.