بنقرة واحدة
schema
Data layer — Prisma model, migration, and Zod validation
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Data layer — Prisma model, migration, and Zod validation
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
Multi-slide bilingual brand carousels — Claude writes the deck, kun renders Anthropic-styled slides at exact platform sizes, a human approves, channels receive
Draft, stage, and publish brand social posts — Claude drafts, /higgs renders, a human approves, Hermes relays
Convert a file or URL to Markdown via MarkItDown (PDF, Office, images, audio, web)
Full pipeline — idea to production (chains every stage)
Autonomous block QA — detect, adversarially verify, fix safe tiers, hand the residual to a human
Technical spec — data model, file plan, refined acceptance criteria
استنادا إلى تصنيف SOC المهني
| name | schema |
| description | Data layer — Prisma model, migration, and Zod validation |
| when_to_use | Use when a feature needs its data foundation built from an approved spec — creating the Prisma model, applying the migration, generating the client, and writing Zod create/update/filter schemas with TypeScript types. Triggers on: add the model/migration, data layer, Prisma model + Zod validation, pipeline Data stage. |
| argument-hint | <model> [product] |
Create the data foundation: Prisma model, migration, Zod validation, TypeScript types.
/schema #42 — from issue spec/schema billing — from feature name/schema — from most recent feature issueFind the feature issue and read the spec comment:
gh issue view <number> --repo <repo> --comments
Extract the data model sketch and file plan from the ## Technical Spec comment.
If no spec exists, stop: "No spec found. Run /spec first."
Based on the spec's data model sketch:
Create the model in the appropriate location:
prisma/models/ directory exists → create prisma/models/{name}.prismaprisma/schema.prismaFollow existing patterns in the schema:
Add relations to existing models where needed
pnpm prisma migrate dev --name add-{feature-name}
Error recovery:
Then generate the client:
pnpm prisma generate
Create src/components/{scope}/{name}/validation.ts:
import { z } from "zod";
// Create schema — fields for creating a new record
export const create{Name}Schema = z.object({
// ... fields from Prisma model (exclude id, timestamps, relations)
// Use .min(), .max(), .email(), .url() etc. as appropriate
});
// Update schema — partial version for edits
export const update{Name}Schema = create{Name}Schema.partial();
// Filter schema — for list view filtering (if applicable)
export const filter{Name}Schema = z.object({
// ... filterable fields
});
// Type exports
export type Create{Name}Input = z.infer<typeof create{Name}Schema>;
export type Update{Name}Input = z.infer<typeof update{Name}Schema>;
Follow the validation patterns used by existing features in the same product.
pnpm tsc --noEmit
Error recovery:
gh issue comment <number> --repo <repo> --body "## Schema Stage Complete
**Model**: \`{ModelName}\` created in \`{file path}\`
**Migration**: \`add-{feature-name}\` applied
**Validation**: \`{scope}/{name}/validation.ts\` created
**Types**: Compiling cleanly
Files created:
- \`prisma/models/{name}.prisma\` (or location in schema.prisma)
- \`src/components/{scope}/{name}/validation.ts\`"
| Error | Fix | Max Retries |
|---|---|---|
| Migration syntax error | Read Prisma error, fix model definition | 3 |
| Relation conflict | Check existing models, fix relation names | 3 |
| Type compilation error | Fix imports, adjust types | 3 |
| Prisma generate failure | Check schema validity, fix | 3 |
If all retries exhausted: stop, report error on issue, label pipeline:blocked.
pnpm prisma generate succeedspnpm tsc --noEmit passes with 0 errors