How it works
The AI template generator:- Takes a natural language description of your desired template
- Generates a complete
TemplateConfigJSON with colors, fonts, layout, and section variants - Saves the generated template to your browser’s localStorage
- Applies the new template to your resume immediately
AI-generated templates are stored separately from the three built-in templates (Classic, Modern, Minimal) and can be managed independently.
Accessing the template generator
The Template Generator is available in the template selector interface:- Open the Resume Builder application
- Look for the Template Selector card near the top of the editor
- Click the “Generate with AI” button to open the generator
Creating a custom template
Describe your template
Enter a natural language description of the template you want. Be specific about:
- Style: Modern, traditional, minimalist, creative, corporate
- Colors: Primary accent colors, sidebar colors
- Layout: Single-column, two-column with sidebar
- Typography: Font preferences (serif, sans-serif, monospace)
- Special features: Skills as tags, timeline for experience, grid for projects
Generate the template
Click the “Generate Template” button. The AI will:
- Parse your description
- Generate appropriate colors, fonts, and spacing
- Choose a suitable layout type (single or two-column)
- Assign section variants that match your style
Generation typically takes 2-5 seconds depending on API response time.
Review the generated template
Once generated, you’ll see:
- Template name: Auto-generated based on your description
- Description: A brief summary of the template’s characteristics
- Preview: The template is temporarily applied to see how it looks
Technical details
API endpoint
The template generator calls a Cloudflare Pages Function:Template configuration structure
Generated templates follow theTemplateConfig type:
Available section variants
The AI can assign these variants to sections:- personal-info:
default,centered,minimal - summary:
default - experience:
default,timeline,minimal,compact - education:
default,minimal - skills:
default,tags,bubbles,bullet-list,sidebar - projects:
default,grid - customSections:
default
Storage
Generated templates are stored in localStorage under the keycustom-resume-templates:
Managing custom templates
Viewing custom templates
Custom templates appear in the template selector alongside built-in templates. They are marked with a custom indicator.Deleting custom templates
To delete a custom template:- Navigate to the template selector
- Find the custom template you want to remove
- Click the delete icon next to the template name
Best practices
Be specific
Include details about colors, fonts, layout preferences, and special styling for sections
Use examples
Reference well-known design styles (e.g., “like a tech startup resume” or “traditional academic CV”)
Iterate
If the first result isn’t perfect, regenerate with a more detailed prompt
Test print
Always preview the PDF export to ensure the template looks good on paper
Troubleshooting
Generation fails with 'API key not configured'
Generation fails with 'API key not configured'
This error occurs when the Cloudflare Pages Function doesn’t have access to the
GEMINI_API_KEY environment variable. This typically happens in local development.Solution: Deploy the app to Cloudflare Pages with the API key configured, or set up local environment variables for development.Generated template looks broken
Generated template looks broken
Sometimes the AI generates invalid color codes or spacing values.Solution: Regenerate the template with a more specific prompt, or manually edit the template JSON in localStorage (advanced users only).
Template doesn't match my description
Template doesn't match my description
The AI interprets prompts based on common design patterns but may not perfectly match your vision.Solution: Add more specific details to your prompt, especially around colors (hex codes), font names, and layout preferences.
Next steps
Template system overview
Learn how the template system works under the hood
Creating templates manually
Build custom templates by writing JSON configurations
useCustomTemplates hook
API reference for managing custom templates programmatically
TemplateGenerator component
Component API for the AI template generator UI

