Modern TypeScript development patterns for type safety, runtime validation, and optimal configuration.
Works with
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versiontypescript-coreExecute the skills CLI command in your project's root directory to begin installation:
Fetches typescript-core from bobmatnyc/claude-mpm-skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate typescript-core. Access via /typescript-core in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
29
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
29
stars
Modern TypeScript development patterns for type safety, runtime validation, and optimal configuration.
New Project: Use 2025 tsconfig → Enable strict + noUncheckedIndexedAccess → Choose Zod for validation
Existing Project: Enable strict: false initially → Fix any with unknown → Add noUncheckedIndexedAccess
API Development: Zod schemas at boundaries → z.infer<typeof Schema> for types → satisfies for routes
Library Development: Enable declaration: true → Use const type parameters → See advanced-patterns-2025.md
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"verbatimModuleSyntax": true,
"isolatedModules": true,
"skipLibCheck": true,
"declaration": true,
"declarationMap": true
}
}
| Option | Purpose | When to Enable |
|---|---|---|
noUncheckedIndexedAccess |
Forces null checks on array/object access | Always for safety |
exactOptionalPropertyTypes |
Distinguishes undefined from missing |
APIs with optional fields |
verbatimModuleSyntax |
Enforces explicit type-only imports | ESM projects |
erasableSyntaxOnly |
Node.js 22+ native TS support | Type stripping environments |
See references/configuration.md for repo-specific tsconfig patterns (CommonJS CLI, NodeNext strict, Next.js bundler).
Preserve literal types through generic functions:
function createConfig<const T extends Record<string, unknown>>(config: T): T {
return config;
}
const config = createConfig({
apiUrl: "https://api.example.com",
timeout: 5000
});
// Type: { readonly apiUrl: "https://api.example.com"; readonly timeout: 5000 }
Validate against a type while preserving literal inference:
type Route = { path: string; children?: Routes };
type Routes = Record<string, Route>;
const routes = {
AUTH: { path: "/auth" },
HOME: { path: "/" }
} satisfies Routes;
routes.AUTH.path; // Type: "/auth" (literal preserved)
routes.NONEXISTENT; // ❌ Type error
Type-safe string manipulation and route extraction:
type ExtractParams<T extends string> =
T extends `${string}:${infer Param}/${infer Rest}`
? Param | ExtractParams<Rest>
: T extends `${string}:${infer Param}`
? Param
: never;
type Params = ExtractParams<"/users/:id/posts/:postId">; // "id" | "postId"
type Result<T, E = Error> =
| { success: true; data: T }
| { success: false; error: E };
function handleResult<T>(result: Result<T>): T {
if (result.success) return result.data;
throw result.error;
}
// Exhaustiveness checking
type Action =
| { type: 'create'; payload: string }
| { type: 'delete'; id: number };
function handle(action: Action) {
switch (action.type) {
case 'create': return action.payload;
case 'delete': return action.id;
default: {
const _exhaustive: never = action;
throw new Error(`Unhandled: ${_exhaustive}`);
}
}
}
TypeScript types disappear at runtime. Use validation libraries for external data (APIs, forms, config files).
| Library | Bundle Size | Speed | Best For |
|---|---|---|---|
| Zod | ~13.5kB | Baseline | Full-stack apps, tRPC integration |
| TypeBox | ~8kB | ~10x faster | OpenAPI, performance-critical |
| Valibot | ~1.4kB | ~2x faster | Edge functions, minimal bundles |
import { z } from "zod";
const UserSchema = z.object({
id: z.string().uuid(),
email: z.string().email(),
role: z.enum(["admin", "user", "guest"]),
});
type User = z.infer<typeof UserSchema>;
// Validate external data
function parseUser(input: unknown): User {
return UserSchema.parse(input);
}
→ See runtime-validation.md for complete Zod, TypeBox, and Valibot patterns
Need to choose between type vs interface?
interfacetypeinterface (default)Need generics or union types?
Dealing with unknown data?
unknown (type-safe)any (temporarily)Need runtime validation?
Prerequisites
Time Estimate
15-45 minutes depending on use case complexity
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
jwynia/agent-skills
omer-metin/skills-for-antigravity
dotneet/claude-code-marketplace
mindrally/skills
github/awesome-copilot
kostja94/marketing-skills
typescript-core fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
typescript-core has been reliable in day-to-day use. Documentation quality is above average for community skills.
Solid pick for teams standardizing on skills: typescript-core is focused, and the summary matches what you get after install.
Registry listing for typescript-core matched our evaluation — installs cleanly and behaves as described in the markdown.
Solid pick for teams standardizing on skills: typescript-core is focused, and the summary matches what you get after install.
We added typescript-core from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
typescript-core fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
We added typescript-core from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
typescript-core fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
typescript-core fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
showing 1-10 of 53