typescript-core▌
bobmatnyc/claude-mpm-skills · updated Apr 8, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
Modern TypeScript development patterns for type safety, runtime validation, and optimal configuration.
TypeScript Core Patterns
Modern TypeScript development patterns for type safety, runtime validation, and optimal configuration.
Quick Start
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
Quick Reference
tsconfig.json 2025 Baseline
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"verbatimModuleSyntax": true,
"isolatedModules": true,
"skipLibCheck": true,
"declaration": true,
"declarationMap": true
}
}
Key Compiler Options
| 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 |
Local Baselines
See references/configuration.md for repo-specific tsconfig patterns (CommonJS CLI, NodeNext strict, Next.js bundler).
Core Type Patterns
Const Type Parameters
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 }
Satisfies Operator
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
Template Literal Types
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"
Discriminated Unions with Exhaustiveness
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}`);
}
}
}
Runtime Validation
TypeScript types disappear at runtime. Use validation libraries for external data (APIs, forms, config files).
Quick Comparison
| 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 |
Basic Pattern (Zod)
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
Decision Support
Quick Decision Guide
Need to choose between type vs interface?
- Public API / library types →
interface - Union types / mapped types →
type - Simple object shapes →
interface(default)
Need generics or union types?
- Output type depends on input type → Generics
- Fixed set of known types → Union types
- Building reusable data structures → Generics
Dealing with unknown data?
- External data (API, user input) →
unknown(type-safe) - Rapid prototyping / migration →
any(temporarily)
Need runtime validation?
- Full-stack TypeScript with tRPC → Zod
- OpenAPI / high performance → TypeBox
- Edge functions / minimal bundle → Valibot
How to use typescript-core on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add typescript-core
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches typescript-core from GitHub repository bobmatnyc/claude-mpm-skills and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate typescript-core. Access the skill through slash commands (e.g., /typescript-core) or your agent's skill management interface.
Security & Verification Notice
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 development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
Task Automation & Efficiency
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Knowledge Enhancement
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Quality Improvement
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client with skill support
- ›Clear understanding of task or problem to solve
- ›Willingness to iterate and refine outputs
Time Estimate
15-45 minutes depending on use case complexity
Installation Steps
- 1.Install skill using provided installation command
- 2.Test with simple use case relevant to your work
- 3.Evaluate output quality and relevance
- 4.Iterate on prompts to improve results
- 5.Integrate into regular workflow if valuable
Common Pitfalls
- ⚠Expecting perfect results without iteration
- ⚠Not providing enough context in prompts
- ⚠Using skill for tasks outside its intended scope
- ⚠Accepting outputs without review and validation
Best Practices▌
✓ Do
- +Start with clear, specific prompts
- +Provide relevant context and constraints
- +Review and refine all outputs before using
- +Iterate to improve output quality
- +Document successful prompt patterns
✗ Don't
- −Don't use without understanding skill limitations
- −Don't skip validation of outputs
- −Don't share sensitive information in prompts
- −Don't expect skill to replace human judgment
💡 Pro Tips
- ★Be specific about desired format and style
- ★Ask for multiple options to choose from
- ★Request explanations to understand reasoning
- ★Combine AI efficiency with human expertise
When to Use This▌
✓ 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.
Learning Path▌
- 1Familiarize yourself with skill capabilities and limitations
- 2Start with low-risk, non-critical tasks
- 3Progress to more complex and valuable use cases
- 4Build expertise through regular use and experimentation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.4★★★★★53 reviews- ★★★★★Emma Singh· Dec 28, 2024
typescript-core fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Benjamin Verma· Dec 20, 2024
typescript-core has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Xiao White· Dec 16, 2024
Solid pick for teams standardizing on skills: typescript-core is focused, and the summary matches what you get after install.
- ★★★★★Noor Martinez· Dec 16, 2024
Registry listing for typescript-core matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Chaitanya Patil· Dec 4, 2024
Solid pick for teams standardizing on skills: typescript-core is focused, and the summary matches what you get after install.
- ★★★★★Piyush G· Nov 23, 2024
We added typescript-core from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Arya Torres· Nov 11, 2024
typescript-core fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Xiao Menon· Nov 7, 2024
We added typescript-core from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Xiao Iyer· Oct 26, 2024
typescript-core fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Shikha Mishra· Oct 14, 2024
typescript-core fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
showing 1-10 of 53