typed-templates

typed-templates is a skill for Claude Code, Codex from stephansama/packages. It costs 83 tokens per session (1,528 once invoked), scanned A, original, MIT.

A tool for checking Handlebars templates against defined data schemas. Handlebars is a template format that inserts data into text, while a schema describes the data's expected shape.

In plain words
What is it for?
It helps validate and compile templates with either separate data rules for each template or one shared rule set.
Why use it?
It catches mismatched template fields while developing and checks the supplied data before rendering output.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps validate and compile templates with either separate data rules for each template or one shared rule set.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/stephansama/packages/typed-templates
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.

Any agent
npx skills add stephansama/packages --skill typed-templates
Clone the repo
git clone --depth 1 https://github.com/stephansama/packages

Made for: Claude Code, Codex.

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 typed-templates

README.md
[![agentmods](https://agentmods.dev/badge/skills/stephansama/packages/typed-templates.svg)](https://agentmods.dev/skills/stephansama/packages/typed-templates)
Your own site
<a href="https://agentmods.dev/skills/stephansama/packages/typed-templates"><img src="https://agentmods.dev/badge/skills/stephansama/packages/typed-templates.svg" alt="Measured on agentmods" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,528 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.00083 $0.01528
Opus 5 $0.00042 $0.00764
Sonnet 5 $0.00017 $0.00306
Haiku 4.5 $0.00008 $0.00153

Measured 7d ago against content hash faa12e3b62f9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

typed-templates 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 7d 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.

core/typed-templates/skills/typed-templates/SKILL.md · 214 lines

How it starts

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

typed-templates

Schema-validated Handlebars template compilation. audit() verifies template slot names match the schema at authoring time. compile(key, data) validates data at runtime then renders.

Choosing the right factory

Scenario Use
Each template has a different data shape createHandlebarSchemaMap
Multiple templates share the same data shape createHandlebarSchemaSingleton

Setup

import * as z from "zod";
import {
  createHandlebarSchemaMap,
  getFileContext,
} from "@stephansama/typed-templates";

const { isLinting, templateDirectory } = getFileContext(import.meta.url);

export const templates = createHandlebarSchemaMap(
  {
    greeting: {
      path: "greeting.hbs",
      schema: z.object({ name: z.string() }),
    },
  },
  { templateDirectory },
);

if (isLinting()) await templates.audit();

getFileContext(import.meta.url) resolves templateDirectory to the directory of the current file — not the working directory. isLinting() returns true only when this file is run directly (e.g. node ./templates.ts), preventing audit() from running on every import.

Core Patterns

Compile a template

const output = await templates.compile("greeting", { name: "Alice" });
// data is validated against the schema before compilation

Singleton: one schema, multiple templates

import * as z from "zod";
import {
  createHandlebarSchemaSingleton,
  getFileContext,
} from "@stephansama/typed-templates";

const { isLinting, templateDirectory } = getFileContext(import.meta.url);

const itemSchema = z.object({
  items: z.array(z.object({ key: z.string(), value: z.string() })),
});

export const itemTemplates = createHandlebarSchemaSingleton(
  ["list.hbs", "table.hbs"],
  itemSchema,
  { templateDirectory },
);

if (isLinting()) await itemTemplates.audit();

const output = await itemTemplates.compile("list.hbs", {
  items: [{ key: "a", value: "1" }],
});

Read the full file on GitHub · 214 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. 7d ago First seen · 214 lines · 83 tokens per session scan A faa12e3b62f9

Subscribe to this mod's changes

typed-templates is a skill published in the GitHub repository stephansama/packages (5 stars, last pushed 1mo ago), licensed MIT. It adds 83 tokens to every session and 1,528 once invoked, about $0.0004 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-31.

Related

Other skills, from other repositories

opendia-harness

Install, configure, and troubleshoot OpenDia for Grok Build (and other MCP harnesses). Use when setting up the plugin, config.toml MCP entry, ports, extension disconnects, tool timeouts, or tunnel mode.

aeonfun/opendia · 52 tokens

opendia

Drive the user's real browser through OpenDia MCP (logged-in sessions, cookies, wallets, bookmarks, history). Use when automating Chrome/Firefox for social posts, form fills, multi-tab research, local webapp testing, or any task that needs the user's existing browser profile — not a disposable cloud browser.

aeonfun/opendia · 66 tokens

npm-security

Prevent JavaScript/TypeScript projects from supply-chain attacks across package managers like npm, pnpm, yarn, bun, and deno. Use whenever planning, installing, updating packages or configuring package managers.

bodadotsh/npm-security-best-practices · 43 tokens

frontmcp-extensibility

Use when extending FrontMCP beyond the core SDK by integrating external npm packages, libraries, or third-party services into providers and tools. Covers VectoriaDB for in-memory semantic and vector search (ML-based embeddings or TF-IDF keyword engines, with persistence) and the tamper-evident, hash-chained skill…

agentfront/frontmcp · 124 tokens

huly-cli

Operate Huly through the @firfi/huly-cli executable. Use when a coding agent needs to authenticate, switch Huly workspaces or projects, discover commands, query structured Huly data, or perform confirmed Huly mutations from a shell or automation workflow.

dearlordylord/huly-mcp · 56 tokens

javascript-expert

Expert-level JavaScript development with modern ES2024+ features, Node.js, npm ecosystem, and best practices. Use when the user mentions ECMAScript, ES2024, Node.js, npm, or web, or when the task involves Modern JavaScript, Node.js Development, Modern Tooling, or Functional Programming.

personamanagmentlayer/pcl · 69 tokens