Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/kaptinlin/gozod/schema_implementation_guidegit clone --depth 1 https://github.com/kaptinlin/gozodWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.05523 | $0.05523 |
| Opus 5 | $0.02762 | $0.02762 |
| Sonnet 5 | $0.01105 | $0.01105 |
| Haiku 4.5 | $0.00552 | $0.00552 |
Grade A, and why
schema_implementation_guide scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 645 lines — stays where its author put it; the contents beside it link to each section on GitHub.
GoZod Schema Implementation Guide
A practical reference for building new schema types inside the GoZod code-base.
It targets Cursor AI and human contributors alike: every rule here exists to keep
implementations consistent, type-safe and performant.
This guide is based on the latest patterns from string.go, object.go, and their test counterparts.
1 Core Principles
- Complete Strict Type Semantics – All methods require exact input types, zero automatic conversions. Both
Parse(any)andStrictParse(T)must be implemented. - Zero-overhead abstractions – primitives allocate nothing, composites allocate lazily.
- Unified architecture – every file follows the same 8-section layout so Cursor can pattern-match and extend it.
- Copy-on-Write modifiers – modifiers clone internals; the original instance is immutable.
- Engine-first architecture – All parsing must go through
engine.ParsePrimitiveorengine.ParseComplex. - Mandatory helper packages – never roll your own validation, parsing, coercion or error logic.
2 Type Classification Cheat-Sheet
| Scenario | Architecture | Generic pattern | Example |
|---|---|---|---|
| Native Go value (string / int…) | Single generic + constraint | ZodType[T Constraint] Constraint: T | *T |
Bool, String, Float |
Requires value comparison (==) |
Comparable + dual generic | ZodType[T comparable, R any] |
Enum, Literal |
| Composite / user struct / slice | Dual generic | ZodType[T any, R any] |
Struct, Slice, Map |
Decision flow ▶ Native? → Comparable? → Composite.
3 Mandatory 5-Section File Layout
Every schema file must keep sections in this exact order for consistency:
- TYPE DEFINITIONS – Constraints,
ZodTypeDef,ZodTypeInternals, publicZodType[T] - CORE METHODS –
GetInternals,IsOptional,IsNilable,Parse,StrictParse,MustParse,MustStrictParse,Coerce - MODIFIER METHODS –
Optional,Nilable,Default,Prefault,Overwrite,Transform,Pipe - VALIDATION & REFINEMENT – Type-specific validations (
Min,Max,Email, etc.),Refine,RefineAny,Check - CONSTRUCTORS –
Type(),TypePtr(),CoercedType(), constructor helpers
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 645 lines · 5,523 tokens per session scan A ef80d12e7634
schema_implementation_guide is a cursor rule published in the GitHub repository kaptinlin/gozod (24 stars, last pushed 1mo ago), licensed MIT. It adds 5,523 tokens to every session, about $0.0276 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
typescript
Changes to these high-fan-out internals can affect every message, delta, element, or rerun. Keep work in them minimal, and benchmark changes with representative stress-test apps.
coolify-ai-docs
Master reference to all Coolify AI documentation in .ai/ directory.
python_lib
Tips and guidelines specific to the development of the Streamlit Python library, not applicable to scripts and e2e tests.
specs
This directory contains product and tech specs for Streamlit features.