code-generator

code-generator is a skill for Claude Code from jhlee0409/claude-plugins. It costs 13 tokens per session (2,208 once invoked), scanned A, original, MIT.

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 Code

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

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import type { User, GetUserRequest } from '../model/types'.

Part of the oas plugin — 6 skills, 6 commands shipped together

Good fit Generating API functions, TypeScript types, and, when the project uses them, hooks and related files for selected OpenAPI endpoints.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/jhlee0409/claude-plugins
agentmods
npx agentmods add skills/jhlee0409/claude-plugins/code-generator

Made for: Claude Code.

Or install oas, the plugin that ships this one along with the rest of its 6 skills, 6 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 code-generator

README.md
[![agentmods](https://agentmods.dev/badge/skills/jhlee0409/claude-plugins/code-generator/github.svg)](https://agentmods.dev/skills/jhlee0409/claude-plugins/code-generator)
Your own site
<a href="https://agentmods.dev/skills/jhlee0409/claude-plugins/code-generator"><img src="https://agentmods.dev/badge/skills/jhlee0409/claude-plugins/code-generator/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 code-generator

Your own site · 80×15
<a href="https://agentmods.dev/skills/jhlee0409/claude-plugins/code-generator"><img src="https://agentmods.dev/badge/skills/jhlee0409/claude-plugins/code-generator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. 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.00013 $0.02208
Opus 5.5 $0.00005 $0.00883
Sonnet 5.5 $0.00003 $0.00442
Haiku 4.5 $0.00001 $0.00221

Measured 1mo ago against content hash 7c9824868059, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 9mo ago), licensed MIT. It adds 13 tokens to every session and 2,208 once invoked, about $0.0001 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-31.

Related

Other skills, from other repositories

fastapi

FastAPI best practices and conventions. Use when working with FastAPI APIs, Pydantic models, dependencies, streaming responses including Server-Sent Events (SSE), and serving frontend apps. Keeps FastAPI code clean and up to date with the latest features and patterns.

fastapi/fastapi · 57 tokens

printing-press-amend

Amend a published CLI from one of two input sources: (1) dogfood mode mines the active Claude Code session transcript for friction (missing flags, hand- rolled API payloads, silent-null returns); (2) direct-input mode accepts user-supplied asks (rename a command, add commands or feeds, fix a named bug, optionally…

mvanhorn/cli-printing-press · 222 tokens

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

printing-press

Set up a new integration, connector, or CLI binding for any API. Wrap or generate a ship-ready Go CLI from an OpenAPI, HAR, or Postman spec via the lean research -> generate -> build -> shipcheck loop. Use when the user says build a CLI, wrap this API, set up a new integration, add a connector, integrate with a…

mvanhorn/cli-printing-press · 86 tokens

implementing-api-schema-validation-security

Implement API schema validation using OpenAPI specifications and JSON Schema to enforce input/output contracts and prevent injection, data exposure, and mass assignment attacks.

xalgorix/xalgorix · 35 tokens

emulate-seed

Generate emulate seed configs for stateful API emulation. Wraps Vercel's emulate tool for GitHub, Vercel, Google OAuth, Slack, Apple Auth, Microsoft Entra, AWS, Okta, Clerk, Resend, Stripe, and MongoDB Atlas APIs — full state machines, not mocks. Use when setting up test environments, CI pipelines, integration tests…

yonatangross/orchestkit · 86 tokens