typescript-best-practices
Use when reading or editing any .ts or .tsx file.
Skill by AmitRockBear
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/amitrockbear-typescript-best-practices
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/typescript-best-practices
What's inside
- Skill name
typescript-best-practices- Description
- Use when reading or editing any .ts or .tsx file.
- License
- MIT
- Instructions
- 25 lines in SKILL.md · view on GitHub
Files (4)
- LICENSE
- SKILL.md
- SOURCE.md
- patterns.md · references/
SKILL.md (first lines)
# TypeScript best practices Read [type-system-discipline](../type-system-discipline/SKILL.md) for type-design principles; apply the TypeScript rules below to the code being inspected or changed. | Rule | Summary | |------|---------| | Discriminated unions | Model variants with a `kind` literal discriminant so impossible states can't be represented. No optional-field bags. | | Branded types | Brand primitives when accidental interchange is a concrete risk. Reuse the repository’s convention and validate at creation. | | Constructive modeling | Use `[T, ...T[]]` for non-empty sequences and `[T, T][]` for pairs when required by the operations. | | Simplest total type | Keep `T[]` while every operation on it stays total. Strengthen to `NonEmpty<T>` only where the loose type forces `!`, a cast, or a "should never happen" throw. | | `unknown` over `any` | External data is `unknown`. `any` disables type checking everywhere it touches. | | Assertions | Prefer narrowing and schema parsing; keep necessary assertions local to a proven invariant. | | Narrowing hierarchy | Discriminant switch > `in` operator > `typeof`/`instanceof` > user-defined type guard > `as`. | | Type guards | Must verify the claim. A lying guard is worse than `as` because the bug hides behind a name that says it's safe. Name them `isX` or `hasX`. | | Exhaustiveness | Inline `const _exhaustive: never = x;` in default arms so the compiler errors when a new variant is added. | | `satisfies` over `as` | Checks compatibility while retaining the expression’s inferred type. | | Boundary validation | Parse where data crosses in, into a named domain type. `Record<string, unknown>` (however spelled) stops at that parse. Trust types inside. | | Schema-derived types | Reach for `Pick`/`Omit`/`Parameters`/`ReturnType`/`Awaited`/`typeof` before declaring a new interface. | | Object args | Prefer object arguments when names prevent ambiguous call sites; follow existing APIs. | | Real tests | For implementation changes, use focused checks for changed behavior and the repository’s test conventions. | | Structured telemetry | Prefer structured logger diagnostics with enough context to debug from an id. No `console.log` in shipped code. | Read [patterns](references/patterns.md) when a rule needs a concrete example; adapt it to the repository’s types and conventions.
From AmitRockBear/skills, MIT.
More from AmitRockBear/skills
- 0.569score
use-codex
AmitRockBear
Use when the user asks to use Codex, GPT, Sol, Luna or Astra.
SkillAFreshness: AClaude Code +9 - 0.565score
verify-change
AmitRockBear
Use when verifying an implemented change or PR before handoff.
SkillAFreshness: AClaude Code +9 - 0.565score
use-cursor
AmitRockBear
Use when the user asks to run a model fable-5-1 or opus-5-5 through Cursor, Grok, including follow-ups to an existing Cursor task.
SkillAFreshness: AClaude Code +9 - 0.564score
use-claude
AmitRockBear
Use when the user asks Claude, Opus or Fable for a task, including follow-ups to an existing Claude task.
SkillAFreshness: AClaude Code +9 - 0.564score
write-skill
AmitRockBear
Use when creating, modifying or reviewing skills based on recurring corrections.
SkillAFreshness: AClaude Code +9 - 0.558score
pr-spec-review
AmitRockBear
Use when the user asks you to review the implementation of a task.
SkillAFreshness: AClaude Code +9 - 0.558score
pr-clean-code-review
AmitRockBear
Use when the user asks you to review the clean code or simplify the implementation of a PR.
SkillAFreshness: AClaude Code +9 - 0.558score
pr-walkthrough
AmitRockBear
Use when the user asks you to explain or give a walkthrough or help understand a pr.
SkillAFreshness: AClaude Code +9 - 0.555score
review-loop
AmitRockBear
Use when the user asks you to do a review loop for a PR.
SkillAFreshness: AClaude Code +9 - 0.554score
principle-boundary-discipline
AmitRockBear
Use when wiring validation, error handling or framework adapters.
SkillAFreshness: AClaude Code +9 - 0.554score
principle-type-system-discipline
AmitRockBear
Use when designing types, reviewing function signatures, or writing statically typed code.
SkillAFreshness: AClaude Code +9 - 0.543score
explainer-video
AmitRockBear
Use when the user explicitly asks to create an animated teaching or explainer video about a subject or a document.
SkillAFreshness: AClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Sep 26, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/AmitRockBear/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from AmitRockBear
- 0.569score
use-codex
AmitRockBear
Use when the user asks to use Codex, GPT, Sol, Luna or Astra.
SkillAFreshness: AClaude Code +9 - 0.565score
use-cursor
AmitRockBear
Use when the user asks to run a model fable-5-1 or opus-5-5 through Cursor, Grok, including follow-ups to an existing Cursor task.
SkillAFreshness: AClaude Code +9 - 0.565score
html-communication
AmitRockBear
Use for plans, specs, write-ups, findings, summaries, reports or comparisons presented as readable HTML; use for UI mocks when the user explicitly asks to…
SkillAFreshness: AClaude Code +9 - 0.565score
verify-change
AmitRockBear
Use when verifying an implemented change or PR before handoff.
SkillAFreshness: AClaude Code +9 - 0.564score
use-claude
AmitRockBear
Use when the user asks Claude, Opus or Fable for a task, including follow-ups to an existing Claude task.
SkillAFreshness: AClaude Code +9 - 0.564score
write-skill
AmitRockBear
Use when creating, modifying or reviewing skills based on recurring corrections.
SkillAFreshness: AClaude Code +9
Cite this page
typescript-best-practices skill. Agent Mart. https://agentmart.dev/skills/amitrockbear-typescript-best-practices (last updated 2026-10-24)