Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/LedgerHQ/ledger-live --skill zod-schemas명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
| name | zod-schemas |
| description | Zod schema validation patterns for API types |
Define types in state-manager/types.ts using Zod schemas for runtime validation.
// ✅ GOOD - state-manager/types.ts
import { z } from "zod";
// 1. Define tag types as enum
export enum MyDataTags {
Items = "Items",
Item = "Item",
}
// 2. Define Zod schemas with validation rules
const ItemSchema = z.object({
id: z.string().uuid(),
name: z.string().min(1),
value: z.number().min(0),
status: z.enum(["active", "inactive"]),
createdAt: z.string().datetime(),
});
const ItemResponseSchema = z.object({
data: ItemSchema,
meta: z.object({
timestamp: z.string(),
version: z.string(),
}),
});
const ItemListResponseSchema = z.object({
items: z.array(ItemSchema),
pagination: z.object({
nextCursor: z.string().optional(),
total: z.number(),
}),
});
// 3. Infer TypeScript types from schemas
export type Item = z.infer<typeof ItemSchema>;
export type ItemResponse = z.infer<typeof ItemResponseSchema>;
export type ItemListResponse = z.infer<typeof ItemListResponseSchema>;
// 4. Define query params as interfaces
export interface GetItemsParams {
search?: string;
limit?: number;
cursor?: string;
}
// 5. Export schemas for runtime validation
export { ItemSchema, ItemResponseSchema, ItemListResponseSchema };
// state-manager/api.ts
import { ItemListResponseSchema, type ItemListResponse } from "./types";
endpoints: (build) => ({
getItems: build.query<ItemListResponse, GetItemsParams>({
query: (params) => ({ url: "items", params }),
transformResponse: (response: unknown) => {
// Runtime validation
return ItemListResponseSchema.parse(response);
},
}),
}),
.min(), .max(), .uuid(), .email() for field validationz.enum() for fixed string valuesz.union() for multiple possible types.optional() for nullable fieldsz.infer<typeof Schema>Place and organize Ledger Wallet code in the DDD monorepo. Use when creating, moving, or reviewing code under apps, features, domain, shared, or support; deciding which layer owns a concern; structuring packages and flow steps; or checking package names, dependency boundaries, platform variants, and legacy imports.
A new-architecture package (shared/, domain/, features/) exposes its API through barrels that contain nothing but `export *`, and keeps its private code in an internals location. Read this when creating a package under shared/, domain/ or features/, when editing any `index.*` file, or when a `lint:structure` check fails.
A new-architecture package (shared/, domain/, features/) exposes its API through barrels that contain nothing but `export *`, and keeps its private code in an internals location. Read this when creating a package under shared/, domain/ or features/, when editing any `index.*` file, or when a `lint:structure` check fails.
SOC 직업 분류 기준