一键导入
typescript-best-practices
TypeScript/Node.js best practices. Use when writing or reviewing TypeScript code. Covers type safety, async patterns, and error handling.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
TypeScript/Node.js best practices. Use when writing or reviewing TypeScript code. Covers type safety, async patterns, and error handling.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Hybrid architecture combining Ralph's PRD format with Planning-with-Files' structured approach. Auto-generates PRDs from task descriptions, manages parallel story execution with dependency resolution, and provides context-filtered agents for efficient multi-story development.
Project-level multi-task orchestration system. Manages multiple hybrid:worktree features in parallel with dependency resolution, coordinated PRD generation, and unified merge workflow.
Implements Manus-style file-based planning for complex tasks. Creates task_plan.md, findings.md, and progress.md. Use when starting complex multi-step tasks, research projects, or any task requiring >5 tool calls. Now with automatic session recovery after /clear and optional Git worktree mode.
Go coding best practices. Use when writing or reviewing Go code. Covers error handling, concurrency, and idiomatic patterns.
Java coding best practices. Use when writing or reviewing Java code (17+). Covers modern features, error handling, and patterns.
Python coding best practices. Use when writing or reviewing Python code. Covers type hints, error handling, and common patterns.
基于 SOC 职业分类
| name | typescript-best-practices |
| description | TypeScript/Node.js best practices. Use when writing or reviewing TypeScript code. Covers type safety, async patterns, and error handling. |
| license | MIT |
| metadata | {"author":"plan-cascade","version":"1.0.0"} |
| Rule | Guideline |
|---|---|
| Formatter | Prettier |
| Linter | ESLint + @typescript-eslint |
| Strict mode | strict: true in tsconfig |
| Rule | Guideline |
|---|---|
Avoid any | Use unknown + narrowing |
| Type guards | Custom predicates |
| Discriminated unions | For variants |
type Result<T> = { success: true; data: T } | { success: false; error: Error };
function isUser(v: unknown): v is User {
return typeof v === 'object' && v !== null && 'id' in v;
}
class ApiError extends Error {
constructor(message: string, public status: number) {
super(message);
this.name = 'ApiError';
}
}
async function fetchUser(id: string): Promise<User> {
const res = await fetch(`/api/users/${id}`);
if (!res.ok) throw new ApiError('Failed', res.status);
return res.json();
}
src/{index.ts, types/, services/, utils/}
tests/
package.json, tsconfig.json
| Pattern | Usage |
|---|---|
Promise.all | Parallel operations |
AbortController | Cancellation |
const [user, settings] = await Promise.all([fetchUser(id), fetchSettings(id)]);
| Avoid | Use Instead |
|---|---|
as assertions | Type guards |
! non-null | ?. and ?? |
any | unknown + narrowing |
// Bad: data as User, user!.name
// Good:
if (isUser(data)) { /* data is User */ }
const name = user?.name ?? 'Unknown';
describe('Service', () => {
it('should create', async () => {
const mock = { save: vi.fn().mockResolvedValue({ id: '1' }) };
const result = await new Service(mock).create({ name: 'Test' });
expect(result.id).toBe('1');
});
});