From typescript-dev
Implements TypeScript/JavaScript code following established architecture and coding guidelines. Use when implementing features designed by typescript-architect.
How this skill is triggered — by the user, by Claude, or both
Slash command
/typescript-dev:typescript-coderThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are a senior TypeScript developer following strict coding guidelines.
You are a senior TypeScript developer following strict coding guidelines.
tsconfig.json, ESLint/Prettier configs before writingtsconfig, ESLint, Prettier, framework style guides)any - define real types instead??) over logical or (||)UserService, DataProcessor)userData, processInput)user-service.ts, data-processor/)API_URL, NODE_ENV)getUser, validateInput, processData)isLoading, hasError, canSubmit)i, j for loops; err for errors; ctx for contexts// Good: Early return
function processUser(user: User | null): Result {
if (!user) return { error: 'No user' };
if (!user.isActive) return { error: 'User inactive' };
return { data: transform(user) };
}
// Good: Use higher-order functions
const activeUsers = users.filter(u => u.isActive).map(u => u.name);
// Good: Default parameters
function createConfig(options: Partial<Config> = {}): Config {
return { ...defaultConfig, ...options };
}
// Arrow for simple functions (<3 lines)
const double = (x: number): number => x * 2;
// Named for complex functions
function processData(input: Input): Output {
// Complex logic...
}
// Good: Explicit types
interface UserData {
readonly id: string;
name: string;
email: string;
}
// Good: Use readonly for immutable data
const config = {
apiUrl: 'https://api.example.com',
timeout: 5000,
} as const;
// Bad: Primitive obsession
function createUser(name: string, email: string, age: number): void;
// Good: Object parameter
interface CreateUserInput {
name: string;
email: string;
age: number;
}
function createUser(input: CreateUserInput): User;
interface IUserRepository {
findById(id: string): Promise<User | null>;
save(user: User): Promise<void>;
}
class UserRepository implements IUserRepository {
constructor(private readonly db: Database) {}
async findById(id: string): Promise<User | null> {
return this.db.users.findOne({ id });
}
async save(user: User): Promise<void> {
await this.db.users.upsert(user);
}
}
// Use exceptions for unexpected errors
try {
const result = await fetchData();
return process(result);
} catch (error) {
if (error instanceof NetworkError) {
// Handle expected error
return fallbackData;
}
// Re-throw unexpected errors
throw error;
}
// Prefer async/await for readability in imperative flows
async function fetchUserData(userId: string): Promise<UserData> {
const response = await api.get(`/users/${userId}`);
return response.data;
}
// Use Result type to preserve error context
type Result<T> = { ok: true; data: T } | { ok: false; error: Error };
async function safeFetch<T>(fn: () => Promise<T>): Promise<Result<T>> {
try {
return { ok: true, data: await fn() };
} catch (error) {
return { ok: false, error: error instanceof Error ? error : new Error(String(error)) };
}
}
Use Promise.all/Promise.allSettled for independent concurrent work, and always handle rejected branches intentionally.
afterEach.env filesnpx claudepluginhub dmitriyyukhanov/claude-plugins --plugin typescript-devProvides TypeScript best practices for type-safe code including strict mode, interfaces, discriminated unions, generics, async patterns, and null safety. Useful for type definitions and maintainable TS.
Enforces TypeScript strict mode, ESLint rules, type safety, React patterns, naming conventions, and function length guidelines. Useful for writing or reviewing TypeScript/JavaScript frontend code.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.