Typescript Patterns
softspark/ai-toolkit
TypeScript types: generics, discriminated unions, Zod, satisfies, branded types.
Agent skill
by TheDecipherist in TheDecipherist/claude-code-mastery-project-starter-kit
One canonical Zod schema per entity, reused across the stack instead of redeclared at each layer.
$ npx skills add TheDecipherist/claude-code-mastery-project-starter-kit --skill schema-source-of-truth -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install TheDecipherist/claude-code-mastery-project-starter-kit schema-source-of-truth --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ 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-srcUse ~/.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/
Install the "schema-source-of-truth" agent skill from https://github.com/TheDecipherist/claude-code-mastery-project-starter-kit/tree/main/.claude/skills/schema-source-of-truth into .claude/skills/schema-source-of-truth/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "schema-source-of-truth", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/TheDecipherist/claude-code-mastery-project-starter-kit/tree/main/.claude/skills/schema-source-of-truthType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add TheDecipherist/claude-code-mastery-project-starter-kit --skill schema-source-of-truth -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install TheDecipherist/claude-code-mastery-project-starter-kit schema-source-of-truth --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/TheDecipherist/claude-code-mastery-project-starter-kit.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/skills/schema-source-of-truth .agents/skills/schema-source-of-truth && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "schema-source-of-truth" agent skill from https://github.com/TheDecipherist/claude-code-mastery-project-starter-kit/tree/main/.claude/skills/schema-source-of-truth into .agents/skills/schema-source-of-truth/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "schema-source-of-truth", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add TheDecipherist/claude-code-mastery-project-starter-kit --skill schema-source-of-truth -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install TheDecipherist/claude-code-mastery-project-starter-kit schema-source-of-truth --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/TheDecipherist/claude-code-mastery-project-starter-kit.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/skills/schema-source-of-truth .cursor/skills/schema-source-of-truth && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "schema-source-of-truth" agent skill from https://github.com/TheDecipherist/claude-code-mastery-project-starter-kit/tree/main/.claude/skills/schema-source-of-truth into .cursor/skills/schema-source-of-truth/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "schema-source-of-truth", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/TheDecipherist/claude-code-mastery-project-starter-kit.git --path .claude/skills/schema-source-of-truth--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add TheDecipherist/claude-code-mastery-project-starter-kit --skill schema-source-of-truth -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install TheDecipherist/claude-code-mastery-project-starter-kit schema-source-of-truth --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/TheDecipherist/claude-code-mastery-project-starter-kit.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/skills/schema-source-of-truth .gemini/skills/schema-source-of-truth && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "schema-source-of-truth" agent skill from https://github.com/TheDecipherist/claude-code-mastery-project-starter-kit/tree/main/.claude/skills/schema-source-of-truth into .gemini/skills/schema-source-of-truth/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "schema-source-of-truth", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install TheDecipherist/claude-code-mastery-project-starter-kit schema-source-of-truthInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add TheDecipherist/claude-code-mastery-project-starter-kit --skill schema-source-of-truth -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/TheDecipherist/claude-code-mastery-project-starter-kit.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/skills/schema-source-of-truth .github/skills/schema-source-of-truth && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "schema-source-of-truth" agent skill from https://github.com/TheDecipherist/claude-code-mastery-project-starter-kit/tree/main/.claude/skills/schema-source-of-truth into .github/skills/schema-source-of-truth/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "schema-source-of-truth", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add TheDecipherist/claude-code-mastery-project-starter-kit --skill schema-source-of-truth -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install TheDecipherist/claude-code-mastery-project-starter-kit schema-source-of-truth --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/TheDecipherist/claude-code-mastery-project-starter-kit.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/skills/schema-source-of-truth .opencode/skills/schema-source-of-truth && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "schema-source-of-truth" agent skill from https://github.com/TheDecipherist/claude-code-mastery-project-starter-kit/tree/main/.claude/skills/schema-source-of-truth into .opencode/skills/schema-source-of-truth/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "schema-source-of-truth", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
schema-source-of-truthOne 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. 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.
Read from SKILL.md and the folder at commit 61fbb99. It shows what the files ask for, not the result of running them.
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.
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.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
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.
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.
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.
The full file from TheDecipherist/claude-code-mastery-project-starter-kit at commit 61fbb99, republished under its MIT licence (© TheDecipherist). 369 words, ~988 tokens.
.claude/skills/schema-source-of-truth/SKILL.md (or your agent's skills folder).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.
Define the canonical schema once and generate every other representation from it:
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.req.body / req.query / req.params through the schema in middleware. safeParse and return 400 on failure, no field-by-field if checks.zodResolver with react-hook-form), so client and server reject the same inputs by the same rules.mongodb-rules skill for the Mongo-specific parse-before-write and $jsonSchema floor.$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.
"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.
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.
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
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
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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Schema Source Of Truth this skillTheDecipherist/claude-code-mastery-project-starter-kit | 338 | — | ~988 | Automated safety check: Pass | MIT | |
| Typescript Patternssoftspark/ai-toolkit | 179 | — | ~1.6k | Automated safety check: Pass | Apache-2.0 | |
| Hono Idiomsirahardianto/awesome-agv | 156 | — | ~3k | Automated safety check: Pass | MIT | |
| Zod Validation Utilitiesgiuseppe-trisciuoglio/developer-kit | 357 | — | ~1.7k | Automated safety check: Notes | MIT | |
| Safe Element Comparisonseasonedcc/remix-forms | 514 | — | ~1.8k | Automated safety check: Pass | MIT | |
| Typed Service Contractsgoogle-labs-code/stitch-sdk | 1.8k | — | ~1.4k | Automated safety check: Pass | Apache-2.0 |
softspark/ai-toolkit
TypeScript types: generics, discriminated unions, Zod, satisfies, branded types.
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.
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…
seasonedcc/remix-forms
Maintain element type comparison safety in remix-forms. An agent skill from seasonedcc/remix-forms.
google-labs-code/stitch-sdk
Architecture standard for building robust, type-safe TypeScript services using the "Spec and Handler" pattern.
shinpr/ai-coding-project-boilerplate
Applies React/TypeScript type safety, component design, and state management rules.
TheDecipherist/claude-code-mastery-project-starter-kit
Scaffold a new microservice that follows the project's server/handlers/adapters architecture.
TheDecipherist/claude-code-mastery-project-starter-kit
Where CSS should live. An agent skill from TheDecipherist/claude-code-mastery-project-starter-kit.
TheDecipherist/claude-code-mastery-project-starter-kit
Production Docker best practices for writing Dockerfiles, Compose files, and Swarm stacks.
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.
TheDecipherist/claude-code-mastery-project-starter-kit
Production MongoDB backup and restore practices that the documentation gets wrong.
TheDecipherist/claude-code-mastery-project-starter-kit
Production MongoDB replica-set operation: topology, durability, host tuning, and the container-specific gotchas Claude gets wrong.
Works with
Categories
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.
Schema Source Of Truth fits situations like: changing a data shape; A TypeScript type; interface for an entity; an API request/response validator.
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.
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.
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.
SKILL.md names no scripts, command-line tools or credentials: Schema Source Of Truth is instructions for the agent only.
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.
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.
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.
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.
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.
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.