Generate code from templates and patterns including scaffolding, boilerplate generation, AST-based code generation, and template engines. Use when generating code, scaffolding projects, creating boilerplate, or using templates.
Comprehensive guide to code generation techniques including template engines, AST manipulation, code scaffolding, and automated boilerplate generation for increased productivity and consistency.
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}}
}
export const {{pascalCase name}}: React.FC<{{pascalCase name}}Props> = ({
{{#each props}}{{this.name}},{{/each}}
}) => {
return (
<div className="{{kebabCase name}}">
{/* Component implementation */}
</div>
);
};
Detailed implementations in the references/ directory:
| Guide | Contents | |---|---| | Template Engines | Template Engines | | AST-Based Code Generation | AST-Based Code Generation | | Project Scaffolding | Project Scaffolding | | OpenAPI Client Generation | OpenAPI Client Generation | | Database Model Generation | Database Model Generation | | GraphQL Code Generation | GraphQL Code Generation | | Plop.js Generator | Plop.js Generator |
Copy a source-pinned command for your client. You run it yourself.
Destination: .claude/skills/code-generation-template · pinned to the source commit
git clone https://github.com/aj-geddes/useful-ai-prompts.git
cd useful-ai-prompts
git checkout 3f5182cfd739fc113f4af5244a1cf342ad7f7911
mkdir -p ".claude/skills/code-generation-template"
cp -r "skills/code-generation-template" ".claude/skills/code-generation-template"Review the source before running. This copies files into your project; it is not a one-click install and does not verify runtime safety.
Scanner static-checks@0.1.0 · commit 3f5182cfd739. Static checks cannot prove runtime safety – review the source and the exact diff before installing. How checks work.
No static rules matched. This is not a safety guarantee.