writing-types
БесплатноБез исполняемых скриптовНе проверенUse this skill when you need to write TypeScript types and interfaces in `srs/types` for the Next.js app — turn a domain or API spec into modular, well-named…
от jiaxiaojunQAQ★ 35 звёзд на GitHubОб этом скилле
Instructions
Write TypeScript types and interfaces under srs/types for the Next.js app. Derive the types from
the domain model / API spec provided, keeping them modular and easy to consume across the app.
Workflow
- Model the domain — identify the entities, their fields, and the relationships between them from the spec. Decide what is required vs. optional, and what is a finite set (→ union/enum).
- Choose the shape —
interfacefor object shapes that may be extended/implemented;typefor unions, intersections, mapped/utility types, and primitives aliases. - Organize into files — one cohesive concern per file (e.g.
user.ts,order.ts,api/responses.ts), re-exported from anindex.tsbarrel so consumers import fromsrs/types. - Name precisely —
PascalCasefor types/interfaces, suffix request/response DTOs clearly (CreateUserRequest,UserResponse), avoid abbreviations. - Constrain, don't widen — prefer literal unions over
string,readonlyfor immutable data, and avoidany(useunknown+ narrowing when the shape is genuinely open).
Rules
- Make it modular.
- Separate the types and interfaces into multiple files if possible.
- Maximum of 50 lines of code per file.
Example
// srs/types/user.ts
export type UserRole = "admin" | "member" | "guest";
export interface User {
id: string;
email: string;
role: UserRole;
createdAt: string; // ISO-8601
displayName?: string;
}
export interface CreateUserRequest {
email: string;
role?: UserRole;
}
// srs/types/index.ts
export * from "./user";
export * from "./order";
Quality bar
- No
any; optionality reflects the real contract (don't mark required fields optional). - Each file stays under 50 lines and covers one concern; shared primitives live in a common module.
- Types compile cleanly and are importable as
import type { User } from "@/srs/types".
Установить writing-types в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл writing-types?
Use this skill when you need to write TypeScript types and interfaces in `srs/types` for the Next.js app — turn a domain or API spec into modular, well-named type definitions.
Как установить скилл writing-types?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл writing-types запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic