Write idiomatic TypeScript patterns for clean, maintainable code. Use when writing or refactoring TypeScript classes, functions, modules, or async logic.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# TypeScript Best Practices
## **Priority: P1 (HIGH)**
## Implementation Guidelines
- **Naming**: Use **`PascalCase`** for Classes/Types/Interfaces, **`camelCase`** for variables/functions, and **`UPPER_SNAKE`** for static constants.
- **Functions**: Use **`arrow functions`** for callbacks/logic; **`function declaration`** for top-level exports. Always type **`public API`** returns.
- **Modules**: Use **`Named exports`** ONLY to enable better refactoring/auto-imports.
- **Async**: Use **`async/await`** with **`Promise.all()`** for parallel execution. Implement **`try-catch`** for error handling; type **`catch(e) as unknown`** and narrow before use. Avoid **`.then().catch()`** chains.
- **Classes**: Explicitly use **`private`**, **`protected`**, and **`public`** modifiers. Favor **`composition`** over inheritance and **`dependency injection`** with **`constructor injection`** and interfaces over singletons for testability.
- **Type Safety**: Use **`never`** for exhaustiveness checks in switch-cases.
- **Optional**: Use **`optional chaining`** (`?.`) and **`nullish coalescing`** (`??`) over manual checks.
…
The line at the top of this page pins the label git:20260714.6bf9b5e, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
GET https://markdownregistry.com/api/v1/artifacts/art_sghd7llx6ahu3sem
GET https://markdownregistry.com/api/v1/resolve?ref=hoangnguyen0403/agent-skills-standard/typescript-best-practices
GET https://markdownregistry.com/api/v1/blob/ef35ad528a09395e0f439e0e2fc70e69f9b1da7732149e2d0e234be23d500b0a
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
hoangnguyen0403/agent-skills-standard · .agents/skills/caveman-compress/SKILL.md · Compress natural language memory files (CLAUDE.md, todos, preferences) into caveman format to save input tokens…
hoangnguyen0403/agent-skills-standard · .agents/skills/caveman-review/SKILL.md · Ultra-compressed code review comments. Cuts noise from PR feedback while preserving the actionable signal. Each comment…
hoangnguyen0403/agent-skills-standard · .agents/skills/caveman/SKILL.md · Ultra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical…
hoangnguyen0403/agent-skills-standard · .agents/skills/common/common-api-design/SKILL.md · Apply REST API conventions — HTTP semantics, status codes, versioning, pagination, and OpenAPI standards for any…
hoangnguyen0403/agent-skills-standard · .agents/skills/common/common-architecture-audit/SKILL.md · Audit structural debt, logic leakage, and monolithic components across Web, Mobile, and Backend codebases. Use when…
hoangnguyen0403/agent-skills-standard · .agents/skills/common/common-architecture-diagramming/SKILL.md · Draws architecture diagrams as editable draw.io files with a fixed house style, C4 levels, evidence-tagged shapes, and…
hoangnguyen0403/agent-skills-standard · .agents/skills/common/common-business-requirements/SKILL.md · Standardize BRD and BRD-lite discovery for business goals, stakeholder impact, current-to-future state, and measurable…
cursor/plugins · harness/pstack/claude-code/skills/typescript-best-practices/SKILL.md · TypeScript best practices. Use when reading or editing any .ts or .tsx file.
nightly-labs/openbot · marketplace/production-catalog/bundles/pstack/skills/typescript-best-practices/SKILL.md · TypeScript best practices. Use when reading or editing any .ts or .tsx file.
michael-denyer/pstack-claude · plugins/pstack/skills/typescript-best-practices/SKILL.md · TypeScript best practices. Use when reading or editing any .ts or .tsx file.
hoangnguyen0403/agent-skills-standard · .claude/skills/typescript/typescript-best-practices/SKILL.md · Write idiomatic TypeScript patterns for clean, maintainable code. Use when writing or refactoring TypeScript classes…
aiskillstore/marketplace · skills/0xbigboss/typescript-best-practices/SKILL.md · Use when reading or writing TypeScript or JavaScript files (.ts, .tsx, .js, tsconfig.json).