بنقرة واحدة
arktype
Arktype schemas. Use when defining, composing, validating, deriving types from, or debugging Arktype schemas.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Arktype schemas. Use when defining, composing, validating, deriving types from, or debugging Arktype schemas.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Skill writing principles. Use when creating, editing, or reviewing any SKILL.md.
Skill rule extraction and creation. Use when the user says /learn.
Kysely database queries. Use when writing, reviewing, or debugging Kysely selects, mutations, joins, transactions, filters, or aggregates.
Frontend components and Tailwind. Use when creating, reviewing, refactoring, splitting, or organizing React components, shared components, component folders, or Tailwind classes.
TanStack Query in React. Use when implementing or reviewing queries, mutations, invalidation, or query hooks.
Lint and optimize existing skills. Use when the user says /skill-linter.
| name | arktype |
| description | Arktype schemas. Use when defining, composing, validating, deriving types from, or debugging Arktype schemas. |
Use Arktype as the source of truth for boundary validation and derived types.
OrderSchemas.create..assert(). Avoid schema(value) plus manual error checks..or() for discriminated unions and .and() to compose schemas..pick() when reusing multiple fields from an existing schema. For one field, declare it directly.? in the field name for optional fields.type.enumerated() over literal unions wherever possible, including discriminants."number" before "number.integer" and "string" before format/min/max checks unless the boundary truly needs that constraint.const status = type.enumerated("pending", "active", "done");
const OrderSchemas = {
create: type({
items: type({ product_id: "number", quantity: "number" }).array(),
"notes?": "string",
status,
}),
update: type({
id: "number",
"status?": status,
}),
};
export type OrderData = typeof OrderDataSchema.infer;
const payload = OrderSchemas.create.assert(input);
Discriminated unions use separate schemas with an enumerated discriminant.
const stripeType = type.enumerated("stripe");
const paypalType = type.enumerated("paypal");
const stripeConfig = type({
type: stripeType,
api_key: "string",
});
const paypalConfig = type({
type: paypalType,
client_id: "string",
secret: "string",
});
export const PaymentConfigSchema = stripeConfig.or(paypalConfig);
const paginatedSearch = searchInput.and(paginationInput);
Schemas should prove the contract needed at the boundary, not encode every possible preference. Add integer, range, length, and format checks only when the domain or downstream operation actually depends on them.
Use field-level .pipe() for normalization.
type({
name: type("string").pipe((v) => v.trim()),
"age?": "number",
email: "string",
items: itemSchema.array(),
status,
});
Never use .pipe() on a whole schema that will be composed with .and(). Whole-schema pipes change the output type and can make intersections lose base fields.
const base = type({ id: "number" });
const badExtra = type({ name: "string" }).pipe((v) => ({ ...v, slug: v.name.toLowerCase() }));
const broken = base.and(badExtra);
const goodExtra = type({ name: type("string").pipe((v) => v.toLowerCase()) });
const combined = base.and(goodExtra);
When a schema receives a larger object and must extract only declared fields, use '+': 'delete'. Undeclared keys are removed. The result contains only what the schema defines.
const configSchema = type({
'+': 'delete',
threshold: "number",
enabled: "boolean",
});
const clean = configSchema.assert({ threshold: 10, enabled: true, extra: "ignored" });
// { threshold: 10, enabled: true }
Useful when one endpoint input contains data for multiple layers and each layer extracts its own part with its own schema.
schema(value) and inspect type.errors.type.enumerated() works..pick() for one field.