一键导入
typescript
TypeScript coding standards for this project. Use when writing or modifying TypeScript files.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
TypeScript coding standards for this project. Use when writing or modifying TypeScript files.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
React coding standards for this project. Use when writing or modifying React components, hooks, or route files.
Code refactor to improve implementation details, only use when explicitly requested by user.
Guides correct usage of the Rostra state management library (createStore, Store, useStore), including store scoping, selectors, optional access, prop-driven initialization, and typing. Use only when the user asks you to work with an existing rostra store or to implement a new one.
Use whenever the scope of your task touches the shopify package or its uses anywhere in the project.
| name | typescript |
| description | TypeScript coding standards for this project. Use when writing or modifying TypeScript files. |
These are the TypeScript standards for this project. Follow them when writing or modifying any TypeScript code.
Use as const to preserve exact literal types and readonly. This is the one acceptable use of as since it tightens types rather than loosening them.
type Status = (typeof STATUS)[number].as const over manually writing literal union types when the source of truth is an array or object.satisfies when you need both exact literal types and structural validation.const STATUS = ["idle", "loading", "success", "error"] as const;
type Status = (typeof STATUS)[number];
const PLAN_LIMITS = {
free: { projects: 3, storage: 500 },
pro: { projects: 50, storage: 10_000 },
} as const satisfies Record<string, Record<string, number>>;
type Plan = keyof typeof PLAN_LIMITS;
Model variants explicitly so the compiler forces you to handle each case.
type, status, kind.if/switch on the discriminant, not by checking for optional field existence.switch with exhaustiveness checking when there are three or more variants. The linter enforces exhaustive switch statements.type Result =
| { status: "success"; data: Order }
| { status: "error"; error: string };
function handleResult(result: Result) {
switch (result.status) {
case "success":
return processOrder(result.data);
case "error":
return reportError(result.error);
}
}