code-generator

A code generator that creates API-related files by following patterns already used in the project. It uses detected project structure, sample API and type files, parsed endpoints, and a selected endpoint group.

In plain words
What is it for?
Generating API functions, TypeScript types, and, when the project uses them, hooks and related files for selected OpenAPI endpoints.
Why use it?
It reduces the need to manually reproduce naming, imports, file locations, formatting, and code organization. Generated code is based on existing examples rather than a separate style.

Skill for Claude CodeCodex

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 skills/jhlee0409/claude-plugins/code-generator
Any agent
npx skills add jhlee0409/claude-plugins --skill code-generator
Clone the repo
git clone --depth 1 https://github.com/jhlee0409/claude-plugins

Made for: Claude Code, Codex.

Per session 13 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,208 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 $0.00013 $0.02208
Opus 5 $0.00006 $0.01104
Sonnet 5 $0.00003 $0.00442
Haiku 4.5 $0.00001 $0.00221

Measured 2d ago against content hash 7c9824868059, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-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 2d 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/oas/skills/code-generator/SKILL.md · 352 lines

How it starts

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

Code Generator

Generate API code that perfectly matches your project's existing patterns.

Core Principle: Your code style is the template.


EXECUTION INSTRUCTIONS

When this skill is invoked, Claude MUST perform these steps in order:

Step 1: Receive Inputs

This skill requires:

  1. Detected patterns from pattern-detector skill
  2. Parsed endpoints from openapi-parser skill
  3. Target tag or list of endpoints to generate

Verify all inputs are present before proceeding.

Step 2: Load Sample Code

  1. Read the sample files from detected patterns:

    • samples.api → API function patterns
    • samples.types → Type definition patterns
    • samples.hooks → Hook patterns (if applicable)
  2. For each sample, extract:

    • Import statements
    • Export patterns
    • Function/type structure
    • Naming conventions
    • Code style (quotes, semicolons, indentation)

Step 3: Generate File Paths

Based on detected structure pattern, generate target file paths:

FSD Pattern:

src/entities/{tag}/
├── api/
│   ├── {tag}-api.ts
│   ├── {tag}-api-paths.ts
│   └── {tag}-queries.ts
└── model/
    └── {tag}-types.ts

Feature-based Pattern:

src/features/{tag}/
├── api.ts
├── hooks.ts
└── types.ts

Flat Pattern:

src/api/{tag}/
├── api.ts
├── hooks.ts
└── types.ts

Step 4: Generate Types

For each schema used by target endpoints:

  1. Determine type style from sample (interface vs type)
  2. Generate TypeScript definition:
// If sample uses interface:
export interface User {
  id: string
  name: string
  email?: string  // optional if not in required array
}

// If sample uses type:
export type User = {
  id: string
  name: string
  email?: string
}
  1. Generate Request/Response types:
    • Follow naming convention from sample
    • Examples: GetUserRequest, CreateUserRequest, UserResponse

Step 5: Generate Path Constants

Clone the path constant pattern from sample:

// Sample pattern: function-based
export const USER_PATHS = {
  list: () => '/api/v1/users',
  detail: (id: string) => `/api/v1/users/${id}`,
  create: () => '/api/v1/users',
} as const

// Generated: same pattern for new tag
export const PROJECT_PATHS = {
  list: () => '/api/v1/projects',
  detail: (id: string) => `/api/v1/projects/${id}`,
  create: () => '/api/v1/projects',
} as const

Read the full file on GitHub · 352 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. 2d ago First seen · 352 lines · 13 tokens per session scan A 7c9824868059

Subscribe to this mod's changes

code-generator is a skill published in the GitHub repository jhlee0409/claude-plugins (4 stars, last pushed 7mo ago), licensed MIT. It adds 13 tokens to every session and 2,208 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-08-31.

Related

Other skills, from other repositories

datamodel-code-generator

Use this skill when the user wants Python data models, Pydantic models, dataclasses, TypedDicts, msgspec structs, or type-safe Python classes generated from OpenAPI, AsyncAPI, JSON Schema, GraphQL, JSON/YAML/CSV sample data, MCP tool schemas, Protocol Buffers, XML Schema, Apache Avro, or existing Python model objects.…

koxudaxi/datamodel-code-generator · 147 tokens

preserved_skill

previous skill.

koxudaxi/datamodel-code-generator · 0 tokens

performing-api-fuzzing-with-restler

Uses Microsoft RESTler to perform stateful REST API fuzzing by automatically generating and executing test sequences that exercise API endpoints, discover producer-consumer dependencies between requests, and find security and reliability bugs. The tester compiles an OpenAPI specification into a RESTler fuzzing…

xalgorix/xalgorix · 123 tokens

ideogram-ultra

Build Ideogram 4 (Ideogram Ultra) txt2img and img2img workflows with the local open-weights model, dual conditional/unconditional models with DualModelGuider, Qwen3-VL text encoder, and structured JSON ("compositional deconstruction") prompts for strong text rendering and layout control.

artokun/comfyui-mcp · 68 tokens

model-compatibility

Model family compatibility matrix covering loaders, resolutions, samplers, CFG, VAE, ControlNet, and LoRA compatibility for SD 1.5, SDXL, Flux, SD3, and video models.

artokun/comfyui-mcp · 47 tokens

flux-txt2img

Build Flux txt2img workflows with Flux.1 Dev (SRPO), Flux 2 Klein 9B, Turbo LoRAs, FluxGuidance, and DualCLIPLoader patterns.

artokun/comfyui-mcp · 44 tokens