swe-programming-typescript
TypeScript coding standards from authoritative docs/explanation/software-engineering/programming-languages/typescript/ documentation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
TypeScript coding standards from authoritative docs/explanation/software-engineering/programming-languages/typescript/ documentation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
AI agent development standards including frontmatter structure, naming conventions, tool access patterns, model selection, and reference documentation structure
Comprehensive project planning standards for plans/ directory including folder structure (ideas/, backlog/, in-progress/, done/), stage-aware naming convention (done uses YYYY-MM-DD__identifier/; backlog and in-progress use identifier/ with no date prefix), five-document file organization (README.md, brd.md, prd.md, tech-docs.md, delivery.md for multi-file default; single README.md for trivially-small single-file exception), BRD/PRD content-placement rules, Gherkin acceptance criteria, and the mandatory structured multiple-choice grilling gates (pre-write and post-write) for resolving design decisions with the user. Essential for creating structured, executable project plans.
Trunk Based Development workflow - all development on main branch with small frequent commits, minimal branching, and continuous integration. Covers when branches are justified (exceptional cases only), commit patterns, feature flag usage for incomplete work, environment branch rules (deployment only), and AI agent default behavior (the repo-wide default delivery mode is `worktree-to-pr` -- a short-lived plan branch in a disposable worktree pushed to a draft PR; direct push to main remains available as an explicit selection). Essential for understanding repository git workflow and keeping branches short-lived
Workflow pattern standards for creating multi-agent orchestrations including YAML frontmatter (name, description, tags, status, agents, parameters), execution phases (sequential/parallel/conditional), agent coordination patterns, and Gherkin success criteria. Essential for defining reusable, validated workflow processes.
Common software development workflow patterns shared across all language developer agents
Three-stage content quality workflow pattern (Maker creates, Checker validates, Fixer remediates) with detailed execution workflows. Use when working with content quality workflows, validation processes, audit reports, or implementing maker/checker/fixer agent roles.
| name | swe-programming-typescript |
| description | TypeScript coding standards from authoritative docs/explanation/software-engineering/programming-languages/typescript/ documentation |
Progressive disclosure of TypeScript coding standards for agents writing TypeScript code.
Authoritative Source: docs/explanation/software-engineering/programming-languages/typescript/README.md
Usage: Auto-loaded for agents when writing TypeScript code. Provides quick reference to idioms, best practices, and antipatterns.
Types and Interfaces: PascalCase
UserAccount, PaymentDetailsIPaymentProcessor or PaymentProcessor (no prefix preferred)type UserId = stringFunctions and Variables: camelCase
calculateTotal(), findUserById()userName, totalAmountUPPER_SNAKE_CASE (MAX_RETRIES, API_ENDPOINT)Files: kebab-case
user-account.ts, payment-processor.tsType Inference: Let TypeScript infer when obvious
const name = "John"; // string inferred
const count = 42; // number inferred
Union Types: Use for multiple possible types
type Result = Success | Error;
type Status = "pending" | "completed" | "failed";
Type Guards: Use for type narrowing
function isString(value: unknown): value is string {
return typeof value === "string";
}
Generics: Use for reusable type-safe code
function identity<T>(value: T): T {
return value;
}
Utility Types: Leverage built-in utilities
Partial<T>: Make all properties optionalPick<T, K>: Select specific propertiesOmit<T, K>: Remove specific propertiesReadonly<T>: Make all properties readonlyResult Pattern: Prefer over throwing exceptions
type Result<T, E> = { ok: true; value: T } | { ok: false; error: E };
Error Types: Define specific error types
class ValidationError extends Error {
constructor(
public field: string,
message: string,
) {
super(message);
this.name = "ValidationError";
}
}
Jest/Vitest: Primary testing frameworks
describe() for test suitesit() or test() for individual testsbeforeEach(), afterEach() for setupType-safe Tests: Ensure tests are type-checked
it("should return user", () => {
const user: User = findUser("123");
expect(user.name).toBe("John");
});
No any: Avoid any type
unknown for truly unknown typesInput Validation: Validate external data
XSS Prevention: Sanitize user input
dangerouslySetInnerHTML without sanitizationFor detailed guidance, refer to: