Creates code generation templates for components, APIs, and models with CLI tools and customization options.
You are a developer tools engineer who creates code generation templates. Create templates for generating boilerplate code.
Generation target: [COMPONENT / API ENDPOINT / DATABASE MODEL / SERVICE / TEST]
Framework: [TECH STACK]
Conventions: [YOUR TEAM'S CONVENTIONS]
Template engine: [HANDLEBARS / EJS / PLOP / HYGEN / CUSTOM]
Provide:
**Template Definition**
```handlebars
// Component template example
import React from 'react';
import styles from './{{pascalCase name}}.module.css';
interface {{pascalCase name}}Props {
{{#each props}}
{{camelCase this.name}}: {{this.type}};
{{/each}}
}
export function {{pascalCase name}}({
{{#each props}}{{camelCase this.name}}{{#unless @last}}, {{/unless}}{{/each}}
}: {{pascalCase name}}Props) {
return (
<div className={styles.container}>
{/* Implementation */}
</div>
);
}
```
**Generator Configuration**
```javascript
// Plop/Hygen configuration
module.exports = {
description: 'Generate a new component',
prompts: [
{
type: 'input',
name: 'name',
message: 'Component name:'
},
// More prompts
],
actions: [
// File generation actions
]
}
```
**Templates Provided**
1. **React Component**
- Component file
- Styles file
- Test file
- Storybook story
- Index export
2. **API Endpoint**
- Route handler
- Validation schema
- Service layer
- Tests
3. **Database Model**
- Schema/migration
- Repository
- Types
**CLI Usage**
```bash
npm run generate component MyComponent
npm run generate api users/create
npm run generate model User
```
**Customization Points**
- Where to add custom logic
- How to extend templates
- Variables available
**Integration**
- VS Code snippets
- IDE plugins
- CI checks for consistency
**Documentation**
- How to use generators
- How to create new templates
- Naming conventions enforcedYou are a developer tools engineer who creates code generation templates. Create templates for generating boilerplate code.
Generation target: [COMPONENT / API ENDPOINT / DATABASE MODEL / SERVICE / TEST]
Framework: [TECH STACK]
Conventions: [YOUR TEAM'S CONVENTIONS]
Template engine: [HANDLEBARS / EJS / PLOP / HYGEN / CUSTOM]
Provide:
**Template Definition**
```handlebars
// Component template example
import React from 'react';
import styles from './{{pascalCase name}}.module.css';
interface {{pascalCase name}}Props {
{{#each props}}
{{camelCase this.name}}: {{this.type}};
{{/each}}
}
export function {{pascalCase name}}({
{{#each props}}{{camelCase this.name}}{{#unless @last}}, {{/unless}}{{/each}}
}: {{pascalCase name}}Props) {
return (
<div className={styles.container}>
{/* Implementation */}
</div>
);
}
```
**Generator Configuration**
```javascript
// Plop/Hygen configuration
module.exports = {
description: 'Generate a new component',
prompts: [
{
type: 'input',
name: 'name',
message: 'Component name:'
},
// More prompts
],
actions: [
// File generation actions
]
}
```
**Templates Provided**
1. **React Component**
- Component file
- Styles file
- Test file
- Storybook story
- Index export
2. **API Endpoint**
- Route handler
- Validation schema
- Service layer
- Tests
3. **Database Model**
- Schema/migration
- Repository
- Types
**CLI Usage**
```bash
npm run generate component MyComponent
npm run generate api users/create
npm run generate model User
```
**Customization Points**
- Where to add custom logic
- How to extend templates
- Variables available
**Integration**
- VS Code snippets
- IDE plugins
- CI checks for consistency
**Documentation**
- How to use generators
- How to create new templates
- Naming conventions enforcedThis prompt is released under CC0 (Public Domain). You are free to use it for any purpose without attribution.
Explore similar prompts based on category and tags
Creates scripts to scrape and extract structured data from websites using various libraries.
Creates comprehensive Architecture Decision Records with options analysis, decision matrices, and consequence documentation.
Conducts thorough code reviews covering security, performance, maintainability, and best practices with specific fix suggestions.
Analyzes complex error stack traces to identify root causes and provide specific code fixes.