Add Theme Icons
Designadd-theme-iconsAdd Theme Icons is an Agent Skill for design published in the r0adkll/Campfire repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Add new `AppTheme.Icon` entries by pulling Icons8 icons (Arcade style by default) and converting them to Compose ImageVectors via the Valkyrie CLI.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/r0adkll/Campfire/blob/HEAD/.claude/skills/add-theme-icons/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/add-theme-icons, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
When to use
Invoke when the user wants to expand the set of icons available in AppTheme.Icon (used by OOTB AppTheme.Fixed themes and user-built AppTheme.Fixed.Custom themes). Icons should match the app's camping / nature / travel theme.
Prerequisites
- Valkyrie CLI installed (
brew install ComposeGears/repo/valkyrie, check withcommand -v valkyrie). Required — do not hand-translate SVG paths. - Icons8 MCP tools available:
mcp__icons8mcp__search_icons,mcp__icons8mcp__get_icon_svg.
Conventions (project-specific — follow exactly)
| Concern | Value |
|---|---|
| Icon style (platform) | arcade (colored; unless user specifies otherwise) |
| Iconpack object | CampfireIcons (defined at common/compose/src/commonMain/kotlin/app/campfire/common/compose/icons/CampfireIcons.kt) |
| Nested pack | Theme |
| ImageVector package | app.campfire.common.compose.icons.theme |
| ImageVector files dir | common/compose/src/commonMain/kotlin/app/campfire/common/compose/icons/theme/ |
| Lazy thread-safety | LazyThreadSafetyMode.PUBLICATION (Valkyrie emits NONE — you must replace it) |
| Indent | 2 spaces (ktlint) |
| Enum location | ui/theming/api/src/commonMain/kotlin/app/campfire/ui/theming/api/AppTheme.kt → AppTheme.Icon |
Workflow
-
Search candidates. First read
AppTheme.ktand list the existingIconenum entries so you can exclude them. Then usemcp__icons8mcp__search_iconswithplatform=arcadeand camping/nature/travel query terms (examples: campfire, compass, binoculars, lantern, map, axe, sleeping bag, evergreen, suitcase, log cabin, canoe, fishing, hammock, trail, camper, waterfall, flashlight). Note: some searches return zero (kayak,hammock,thermos) — try synonyms (dinghy,picnic). Fire multiple searches in parallel. -
Fetch SVGs in parallel via
mcp__icons8mcp__get_icon_svgfor each chosen icon id. -
Stage SVGs. Write each to
/tmp/campfire-icons-svg/<PascalCaseName>.svg. The filename becomes the generated Kotlin property name (CampfireIcons.Theme.<PascalCaseName>) — avoid names that collide with existing Kotlin types (e.g. preferPaperMapoverMap). -
Run Valkyrie. Output to a scratch dir first (Valkyrie creates a
theme/subfolder):valkyrie svgxml2imagevector \ --input-path=/tmp/campfire-icons-svg \ --output-path=/tmp/campfire-icons-out \ --package-name=app.campfire.common.compose.icons \ --iconpack-name=CampfireIcons \ --nested-pack-name=Theme \ --output-format=lazy-property \ --indent-size=2 \ --trailing-comma=trueKey flags:
--package-nameis the root package (Valkyrie appends.themefrom--nested-pack-name); do not pass the full...icons.themepackage or you'll get a doubled path.--trailing-comma=trueis required — without it ktlint flags every multi-argpath(...)call. -
Post-process — replace Valkyrie's default lazy mode to match project convention:
bash -c 'for f in /tmp/campfire-icons-out/theme/*.kt; do sed -i "" "s/LazyThreadSafetyMode.NONE/LazyThreadSafetyMode.PUBLICATION/g" "$f"; done' -
Move into the source tree.
cp /tmp/campfire-icons-out/theme/*.kt \ /Users/r0adkll/StudioProjects/Campfire/common/compose/src/commonMain/kotlin/app/campfire/common/compose/icons/theme/ -
Wire into
AppTheme.Icon. Inui/theming/api/src/commonMain/kotlin/app/campfire/ui/theming/api/AppTheme.kt:- Add
import app.campfire.common.compose.icons.theme.<Name>(keep alphabetical ordering). - Add
<Name>(icon = { CampfireIcons.Theme.<Name> }),to theIconenum.
- Add
-
Verify. Run
--formatfirst (it auto-fixes the alphabetical import reordering that adding new imports can break), then compile:./scripts/ktlint --format ./gradlew :common:compose:compileKotlinIosSimulatorArm64 :ui:theming:api:compileKotlinIosSimulatorArm64 --console=plainPre-existing warnings (
ExperimentalMaterial3Apiopt-in,dayOfMonthdeprecation,SynchronizedObjectundercompileCommonMainKotlinMetadata) are unrelated — ignore. -
Clean up
/tmp/campfire-icons-svgand/tmp/campfire-icons-out.
Notes
- Icons are rendered by
AppThemeImageviaImage(...)(notIcon(... tint)), so the original Arcade colors come through — do not convert to single-color vectors. - Custom themes built by users pick from this same enum (see
AppTheme.Fixed.Custom.icon), so every added entry is immediately user-selectable. - If the user names a different Icons8 platform (e.g.
color,plumpy), pass that as theplatformfilter in step 1 — the rest of the workflow is identical.