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

v1.0.0

关于此技能

非常适合需要强大的运行时验证和规范类型定义的TypeScript Agents。 本地化技能摘要: Rule mapping for schemas # Rule schemas Apply this rule whenever work touches: .ts Zod is the runtime validation library for this project. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

功能特性

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),

# 核心主题

carrot-foundation carrot-foundation
[3]
[0]
更新于: 3/18/2026

技能概览

先看适用场景、限制条件和安装路径,再决定是否继续深入。

非常适合需要强大的运行时验证和规范类型定义的TypeScript Agents。 本地化技能摘要: Rule mapping for schemas # Rule schemas Apply this rule whenever work touches: .ts Zod is the runtime validation library for this project. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

核心价值

赋予代理人使用Zod确保数据完整性和自动化工作流的能力,提供运行时验证和类型推断通过`z.infer`用于`.ts`文件。

适用 Agent 类型

非常适合需要强大的运行时验证和规范类型定义的TypeScript Agents。

赋予的主要能力 · rule-schemas

验证运行时边界的数据
为TypeScript项目生成规范类型定义
使用Zod模式自动化工作流验证

! 使用限制与门槛

  • 需要Zod库
  • 仅限于具有`.ts`文件的TypeScript项目

关于来源内容

The section below comes from the upstream repository. Use it as supporting material alongside the fit, use-case, and installation summary on this page.

实验室 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

rule-schemas 是什么?

非常适合需要强大的运行时验证和规范类型定义的TypeScript Agents。 本地化技能摘要: Rule mapping for schemas # Rule schemas Apply this rule whenever work touches: .ts Zod is the runtime validation library for this project. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

如何安装 rule-schemas?

运行命令:npx killer-skills add carrot-foundation/methodology-rules/rule-schemas。支持 Cursor、Windsurf、VS Code、Claude Code 等 19+ IDE/Agent。

rule-schemas 适用于哪些场景?

典型场景包括:验证运行时边界的数据、为TypeScript项目生成规范类型定义、使用Zod模式自动化工作流验证。

rule-schemas 支持哪些 IDE 或 Agent?

该技能兼容 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。可使用 Killer-Skills CLI 一条命令通用安装。

rule-schemas 有哪些限制?

需要Zod库;仅限于具有`.ts`文件的TypeScript项目。

安装步骤

  1. 1. 打开终端

    在你的项目目录中打开终端或命令行。

  2. 2. 执行安装命令

    运行:npx killer-skills add carrot-foundation/methodology-rules/rule-schemas。CLI 会自动识别 IDE 或 AI Agent 并完成配置。

  3. 3. 开始使用技能

    rule-schemas 已启用,可立即在当前项目中调用。

! 来源说明

此页面仍可作为安装与查阅参考。继续使用前,请结合上方适用场景、限制条件和上游仓库说明一起判断。

Upstream Repository Material

The section below comes from the upstream repository. Use it as supporting material alongside the fit, use-case, and installation summary on this page.

Upstream Source

rule-schemas

安装 rule-schemas,这是一款面向AI agent workflows and automation的 AI Agent Skill。查看功能、使用场景、限制条件与安装命令。

SKILL.md
Readonly
Upstream Repository Material
The section below comes from the upstream repository. Use it as supporting material alongside the fit, use-case, and installation summary on this page.
Upstream Source

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.

相关技能

寻找 rule-schemas 的替代方案 (Alternative) 或可搭配使用的同类 community Skill?探索以下相关开源技能。

查看全部

openclaw-release-maintainer

Logo of openclaw
openclaw

本地化技能摘要: 🦞 # OpenClaw Release Maintainer Use this skill for release and publish-time workflow. It covers ai, assistant, crustacean workflows. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

333.8k
0
AI

widget-generator

Logo of f
f

本地化技能摘要: Generate customizable widget plugins for the prompts.chat feed system # Widget Generator Skill This skill guides creation of widget plugins for prompts.chat . It covers ai, artificial-intelligence, awesome-list workflows. This AI agent skill supports Claude Code, Cursor, and Windsurf

149.6k
0
AI

flags

Logo of vercel
vercel

本地化技能摘要: The React Framework # Feature Flags Use this skill when adding or changing framework feature flags in Next.js internals. It covers blog, browser, compiler workflows. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

138.4k
0
浏览器

pr-review

Logo of pytorch
pytorch

本地化技能摘要: Usage Modes No Argument If the user invokes /pr-review with no arguments, do not perform a review . It covers autograd, deep-learning, gpu workflows. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

98.6k
0
开发者工具