/ratchet-code:typescript-authoringfrom ratchet-code
Use whenever a task writes, reviews, or refactors TypeScript or JavaScript in Node.js, including a review of a diff - especially renames, async errors, loops that query or enqueue, bulk paths, and HTTP calls. Keeps code direct: no forwarding aliases, shims, or dynamic dispatch; errors handled where thrown; one batch call for per-item I/O; packages that respect layer and runtime boundaries.
Ships in ratchet-code. 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.
Read every applicable AGENTS.md first. Repository-local policy overrides these defaults.
These rules are for runtime code. A test file or a fixture, or a seed for a disposable
database, may loop over a single-item call, use top-level await, and call fetch directly. A
backfill against production data follows them.
The common thread: a reader, or a tool, should be able to follow a name to the one place it is defined and to every place it is used.
Do not export a placeholder type, an error class nothing throws, an empty file, or code no entry point reaches. Add the export in the change that first uses it.
Do not hide a call behind a computed property key, a runtime registry, or a lambda that only forwards its arguments.
// Avoid: the callee is data.
handlers[`on${kind}`](event)
// Prefer: every call site names its callee.
switch (kind) {
case 'Created':
return onCreated(event)
case 'Deleted':
return onDeleted(event)
}
A direct call can be found, renamed, and type-checked. A dispatched one is found only by running the code.
Before removing or renaming a value of a closed set (a union, enum, discriminator, route slug),
list every place that enumerates it: the type and the database enum or CHECK, maps and
formatters from value to label, slug, or URL, tests and mock factories, seeds and imports, and
docs. Change them in one commit, then search the repository for the old value, and for a slug the
file and directory names too. Decide each remaining hit: intended, unrelated, or still to fix.
For a rename, search both names.
Inside a try whose catch should handle the failure, write return await promise. A bare
return promise leaves the try before the promise settles, so the rejection skips the catch
and the finally runs early.
fetch beside it; that request silently skips all of those.await to entrypoints and standalone scripts. A library module initializes
synchronously, or lazily inside a function. A top-level await delays every importer, and
some bundlers do not wait for it through export * from, so an importer reads a binding
before it is set.A function that does I/O per item (a database read or write, an enqueue, an outbound API call)
takes a list and makes one round trip for the whole batch. The single-item form is a thin
wrapper that calls the batch function with a one-element list, so there is one code path.
Loops, .map callbacks, and Promise.all fan-outs call the batch function, never the
single-item form N times.
// One round trip for N jobs; the single form only wraps it.
export const enqueueReceipts = (orderIds: string[]) =>
queue.addBulk(orderIds.map((id) => ({ name: 'receipt', data: { id }, opts: { jobId: id } })))
export const enqueueReceipt = (orderId: string) => enqueueReceipts([orderId])
The batch must give a one-item list the same semantics as the single call. For the SQL shape
and its caveats, see
round trips (ratchet-backend:postgres-node-performance-tuning).
Delete Redis or Valkey keys with UNLINK, not DEL. UNLINK frees the memory in a background
thread, so a large value does not block the server. Pass a set of keys to one UNLINK call
instead of one round trip per key, as in batch first above.
await redis.unlink(keys) // one round trip for every key
Keep a multi-line script in another language (Lua, SQL, shell) in its own file and load it. A script inside a string literal gets no syntax highlighting, no linting, and no test of its own.
For what a code comment should and should not say, use documentation.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
12 skills in this plugin
/interface-feedbackUse when writing or reviewing interface code that shows an action button, a toast or error message, or a form's submit, including a review of such a diff. Show only the actions the server allows this viewer and why one is blocked, render errors by code with their details, and check a submit's preconditions so it never succeeds partly in silence./lint-rule-authoringUse when writing or reviewing the code of a lint rule, analyzer, or codemod that walks a syntax tree, such as an ESLint or oxlint rule, a Clippy lint, or a custom AST check, including a request to "write a rule that bans X". Covers finding the rule's subject by what a name is bound to, reporting a name it cannot trace, and the fixtures that prove both./native-app-architectureUse when writing or reviewing native app code, deciding where logic lives, adding a web view, setting up native project files, or planning native CI. Structure a native app (Swift, Kotlin, .NET MAUI) around a portable core library with thin platform views./npm-publishingUse when publishing a new package, moving a package to trusted publishing, writing or reviewing a release workflow that bumps a version and publishes it, or fixing a CI publish that fails with E404 or ENEEDAUTH. Prepare a first npm publish and trusted publishing (OIDC) for a human to run, and set up the GitHub Actions workflow that bumps, tags, and publishes./package-json-checklistUse when writing or reviewing a package.json, adding, upgrading, overriding, patching, or moving a dependency, setting a package's entrypoints or exports, changing workspace metadata such as pnpm-workspace.yaml, or resolving a lockfile change. Checks package metadata, dependencies, entrypoints, and lockfiles./playwright-authoringUse when writing, reviewing, or de-flaking Playwright or other browser end-to-end tests, or when adding test ids to interface code. Decide what a browser test should cover and how to locate elements with roles, labels, and test ids.npx claudepluginhub jongleberry/ratchet-stack --plugin ratchet-code