project-structure

project-structure is a cursor rule for Cursor from kaptinlin/gozod. It costs 0 tokens per session (2,688 once invoked), scanned A, original, MIT.

A folder and package layout for GoZod, a Go library that checks whether data matches expected shapes, modeled after Zod v4. It separates parsing, checks, errors, translation, and JSON Schema conversion.

In plain words
What is it for?
Use it when adding or locating GoZod schemas, validation checks, error handling, localization, coercion, examples, or JSON Schema conversion.
Why use it?
It keeps related code in predictable places and separates responsibilities, making the library easier to extend and maintain.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc). Also seen: mentions CLAUDE.md; mentions Claude Code; installed under .agents/ (shared by several agents).

Good fit Use it when adding or locating GoZod schemas, validation checks, error handling, localization, coercion, examples, or JSON Schema conversion.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/kaptinlin/gozod/project-structure
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 project-structure

README.md
[![agentmods](https://agentmods.dev/badge/rules/kaptinlin/gozod/project-structure/github.svg)](https://agentmods.dev/rules/kaptinlin/gozod/project-structure)
Your own site
<a href="https://agentmods.dev/rules/kaptinlin/gozod/project-structure"><img src="https://agentmods.dev/badge/rules/kaptinlin/gozod/project-structure/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 project-structure

Your own site · 80×15
<a href="https://agentmods.dev/rules/kaptinlin/gozod/project-structure"><img src="https://agentmods.dev/badge/rules/kaptinlin/gozod/project-structure.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 2,688 The whole file, excluding the scripts and references it only reads on demand.
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.00000 $0.02688
Opus 5.5 $0.00000 $0.01075
Sonnet 5.5 $0.00000 $0.00538
Haiku 4.5 $0.00000 $0.00269

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

Security

Grade A, and why

project-structure 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/project-structure.mdc · 257 lines

How it starts

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

GoZod Project Structure & File Organization Guide


1. Design Goals & Philosophy

GoZod follows a type-safe, layered architecture that mirrors the API surface of Zod v4 while embracing Go idioms:

  1. Input-Output Symmetry – every schema returns the same type it accepts after validation/coercion.
  2. Unified Wrapper Pattern – optional / nilable / default / prefault wrappers share the same internal contract.
  3. Strict Separation of Concerns – parsing, checking, issue creation, error formatting and i18n each live in their own packages.
  4. Composable Validation Pipeline – checks are first-class citizens that can be merged, cloned and reused.
  5. Compatibility First – public API names and ergonomics track Zod whenever practical.

2. Layered Architecture

go module gozod
├── bin/         # Build outputs and tools
├── coerce/      # Root-level coercion utilities
├── core/        # Foundation contracts (no concrete logic)
├── docs/        # Documentation and guides
├── examples/    # Example implementations and usage
├── internal/    # Private runtime (engine, checks, issues, utils)
├── jsonschema/  # JSON Schema conversion (to/from)
├── locales/     # Built-in i18n bundles
├── pkg/         # Re-usable, reflection-free helpers (zero deps)
└── types/       # Public schema implementations (String, Array, …)

2.1 One-Way Dependency Rule

graph TD;
  core --> internal;
  core --> pkg;
  pkg  --> internal;
  internal --> types;
  core --> types;
  internal --> locales;
  types --> locales;
  coerce --> types;
  coerce --> internal;

types never import each other; all cross-type logic lives in internal, pkg, or coerce.


3. Directory Reference

3.1 Root Level Files

File Purpose
gozod.go Main entry point re-exporting all types, constructors, and JSON Schema conversion from subpackages
gozod_test.go Integration tests for the main API
gozod_tags_test.go Tests for struct tag validation
gozod_circular_test.go Tests for circular reference handling
metadata_test.go Tests for metadata/registry functionality
CLAUDE.md Project instructions for Claude Code AI assistant
Makefile Build automation and common tasks

Read the full file on GitHub · 257 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 · 257 lines · 0 tokens per session scan A 939617de472b

Subscribe to this mod's changes

project-structure is a cursor rule published in the GitHub repository kaptinlin/gozod (25 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,688 tokens. 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.