hayatosc/dotfiles/typescript-best-practices

Trust tier 3
  • community
Source check pending

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-practices

SKILL.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 unknown and narrowing for untrusted data; avoid any and 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

  1. Identify the affected types, runtime inputs, and the project's typecheck command. Inspect the active tsconfig when module behavior or compiler settings matter.
  2. Implement with inference locally and explicit contracts at public boundaries. Prefer narrowing, discriminated unions, or satisfies to assertions; as const is appropriate for preserved literal values.
  3. Use ESM for new code unless the project or runtime requires CommonJS. Document exported APIs' intent and non-obvious constraints without restating types.
  4. 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

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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/hayatosc/dotfiles/typescript-best-practices/badge)](https://verified-skill.com/skills/hayatosc/dotfiles/typescript-best-practices)

Something wrong with this skill or its page? Tell us.