Applies the user's personal code standards distilled from ~200 PR review comments. Covers ts-pattern exhaustive matching, strict zod/pydantic parsing, object params, story-first function layout, library usage over hand-rolled code, and explicit error handling. Activates before writing, editing, refactoring, or reviewing TypeScript or Python code.
Ships in no-smell. 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.
Read when SKILL.md points to them; scripts run unread.
Every rule here is something the user had to write in their own PR more than once. Each repeat costs them a review round, so treat these as requirements rather than preferences. The top three account for most of the comments: ts-pattern, strict typing, readable structure.
.exhaustive()When a union, enum, status, kind/type field or result tag gains a new
variant, the build must fail at every place that branches on it. switch,
if/else if chains on one field, and nested ternaries fail silently, so use:
import { match } from 'ts-pattern';
const badge = match(order.status)
.with('pending', 'processing', () => ({ tone: 'info', label: 'In progress' }))
.with('failed', () => ({ tone: 'danger', label: 'Failed' }))
.with('shipped', () => ({ tone: 'success', label: 'Shipped' }))
.exhaustive();
switch even with a never default. The user wants ts-pattern
specifically, for consistency..otherwise() only when the input is truly open-ended (an arbitrary string).
Leave a one-line comment saying why.{...} satisfies Record<Status, V>. Use cva
for class variants.if (!user) return) is not branching on kinds and is fine.match + assert_never in the fallthrough, not elif chains.Untyped data that leaks inward is what made the user write "strongly type it" and "safe_parse everywhere" again and again.
safeParse and handle the failure branch. In
Python, use pydantic model_validate / model_validate_json.any, don't use as casts to quiet the compiler, and don't use
JSON.parse(x) as T. unknown is fine only right before a parse..optional() to dodge an error.z.object strips unknown keys, z.strictObject rejects
them, and z.looseObject keeps them. Use loose only for third-party payloads..transform so callers receive the domain shape:const webhookSchema = z
.object({ customer_id: z.string(), amount_cents: z.number().int(), is_test: z.boolean() })
.transform((w) => ({ customerId: w.customer_id, amountCents: w.amount_cents, isTest: w.is_test }));
z.infer, Pick/Omit, and
Remeda (R.pick, R.omit, R.mapValues, R.groupBy) instead of
Object.entries, which loses types.startsWith, split('-')[1] or a regex on an ID means the data model is
wrong. Carry a typed field, or return it from the server. Fix the model;
don't patch the call site.const STATE_FIELDS = ['status', 'shippedAt', …]) to pick, omit or classify them means the schema is missing a
concept. Declare the category where the fields are defined: split the schema
into named groups (orderSpecFields, fulfilmentFields) composed with
spread, add a compile-time check that the groups are disjoint, and export the
group's schema. Consumers then use it (GroupSchema.safeParse(x) /
.keyof()), so a new field is classified when it is declared, not forgotten
in a far-off list.const orderSpecFields = { sku: z.string(), quantity: z.number() } as const
const fulfilmentFields = { status: FulfilmentStatus, shippedAt: z.iso.datetime().optional() } as const
export const FulfilmentSchema = z.object(fulfilmentFields)
export const OrderSchema = z.object({ ...orderSpecFields, ...fulfilmentFields })
// consumer: show this order with another warehouse's fulfilment
const fulfilment = FulfilmentSchema.safeParse(otherWarehouseOrder)
const shown = fulfilment.success
? { ...R.omit(order, FulfilmentSchema.keyof().options), ...fulfilment.data }
: order
The user reads code top-down and wants to stop as soon as they understand. "Super hard to read", "bloated" and "UGLY" all came from violating this.
reserveInventoryForOrder, not reserve;
confirmPaymentCapture, not confirm.export async function refundOrder({ orderId, reason }: RefundOrderInput) {
const order = await loadOrderOrFail({ orderId });
const refund = buildRefund({ order, reason });
await assertNotAlreadyRefunded({ orderId: order.id });
return submitRefund({ refund });
}
async function loadOrderOrFail({ orderId }: { orderId: OrderId }) { /* ... */ }
createLease(id, 3000, true) is unreadable at the call site. A function you
define with 2+ params takes { customerId, ttlMs, owner }. Callbacks whose
signature a library dictates (.map, .with, event handlers) are exempt.
Python: keyword-only (def f(*, customer_id: str, ttl_s: int)).
"Isn't there a popular lib for this?" and "don't we have something to reuse?" were asked repeatedly. Search the repo first, then use these:
| Need | Use |
|---|---|
| Branching | ts-pattern |
| Validation | zod / pydantic |
| Typed collection/object ops | remeda |
| Dates, durations | date-fns |
| Style variants | cva |
| UI | shadcn/ui components and composites |
| Forms | @tanstack/react-form |
| Hooks (intervals, etc.) | react-use, not ad-hoc useEffect |
| Python CLI | typer |
| Cleanup | await using / finally |
never-throw-typescript).Promise.all rejects on the first failure. Pick deliberately between
all-or-nothing and allSettled with per-item handling, and say which.When an app misbehaves (drops requests on shutdown, starts slowly, leaks, times out), fix the app. Infra knobs that hide the behaviour are a patch: the next service copies the bug, and dev/PDE still has it.
preStop sleeps, stretched terminationGracePeriodSeconds, shutdown or
drain timeouts in env vars, inflated probe delays or retry middlewares to
hide what the process does wrong.drainOnTermination used by every HTTP server).A PostToolUse hook runs scripts/hook.sh after every Edit/Write of a TS or
Python file (the no-smell plugin installs it; with a skill-only install, wire it
up as the README shows). It reports only smells the edit introduced (lines already in
HEAD are ignored), and the report comes back to you as feedback. When one
arrives, fix it right away, or mark a deliberate exception on that line with
// no-smell: <reason> (# no-smell: in Python). That comment is also how
you silence the branch scan below.
Run the branch-wide scan from the repo root (in a gitops repo too: it flags
YAML that patches app behaviour for review). It covers committed, staged,
unstaged and untracked changes against the merge-base. <skill dir> is this
skill's base directory (shown when the skill loads; it differs between a plugin
and a skills-folder install):
bash "<skill dir>/scripts/check.sh" # or: check.sh <base-ref> | check.sh -- <files>
== SMELL lines fail the scan; fix each one or justify it with no-smell:.
-- review lines (new classes, ids parsed with string methods) need a look,
because only you can tell whether this repo owns that format or pattern. Then
check what regex can't: the entry point reads as a story, names are specific,
nothing is hand-rolled that a library or repo helper already does, and every
Promise.all choice is deliberate.
If you change check.sh, run bash "<skill dir>/tests/run.sh".
scripts/check.sh (opens in a new tab)scripts/hook.sh (opens in a new tab)tests/fixtures/src/__tests__/mock.spec.ts (opens in a new tab)tests/fixtures/src/clean.ts (opens in a new tab)tests/fixtures/src/patch.yaml (opens in a new tab)tests/fixtures/src/smelly.py (opens in a new tab)tests/fixtures/src/smelly.ts (opens in a new tab)tests/run.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
code-standards, pr-review, code-quality, typescript, python, ts-pattern, zod, pydantic
Other plugins' skills for the same job
/no-smell:no-smellfrom no-smell
npx claudepluginhub iamshobe/dotfiles --plugin no-smell