Use this skill when working with TypeScript code, type definitions, interfaces, generics, or async patterns.
A Conductor skill providing guidance for writing type-safe, maintainable TypeScript code.
This skill activates when working with TypeScript files and provides guidance on:
The skill automatically activates when:
.ts or .tsx filestypescript, type, interface, generic, async| Pattern | Description | |---------|-------------| | type-safety | Type definitions, generics, discriminated unions | | async-patterns | Async/await, Promise handling, error management | | null-handling | Null safety, optional chaining, type guards |
interface ApiResponse<T> {
data: T;
status: number;
timestamp: string;
}
type ApiResult<T> =
| { success: true; response: ApiResponse<T> }
| { success: false; error: Error };
async function fetchApi<T>(url: string): Promise<ApiResult<T>> {
try {
const response = await fetch(url);
const data = await response.json();
return {
success: true,
response: { data, status: response.status, timestamp: new Date().toISOString() }
};
} catch (error) {
return { success: false, error: error as Error };
}
}
interface Entity {
id: string;
createdAt: Date;
updatedAt: Date;
}
interface Repository<T extends Entity> {
findById(id: string): Promise<T | undefined>;
findAll(): Promise<T[]>;
create(data: Omit<T, 'id' | 'createdAt' | 'updatedAt'>): Promise<T>;
update(id: string, data: Partial<T>): Promise<T>;
delete(id: string): Promise<void>;
}
Recommended tsconfig.json settings:
{
"compilerOptions": {
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true
}
}
npx skills add rbarcante/typescript-best-practices下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer