checks_implementation_guide

checks_implementation_guide is a cursor rule for Cursor from kaptinlin/gozod. It costs 2,843 tokens per session, scanned A, original, MIT.

An implementation guide for adding validation checks to the GoZod library, a Go library for checking whether data matches expected rules. It describes factory functions, JSON Schema metadata, shared validation logic, and error handling.

In plain words
What is it for?
Use it when implementing or reviewing GoZod checks, connecting checks to JSON Schema, reusing the validation package, and designing their errors.
Why use it?
It reduces inconsistent check implementations and duplicated validation code. It also helps new checks fit the library’s existing architecture and schema output.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc). Also seen: installed under .agents/ (shared by several agents).

Good fit Use it when implementing or reviewing GoZod checks, connecting checks to JSON Schema, reusing the validation package, and designing their errors.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/kaptinlin/gozod/checks_implementation_guide
Install

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.

Clone the repo
git clone --depth 1 https://github.com/kaptinlin/gozod

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for checks_implementation_guide

README.md
[![agentmods](https://agentmods.dev/badge/rules/kaptinlin/gozod/checks_implementation_guide/github.svg)](https://agentmods.dev/rules/kaptinlin/gozod/checks_implementation_guide)
Your own site
<a href="https://agentmods.dev/rules/kaptinlin/gozod/checks_implementation_guide"><img src="https://agentmods.dev/badge/rules/kaptinlin/gozod/checks_implementation_guide/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for checks_implementation_guide

Your own site · 80×15
<a href="https://agentmods.dev/rules/kaptinlin/gozod/checks_implementation_guide"><img src="https://agentmods.dev/badge/rules/kaptinlin/gozod/checks_implementation_guide.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,843 This file is loaded in full into every session.
When invoked 2,843 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5.1 $0.02843 $0.02843
Opus 5.5 $0.01137 $0.01137
Sonnet 5.5 $0.00569 $0.00569
Haiku 4.5 $0.00284 $0.00284

Measured 1mo ago against content hash 08231e883283, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

checks_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 1mo 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.

.agents/rules/checks_implementation_guide.mdc · 396 lines

How it starts

The opening of the file, as written. The whole thing — 396 lines — stays where its author put it; the contents beside it link to each section on GitHub.

GoZod Checks Implementation Guide

📋 Overview

This document provides implementation guidelines for GoZod validation checks based on the current architecture. All checks follow a unified factory function pattern that directly creates core.ZodCheckInternals instances with optional JSON Schema support.

🎯 Core Design Principles

1. Factory Function Pattern

  • All check functions return core.ZodCheck interface
  • Direct creation of core.ZodCheckInternals instances
  • No wrapper types or unnecessary abstractions

2. JSON Schema Integration

  • OnAttach callbacks for metadata generation
  • Automatic constraint merging for compatible properties
  • Type-appropriate attribute mapping

3. Validation Reuse

  • Leverage pkg/validate package for actual validation logic
  • Avoid duplicating validation implementations
  • Focus on error handling and schema generation

🏗️ Current Architecture

Core Types (from core package)

// ZodCheck interface - implemented by ZodCheckInternals
type ZodCheck interface {
    GetZod() *ZodCheckInternals
}

// ZodCheckInternals - the main check implementation
type ZodCheckInternals struct {
    Def      *ZodCheckDef                     // Check definition
    Check    func(payload *ParsePayload)      // Validation function  
    OnAttach []func(any)                     // JSON Schema callbacks
    When     func(payload *ParsePayload) bool // Conditional execution
}

// ZodCheckDef - check metadata
type ZodCheckDef struct {
    Check  string                // Check type identifier
    Params map[string]any        // Check parameters
    Error  *ZodErrorMap         // Custom error mapping
}

Helper Functions (from internal/checks/checks.go)

// normalizeParams - standardize string parameters to error maps
func normalizeParams(def *ZodCheckDef, params []string)

// setBagProperty - set JSON Schema property
func setBagProperty(schema any, key string, value any)

// mergeConstraint - merge constraints with conflict resolution
func mergeConstraint(schema any, key string, value any, merge func(old, new any) any)

// mergeMinimumConstraint/mergeMaximumConstraint - boundary constraint merging
func mergeMinimumConstraint(schema any, value any, inclusive bool)
func mergeMaximumConstraint(schema any, value any, inclusive bool)

Read the full file on GitHub · 396 lines

Changes

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.

  1. 1mo ago First seen · 396 lines · 2,843 tokens per session scan A 08231e883283

Subscribe to this mod's changes

checks_implementation_guide is a cursor rule published in the GitHub repository kaptinlin/gozod (25 stars, last pushed 2mo ago), licensed MIT. It adds 2,843 tokens to every session, about $0.0114 per session on Opus 5.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.