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 1mo 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 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.

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. 1mo 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 (6 stars, last pushed 9d ago), 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

Other skills, from other repositories

climate-generator

Generate Go CLIs from OpenAPI 3.x specs with climate, inspect generated CLIs, and emit Markdown skill prompts so those CLIs can be attached to agent workflows.

disk0Dancer/climate · 39 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

go

Use when writing, reviewing, testing, or shipping Go code and HTTP services: idioms, %w error wrapping, goroutine/context/errgroup concurrency, net/http 1.22 routing, log/slog, project layout, table-driven tests, Go hardening. NOT language-agnostic threat modeling (that is secure-coding), NOT Dockerfile/CI shipping…

ericrisco/rsc-harness · 86 tokens

jwt

Development guide for the jwt JSON Web Token library for Go (github.com/kataras/jwt). Use this skill when signing or verifying JWTs, choosing a signing algorithm (HMAC, RSA, RSA-PSS, ECDSA, EdDSA), reading or validating standard or custom claims, setting expiry and clock-skew tolerance, rotating keys with a kid-based…

kataras/jwt · 107 tokens

functions-development

Build serverless Go or Python functions for Falcon Foundry apps. TRIGGER when user asks to "create a function", "write a serverless function", "build backend logic", runs foundry functions create, or needs help with FDK handler patterns, function testing, or collection integration from functions. Also TRIGGER when…

CrowdStrike/foundry-skills · 195 tokens

go-expert

Expert-level Go development with Go 1.22+ features, concurrency, standard library, and production-grade best practices. Use when the user mentions concurrency, microservices, or backend, or when the task involves idiomatic Go, goroutines and channels, context-based cancellation, or writing an HTTP server.

personamanagmentlayer/pcl · 65 tokens