One canonical Zod schema per entity, reused across the stack instead of redeclared at each layer.

MITAuto-check passedFrontend & Design

Install Schema Source Of Truth

skills CLI
$ npx skills add TheDecipherist/claude-code-mastery-project-starter-kit --skill schema-source-of-truth -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install TheDecipherist/claude-code-mastery-project-starter-kit schema-source-of-truth --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/TheDecipherist/claude-code-mastery-project-starter-kit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/schema-source-of-truth .claude/skills/schema-source-of-truth && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
schema-source-of-truth
GitHub stars
338
Token cost
~988 tokens
SKILL.md length
369 words
Files
1
Skills in repo
24
Repo updated
First seen
Licence
MIT

At a glance

One canonical Zod schema per entity, reused across the stack instead of redeclared at each layer.

  • Changing a data shape
  • SKILL.md covers One schema per entity, derive…, One base, many variants (they… and Make it physically shared
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • A TypeScript type

What it does

Schema Source Of Truth is an agent skill from TheDecipherist/claude-code-mastery-project-starter-kit. One canonical Zod schema per entity, reused across the stack instead of redeclared at each layer. Use whenever defining or changing a data shape, a TypeScript type or interface for an entity, an API request/response validator, an Express body/query/params check, a frontend form validator, or a DB document shape. Catches the same-entity-defined-four-times drift. TypeScript-first, derive types and per-layer variants from one base instead of hand-writing parallel copies.

Its SKILL.md is about 990 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Frontend & Design, covering Type safety. It works with Zod and TypeScript. The repository describes itself as: The definitive starting point for Claude Code projects. Based on Claude Code Mastery Guides V1-V5. The licence is MIT.

When your agent uses it

  • Changing a data shape
  • A TypeScript type
  • Interface for an entity
  • An API request/response validator

Example prompts

  • “/schema-source-of-truth”

What it can do on your machine

Read from SKILL.md and the folder at commit 61fbb99. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Schema Source Of Truth loads about 988 tokens when it runs. Until then it costs about 124 tokens; SKILL.md has 369 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~124
When it runs · the whole SKILL.md, loaded when a task matches
~988

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from TheDecipherist/claude-code-mastery-project-starter-kit at commit 61fbb99, republished under its MIT licence (© TheDecipherist). 369 words, ~988 tokens.

Download SKILL.mdSave it as .claude/skills/schema-source-of-truth/SKILL.md (or your agent's skills folder).
name
schema-source-of-truth
description
One canonical Zod schema per entity, reused across the stack instead of redeclared at each layer. Use whenever defining or changing a data shape, a TypeScript type or interface for an entity, an API request/response validator, an Express body/query/params check, a frontend form validator, or a DB document shape. Catches the same-entity-defined-four-times drift. TypeScript-first, derive types and per-layer variants from one base instead of hand-writing parallel copies.
when_to_use
- Defining or editing an entity's shape (a User, Order, etc.) in types, an API, a form, or the DB - Writing API request/response validation or Express…

Schema as a Single Source of Truth

A data entity should be defined once, as a Zod schema, and everything else derived from it. The failure pattern to kill: declaring the same entity separately at each layer, a frontend interface User, a backend interface User, a hand-written API validator, and a manual Mongo $jsonSchema. Four shapes for one entity, kept in sync by hand, guaranteed to drift the first time a field is added or renamed.

One schema per entity, derive the rest

Define the canonical schema once and generate every other representation from it:

  • TypeScript type: type User = z.infer<typeof UserSchema>. Never hand-write an interface that parallels a schema, infer it so it can't fall out of sync.
  • API validation: parse req.body / req.query / req.params through the schema in middleware. safeParse and return 400 on failure, no field-by-field if checks.
  • Frontend forms: the same schema drives form validation (zodResolver with react-hook-form), so client and server reject the same inputs by the same rules.
  • Pre-write guard: parse before writing to the DB. See the mongodb-rules skill for the Mongo-specific parse-before-write and $jsonSchema floor.
  • OpenAPI and $jsonSchema: generate them from the schema (zod-to-openapi, zod-to-json-schema) rather than maintaining them by hand.

Zod is TypeScript-first with zero runtime dependencies, so this costs one small library and removes every duplicated definition.

Show full SKILL.md (154 more words)Show less

One base, many variants (they are not identical)

"Same schema everywhere" is the goal, but a create payload is not the stored document and a response is not the request, so don't pretend they're one object. Model it honestly: one base schema, with per-layer variants derived from it, sharing a single origin while differing where they genuinely must.

typescript
const UserSchema = z.object({
  _id: z.string(),
  email: z.string().email(),
  name: z.string().min(1),
  createdAt: z.date(),
});

const CreateUser   = UserSchema.omit({ _id: true, createdAt: true }); // POST body
const UpdateUser   = CreateUser.partial();                            // PATCH body
const UserResponse = UserSchema.extend({ displayName: z.string() });  // adds computed field
type User = z.infer<typeof UserSchema>;

Derive variants with .omit(), .partial(), .pick(), .extend(). When the base gains a field, every variant inherits it automatically, which is the entire point. A hand-copied variant is just the drift problem at smaller scale.

Make it physically shared

Single source of truth only holds if there is literally one file. Put entity schemas in a shared module both sides import, a packages/schemas workspace, or a shared src/schemas/ reachable by frontend and backend. If each side keeps its own copy, they diverge no matter how disciplined the intent. The shared import is the enforcement, not the convention.

© TheDecipherist, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/schema-source-of-truth of TheDecipherist/claude-code-mastery-project-starter-kit.

Open the folder on GitHubat commit 61fbb99

Compare with similar skills

Schema Source Of Truth next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Schema Source Of Truth compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Schema Source Of Truth this skillTheDecipherist/claude-code-mastery-project-starter-kit338—~988Automated safety check: PassMIT
Typescript Patternssoftspark/ai-toolkit179—~1.6kAutomated safety check: PassApache-2.0
Hono Idiomsirahardianto/awesome-agv156—~3kAutomated safety check: PassMIT
Zod Validation Utilitiesgiuseppe-trisciuoglio/developer-kit357—~1.7kAutomated safety check: NotesMIT
Safe Element Comparisonseasonedcc/remix-forms514—~1.8kAutomated safety check: PassMIT
Typed Service Contractsgoogle-labs-code/stitch-sdk1.8k—~1.4kAutomated safety check: PassApache-2.0

Similar skills

  • Typescript Patterns

    softspark/ai-toolkit

    TypeScript types: generics, discriminated unions, Zod, satisfies, branded types.

    179 GitHub stars~1.6k tokensUpdated 2 days ago
    Frontend & DesignAuto-check passed
  • Hono Idioms

    irahardianto/awesome-agv

    Hono lightweight web framework patterns: type-safe route handlers, middleware composition, Zod validation, and RPC clients for Cloudflare Workers, Node, or Bun.

    156 GitHub stars~3k tokensUpdated 6 days ago
    DevelopmentAuto-check passed
  • Zod Validation Utilities

    giuseppe-trisciuoglio/developer-kit

    Creates reusable Zod v4 schemas, validates API payloads, forms, and configuration input, transforms and coerces data safely, and handles validation errors with strong type inference for TypeScript…

    357 GitHub stars~1.7k tokensUpdated 1 mo ago
    Frontend & DesignAuto-check: notes
  • Safe Element Comparison

    seasonedcc/remix-forms

    Maintain element type comparison safety in remix-forms. An agent skill from seasonedcc/remix-forms.

    514 GitHub stars~1.8k tokensUpdated 5 mo ago
    Frontend & DesignAuto-check passed
  • Typed Service Contracts

    google-labs-code/stitch-sdk

    Official

    Architecture standard for building robust, type-safe TypeScript services using the "Spec and Handler" pattern.

    1.8k GitHub stars~1.4k tokensUpdated 10 days ago
    DevelopmentAuto-check passed
  • Frontend Typescript Rules

    shinpr/ai-coding-project-boilerplate

    Applies React/TypeScript type safety, component design, and state management rules.

    234 GitHub stars~1.7k tokensUpdated 7 days ago
    Frontend & DesignAuto-check passed

More from TheDecipherist/claude-code-mastery-project-starter-kit

All 24 skills in this repo
  • Create Service

    TheDecipherist/claude-code-mastery-project-starter-kit

    Scaffold a new microservice that follows the project's server/handlers/adapters architecture.

    338 GitHub stars~1.8k tokensUpdated 3 mo ago
    Auto-check: notes
  • CSS Structure

    TheDecipherist/claude-code-mastery-project-starter-kit

    Where CSS should live. An agent skill from TheDecipherist/claude-code-mastery-project-starter-kit.

    338 GitHub stars~1k tokensUpdated 3 mo ago
    Auto-check passed
  • Docker

    TheDecipherist/claude-code-mastery-project-starter-kit

    Production Docker best practices for writing Dockerfiles, Compose files, and Swarm stacks.

    338 GitHub stars~1.6k tokensUpdated 3 mo ago
    Auto-check: notes
  • Docker Swarm

    TheDecipherist/claude-code-mastery-project-starter-kit

    Production Docker Swarm deployment rules: what changes when a compose file goes from a single node to a multi-node Swarm.

    338 GitHub stars~1.8k tokensUpdated 3 mo ago
    Auto-check passed
  • Mongodb Backups

    TheDecipherist/claude-code-mastery-project-starter-kit

    Production MongoDB backup and restore practices that the documentation gets wrong.

    338 GitHub stars~1.3k tokensUpdated 3 mo ago
    Auto-check passed
  • Mongodb Replica Sets

    TheDecipherist/claude-code-mastery-project-starter-kit

    Production MongoDB replica-set operation: topology, durability, host tuning, and the container-specific gotchas Claude gets wrong.

    338 GitHub stars~1.6k tokensUpdated 3 mo ago
    Auto-check passed

Works with

Questions about Schema Source Of Truth

What does Schema Source Of Truth do?

One canonical Zod schema per entity, reused across the stack instead of redeclared at each layer. Schema Source Of Truth is an agent skill from TheDecipherist/claude-code-mastery-project-starter-kit. One canonical Zod schema per entity, reused across the stack instead of redeclared at each layer.

When should I use Schema Source Of Truth?

Schema Source Of Truth fits situations like: changing a data shape; A TypeScript type; interface for an entity; an API request/response validator.

How do I install Schema Source Of Truth in Claude Code?

Run `npx skills add TheDecipherist/claude-code-mastery-project-starter-kit --skill schema-source-of-truth -a claude-code`. Or copy the skill folder (.claude/skills/schema-source-of-truth in TheDecipherist/claude-code-mastery-project-starter-kit) into .claude/skills/schema-source-of-truth in your project. Claude Code loads it when a task matches its description.

How do I install Schema Source Of Truth in Codex?

Run `npx skills add TheDecipherist/claude-code-mastery-project-starter-kit --skill schema-source-of-truth -a codex`. Or copy the skill folder (.claude/skills/schema-source-of-truth in TheDecipherist/claude-code-mastery-project-starter-kit) into .agents/skills/schema-source-of-truth in your project. Codex loads it when a task matches its description.

Can I use Schema Source Of Truth in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add TheDecipherist/claude-code-mastery-project-starter-kit --skill schema-source-of-truth -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/schema-source-of-truth, .gemini/skills/schema-source-of-truth, .github/skills/schema-source-of-truth and .opencode/skills/schema-source-of-truth in your project.

What does Schema Source Of Truth need to run?

SKILL.md names no scripts, command-line tools or credentials: Schema Source Of Truth is instructions for the agent only.

Does Schema Source Of Truth access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Schema Source Of Truth safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Schema Source Of Truth use?

Schema Source Of Truth is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Schema Source Of Truth use?

About 988 tokens (SKILL.md is roughly 4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Schema Source Of Truth?

Skills that share tags, products or a category with Schema Source Of Truth: Typescript Patterns (softspark/ai-toolkit, 179 stars), Hono Idioms (irahardianto/awesome-agv, 156 stars), Zod Validation Utilities (giuseppe-trisciuoglio/developer-kit, 357 stars) and Safe Element Comparison (seasonedcc/remix-forms, 514 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Schema Source Of Truth?

TheDecipherist (a GitHub user) maintains it in TheDecipherist/claude-code-mastery-project-starter-kit, which has 338 GitHub stars. The repository holds 24 skills in this directory. The repository was last updated on June 29, 2026.

Source: TheDecipherist/claude-code-mastery-project-starter-kit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.