Agent-almanac render-icon-pipeline
git clone https://github.com/pjt222/agent-almanac
T=$(mktemp -d) && git clone --depth=1 https://github.com/pjt222/agent-almanac "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/render-icon-pipeline" ~/.claude/skills/pjt222-agent-almanac-render-icon-pipeline-a5d027 && rm -rf "$T"
skills/render-icon-pipeline/SKILL.mdRender Icon Pipeline
Run the viz pipeline end-to-end to render icons from existing glyphs. Covers palette generation, data building, manifest creation, and icon rendering for skills, agents, and teams.
Canonical entry point:
bash viz/build.sh [flags] from the project root, or bash build.sh [flags] from viz/. This script handles platform detection (WSL, Docker, native), R binary selection, and step ordering. Never call Rscript directly for build scripts — that path is only for MCP server configuration.
When to Use
- After creating or modifying glyph functions
- After adding new skills, agents, or teams to registries
- When icons need re-rendering for new or updated palettes
- For a full pipeline rebuild (e.g., after infrastructure changes)
- When setting up the viz environment for the first time
Inputs
- Optional: Entity type —
,skill
,agent
, orteam
(default:all
)all - Optional: Palette — specific palette name or
(default:all
)all - Optional: Domain filter — specific domain for skill icons (e.g.,
,git
)design - Optional: Render mode —
,full
, orincremental
(default:dry-run
)incremental
Procedure
Step 1: Verify Prerequisites
Ensure the environment is ready for rendering.
- Confirm
exists:viz/build.shls -la viz/build.sh - Verify Node.js is available:
node --version - Check that
exists (platform-specific R path profiles):viz/config.ymlls viz/config.yml
build.sh handles R binary resolution automatically — you do not need to verify R paths manually. On WSL it uses /usr/local/bin/Rscript (WSL-native R), on Docker it uses the container R, and on native Linux/macOS it uses Rscript from PATH.
Expected:
build.sh, Node.js, and config.yml are present.
On failure: If
config.yml is missing, the pipeline falls back to system defaults. If Node.js is missing, install via nvm.
Step 2: Run the Pipeline
build.sh executes 5 steps in order:
- Generate palette colors (R) →
+palette-colors.jsoncolors-generated.js - Build data (Node) →
skills.json - Build manifests (Node) →
,icon-manifest.json
,agent-icon-manifest.jsonteam-icon-manifest.json - Render icons (R) →
andicons/
WebP filesicons-hd/ - Generate terminal glyphs (Node) →
cli/lib/glyph-data.json
Full pipeline (all types, all palettes, standard + HD):
bash viz/build.sh
Incremental (skip icons that already exist on disk):
bash viz/build.sh --skip-existing
Single domain (skills only):
bash viz/build.sh --only design
Single entity type:
bash viz/build.sh --type skill bash viz/build.sh --type agent bash viz/build.sh --type team
Dry run (preview without rendering):
bash viz/build.sh --dry-run
Standard size only (skip HD):
bash viz/build.sh --no-hd
All flags after
build.sh are passed through to build-all-icons.R.
Expected: Icons rendered to
viz/public/icons/<palette>/ and viz/public/icons-hd/<palette>/.
On failure:
- renv hang on NTFS: The viz
bypasses.Rprofile
and setsrenv/activate.R
directly. Ensure you run from.libPaths()
(build.sh does this automatically viaviz/
)cd "$(dirname "$0")" - Missing R packages: Run
from the R environment thatRscript -e "install.packages(c('ggplot2', 'ggforce', 'ggfx', 'ragg', 'magick', 'future', 'furrr', 'digest'))"
selectsbuild.sh - No glyph mapped: The entity needs a glyph function — use the
skill before renderingcreate-glyph
Step 3: Verify Output
Confirm the render completed successfully.
- Check file counts match expectations:
find viz/public/icons/cyberpunk -name "*.webp" | wc -l find viz/public/icons-hd/cyberpunk -name "*.webp" | wc -l - Check for reasonable file sizes (2-80 KB per icon)
- Run the
skill for a comprehensive checkaudit-icon-pipeline
Expected: File counts match manifest entry counts. File sizes in expected range.
On failure: If counts don't match, some glyphs may have errored during rendering. Check the build log for
[ERROR] lines.
CLI Flag Reference
All flags are passed through
build.sh to build-all-icons.R:
| Flag | Default | Description |
|---|---|---|
| | Comma-separated: skill, agent, team |
| | Single palette or (9 palettes) |
| none | Domain (skills) or entity ID (agents/teams) |
| off | Skip icons with existing WebP files |
| off | List what would be generated |
| | Output dimension in pixels |
| | Glow blur radius |
| auto | Parallel workers (detectCores()-1) |
| off | Ignore content-hash cache |
| on | Enable HD variants (1024px) |
| off | Skip HD variants |
| off | Exit on first sub-script failure |
What build.sh Does Internally
For reference only — do NOT run these steps manually:
cd viz/ # 1. Platform detection: sets R_CONFIG_ACTIVE (wsl, docker, or unset) # 2. R binary selection: WSL → /usr/local/bin/Rscript, Docker → same, native → Rscript # 3. $RSCRIPT generate-palette-colors.R # 4. node build-data.js # 5. node build-icon-manifest.js --type all # 6. $RSCRIPT build-all-icons.R "$@" (flags passed through) # 7. node build-terminal-glyphs.js
Docker Alternative
The pipeline can also run in Docker:
cd viz docker compose up --build
This runs the full pipeline in an isolated Linux environment and serves the result on port 8080.
Validation Checklist
- Ran
(not barebash viz/build.sh
)Rscript - Palette colors generated (JSON + JS)
- Data files built from registries
- Manifests generated from data
- Icons rendered for target types and palettes
- File counts match expectations
- File sizes in expected range (2-80 KB)
Common Pitfalls
- Calling Rscript directly: Never run
orRscript build-icons.R
manually. Always useRscript generate-palette-colors.R
. Direct Rscript calls bypass platform detection and may use the wrong R binary (Windows R viabash build.sh [flags]
wrapper instead of WSL-native R at~/bin/Rscript
). Note: the Windows R path in CLAUDE.md and guides is for MCP server configuration only, not for build scripts./usr/local/bin/Rscript - Wrong working directory:
CDs to its own directory automatically (build.sh
), so you can call it from anywhere:cd "$(dirname "$0")"
from project root works correctly.bash viz/build.sh - Stale manifests:
runs Steps 1-5 in order, so manifests are always regenerated before rendering. If you only need manifests without rendering, usebuild.sh
(the Node steps don't need R).node viz/build-data.js && node viz/build-icon-manifest.js - renv not activated: The
workaround requires running from.Rprofile
—viz/
handles this. Usingbuild.sh
flag or running R from another directory will skip it.--vanilla - Parallel on Windows: Windows doesn't support fork-based parallelism — the pipeline auto-selects
viamultisession
.config.yml
Related Skills
- audit-icon-pipeline — detect missing glyphs and icons before rendering
- create-glyph — create new glyph functions for entities missing icons
- enhance-glyph — improve existing glyphs before re-rendering