| name | injector-json-generator |
| description | Generate themed input.json files for vite-plugin-injector. Use this skill whenever the user wants to create, customize, or generate content for vite-plugin-injector — including requests like "generate input.json", "create injector content", "make a theme for vite-plugin-injector", "generate jokes/quotes/comments for my build", or any mention of injector themes, build artifact injection content, or the vite-plugin-injector input file. Also trigger when the user provides a topic/theme and wants it turned into developer comments, console logs, variable suffixes, ASCII art, changelog entries, or HTML comments for code injection. |
Injector JSON Generator
Generate themed input.json files for the vite-plugin-injector Vite plugin. The user provides a topic or theme, and this skill produces a complete, valid input.json populated with creative, on-theme content across all slots.
What is input.json?
The vite-plugin-injector plugin reads an input.json file that defines content to inject into build artifacts (JS, CSS, HTML). The file has this schema:
{
"oneLiners": ["// single-line JS comments"],
"blockComments": ["/* multi-line\n * JS comments */"],
"cssComments": ["/* CSS comments */"],
"htmlComments": ["<!-- HTML comments -->"],
"variableSuffixes": ["camelCaseIdentifiers"],
"consoleLogs": ["console.log('statements');"],
"bannerMessages": ["// banner lines prepended to chunks"],
"asciiArt": ["multi-line ASCII art strings"],
"changelogEntries": ["- Markdown list items for a fake changelog"],
"metadata": {
"label": "windowGlobalName",
"changelogTitle": "Heading for generated CHANGELOG.md"
}
}
Workflow
- Ask the user for a topic or theme (e.g., "space exploration", "cats", "philosophy", "pirate speak", "corporate buzzwords").
- Read the reference file at
references/schema-and-examples.md to understand the exact format, slot rules, and two full worked examples.
- Generate the
input.json by filling every slot with creative, theme-appropriate content following the rules in the reference file.
- Save the result as
input.json and present it to the user.
Slot-by-slot generation rules
These are the key constraints for each slot. The reference file has more detail and examples.
| Slot | Format rule | Count target |
|---|
oneLiners | Must start with // | 8–12 entries |
blockComments | Must use /* ... */ with \n * line breaks | 4–6 entries |
cssComments | Must use /* ... */, single line preferred | 6–8 entries |
htmlComments | Must use <!-- ... --> | 6–8 entries |
variableSuffixes | camelCase, no spaces/special chars, thematic | 8–12 entries |
consoleLogs | Complete console.log('...'); statements | 6–8 entries |
bannerMessages | Start with // — short, punchy | 5–7 entries |
asciiArt | Multi-line strings, each line max ~60 chars | 2–3 entries |
changelogEntries | Start with - , written as fake changelog items | 8–12 entries |
metadata.label | Single camelCase word summarizing the theme | 1 |
metadata.changelogTitle | Short title string | 1 |
Quality guidelines
- Be creative and entertaining. The whole point is to delight developers who discover these in build output. Dry or generic content defeats the purpose.
- Stay on theme. Every entry should clearly relate to the user's chosen topic. Don't drift into generic programming humor unless that IS the theme.
- Vary tone within the theme. Mix clever wordplay, absurd observations, fake-serious warnings, and genuine knowledge about the topic.
- Variable suffixes must be valid JS identifiers. No spaces, hyphens, or special characters. camelCase only.
- ASCII art should actually look like something. Simple but recognizable shapes related to the theme. Keep lines under 60 characters.
- Console logs should be funny or surprising when seen in a browser console. Imagine a developer opening DevTools and encountering these.
- Changelog entries should read like plausible (but absurd) software changelogs. The humor comes from the contrast between changelog format and ridiculous content.
- Escape special characters properly in JSON. Newlines as
\n, quotes escaped, etc. The output must be valid JSON that parses without errors.
Validation
After generating, verify:
- The output is valid JSON (parse it).
- Every
oneLiners entry starts with // .
- Every
blockComments entry starts with /* and ends with */.
- Every
cssComments entry starts with /* and ends with */.
- Every
htmlComments entry starts with <!-- and ends with -->.
- Every
variableSuffixes entry matches /^[a-z][a-zA-Z0-9]*$/.
- Every
consoleLogs entry starts with console.log( and ends with );.
- Every
bannerMessages entry starts with // .
- Every
changelogEntries entry starts with - .
metadata.label matches /^[a-z][a-zA-Z0-9]*$/.
If any validation fails, fix the issue before presenting the file.