schema-generator

schema-generator is a command for Claude Code from sigistry/marketplace. It costs 28 tokens per session (3,312 once invoked), scanned A, original, MIT.

A command that creates data schemas and type definitions from existing JSON or CSV files, API responses, or other data structures. A schema describes the fields and types data is expected to contain.

In plain words
What is it for?
Use it to generate JSON Schema, TypeScript interfaces, SQL database definitions, OpenAPI or GraphQL schemas, and Zod or Yup validators.
Why use it?
It reduces manual work when turning sample data into validation rules, type definitions, database designs, or API contracts.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the data-converter plugin — 5 commands shipped together

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.

agentmods
npx agentmods add commands/sigistry/marketplace/schema-generator
Clone the repo
git clone --depth 1 https://github.com/sigistry/marketplace

Made for: Claude Code.

Or install data-converter, the plugin that ships this one along with the rest of its 5 commands.

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 schema-generator

README.md
[![agentmods](https://agentmods.dev/badge/commands/sigistry/marketplace/schema-generator.svg)](https://agentmods.dev/commands/sigistry/marketplace/schema-generator)
Your own site
<a href="https://agentmods.dev/commands/sigistry/marketplace/schema-generator"><img src="https://agentmods.dev/badge/commands/sigistry/marketplace/schema-generator.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,312 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00028 $0.03312
Opus 5 $0.00014 $0.01656
Sonnet 5 $0.00006 $0.00662
Haiku 4.5 $0.00003 $0.00331

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

Security

Grade A, and why

schema-generator 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 3d 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.

plugins/data-converter/commands/schema-generator.md · 477 lines

How it starts

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

You are a schema generation expert. Help users automatically generate schemas, type definitions, and data contracts from existing data files.

Your Task

Generate schemas and type definitions from data:

  • JSON Schema from JSON data
  • TypeScript interfaces from JSON/CSV
  • Database schemas (SQL DDL) from CSV/JSON
  • OpenAPI/Swagger specs from API responses
  • GraphQL schemas from JSON data
  • Zod/Yup validators from data structure

Why Generate Schemas?

  1. Type Safety: Generate TypeScript types from API responses
  2. Validation: Create validation schemas for runtime checks
  3. Documentation: Auto-document data structures
  4. Database Design: Create table schemas from sample data
  5. API Contracts: Generate OpenAPI specs from examples
  6. Code Generation: Use schemas to generate client code

JSON Schema Generation

From JSON Data

function generateJsonSchema(data) {
  function inferType(value) {
    if (value === null) return { type: 'null' };
    if (Array.isArray(value)) {
      return {
        type: 'array',
        items: value.length > 0 ? inferType(value[0]) : { type: 'string' }
      };
    }
    if (typeof value === 'object') {
      return {
        type: 'object',
        properties: Object.fromEntries(
          Object.entries(value).map(([k, v]) => [k, inferType(v)])
        ),
        required: Object.keys(value)
      };
    }
    if (typeof value === 'number') {
      return Number.isInteger(value) ? { type: 'integer' } : { type: 'number' };
    }
    if (typeof value === 'boolean') return { type: 'boolean' };
    if (typeof value === 'string') {
      // Detect formats
      if (/^\d{4}-\d{2}-\d{2}/.test(value)) return { type: 'string', format: 'date-time' };
      if (/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) return { type: 'string', format: 'email' };
      if (/^https?:\/\//.test(value)) return { type: 'string', format: 'uri' };
      return { type: 'string' };
    }
  }

  const schema = {
    $schema: 'http://json-schema.org/draft-07/schema#',
    ...inferType(data)
  };

  return schema;
}

Read the full file on GitHub · 477 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. 3d ago First seen · 477 lines · 28 tokens per session scan A bc7ca67ab29f

Subscribe to this mod's changes

schema-generator is a command published in the GitHub repository sigistry/marketplace (3 stars, last pushed 2d ago), licensed MIT. It adds 28 tokens to every session and 3,312 once invoked, about $0.0001 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-09-03.