hayatosc/dotfiles/typescript-best-practices
- community
Checking that the SKILL.md file is still in the repository.
Implement or review TypeScript code with safe narrowing, precise API types, and compiler checks. Includes guidance for type errors and strictness changes; skip styling-only work.
Install
npx vskill@latest install hayatosc/dotfiles/typescript-best-practicesSKILL.md
TypeScript Best Practices
Preserve precise types and runtime guarantees without silencing the checker. Follow the repository's module system, dependencies, and check scripts.
- Prefer local inference and explicit public contracts. Use
unknownand narrowing for untrusted data; avoidanyand assertions that hide a runtime mismatch. - Model related states with discriminated unions and handle variants exhaustively. Add branded types when confusing otherwise identical primitives is a concrete domain risk.
- Reuse existing runtime validation. A typing fix alone does not justify another validation dependency.
- Document non-obvious public constraints, errors, and usage according to repository conventions; do not duplicate self-explanatory signatures.
- Inspect compiler and lint configuration when the error or requested change depends on it. Keep strictness changes scoped rather than turning a local fix into a toolchain migration.
Default Workflow
- Identify the affected types, runtime inputs, and the project's typecheck command. Inspect the active
tsconfigwhen module behavior or compiler settings matter. - Implement with inference locally and explicit contracts at public boundaries. Prefer narrowing, discriminated unions, or
satisfiesto assertions;as constis appropriate for preserved literal values. - Use ESM for new code unless the project or runtime requires CommonJS. Document exported APIs' intent and non-obvious constraints without restating types.
- Run typecheck and affected behavior tests. Do not suppress errors, relax strictness, or skip tests to make the change pass. Distinguish unrelated existing failures from regressions.
References
- Narrowing, generics, brands, and assertion replacements: type-safety-patterns.md.
- Compiler or lint settings: config-baseline.md.
Use the project's typecheck and relevant behavior tests. Add compile-time tests when a public inference contract could regress without a runtime failure. Reuse passing results until the code changes; report pre-existing failures separately instead of weakening types to pass.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/typescript-best-practices/SKILL.md
Popularity
- Repository stars
- 1
- 7-day trend score
- 8
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/hayatosc/dotfiles/typescript-best-practices)