agentleFS
jaysonventurajaysonventura/claude-dev-team/skills/clean-code-typescript/SKILL.md

clean-code-typescript

Skill19 starsChanged 6 months agoMITView on GitHub

Use when writing or reviewing TypeScript/JavaScript. Conventions for strict types, naming, immutability, and control flow that keep TS code safe and readable.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    No any: Use precise types, unknown at boundaries (then narrow), generics for reuse.

    line 9
  2. Very specific:

    Prefer immutability: const, readonly, ReadonlyArray.

    line 17
  3. Very specific:

    No magic values — name constants.

    line 19

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Clean code — TypeScript

Types

  • No any. Use precise types, unknown at boundaries (then narrow), generics for reuse. Enable strict (incl. noUncheckedIndexedAccess, exactOptionalPropertyTypes where feasible).
  • Derive, don't duplicate: ReturnType, Parameters, Pick/Omit, as const, template literal types. Single source of truth for shapes (infer from schema/zod where possible).
  • Make illegal states unrepresentable: discriminated unions over boolean flags; narrow with exhaustive switch + a never default.

Values & flow

  • Prefer immutability: const, readonly, ReadonlyArray; return new objects over mutation.
  • Early returns / guard clauses over deep nesting. Handle errors and edge cases first.
  • No magic values — name constants. Avoid == (use ===); avoid truthiness traps with 0/"".
  • Handle null/undefined explicitly (?., ??); don't !-assert away real possibilities.

Naming & structure

  • Intention-revealing names; verbs for functions, nouns for data; no abbreviations that aren't standard.
  • One responsibility per function/module; keep files focused (see code-splitting).
  • Async: always handle rejections; don't mix callbacks and promises; avoid floating promises.

Review checklist

any/unsafe casts? unhandled null? non-exhaustive union? mutation that should be pure? magic number? name that lies? Fix before approving.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.