rule-schemas — for Claude Code rule-schemas, methodology-rules, community, for Claude Code, ide skills, z.infer, schemas, whenever, touches, runtime

v1.0.0

About this Skill

Perfect for TypeScript Agents needing robust runtime validation and canonical type definitions. Rule mapping for schemas

Features

Apply this rule whenever work touches:
Define schemas close to the types they describe. A common pattern is to export both from the same
import { z } from 'zod';
export const VehicleSchema = z.object({
plate: z.string().min(7),

# Core Topics

carrot-foundation carrot-foundation
[3]
[0]
Updated: 3/18/2026

Killer-Skills Review

Decision support comes first. Repository text comes second.

Reference-Only Page Review Score: 8/11

This page remains useful for teams, but Killer-Skills treats it as reference material instead of a primary organic landing page.

Original recommendation layer Concrete use-case guidance Explicit limitations and caution Locale and body language aligned
Review Score
8/11
Quality Score
39
Canonical Locale
en
Detected Body Locale
en

Perfect for TypeScript Agents needing robust runtime validation and canonical type definitions. Rule mapping for schemas

Core Value

Empowers agents to ensure data integrity and automate workflows using Zod, providing runtime validation and type inference via `z.infer` for `.ts` files.

Ideal Agent Persona

Perfect for TypeScript Agents needing robust runtime validation and canonical type definitions.

Capabilities Granted for rule-schemas

Validating data at runtime boundaries
Generating canonical type definitions for TypeScript projects
Automating workflow validation using Zod schemas

! Prerequisites & Limits

  • Requires Zod library
  • Limited to TypeScript projects with `.ts` files

Why this page is reference-only

  • - The underlying skill quality score is below the review floor.

Source Boundary

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

After The Review

Decide The Next Action Before You Keep Reading Repository Material

Killer-Skills should not stop at opening repository instructions. It should help you decide whether to install this skill, when to cross-check against trusted collections, and when to move into workflow rollout.

Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is rule-schemas?

Perfect for TypeScript Agents needing robust runtime validation and canonical type definitions. Rule mapping for schemas

How do I install rule-schemas?

Run the command: npx killer-skills add carrot-foundation/methodology-rules/rule-schemas. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for rule-schemas?

Key use cases include: Validating data at runtime boundaries, Generating canonical type definitions for TypeScript projects, Automating workflow validation using Zod schemas.

Which IDEs are compatible with rule-schemas?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for rule-schemas?

Requires Zod library. Limited to TypeScript projects with `.ts` files.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add carrot-foundation/methodology-rules/rule-schemas. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use rule-schemas immediately in the current project.

! Reference-Only Mode

This page remains useful for installation and reference, but Killer-Skills no longer treats it as a primary indexable landing page. Read the review above before relying on the upstream repository instructions.

Upstream Repository Material

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

Upstream Source

rule-schemas

Install rule-schemas, an AI agent skill for AI agent workflows and automation. Review the use cases, limitations, and setup path before rollout.

SKILL.md
Readonly
Upstream Repository Material
The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.
Supporting Evidence

Rule schemas

Apply this rule whenever work touches:

  • *.ts

Zod is the runtime validation library for this project. Schemas serve a dual purpose: they validate data at runtime boundaries and provide the canonical type definition via z.infer.

Schema definition

Define schemas close to the types they describe. A common pattern is to export both from the same file:

ts
1import { z } from 'zod'; 2 3export const VehicleSchema = z.object({ 4 plate: z.string().min(7), 5 weightKg: z.number().positive(), 6 type: z.enum(['truck', 'van', 'car']), 7}); 8 9export type Vehicle = z.infer<typeof VehicleSchema>;

Never create a separate interface Vehicle that duplicates the schema shape.

Validation strategy

Choose the right parse method based on the trust level of the data:

ts
1// External input (API payload, S3 object, SQS message) - handle errors 2const result = VehicleSchema.safeParse(rawPayload); 3if (!result.success) { 4 logger.warn('Invalid vehicle payload', result.error.flatten()); 5 return { error: 'INVALID_INPUT' }; 6} 7const vehicle = result.data; 8 9// Internal data (already validated upstream) - let it throw 10const vehicle = VehicleSchema.parse(trustedData);

Schema composition

Reuse schemas through composition rather than copy-pasting fields:

ts
1const BaseDocumentSchema = z.object({ 2 id: z.string().uuid(), 3 createdAt: z.string().datetime(), 4}); 5 6const CertificateSchema = BaseDocumentSchema.extend({ 7 issuer: z.string(), 8 validUntil: z.string().datetime(), 9});

Test data generation

Use zocker and the shared testing utilities to generate test data from schemas:

ts
1import { createStubFromSchema } from '@carrot-fndn/shared/testing'; 2 3const stubVehicle = createStubFromSchema(VehicleSchema);

This ensures test data always conforms to the current schema shape and evolves automatically when the schema changes.

Related Skills

Looking for an alternative to rule-schemas or another community skill for your workflow? Explore these related open-source skills.

View All

openclaw-release-maintainer

Logo of openclaw
openclaw

openclaw-release-maintainer is an AI agent skill for openclaw release maintainer.

333.8k
0
AI

widget-generator

Logo of f
f

Generate customizable widget plugins for the prompts.chat feed system

149.6k
0
AI

flags

Logo of vercel
vercel

flags is an AI agent skill for use this skill when adding or changing framework feature flags in next.js internals.

138.4k
0
Browser

pr-review

Logo of pytorch
pytorch

pr-review is an AI agent skill for pytorch pr review skill.

98.6k
0
Developer