aj-geddes avatar

Code Generation Template

This covers the full spectrum of code generation, from simple template engines like Handlebars to AST manipulation and scaffolding entire projects. You'd reach for this when generating repetitive patterns like React components, CRUD operations, or API clients from OpenAPI specs. The guide includes practical references for tools like Plop.js and GraphQL Codegen, plus database model generation. The best practices section gets the balance right: it's honest about when not to use code generation, warning against over-generation and overly complex templates that create maintenance headaches. Good reminder that generated code still needs to be readable and follow your project's conventions.

skills.sh installs
537
GitHub stars
379
last updated
Aug 21, 2026

Install

$ npx -y skills add aj-geddes/useful-ai-prompts --skill code-generation-template --agent claude-code

Installs into .claude/skills of the current project.

Files

Code Generation & Templates

Table of Contents

Overview

Comprehensive guide to code generation techniques including template engines, AST manipulation, code scaffolding, and automated boilerplate generation for increased productivity and consistency.

When to Use

  • Scaffolding new projects or components
  • Generating repetitive boilerplate code
  • Creating CRUD operations automatically
  • Generating API clients from OpenAPI specs
  • Building code from templates
  • Creating database models from schemas
  • Generating TypeScript types from JSON Schema
  • Building custom CLI generators

Quick Start

Minimal working example:

// templates/component.hbs
import React from 'react';

export interface {{pascalCase name}}Props {
  {{#each props}}
  {{this.name}}{{#if this.optional}}?{{/if}}: {{this.type}};
  {{/each}}
}

Sponsors

Details

Repository
github.com/aj-geddes/useful-ai-prompts
Categories
AI & Agent Building, Automation & Workflows
First seen
Jun 3, 2026

More from aj-geddes/useful-ai-prompts

All 258
1buiducnhat avatarbrainstormbuiducnhat/agent-skillsbrainstorm537skills.sh installs
2bitwize-music-studio avatarlyric-writerbitwize-music-studio/claude-ai-music-skillsWrites or reviews lyrics with professional prosody, rhyme craft, and quality checks. Use when writing new lyrics, revising existing lyrics, or when the user say535skills.sh installs
3vercel-labs avatarvercel-deployvercel-labs/agent-skillsDeploy applications and websites to Vercel. Use this skill when the user requests deployment actions such as "Deploy my app", "Deploy this to production", "Crea534skills.sh installs
4aj-geddes avatarsql-injection-preventionaj-geddes/useful-ai-promptsPrevent SQL injection attacks using prepared statements, parameterized queries, and input validation. Use when building database-driven applications securely.533skills.sh installs
5tuist avatardebug-generated-projecttuist/agent-skillsDebugs issues users encounter with Tuist-generated projects by reproducing the scenario locally, building Tuist from source when needed, and triaging whether it533skills.sh installs
6aj-geddes avatargrpc-service-developmentaj-geddes/useful-ai-promptsBuild high-performance gRPC services with Protocol Buffers, bidirectional streaming, and microservice communication. Use when building gRPC servers, defining se532skills.sh installs