From hopeoverture-worldbuilding-app-skills
Generates Zod schemas and TypeScript types for forms, API routes, and Server Actions with runtime validation. Includes an automated TypeScript-to-Zod schema generator script.
How this skill is triggered — by the user, by Claude, or both
Slash command
/hopeoverture-worldbuilding-app-skills:api-contracts-and-zod-validationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate Zod schemas with TypeScript type inference for forms, API routes, and Server Actions. Validate inputs in Server Actions or route handlers with runtime type checking.
Generate Zod schemas with TypeScript type inference for forms, API routes, and Server Actions. Validate inputs in Server Actions or route handlers with runtime type checking.
When creating API contracts or form validations:
z.infer<typeof schema> for automatic type inferenceTo create form validation with Zod:
references/zod_patterns.md for common validation patternsTo add validation to API endpoints or Server Actions:
.parse() or .safeParse()Use scripts/generate_zod_schema.py to automate schema generation:
python scripts/generate_zod_schema.py --input types/entities.ts --output schemas/entities.ts
The script:
Automated TypeScript-to-Zod schema generator. Parses TypeScript AST and generates equivalent Zod schemas.
Common Zod validation patterns including:
Pre-built Zod schema templates:
form_schema_template.ts - Basic form validationapi_route_schema_template.ts - API route request/responseserver_action_schema_template.ts - Server Action input/outputentity_schema_template.ts - Database entity validationscripts/generate_zod_schema.py or templates.safeParse() at the beginning of the action.safeParse() instead of .parse() to avoid throwing exceptionsz.infer<typeof schema> for automatic TypeScript typesCommon use cases for worldbuilding applications:
Consult references/zod_patterns.md for specific validation patterns applicable to worldbuilding entities.
npx claudepluginhub hopeoverture/worldbuilding-app-skillsGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.