AI & Agents
Skill
/typescript
TypeScript coding conventions, best practices, and patterns for writing clean, maintainable code.
Claude Code
$ npx -y skills add genkit-ai/genkit --skill typescript --agent claude-code
Codex
$ npx skills add genkit-ai/genkit --skill typescript -a codex -y
Cursor
$ npx skills add genkit-ai/genkit --skill typescript -a cursor -y
Gemini CLI
$ npx skills add genkit-ai/genkit --skill typescript -a gemini-cli -y
GitHub Copilot
$ npx skills add genkit-ai/genkit --skill typescript -a github-copilot -y
OpenCode
$ npx skills add genkit-ai/genkit --skill typescript -a opencode -y
Windsurf
$ npx skills add genkit-ai/genkit --skill typescript -a windsurf -y
SKILL.md
typescript.SKILL.mdname: typescript
description: TypeScript coding conventions, best practices, and patterns for writing clean, maintainable code.
TypeScript Coding Conventions
General Principles
- Use **TypeScript strict mode** (`"strict": true` in tsconfig.json).
- Prefer `const` over `let`; never use `var`.
- Use explicit return types on exported functions.
- Prefer interfaces over type aliases for object shapes.
- Use `unknown` instead of `any` where possible.
Naming Conventions
- **Variables & functions**: `camelCase`
- **Classes & interfaces**: `PascalCase`
- **Constants**: `UPPER_SNAKE_CASE` for true constants, `camelCase` for derived values
- **Files**: `kebab-case.ts`
- **Type parameters**: Single uppercase letter (`T`, `K`, `V`) or descriptive (`TResult`)
File Structure
src/
index.ts # Entry point, exports
types.ts # Shared type definitions
utils/ # Utility functions
services/ # Business logic
middleware/ # Express/framework middleware
Error Handling
- Use typed errors (extend `Error` class).
- Always handle promise rejections.
- Prefer `try/catch` with specific error types over generic catches.
class AppError extends Error {
constructor(
message: string,
public readonly code: string,
public readonly statusCode: number = 500
) {
super(message);
this.name = 'AppError';
}
}Async Patterns
- Use `async/await` over raw promises.
- Use `Promise.all()` for concurrent independent operations.
- Avoid mixing callbacks and promises.
Imports
- Use named imports: `import { thing } from './module'`
- Group imports: external packages first, then internal modules.
- Use `.js` extensions in import paths for ESM compatibility.
Code Style
- Maximum line length: 100 characters.
- Use template literals for string interpolation.
- Prefer `Array.map/filter/reduce` over `for` loops for transformations.
- Use optional chaining (`?.`) and nullish coalescing (`??`).
- Destructure objects and arrays when accessing multiple properties.
Testing
- Co-locate test files: `thing.ts` → `thing.test.ts`
- Use descriptive test names: `it('should return empty array when no items match')`
- Test edge cases: empty inputs, null values, error conditions.
Read more
name: typescript description: TypeScript coding conventions, best practices, and patterns for writing clean, maintainable code.
TypeScript Coding Conventions
General Principles
- Use **TypeScript strict mode** (`"strict": true` in tsconfig.json).
- Prefer `const` over `let`; never use `var`.
- Use explicit return types on exported functions.
- Prefer interfaces over type aliases for object shapes.
- Use `unknown` instead of `any` where possible.
Naming Conventions
- **Variables & functions**: `camelCase`
- **Classes & interfaces**: `PascalCase`
- **Constants**: `UPPER_SNAKE_CASE` for true constants, `camelCase` for derived values
- **Files**: `kebab-case.ts`
- **Type parameters**: Single uppercase letter (`T`, `K`, `V`) or descriptive (`TResult`)
File Structure
src/ index.ts # Entry point, exports types.ts # Shared type definitions utils/ # Utility functions services/ # Business logic middleware/ # Express/framework middleware
Error Handling
- Use typed errors (extend `Error` class).
- Always handle promise rejections.
- Prefer `try/catch` with specific error types over generic catches.
class AppError extends Error {
constructor(
message: string,
public readonly code: string,
public readonly statusCode: number = 500
) {
super(message);
this.name = 'AppError';
}
}Async Patterns
- Use `async/await` over raw promises.
- Use `Promise.all()` for concurrent independent operations.
- Avoid mixing callbacks and promises.
Imports
- Use named imports: `import { thing } from './module'`
- Group imports: external packages first, then internal modules.
- Use `.js` extensions in import paths for ESM compatibility.
Code Style
- Maximum line length: 100 characters.
- Use template literals for string interpolation.
- Prefer `Array.map/filter/reduce` over `for` loops for transformations.
- Use optional chaining (`?.`) and nullish coalescing (`??`).
- Destructure objects and arrays when accessing multiple properties.
Testing
- Co-locate test files: `thing.ts` → `thing.test.ts`
- Use descriptive test names: `it('should return empty array when no items match')`
- Test edge cases: empty inputs, null values, error conditions.
Stats
6,603
Stars
Active
Maintenance
TypeScript
Language
Apache-2.0
License
Last commit
Created
Added
Ships withgenkit
Open-source framework for building agentic apps in JavaScript, Go, Dart, and Python, built and used in production by Google
6.6k2 skills
Other skills on genkit.
More skills from other plugins.
karpathy-guidelines
Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid…
agent-builder
Design and build AI agents for any domain. Use when users: (1) ask to "create an agent", "build an assistant", or "design an AI…
Questions about typescript.
- Which coding agents can use typescript?
- typescript installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.

