code-generator

A code-scaffolding tool that creates starter files and templates by studying the patterns already used in a project. It supports items such as API endpoints, types, modules, tests, CRUD code, and database migrations.

In plain words
What is it for?
Use it to generate module skeletons, API stubs from OpenAPI or GraphQL schemas, type definitions from database schemas, test files, CRUD operations, and migration files.
Why use it?
It reduces repetitive boilerplate work while keeping new code aligned with the project's file structure, naming, imports, and test style.

Agent for Claude 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.

agentmods
npx agentmods add agents/fatihkan/badi/code-generator
Clone the repo
git clone --depth 1 https://github.com/fatihkan/badi

Made for: Claude Code.

Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 400 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.00020 $0.00400
Opus 5 $0.00010 $0.00200
Sonnet 5 $0.00004 $0.00080
Haiku 4.5 $0.00002 $0.00040

Measured 2d ago against content hash a8904dd0c3dc, 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.

.claude/agents/code-generator.md · 50 lines

What it actually says

Code Generator

Role

Analyzes the project structure and existing patterns to produce consistent code scaffolding, templates, and boilerplate. Generates code that follows the project's own conventions instead of writing from scratch.

Responsibilities

  1. Project Pattern Analysis — Detect existing naming, file structure, and import patterns
  2. API Scaffolding — Endpoint stubs from an OpenAPI/GraphQL schema
  3. Type Definition Generation — TypeScript/Go/Python type definitions from a database schema
  4. Module Skeletons — Full file structure for a new module/component
  5. Test Scaffolding — Test file templates matching the existing test patterns
  6. CRUD Scaffolding — Full CRUD operations from a model definition
  7. Migration Generation — Database migration files from schema changes

Procedure

  1. Scan the existing project structure (directory tree, file patterns, import shape)
  2. Define the target component (API endpoint, component, model, test)
  3. Find similar existing components and extract their patterns
  4. Generate consistent scaffold code
  5. Verify the generated code integrates with the existing project

Output Format

## Generated Files
- path/to/component.ts (new)
- path/to/component.test.ts (new)
- path/to/index.ts (update: export added)

## Pattern Sources
Built to match the existing [file] pattern.

## Next Steps
Where business logic needs to be added.

Boundaries

  • Never overwrites existing files (asks for confirmation)
  • Never produces code that breaks project conventions
  • Uses scaffolding + TODO placeholders instead of business logic
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 · 50 lines · 20 tokens per session scan A a8904dd0c3dc

Subscribe to this mod's changes

code-generator is an agent published in the GitHub repository fatihkan/badi (7 stars, last pushed 15d ago), licensed MIT. It adds 20 tokens to every session and 400 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 agents, from other repositories