frontend-types
БесплатноБез исполняемых скриптовНе проверенAll TypeScript types are defined in `frontend/types/index.ts`. Types match backend API response structure and provide type safety across the frontend…
от aiskillstore★ 509 звёзд на GitHubОб этом скилле
Frontend TypeScript Types Skill
Purpose: Guidance for creating TypeScript type definitions following existing patterns from frontend/types/index.ts.
Overview
All TypeScript types are defined in frontend/types/index.ts. Types match backend API response structure and provide type safety across the frontend application.
Type Patterns from frontend/types/index.ts
1. User Types
export interface User {
id: string;
email: string;
name: string;
createdAt?: string;
updatedAt?: string;
}
export interface UserCredentials {
email: string;
password: string;
}
export interface UserSignupData extends UserCredentials {
name: string;
}
Pattern:
- Use
interfacefor object types - Mark optional fields with
? - Use
extendsfor type inheritance - Use camelCase for frontend types (even if backend uses snake_case)
2. Task Types
export type TaskStatus = "pending" | "completed";
export type TaskPriority = "low" | "medium" | "high";
export interface Task {
id: number;
user_id: string;
title: string;
description?: string;
completed: boolean;
priority: TaskPriority;
due_date?: string;
tags: string[];
created_at: string;
updated_at: string;
}
export interface TaskFormData {
title: string;
description?: string;
priority?: TaskPriority;
due_date?: string;
tags?: string[];
}
export interface TaskQueryParams {
status?: "all" | "pending" | "completed";
sort?: "created" | "title" | "updated" | "priority" | "due_date";
search?: string;
page?: number;
limit?: number;
}
Pattern:
- Use
typefor union types (string literals) - Use
interfacefor object types - Match backend field names (snake_case for API fields like
user_id,due_date,created_at) - Create separate types for form data (all optional except required fields)
- Create separate types for query parameters (all optional)
3. API Response Types
export interface ApiResponse<T = unknown> {
data?: T;
success: boolean;
message?: string;
error?: {
code: string;
message: string;
details?: unknown;
};
}
export interface PaginatedResponse<T> {
data: T[];
meta: {
total: number;
page: number;
limit: number;
totalPages: number;
};
}
Pattern:
- Use generic types
<T>for reusable structures - Provide default type parameter (
<T = unknown>) - Include
successboolean flag - Include optional
data,message, anderrorfields - Create separate type for paginated responses with
metaobject
4. Authentication Types
export interface AuthResponse {
success: boolean;
token: string;
user: User;
}
export interface Session {
user: User;
token: string;
expiresAt: number;
}
Pattern:
- Include
successboolean - Include
tokenstring - Include
userobject (User type) - Include
expiresAttimestamp for session
5. Error Types
export interface AppError {
message: string;
code?: string;
statusCode?: number;
field?: string;
}
export interface FormErrors {
[key: string]: string | undefined;
}
Pattern:
- Use
interfacefor error objects - Mark optional fields with
? - Use index signature
[key: string]for dynamic object types (FormErrors)
6. UI Types
export type LoadingState = "idle" | "loading" | "success" | "error";
export type ToastType = "success" | "error" | "warning" | "info";
export interface ToastMessage {
id: string;
type: ToastType;
message: string;
duration?: number;
}
Pattern:
- Use
typefor union types (string literals) - Use
interfacefor object types - Include
idfor unique identification - Mark optional fields with
?
7. Export/Import Types
export type ExportFormat = "csv" | "json";
export interface ImportResult {
imported: number;
errors: number;
errorDetails?: string[];
}
Pattern:
- Use
typefor union types (string literals) - Use
interfacefor result objects - Include counts for success/error tracking
- Include optional error details array
Type Naming Conventions
Interfaces
- PascalCase:
User,Task,ApiResponse - Descriptive names:
TaskFormData,UserSignupData
Types (Union Types)
- PascalCase:
TaskStatus,TaskPriority,LoadingState - Descriptive names:
ToastType,ExportFormat
Props Types
- ComponentName + Props:
TaskItemProps,ProtectedRouteProps - Example:
interface TaskItemProps { task: Task; }
Form Data Types
- EntityName + FormData:
TaskFormData,UserSignupData - Example:
interface TaskFormData { title: string; description?: string; }
Query Parameter Types
- EntityName + QueryParams:
TaskQueryParams - Example:
interface TaskQueryParams { status?: "all" | "pending" | "completed"; }
Matching Backend Schema
Field Name Mapping
Backend (snake_case) → **Frontend (camelCase for fo
Установить frontend-types в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл frontend-types?
All TypeScript types are defined in `frontend/types/index.ts`. Types match backend API response structure and provide type safety across the frontend application.
Как установить скилл frontend-types?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл frontend-types запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic