typescript-fundamentals
Use when designing or reviewing TypeScript code structure, type safety, patterns, JSDoc, naming conventions, formatting, and module organization.
Skill by prachwal-archive
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/prachwal-archive-typescript-fundamentals
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: frontend, backend
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-fundamentals
What's inside
- Skill name
typescript-fundamentals- Description
- Use when designing or reviewing TypeScript code structure, type safety, patterns, JSDoc, naming conventions, formatting, and module organization. Applies to both frontend and backend TypeScript projects.
- License
- MIT
- Instructions
- 241 lines in SKILL.md · view on GitHub
Files (4)
- SKILL.md
- jsdoc.md · references/
- patterns.md · references/
- types.md · references/
SKILL.md (first lines)
# TypeScript Fundamentals Skill
Use this skill when writing, reviewing, or refactoring TypeScript code with a focus on correctness, readability, and maintainability.
## Core principles
1. Prefer explicit types at module boundaries; let the compiler infer inside function bodies.
2. Model the domain with types before writing logic.
3. Avoid `any`. Use `unknown` for truly unknown values and narrow at the boundary.
4. Keep types small and composable. Prefer intersection and union over large monolithic interfaces.
5. Write code that is easy to delete — avoid deep coupling through concrete classes, global state, or shared mutable singletons.
6. Fail fast: validate untrusted input at system entry points and return typed errors instead of throwing broadly.
## tsconfig baseline
```json
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"noImplicitOverride": true,
"verbatimModuleSyntax": true,
"skipLibCheck": false
}
}
```
- Enable `strict` always. Enable `noUncheckedIndexedAccess` and `exactOptionalPropertyTypes` for new projects.
- Use `verbatimModuleSyntax` to make import/export intent explicit and avoid commonjs interop surprises.
- Set `skipLibCheck: false` for strict projects; relax only when third-party type errors block builds.
## Type design
```ts
// Prefer discriminated unions for state machines
type RequestState<T> =
| { status: "idle" }
| { status: "loading" }
| { status: "success"; data: T }
| { status: "error"; error: string };
// Use branded types for IDs that must not be mixed
type UserId = string & { readonly _brand: "UserId" };
type ProductId = string & { readonly _brand: "ProductId" };
// Narrow exhaustively
function describe(state: RequestState<Product>): string {
switch (state.status) {
case "idle": return "idle";
case "loading": return "loading";
case "success": return state.data.name;
case "error": return state.error;
}
}
```
## Naming conventions
| Context | Convention | Example |
|---|---|---|
| Variables, functions | `camelCase` | `getUserById`, `pageLimit` |
| Types, interfaces, classes | `PascalCase` | `ProductInput`, `UserService` |
| Enums | `PascalCase` members | `Status.Active` |
| Constants (module-level) | `SCREAMING_SNAKE` for primitives | `MAX_PAGE_SIZE = 100` |
| Files | `kebab-case` | `user-service.ts`, `api-products.ts` |
| Private class members | `_prefix` only when disambiguation is needed; prefer `#private` | `#cache` |
| Boolean variables | `is`, `has`, `can`, `should` prefix | `isActive`, `hasPermission` |
- Do not abbreviate unless the abbreviation is domain-standard (`id`, `url`, `db`, `req`, `res`).
- Name functions with verbs: `fetchUser`, `createOrder`, `validateInput`.
- Name types with nouns: `User`, `OrderSummary`, `ValidationResult`.
## Patterns
### Result type instead of throwing
```ts
type Result<T, E = string> =
| { ok: true; value: T }
| { ok: false; error: E };
function parsePositiveInt(raw: string): Result<number> {
const n = parseInt(raw, 10);
if (isNaN(n) || n < 1) return { ok: false, error: `"${raw}" is not a positive integer` };
return { ok: true, value: n };
}
```
### Validation with Zod
```ts
import { z } from "zod";
const ProductInput = z.object({
name: z.string().min(1).max(200),
price: z.number().nonnegative(),
tags: z.array(z.string()).max(10).default([]),
});
type ProductInput = z.infer<typeof ProductInput>;
// At boundary:
const parsed = ProductInput.safeParse(await req.json());
if (!parsed.success) return Response.json({ error: "Validation failed" }, { status: 422 });
```
### Dependency injection without a framework
```ts
// Define ports as interfaces; inject at callsite
interface Logger {
info(message: string, context?: Record<string, unknown>): void;
error(message: string, error?: unknown): void;
}From prachwal-archive/web-ui-skills, MIT.
More from prachwal-archive/web-ui-skills
- 0.502score
a11y-review
prachwal-archive
Use when reviewing web interfaces for accessibility, including WCAG 2.2 mapping, ARIA misuse, keyboard access, focus management, responsive/mobile behavior…
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
docs-instructions
prachwal-archive
Use when maintaining repository Markdown, Copilot instructions, Codex AGENTS.md, repo skills, prompts, or LLM evaluation tasks.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
preact-a11y
prachwal-archive
Use when designing, implementing, testing, or reviewing accessibility in Preact apps — semantic HTML, ARIA, keyboard flow, focus management, forms, contrast…
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
react-a11y
prachwal-archive
Use when designing, implementing, testing, or reviewing accessibility in React apps — semantic HTML, ARIA, keyboard flow, focus management, forms, contrast…
SkillCFreshness: C★ 1Claude Code +9 - 0.494score
react-ui
prachwal-archive
Guidance for building, redesigning, or reviewing React TSX pages/components, hooks, state management, styling, routing, accessibility, and Testing Library…
SkillCFreshness: C★ 1Claude Code +9 - 0.491score
project-tooling
prachwal-archive
Tooling guidance for Vite, Vitest, TypeScript, ESLint/Biome, package scripts, path aliases, and build/test tooling.
SkillCFreshness: C★ 1Claude Code +9 - 0.437score
netlify-serverless
prachwal-archive
Use when choosing and operating Netlify's serverless execution primitives.
SkillDFreshness: D★ 1Claude Code +9 - 0.437score
netlify-typescript-api
prachwal-archive
Use when designing or implementing TypeScript backend APIs on Netlify, including handler structure, validation, typed contracts, error envelopes, and testable…
SkillDFreshness: D★ 1Claude Code +9 - 0.437score
preact-ui
prachwal-archive
Use when designing, refactoring, or reviewing Preact pages and components, including component structure, MVVM architecture, signals, hooks, forms, routing…
SkillDFreshness: D★ 1Claude Code +9 - 0.437score
storybook-ui
prachwal-archive
Use when building, documenting, and testing UI components with Storybook.
SkillDFreshness: D★ 1Claude Code +9 - 0.437score
eslint-config
prachwal-archive
Use when setting up, extending, or fixing ESLint configuration for TypeScript projects, including flat config, Preact/React, Node.js, Netlify Functions, and…
SkillDFreshness: D★ 1Claude Code +9 - 0.437score
mongodb-netlify
prachwal-archive
Use when building Netlify Functions or full-stack apps that use MongoDB Atlas or MongoDB-compatible deployments.
SkillDFreshness: D★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Apr 9, 2026 (6 months ago)
- Last release
- Apr 23, 2026 (6 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from prachwal-archive
- 0.502score
a11y-review
prachwal-archive
Use when reviewing web interfaces for accessibility, including WCAG 2.2 mapping, ARIA misuse, keyboard access, focus management, responsive/mobile behavior…
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
react-a11y
prachwal-archive
Use when designing, implementing, testing, or reviewing accessibility in React apps — semantic HTML, ARIA, keyboard flow, focus management, forms, contrast…
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
docs-instructions
prachwal-archive
Use when maintaining repository Markdown, Copilot instructions, Codex AGENTS.md, repo skills, prompts, or LLM evaluation tasks.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
preact-a11y
prachwal-archive
Use when designing, implementing, testing, or reviewing accessibility in Preact apps — semantic HTML, ARIA, keyboard flow, focus management, forms, contrast…
SkillCFreshness: C★ 1Claude Code +9 - 0.494score
react-ui
prachwal-archive
Guidance for building, redesigning, or reviewing React TSX pages/components, hooks, state management, styling, routing, accessibility, and Testing Library…
SkillCFreshness: C★ 1Claude Code +9 - 0.491score
project-tooling
prachwal-archive
Tooling guidance for Vite, Vitest, TypeScript, ESLint/Biome, package scripts, path aliases, and build/test tooling.
SkillCFreshness: C★ 1Claude Code +9
Cite this page
typescript-fundamentals skill. Agent Mart. https://agentmart.dev/skills/prachwal-archive-typescript-fundamentals (last updated 2026-10-24)