How Many Template Categories Are Available in gpt-image-2?
The gpt-image-2 skill defines exactly 18 visual template categories, as declared in the skill's manifest and programmatically verified through the template metadata structure.
If you're working with the ConardLi/garden-skills repository and need to know how many template categories are available in gpt-image-2, the answer is codified in both configuration files and utility scripts. These 18 categories represent distinct groups of image-generation prompts—ranging from academic figures to social media graphics and UI mock-ups—that organize the skill's capabilities.
Understanding the 18 Template Categories in gpt-image-2
According to skills/gpt-image-2/manifest.json, the skill explicitly supports 18 visual categories[【1†L4-L6】]. This declaration reflects the complete set of prompt classifications available when generating or editing images through the skill.
Each category groups related templates that share contextual similarity. When users select a category, the skill filters the available templates to match that specific visual context, ensuring generated images align with intended use cases like academic publications, marketing materials, or interface designs.
How the Category Count Is Calculated Programmatically
Rather than hardcoding the number 18 throughout the codebase, the skill derives the category count dynamically from the template metadata. This approach ensures consistency between the manifest declaration and the actual data structure.
Enumerating Categories in shared.js
The primary enumeration logic resides in skills/gpt-image-2/scripts/shared.js. The getAllCategories() function extracts unique categories by parsing the template_key field from the cases data:
// skills/gpt-image-2/scripts/shared.js – loads the template definitions
import cases from '../data/cases.json';
export const getAllCategories = () => {
const categories = new Set();
cases.forEach(c => categories.add(c.template_key.split('/')[0]));
return Array.from(categories);
};
// Usage example
console.log('Template categories:', getAllCategories().length); // → 18
This implementation splits each template_key on the forward slash and uses the first segment as the category identifier. By collecting these values into a Set, the function automatically deduplicates entries and returns an array containing exactly 18 unique category strings.
Summary Statistics in the Website Layer
The website interface implements parallel logic in website/gpt-image2-website/src/lib/data.ts via the getSummary() function:
// website/gpt-image2-website/src/lib/data.ts – summary statistics
export const getSummary = (cases: Case[]) => ({
templates: cases.reduce((sum, c) => sum + c.templates.length, 0),
categories: new Set(cases.map(c => c.template_key.split('/')[0])).size,
});
This TypeScript function confirms the category count by mapping over the case array and calculating the size of the unique category set, validating the 18 category total declared in the manifest.
Key Source Files Managing Template Categories
The following files in the ConardLi/garden-skills repository collectively implement the category system:
skills/gpt-image-2/manifest.json— Declares the skill's metadata, including the explicit statement that the skill supports "18 visual categories".skills/gpt-image-2/scripts/shared.js— Contains thegetAllCategories()helper function for loading and processing template category data.skills/gpt-image-2/scripts/generate.js— Implements image-generation logic that selects templates based on their category metadata.skills/gpt-image-2/scripts/edit.js— Handles prompt-editing features, referencing category information to maintain generation context.website/gpt-image2-website/src/data/cases.json— Stores the concrete template definitions, including keys, labels, and example prompts used by the UI layer.
Summary
- The gpt-image-2 skill provides exactly 18 template categories for organizing image generation prompts.
- The count is explicitly declared in
skills/gpt-image-2/manifest.jsonand programmatically verified inscripts/shared.js. - Categories are derived by parsing the first segment of
template_keyvalues from the cases data structure. - Both the core skill scripts and the website layer use Set data structures to calculate unique category counts dynamically, ensuring the total remains consistent with the manifest declaration.
Frequently Asked Questions
How many template categories does gpt-image-2 support?
The gpt-image-2 skill supports exactly 18 visual template categories. This number is explicitly stated in the skill's manifest file and confirmed by the data processing logic that parses template keys from the cases dataset.
Where are the template categories defined in the source code?
The categories are declared in skills/gpt-image-2/manifest.json and implemented in skills/gpt-image-2/scripts/shared.js. The underlying template data resides in website/gpt-image2-website/src/data/cases.json, where each entry's template_key field uses a path-like format (e.g., "academic/figure") to determine its category classification.
How can I programmatically access the list of categories?
Import the getAllCategories() function from skills/gpt-image-2/scripts/shared.js. This function returns an array of unique category strings by splitting the template_key field on forward slashes and collecting the first segment from each case in the dataset.
What types of templates are included in these categories?
The 18 categories encompass diverse visual use cases including academic figures, social media graphics, and UI mock-ups. Each category contains multiple specialized templates that provide contextual prompts for generating images within that specific domain.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →