typescript-code-and-test-standards
TypeScript code and test standards
Covers .ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, and .cts. It carries the discipline no tool checks: what a comment is allowed to say, what a documentation block owes a reader, when a test is required, and when a mock is justified.
What this skill decides and what it does not
The host project's own tooling owns everything it can check, and this skill never overrides it:
- The formatter owns indentation, quotes, semicolons, line width, trailing commas, and import order.
- The linter owns unused variables, equality operators, brace enforcement, and rule-level style.
- The compiler owns types and strictness.
This skill owns comments, documentation blocks, readability judgement, structure, the test mandate, and mocking. Structure belongs here because no tool checks it: a formatter will lay out a two-thousand-line file and a linter will pass a twenty-member interface, so file length, interface size, directory shape, and repeated logic reach a reader only if someone counts them. It reports and follows configuration. It never creates or edits a configuration file to make a project match itself, which is not the same as setting a value the change itself requires at the level the tool reads it.
Step 1: Detect the project
Read the project before writing anything. Never assume a convention this skill happens to prefer.