generate-code

generate-code is a skill for Claude Code from erraggy/oastools. It costs 17 tokens per session (526 once invoked), scanned A, original, MIT.

A code generator that creates Go types, HTTP clients, or server interfaces from an OpenAPI specification. OpenAPI is a machine-readable description of an HTTP API, including its endpoints and data shapes.

In plain words
What is it for?
Use it to generate Go models, client methods, or server handler stubs from an OpenAPI file.
Why use it?
It removes the need to manually write repetitive Go code and keeps generated interfaces aligned with the API description.

Skill for Claude Code

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

Part of the oastools plugin — 5 skills, 1 hook shipped together

Good fit Use it to generate Go models, client methods, or server handler stubs from an OpenAPI file.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/erraggy/oastools/generate-code
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 erraggy/oastools --skill generate-code
Clone the repo
git clone --depth 1 https://github.com/erraggy/oastools

Made for: Claude Code.

Or install oastools, the plugin that ships this one along with the rest of its 5 skills, 1 hook.

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 generate-code

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/erraggy/oastools/generate-code"><img src="https://agentmods.dev/badge/skills/erraggy/oastools/generate-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 526 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.00017 $0.00526
Opus 5.5 $0.00007 $0.00210
Sonnet 5.5 $0.00003 $0.00105
Haiku 4.5 $0.00002 $0.00053

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

Security

Grade A, and why

generate-code 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.

plugin/skills/generate-code/SKILL.md · 78 lines

How it starts

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

Generate Code from an OpenAPI Specification

Step 1: Understand the spec

Call parse to get an overview of the API:

{"spec": {"file": "<path>"}}

Report the API title, version, number of operations and schemas. This helps set expectations for what will be generated.

Step 2: Determine what to generate

Ask the user what they need. The generate tool supports three output modes:

Option What it generates
types Go type definitions for all schemas
client HTTP client with methods for each operation (includes types)
server Server interface and handler stubs (includes types)

Also determine:

  • output_dir (required) -- Where to write the generated files
  • package_name (optional, default: api) -- Go package name for the generated code

Step 3: Generate the code

Call the generate tool:

{
  "spec": {"file": "<path>"},
  "client": true,
  "output_dir": "./generated",
  "package_name": "petstore"
}

Step 4: Review the output

The tool returns a manifest of generated files with names and sizes. Review:

  • File list -- Confirm all expected files were created
  • Generated types count -- Matches the schema count from Step 1
  • Generated operations count -- Matches the operation count from Step 1
  • Warnings -- Any issues encountered during generation (unsupported features, naming conflicts)
  • Critical errors -- If success is false, explain what went wrong

Read the generated files and provide a summary of the key types and functions.

Step 5: Suggest integration steps

Based on what was generated, suggest next steps:

For types only:

  • Import the package and use the types in existing code
  • Note any custom types that may need manual adjustment (e.g., interface{} fields)

For client:

  • Show how to initialize the client with a base URL
  • Demonstrate calling one or two key endpoints
  • Note authentication setup if the spec has security schemes

Read the full file on GitHub · 78 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 · 78 lines · 17 tokens per session scan A 7eee37363ee0

Subscribe to this mod's changes

generate-code is a skill published in the GitHub repository erraggy/oastools (7 stars, last pushed today), licensed MIT. It adds 17 tokens to every session and 526 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

generate-code compared with skills from other repositories

generate-code next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
generate-codeerraggy/oastoolsSkill7todayMITA17Claude Code
climate-generatordisk0Dancer/climateSkill64mo agoApache-2.0A39Claude Code, Codex
printing-pressmvanhorn/cli-printing-pressSkill5.1ktodayMITA86Claude Code
goericrisco/rsc-harnessSkill7093d agoMITA86Claude Code, Codex
functions-developmentCrowdStrike/foundry-skillsSkill40yesterdayMITA124Claude Code
structpagesjackielii/structpagesSkill24yesterdayBSD-3-ClauseA154Claude Code
skmtc-lang-goskmtc/skmtcSkill20todayApache-2.0A96Claude Code