/agent-skills:ts-stylefrom agent-skills
Style rules for this user's TypeScript code, and for `.js` files too. Write for-of loops instead of callback-taking Array methods (map, filter, forEach, reduce, some, every, find, flatMap and the like), write named functions as function declarations whose names start with a verb (components exempt, never `<noun>Of`), comment the steps inside a function rather than the function itself, and run the repo's linter and formatter after editing. Use this skill whenever writing, editing or reviewing TypeScript, `.ts`, `.tsx`, `.js` or `.jsx` code, unless the repo's own style rules say otherwise.
Ships in agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Rules that apply to every repo of this user with .ts, .tsx, .js or .jsx code. A repo's own conventions (a CLAUDE.md, a lint config, the existing code) win when they disagree.
Iterate with for...of instead of an Array method that takes a callback. This is the user's style: their code has far more for-of loops than callback methods. A chain of methods walks the array once per method, and a loop does the work in one pass.
Do not claim the loop is faster. A single map over a small array is often faster than a loop with push. When speed matters, measure it with the perf-pass skill.
Test files are exempt. expect(units.map((unit) => unit.id)).toEqual(...) is fine in a test.
map, filter, forEach, reduce, reduceRight, some, every, find, findIndex, findLast, findLastIndex, flatMap, and Array.from(items, mapper). The same goes for forEach on a Map or a Set.
filter then map is one pass with a continue.some, every and find keep their short circuit with return or break.entries(), or uses a counted for.Promise.all(items.map(async ...)) becomes a loop that pushes the promises, then Promise.all over them.new Map(items.map(...)) becomes an empty Map filled in the loop.prefer-find flags filter(...)[0], write a loop with break, not find.// Before
const names = party.filter((unit) => unit.alive).map((unit) => unit.name);
const fainted = party.some((unit) => unit.hp === 0);
// After
const names: string[] = [];
let fainted = false;
for (const unit of party) {
if (unit.hp === 0) {
fainted = true;
}
if (unit.alive) {
names.push(unit.name);
}
}
sort, join, slice, includes, indexOf, concat, push, at.sort comparator, which no loop replaces.<For each={...}> in Solid, items.map(...) inside React JSX..then(...), a string's .includes(...).const names: string[] = []), so callers still see what the method inferred.Write a named function as a function declaration, not as a const holding an arrow function.
// Before
export const heal = (unit: Unit, amount: number): void => { ... };
// After
export function heal(unit: Unit, amount: number): void { ... }
Inline callbacks, sort comparators, JSX event handlers and functions passed straight to another call stay arrows.
Comment the steps inside a function, not the function. Split a body of more than a few lines into sections, one blank line apart. Open each section with a comment that says what the step does, and why when that is not obvious. A reader should be able to follow the function by reading only its section comments.
function applyDamage(battle: Battle, hit: Hit): void {
// Shields absorb the hit first, and only the rest reaches the hp.
const absorbed = Math.min(hit.target.shield, hit.amount);
hit.target.shield -= absorbed;
const rest = hit.amount - absorbed;
// A unit at 0 hp faints at once, before the next hit in the same turn.
hit.target.hp = Math.max(0, hit.target.hp - rest);
if (hit.target.hp === 0) {
faint(battle, hit.target);
}
// The log keeps the absorbed part, so the replay can draw the shield breaking.
battle.log.push({ kind: 'damage', target: hit.target.id, absorbed, rest });
}
Start every function name with a verb. A call is an action, so the name says what the call does: getKey, findFile, createUnit, applyDamage, isAlive, hasShield.
// Before
function unitName(unit: Unit): string { ... }
function damage(unit: Unit, amount: number): void { ... }
// After
function getUnitName(unit: Unit): string { ... }
function applyDamage(unit: Unit, amount: number): void { ... }
<noun>Of (keyOf, fileOf, ownerOf). Use getKey(unit) for a plain read, or a verb that says the work, such as findFile, readFile or createKey.UnitCard, not renderUnitCard. Classes and types stay nouns.Most repos of this user extend @lxsmnsyc/oxlint-config and format with oxfmt. That config enforces about 150 rules, such as braces on every if, prefer-const and explicit return types. This skill does not repeat them. After editing, run the repo's linter and formatter on the files you changed, not on the whole repo. Take the command from the lint script (often oxlint --type-aware) and pass the file paths, for example pnpm exec oxlint --type-aware src/a.ts src/b.ts. Fix what they report. The scoped-checks skill covers the other checks.
Search the lines your change added for callback Array methods, for example with git diff -U0 | grep -E '^\+.*\.(map|filter|forEach|reduce|some|every|find|findIndex|flatMap)\('. Turn each hit outside tests and the "What stays" list into a loop. Search the same lines for function \w+Of( and rename each hit. Read the names of the functions the change added, and rename any that does not start with a verb, unless it is a component.
What SKILL.md sets; muted values are Claude Code's defaults
17 skills in this plugin
/changesetsWrite the changeset for a change in a repo that releases with changesets (a `.changeset/` folder exists). The bump level follows one question, whether the thing existed before: patch for changed behavior, minor for something new, major only with the maintainer's approval. Use this skill whenever finishing a change, opening a pull request or reviewing one in such a repo, even when nobody asks for a changeset, and when the user asks about bump levels or changelog entries./docs-siteMethod for planning, writing and maintaining a documentation site for a library, CLI, framework, API or app. Splits the site by what the reader needs (learn, do a task, understand, look up) into getting started, guides, concepts and reference, plus examples, troubleshooting, migration and a glossary. Gives each page type a fixed template, including the feature page (what it is, why, how it works, usage, options, limits, related) and the API reference entry. Covers navigation, code examples that run, keeping docs in step with the code, versioned docs and pages agents can read. Includes page templates, a checker script for page structure, links, orphan pages and code fences, and a review checklist. Use this skill whenever writing, restructuring, auditing or reviewing documentation, a docs site, a docs page, a README that has grown into docs, API reference, a getting started page, a migration guide or the docs part of the website/ folder, even if the user does not say "docs site". Load plain-writing with it./fewer-questionsDecide whether a question to the user is worth asking before asking it. Skip a question whose options give the answer away, such as one real option next to declines or weaker copies. Skip a question where "no" leaves nothing to do, such as "Should I proceed?" or "Is the plan ready?", and do the work the user asked for. Ask only when each answer leads to different work, or before an action that is hard to undo, reaches outside the machine or costs money. Includes an optional hook that blocks yes-or-no and proceed questions in AskUserQuestion. Use this skill whenever about to ask the user a question, call AskUserQuestion, offer options, or end a turn with "should I...?", "do you want me to...?" or "let me know if...", even if the user never says "questions"./goal-debateWeigh a goal against what it costs before anyone plans or builds it. A proponent agent proposes the idea and expands it, an opponent agent attacks its weak points and costs, and the orchestrator judges each claim with evidence until the two settle on the structure with the best value for its cost. Costs are weighed on three axes, device capability (storage, RAM, compute), time to deliver and token spend, plus any axis the plan needs. Prior art (papers, public repos, the lab's past attempts) counts as evidence, small capped proofs settle feasibility claims, and research goals end with a hypothesis and success threshold fixed before any run. Unknowns that cannot be measured go to the user as questions. It also weighs an existing roadmap that grows faster than it ships, and proposes which nodes to drop, park or merge. Use this skill when the user wants to evaluate, challenge, debate or sanity-check a goal, idea, proposal, ADR or roadmap, wants to cut scope, asks whether something is worth building or researching, whether it has been done before, or whether it is feasible on their machine, in their time or within a token budget, or before parallel-roadmap plans a large or costly goal, even if they never say "debate"./issue-authorWrite and open GitHub issues that a maintainer can act on, such as bug reports, feature requests and diagnosis handoffs, in the user's repo or someone else's. Searches open and closed issues and pull requests for duplicates first, follows the repo's own issue templates and labels, reproduces a bug on the latest release and on every release line the repo still maintains, and lists which lines it affects. Opens no issue for a bug that shows only in unmaintained versions, and none for a security problem, which goes to a private report or the security-fix skill instead. Use this skill whenever the user asks to open, file, write, draft or report an issue or a bug, when root-cause returns a fix-large verdict, or when pr-author finds a bug too large for a fix PR, even if they do not say "issue"./landing-pageRules for landing pages, homepages and marketing sites of any product, such as a library, CLI, web app, mobile app, API or physical product. The page shows a demo of the product or its effect, with an animated or interactive hero visual chosen from designs the author reviews. It sells the benefit and the difference from competitors instead of describing features. It keeps text short and lets visuals carry the page. It picks the selling points the visitor cares about, uses playful animation or interaction that shows what the product does, and shows who uses it when that proof is strong enough. Includes steps for each kind of product, a word count script and a review checklist. Use this skill whenever designing, writing, building or reviewing a landing page, product homepage, marketing site, the website/ folder of a repo, or a hero section, even if the user does not say "landing page". Load ui-style with it. This skill overrides only the ui-style rule against idle and first-paint animation. Every other ui-style rule still applies.npx claudepluginhub lxsmnsyc/agent-skills --plugin agent-skillsOther plugins' skills for the same job