directives

directives is a skill for Claude Code, Codex from vercel-labs/json-render. It costs 70 tokens per session (1,759 once invoked), scanned A, original, Apache-2.0.

A collection of ready-made rules for changing values in JSON-based interface descriptions, including formatting, calculations, text operations, counting, and translation. These rules can be added to a component catalog and used by the renderer.

In plain words
What is it for?
Use it to format values, perform math, join or shorten text, count items, choose singular or plural wording, and translate text with internationalisation rules.
Why use it?
It avoids writing common value transformations yourself and helps generated interface descriptions handle display text and simple calculations consistently.

Skill for Claude CodeCodex ✓ vendor

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

Good fit Use it to format values, perform math, join or shorten text, count items, choose singular or plural wording, and translate text with internationalisation rules.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vercel-labs/json-render/directives
About the project

json-render is a framework where AI produces user interfaces as structured JSON constrained by a developer-defined component catalogue. It is for building dynamic interfaces from natural-language prompts across web and mobile frameworks.

vercel-labs/json-render · 19,939 stars · on GitHub · json-render.dev

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 vercel-labs/json-render --skill directives
Clone the repo
git clone --depth 1 https://github.com/vercel-labs/json-render

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 directives

README.md
[![agentmods](https://agentmods.dev/badge/skills/vercel-labs/json-render/directives/github.svg)](https://agentmods.dev/skills/vercel-labs/json-render/directives)
Your own site
<a href="https://agentmods.dev/skills/vercel-labs/json-render/directives"><img src="https://agentmods.dev/badge/skills/vercel-labs/json-render/directives/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 directives

Your own site · 80×15
<a href="https://agentmods.dev/skills/vercel-labs/json-render/directives"><img src="https://agentmods.dev/badge/skills/vercel-labs/json-render/directives.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,759 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. Third-party audits
  • Socket pass 14 Sept 2026
  • Snyk pass 14 Sept 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00070 $0.01759
Opus 5.5 $0.00028 $0.00704
Sonnet 5.5 $0.00014 $0.00352
Haiku 4.5 $0.00007 $0.00176

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

Security

Grade A, and why

directives 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 3mo 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.

skills/directives/SKILL.md · 206 lines

How it starts

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

@json-render/directives

Pre-built custom directives for @json-render/core. Drop them into your catalog and renderer to add formatting, math, string manipulation, and i18n.

Quick Start

import { standardDirectives } from '@json-render/directives';

// Wire into prompt generation
const prompt = catalog.prompt({ directives: standardDirectives });

// Wire into the renderer (React example)
import { JSONUIProvider, Renderer } from '@json-render/react';

<JSONUIProvider registry={registry} directives={standardDirectives}>
  <Renderer spec={spec} registry={registry} />
</JSONUIProvider>

To add factory directives like createI18nDirective, spread the array:

import { standardDirectives, createI18nDirective } from '@json-render/directives';

const directives = [...standardDirectives, createI18nDirective(config)];

Defining Custom Directives

Use defineDirective from @json-render/core:

import { defineDirective, resolvePropValue } from '@json-render/core';
import { z } from 'zod';

const doubleDirective = defineDirective({
  name: '$double',
  description: 'Double a numeric value.',
  schema: z.object({
    $double: z.unknown(),
  }),
  resolve(value, ctx) {
    const resolved = resolvePropValue(value.$double, ctx);
    return (resolved as number) * 2;
  },
});

Rules:

  • Name must start with $
  • Name must not conflict with built-in keys ($state, $cond, $computed, $template, $item, $index, $bindState, $bindItem)
  • Resolvers should call resolvePropValue on sub-values to support composition

Built-in Directives

$format — Locale-aware value formatting

Formats values using Intl formatters. Supports date, currency, number, and percent.

{ "$format": "currency", "value": { "$state": "/cart/total" }, "currency": "USD" }
{ "$format": "date", "value": { "$state": "/user/createdAt" } }
{ "$format": "number", "value": 1234567, "notation": "compact" }
{ "$format": "percent", "value": 0.75 }
{ "$format": "date", "value": { "$state": "/post/createdAt" }, "style": "relative" }

Read the full file on GitHub · 206 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. 3mo ago First seen · 206 lines · 70 tokens per session scan A af32f33e68b7

Subscribe to this mod's changes

directives is a skill published in the GitHub repository vercel-labs/json-render (19,939 stars, last pushed 9d ago), licensed Apache-2.0. It adds 70 tokens to every session and 1,759 once invoked, about $0.0003 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.

Related

directives compared with skills from other repositories

directives next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
directivesvercel-labs/json-renderSkill20k9d agoApache-2.0A70Claude Code, Codex
intl-expansionalirezarezvani/claude-skillsSkill31kyesterdayMITA27Claude Code
chinese-documentationjnMetaCode/superpowers-zhSkill8.6kyesterdayMITA62Claude Code
azure-ai-translation-text-pymicrosoft/skillsSkill3.3kyesterdayMITA60Claude Code
hardenfengshao1227/ccg-workflowSkill6.0k13d agoMITA62Claude Code
edit-sitemicrosoft/power-platform-skillsSkill1.2ktodayMITA104Claude Code
asc-subscription-localizationrorkai/app-store-connect-cli-skillsSkill1.2k2d agoMITA60Claude Code