
Typescript Best Practices
This is a comprehensive reference for writing TypeScript the right way. It pushes type safety over convenience (unknown instead of any, explicit return types, readonly by default), includes a Result type pattern for error handling, and comes with Deno scripts to analyze code quality and generate types from JSON. The quick reference table is genuinely useful when you're in the middle of code and need to remember whether to use a type guard or an assertion. It won't teach you TypeScript from scratch, but if you're already writing it and want to stop cutting corners, this codifies the discipline.
- skills.sh installs
- 616
- GitHub stars
- 182
- last updated
- Aug 21, 2026
Install
$ npx -y skills add jwynia/agent-skills --skill typescript-best-practices --agent claude-codeInstalls into .claude/skills of the current project.
Files
TypeScript Best Practices
Guide AI agents in writing high-quality TypeScript code. This skill provides coding standards, architecture patterns, and tools for analysis and scaffolding.
When to Use This Skill
Use this skill when:
- Generating new TypeScript code
- Reviewing TypeScript files for quality issues
- Creating new modules, services, or components
- Refactoring JavaScript to TypeScript
- Answering questions about TypeScript patterns or types
- Designing APIs or interfaces
Do NOT use this skill when:
- Working with pure JavaScript (no TypeScript)
- Debugging runtime errors (use debugging tools)
- Framework-specific patterns (React, Vue, etc. - use framework skills)
Core Principles
1. Type Safety First
Maximize compile-time error detection:
// Prefer unknown over any for unknown types
function processInput(data: unknown): string {
if (typeof data === "string") return data;
if (typeof data === "number") return String(data);
throw new Error("Unsupported type");
}
// Explicit return types for public APIs
export function calculateTotal(items: ReadonlyArray<Item>): number {
return items.reduce((sum, item) => sum + item.price, 0);
}
Sponsors
Details
- Repository
- github.com/jwynia/agent-skills
- Categories
- Documentation, Code Review & Quality, AI & Agent Building, Debugging
- First seen
- Jun 3, 2026
More from jwynia/agent-skills
All 118- Task Decomposition599
- Interactive Fiction587
- Musical Dna564
- Prose Style564
- Brainstorming547
- Pptx Generator543
- Good Thinking528
- Lyric Diagnostic526
- Research Workflow521
- Naming514
- Key Moments513
- Scene Sequencing508
- Code Review504
- Outline Coach504
- Architecture Decision500
- Gentle Teaching498
- Task Breakdown497
- Game Facilitator493
- Character Naming488
- Economic Systems487
- Security Scan487
- Genre Conventions485
- Flash Fiction479
- Revision479