clean-code-ts

clean-code-ts is a skill for Claude Code from CassetteTapeCrackle/claude-starters. It costs 36 tokens per session (342 once invoked), scanned A, original, MIT.

A set of detailed rules for writing and reviewing TypeScript, a programming language that adds type checks to JavaScript.

In plain words
What is it for?
Use it when writing or reviewing TypeScript code, especially around type design, runtime validation, promises, module structure, and code smells.
Why use it?
It helps prevent unclear types, unsafe values, unhandled asynchronous work, and state combinations that should not be possible.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the claude-starters plugin — 9 skills, 1 command, 8 agents, 2 hooks shipped together

Good fit Use it when writing or reviewing TypeScript code, especially around type design, runtime validation, promises, module structure, and code smells.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cassettetapecrackle/claude-starters/clean-code-ts
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add CassetteTapeCrackle/claude-starters --skill clean-code-ts
Clone the repo
git clone --depth 1 https://github.com/CassetteTapeCrackle/claude-starters

Made for: Claude Code.

Or install claude-starters, the plugin that ships this one along with the rest of its 9 skills, 1 command, 8 agents, 2 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for clean-code-ts

README.md
[![agentmods](https://agentmods.dev/badge/skills/cassettetapecrackle/claude-starters/clean-code-ts/github.svg)](https://agentmods.dev/skills/cassettetapecrackle/claude-starters/clean-code-ts)
Your own site
<a href="https://agentmods.dev/skills/cassettetapecrackle/claude-starters/clean-code-ts"><img src="https://agentmods.dev/badge/skills/cassettetapecrackle/claude-starters/clean-code-ts/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for clean-code-ts

Your own site · 80×15
<a href="https://agentmods.dev/skills/cassettetapecrackle/claude-starters/clean-code-ts"><img src="https://agentmods.dev/badge/skills/cassettetapecrackle/claude-starters/clean-code-ts.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 342 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00036 $0.00342
Opus 5 $0.00018 $0.00171
Sonnet 5 $0.00007 $0.00068
Haiku 4.5 $0.00004 $0.00034

Measured 9d ago against content hash 90d7d9b8736f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

clean-code-ts scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/clean-code-ts/SKILL.md · 28 lines

What it actually says

Clean-code TypeScript (depth)

On top of the base rules (strict tsconfig, ESLint+Prettier, Vitest).

Types

  • No any. Use unknown at boundaries and narrow. Prefer type aliases + discriminated unions for state over booleans/optionals.
  • Model impossible states out of existence (a union, not many independent flags). Exhaustiveness-check unions with a never default in switch.
  • Derive types from runtime schemas (zod/TypeBox) at IO boundaries — one source of truth, not parallel interface + validator.

Correctness

  • strictNullChecks on; handle null/undefined explicitly, no ! non-null assertions outside tests.
  • await every promise or handle it; no floating promises. Promise.all for independent async, not sequential awaits.
  • Readonly by default (readonly, as const); immutable data flow.

Style

  • Named exports over default (grep + refactor friendliness). Small modules; pure functions; early returns.
  • Narrow function signatures — take exactly what's used, not the whole object.

Smells

  • any or as SomeType casts → narrow or fix the type at the source.
  • Booleans multiplying into impossible combinations → discriminated union.
  • A validator and an interface that can drift → derive the type from the schema.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 28 lines · 36 tokens per session scan A 90d7d9b8736f

Subscribe to this mod's changes

clean-code-ts is a skill published in the GitHub repository CassetteTapeCrackle/claude-starters (1 stars, last pushed 20d ago), licensed MIT. It adds 36 tokens to every session and 342 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

scan-reward-hacking

Scan TypeScript code for reward hacking patterns — shortcuts that make linters pass without actually fixing type safety. This skill has a comprehensive checklist of 8 forbidden patterns with severity tuning (libraries vs apps) that you cannot reliably check on your own. ALWAYS consult this skill when the user says…

coalesce-labs/catalyst · 158 tokens

react-frontend

React, TypeScript, and Next.js patterns for frontend development. Use when building React components, managing state, fetching data, optimizing performance, or working with Next.js App Router. Covers React 18-19, hooks, Server Components, and type-safe patterns.

iliaal/whetstone · 57 tokens

shared-tooling-eslint-prettier

ESLint 9/10 flat config with defineConfig(), Prettier v3.0+ shared config, eslint-config-prettier integration, typescript-eslint v8+ projectService.

agents-inc/skills · 46 tokens

spec-implement

Continue an approved Spec-backed workflow when the user says "implement", "go", "start", or "do it". After Codex Plan Mode, persist the next missing design.md or plan.json artifact and stop. When both artifacts exist, execute plan.json with TDD and report between batches.

martinffx/atelier · 63 tokens

typescript-coder

Implements TypeScript/JavaScript code following established architecture and coding guidelines. Use when implementing features designed by typescript-architect.

DmitriyYukhanov/claude-plugins · 30 tokens

typescript-testing

TypeScript testing patterns with Jest/Vitest including unit tests, integration tests, mocking strategies, and coverage. Use when writing TypeScript tests.

DmitriyYukhanov/claude-plugins · 31 tokens