Install any skill in seconds. Free to start, no credit card required.
Get Started Free →ledgerhq/prefer-set-has
Prefer Set.has() over Array.includes() for constant allowlists/blocklists. Read this when reviewing or writing membership checks in TypeScript files.
Passed 22 of 22 test cases with the skill, and 8 of 22 without it.
and 25 more in the full report
14 fixed8 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 14 test cases the skill fixed. Same model, same prompt, with and without the skill.
Write a TypeScript module that exports a check function `isBlockedFeature` for checking if a feature key is in a constant blocklist containing 'beta_checkout', 'experimental_ai', and 'legacy_auth'.
| Checked | Without skill | With skill |
|---|---|---|
| The blocklist constant is constructed with new Set. | Missed | Passed |
| The check function uses .has() for membership evaluation. | Missed | Passed |
The instructions your model reads when the skill loads.
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.
test cases passed, vs 8 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.