Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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

  1. 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).
  2. Choose the shape — interface for object shapes that may be extended/implemented; type for unions, intersections, mapped/utility types, and primitives aliases.
  3. Organize into files — one cohesive concern per file (e.g. user.ts, order.ts, api/responses.ts), re-exported from an index.ts barrel so consumers import from srs/types.
  4. Name precisely — PascalCase for types/interfaces, suffix request/response DTOs clearly (CreateUserRequest, UserResponse), avoid abbreviations.
  5. Constrain, don't widen — prefer literal unions over string, readonly for immutable data, and avoid any (use unknown + 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), без исполняемых скриптов.

Похожие скиллы

Сравнить writing-types с