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.
In this repository14 other files it gives its agents.
- automation-firstSkill
- code-splittingSkill
- final-responseSkill
- gauge-improvementsSkill
- karpathy-guidelinesSkill
- mobile-qaSkill
- orchestrationSkill
- qa-sharedSkill
- requirement-intelligenceSkill
- root-cause-analysisSkill
- technical-writingSkill
- ui-ux-pro-maxSkill
- web-design-guidelinesSkill
- web-qaSkill
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
- Very specific: line 9
No
any: Use precise types, unknown at boundaries (then narrow), generics for reuse. - Very specific: line 17
Prefer immutability: const, readonly, ReadonlyArray.
- Very specific: line 19
No magic values — name constants.
≈ “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.
Files
Clean code — TypeScript
Types
- No
any. Use precise types,unknownat boundaries (then narrow), generics for reuse. Enablestrict(incl.noUncheckedIndexedAccess,exactOptionalPropertyTypeswhere 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+ aneverdefault.
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 with0/"". - Handle
null/undefinedexplicitly (?.,??); 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.
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
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.

