ワンクリックで
typescript-standards
Apply when writing or reviewing TypeScript — enforces TCP TypeScript standards.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Apply when writing or reviewing TypeScript — enforces TCP TypeScript standards.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | typescript-standards |
| description | Apply when writing or reviewing TypeScript — enforces TCP TypeScript standards. |
These are what NOT to do rules. Each rule exists because the antipattern causes real bugs or obscures real errors. Enforce them when writing new TypeScript and flag them during code review.
any TypeRule: Do not use any. Use unknown and narrow with type guards, or model the type properly.
Why: any silently disables the type checker, turning TypeScript into JavaScript with extra steps.
// ❌ Bad
function parse(input: any) {
return input.value;
}
// ✅ Good
function parse(input: unknown) {
if (typeof input === "object" && input !== null && "value" in input) {
return (input as { value: unknown }).value;
}
throw new Error("Invalid input shape");
}
!)Rule: Do not use the non-null assertion operator !. Handle the null or undefined case explicitly.
Why: ! is a promise to the compiler that you are making without proof — it defers the crash to runtime.
// ❌ Bad
const name = user!.profile!.name;
// ✅ Good
if (!user?.profile?.name) {
throw new Error("User profile name is required");
}
const name = user.profile.name;
as Casting Without a Preceding Type GuardRule: Do not use as to cast a type unless you have already narrowed the type with a type guard immediately above the cast.
Why: Casting without a guard is lying to the compiler — it produces a type-safe illusion over an unchecked assumption.
// ❌ Bad
const config = JSON.parse(raw) as AppConfig;
// ✅ Good
function isAppConfig(value: unknown): value is AppConfig {
return (
typeof value === "object" &&
value !== null &&
"apiUrl" in value &&
typeof (value as Record<string, unknown>).apiUrl === "string"
);
}
const parsed = JSON.parse(raw);
if (!isAppConfig(parsed)) {
throw new Error("Invalid config format");
}
const config = parsed as AppConfig; // guard has already run
Rule: Every Promise must be awaited, explicitly discarded with void, or assigned to a variable and handled.
Why: Unhandled promises swallow errors silently and cause unpredictable execution order.
// ❌ Bad
function setup() {
loadConfig(); // promise floats, errors are lost
initDatabase(); // same
}
// ✅ Good
async function setup() {
await loadConfig();
await initDatabase();
}
// ✅ Also acceptable for intentional fire-and-forget
void sendAnalyticsEvent("app_start");
enumRule: Do not use TypeScript enum. Use const objects with as const and derive the union type via typeof.
Why: enum compiles to runtime objects with surprising semantics, numeric reverse-mapping, and poor tree-shaking behaviour; const objects are transparent plain values.
// ❌ Bad
enum Status {
Active = "active",
Inactive = "inactive",
}
// ✅ Good
const Status = {
Active: "active",
Inactive: "inactive",
} as const;
type Status = (typeof Status)[keyof typeof Status];
// type Status = 'active' | 'inactive'
Trigger this skill when:
.ts or .tsx file.ts file or TypeScript moduleCheck each rule (TCP-TS-001 through TCP-TS-005) against the code in scope and flag or fix every violation found.
Apply when designing or reviewing HTTP APIs — enforces TCP API design standards.
Use when starting any development task — scans files in scope and loads the correct TCP coding standards before any code is written.
Use when reviewing TypeScript/Bun code in this project — flags anti-patterns to raise and enforces test philosophy
Use when building or modifying review/src/agents/ using @github/copilot-sdk, or migrating from @opencode-ai/sdk, or asking how to run parallel agent sessions, get structured JSON output, configure custom OpenAI providers, use hooks, MCP servers, custom agents/skills, session persistence, observability, or troubleshoot SDK issues.
everything you need to know about octokit.js, form github's official SDK for REST and GraphQL API requests, GitHub App authentication, and webhooks