Enhance glyph

From pjt222/agent-almanac · View interactive version

Enhance glyph is an AI agent skill from the GitHub repository pjt222/agent-almanac. Improve an existing R-based pictogram glyph for the visualization layer. Covers visual audit of the current glyph, diagnosis of specific issues (proportions, readability, glow balance), targeted modifications to the glyph function, re-rendering, and before/after comparison. Works for skill, agent, a

How to use this skill

Skill file

Enhance Glyph

Improve existing pictogram glyph in viz/ → audit render, diagnose issues, targeted mods, re-render, compare before/after. Works skill/agent/team.

Use When

In

Do

Step 1: Audit

Examine current, identify issues.

  1. Locate glyph fn by entity type:
  1. Read fn structure:
  1. View rendered output:
  1. Score on quality dimensions:
Glyph Quality Dimensions:
+----------------+------+-----------------------------------------------+
| Dimension      | 1-5  | Assessment Criteria                           |
+----------------+------+-----------------------------------------------+
| Readability    |      | Recognizable at 48px? Clear at 160px?         |
| Proportions    |      | Well-centered? Good use of the 100x100 canvas?|
| Metaphor       |      | Does the shape clearly represent the entity?   |
| Glow balance   |      | Glow enhances without overwhelming?            |
| Palette compat |      | Looks good across cyberpunk + viridis palettes?|
| Complexity     |      | Appropriate layer count (not too busy/sparse)? |
+----------------+------+-----------------------------------------------+
  1. Identify 1-2 lowest dims → enhancement targets

→ Clear diagnosis. Specific: "proportions: uses 40% canvas" not "looks bad."

If err: fn missing or entity not in *_glyphs.R → glyph not created → use create-glyph.

Step 2: Diagnose

Root cause.

  1. Readability:
  1. Proportion:
  1. Glow:
  1. Palette compat:
  1. Document specific root cause each issue

→ Root causes point to code changes. "Too small" → "s=0.6, should be 0.8." "Glow overwhelms" → "3 overlapping filled polygons each generate glow."

If err: root cause not obvious from code → render isolation w/ diff params. render_glyph() single glyph to test.

Step 3: Modify

Edit fn → targeted fixes.

  1. Open file containing fn
  2. Mods per diagnosis:
  1. Follow contract:

```r

glyph_name <- function(cx, cy, s, col, bright) {

# cx, cy = center (50, 50)

# s = scale (1.0 = ~70% of canvas)

# col = domain color, bright = brightened variant

# Returns: list() of ggplot2 layers

}

```

  1. Preserve signature — no param change
  2. Minimal mods — fix diagnosed, no redesign

→ Modified fn addresses Step 1-2 issues. Targeted + minimal.

If err: mods make other dims worse → revert, try diff. Needs redesign → create-glyph.

Step 4: Re-render

Render + verify. Always build.sh → handles platform + R binary. See render-icon-pipeline for flags.

  1. Re-render by entity:

```bash

# From project root — use --no-cache to force re-render of modified glyph

bash viz/build.sh --only <domain> --no-cache # skills

bash viz/build.sh --type agent --only <id> --no-cache # agents

bash viz/build.sh --type team --only <id> --no-cache # teams

```

  1. Verify output exists each palette
  2. Check sizes — icons 2-15 KB (WebP):

→ Fresh icons each palette. Sizes in range.

If err: build errs → R console for specific. Common: missing paren, undefined primitives, non-list return. Renders but blank → layers outside canvas.

Step 5: Compare

Verify enhancement improved targets.

  1. Compare old/new:
  1. Re-score dims from Step 1:
  1. If in force-graph, test there:
  1. Document changes + improvement

→ Measurable improvement on targets, no regression others. Better both sizes + all palettes.

If err: marginal improvement or regression → revert, reconsider diagnosis. Sometimes orig limit = inherent to metaphor → metaphor itself needs change (escalate create-glyph).

Check

Traps

→

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.