关于
This skill creates pictogram icons in R using ggplot2 and a primitives library for visualizing entities in a force-graph. It handles the entire workflow from concept and color strategy to registration, pipeline rendering, and verification of the final neon-glow output. Use it when adding new entities, replacing icons, or batch-creating glyphs for a new domain.
快速安装
Claude Code
推荐npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/create-glyph在 Claude Code 中复制并粘贴此命令以安装该技能
技能文档
Create Glyph
R pictogram glyphs → skill/agent/team icons in viz/. Pure-ggplot2 fn on 100x100 → neon glow → transparent WebP.
Use When
- New skill/agent/team needs icon
- Existing glyph needs replace/redesign
- Batch-create for new domain
- Prototype visual metaphors
In
- Required: Type —
skill,agent,team - Required: Entity ID (
create-glyph,mystic,r-package-review) + domain (skills) - Required: Visual concept
- Optional: Reference glyph (complexity calibration)
- Optional: Custom
--glow-sigma(def: 4)
Do
Step 1: Concept
- Read entity source:
- Skills:
skills/<id>/SKILL.md - Agents:
agents/<id>.md - Teams:
teams/<id>.md
- Skills:
- Metaphor type:
- Literal: flask→experiment, shield→security
- Abstract: arrows→merge, spirals→iterate
- Composite: 2-3 simple shapes (doc + pen)
- Complexity ref:
Complexity Tiers:
+----------+--------+-------------------------------------------+
| Tier | Layers | Examples |
+----------+--------+-------------------------------------------+
| Simple | 2 | glyph_flame, glyph_heartbeat |
| Moderate | 3-5 | glyph_document, glyph_experiment_flask |
| Complex | 6+ | glyph_ship_wheel, glyph_bridge_cpp |
+----------+--------+-------------------------------------------+
- Fn name:
glyph_<descriptive_name>(snake_case, unique)
Got: Mental sketch, 2-6 planned layers.
If err: Too abstract → concrete related. Check existing in same domain.
Step 2: Compose
Write R fn → ggplot2 layers.
-
Signature (immutable):
glyph_<name> <- function(cx, cy, s, col, bright) { # cx, cy = center coordinates (50, 50 on 100x100 canvas) # s = scale factor (1.0 = fill ~70% of canvas) # col = domain color hex (e.g., "#ff88dd" for design) # bright = brightened variant of col (auto-computed by renderer) # Returns: list() of ggplot2 layers } -
Apply
* sto ALL dims:r <- 20 * s # radius hw <- 15 * s # half-width lw <- .lw(s) # line width (default base 2.5) lw_thin <- .lw(s, 1.2) # thinner line width -
Geometry primitives:
Geometry Usage ggplot2::geom_polygon(data, .aes(x, y), ...)Filled shapes ggplot2::geom_path(data, .aes(x, y), ...)Open lines/curves ggplot2::geom_segment(data, .aes(x, xend, y, yend), ...)Segments, arrows ggplot2::geom_rect(data, .aes(xmin, xmax, ymin, ymax), ...)Rects ggforce::geom_circle(data, .aes(x0, y0, r), ...)Circles -
Color strategy:
Alpha Guide: +----------------------+------------+--------------------------+ | Purpose | Alpha | Example | +----------------------+------------+--------------------------+ | Large fill (body) | 0.08-0.15 | hex_with_alpha(col, 0.1) | | Medium fill (accent) | 0.15-0.25 | hex_with_alpha(col, 0.2) | | Small fill (detail) | 0.25-0.35 | hex_with_alpha(bright, 0.3) | | Outline stroke | 1.0 | color = bright | | Secondary stroke | 1.0 | color = col | | No fill | --- | fill = NA | +----------------------+------------+--------------------------+ -
Return flat
list()→ renderer wraps each w/ glow -
Place fn in right primitives file:
- Skills: domain-grouped across 19 files:
primitives.R— bushcraft, compliance, containerization, data-serialization, defensiveprimitives_2.R— devops, general, git, mcp-integrationprimitives_3.R— mlops, observability, PM, r-packages, reporting, review, web-dev, esoteric, designprimitives_4.Rthroughprimitives_19.Rfor newer
- Agents:
viz/R/agent_primitives.R - Teams:
viz/R/team_primitives.R
- Skills: domain-grouped across 19 files:
Got: Working R fn → list of 2-6 layers.
If err: ggforce::geom_circle err → install ggforce. Coords off → canvas 100x100, (0,0) bottom-left. Test:
source("viz/R/utils.R"); source("viz/R/primitives.R") # etc.
layers <- glyph_<name>(50, 50, 1.0, "#ff88dd", "#ffa8f0")
p <- ggplot2::ggplot() + ggplot2::coord_fixed(xlim=c(0,100), ylim=c(0,100)) +
ggplot2::theme_void()
for (l in layers) p <- p + l
print(p)
Step 3: Register
Map entity → glyph.
Skills:
- Open
viz/R/glyphs.R - Find domain section comment (
# -- design (3)) - Alphabetical in domain block:
"skill-id" = "glyph_function_name", - Update count comment if applicable
Agents:
- Open
viz/R/agent_glyphs.R - Alphabetical in
AGENT_GLYPHS:"agent-id" = "glyph_function_name",
Teams:
-
Open
viz/R/team_glyphs.R -
Alphabetical in
TEAM_GLYPHS:"team-id" = "glyph_function_name", -
Verify no dup ID
Got: *_GLYPHS list has new mapping.
If err: "No glyph mapped" → check ID exact match vs manifest + registry.
Step 4: Manifest
Register icon.
Skills: viz/data/icon-manifest.json
{
"skillId": "skill-id",
"domain": "domain-name",
"prompt": "<domain basePrompt>, <descriptors>, dark background, vector art",
"seed": <next_seed>,
"path": "public/icons/cyberpunk/<domain>/<skill-id>.webp",
"status": "pending"
}
Agents: viz/data/agent-icon-manifest.json
{
"agentId": "agent-id",
"prompt": "<agent-specific descriptors>, dark background, vector art",
"seed": <next_seed>,
"path": "public/icons/cyberpunk/agents/<agent-id>.webp",
"status": "pending"
}
Teams: viz/data/team-icon-manifest.json
{
"teamId": "team-id",
"prompt": "<team-specific descriptors>, dark background, vector art",
"seed": <next_seed>,
"path": "public/icons/cyberpunk/teams/<team-id>.webp",
"status": "pending"
}
Got: Valid JSON, entry among type siblings.
If err: Validate syntax. Common: trailing comma after last elem, missing quotes.
Step 5: Render
Run pipeline. Always build.sh → platform detect + R binary. See render-icon-pipeline.
# From project root — renders all palettes, standard + HD, skips existing icons
bash viz/build.sh --only <domain> --skip-existing # skills
bash viz/build.sh --type agent --only <id> --skip-existing # agents
bash viz/build.sh --type team --only <id> --skip-existing # teams
# Dry run first:
bash viz/build.sh --only <domain> --dry-run
build.sh = full pipeline (palette → data → manifest → render → terminal glyphs). Non-render steps +~10s but ensure current.
Out:
- Skills:
viz/public/icons/<palette>/<domain>/<skill-id>.webp - Agents:
viz/public/icons/<palette>/agents/<agent-id>.webp - Teams:
viz/public/icons/<palette>/teams/<team-id>.webp
Got: Log OK: <entity> (seed=XXXXX, XX.XKB), WebP exists.
If err:
"No glyph mapped"— Step 3 missing / typo"Unknown domain"— Not inget_palette_colors()inpalettes.R- R pkg err —
install.packages(c("ggplot2", "ggforce", "ggfx", "ragg", "magick")) - Crash → test fn interactive (Step 2 fallback)
Step 6: Verify
-
Check file + size:
ls -la viz/public/icons/cyberpunk/<type-path>/<entity-id>.webp # Expected: 15-80 KB typical range -
Open WebP → check:
- Shape clear @ 1024x1024
- Neon glow present, not overpowering
- BG transparent (no rect)
- No edge clip
-
Small sizes (~40-160px in graph):
- Shape recognizable
- Detail ≠ noise
- Glow doesn't overwhelm
Got: Clear pictogram + even glow + transparent BG.
If err:
- Glow strong → re-render
--glow-sigma 2 - Glow weak →
--glow-sigma 8 - Unreadable small → simplify (fewer layers, bolder strokes,
.lw(s, base)higher) - Edge clip → reduce dims / shift center
Step 7: Iterate
-
Common adjustments:
- Bolder strokes:
.lw(s, base)→base = 3.0/3.5 - Visible fill: alpha 0.10 → 0.15-0.20
- Proportions: tweak
smultipliers (20 * s→24 * s) - Add/rm layers: 2-6 best
- Bolder strokes:
-
Re-render:
# Delete the existing icon first, then re-render rm viz/public/icons/cyberpunk/<type-path>/<entity-id>.webp # Use the appropriate build command from Step 5 -
When done → manifest status =
"done"(auto on success)
Got: Icon passes Step 6.
If err: 3+ iter fail → try diff metaphor (→ Step 1).
Reference
Domain + Entity Palettes
All 58 domain colors (skills) in viz/R/palettes.R (single truth). Agent/team colors same. Cyberpunk (hand-tuned neon) in get_cyberpunk_colors(). Viridis auto via viridisLite.
Lookup:
source("viz/R/palettes.R")
get_palette_colors("cyberpunk")$domains[["design"]] # skill domain
get_palette_colors("cyberpunk")$agents[["mystic"]] # agent
get_palette_colors("cyberpunk")$teams[["tending"]] # team
New domain → 3 places in palettes.R:
PALETTE_DOMAIN_ORDER(alphabetical)get_cyberpunk_colors()domains list- Run
bash viz/build.sh→ regen palettes + data + manifests
Glyph Fn Catalog
Full catalog in primitives source:
- Skills:
viz/R/primitives.R→viz/R/primitives_19.R(domain-grouped) - Agents:
viz/R/agent_primitives.R - Teams:
viz/R/team_primitives.R
Helpers
| Fn | Sig | Purpose |
|---|---|---|
.lw(s, base) | (scale, base=2.5) | Scale-aware line width |
.aes(...) | alias for ggplot2::aes | Shorthand aes map |
hex_with_alpha(hex, alpha) | (string, 0-1) | Alpha on hex |
brighten_hex(hex, factor) | (string, factor=1.3) | Brighten |
dim_hex(hex, factor) | (string, factor=0.4) | Dim |
Check
- Fn signature:
glyph_<name>(cx, cy, s, col, bright) -> list() - All dims
* s - Colors:
colfills,brightoutlines,hex_with_alpha()transparency - Fn in correct primitives file
- Mapping in right
*_glyphs.R - Manifest entry + correct path +
"status": "pending" - Build runs no err (dry-run first)
- WebP at expected path
- Size 15-80 KB
- Reads clear 1024px + ~40px
- Transparent BG
- Status →
"done"post-render
Traps
- Forgot
* s: Hard-coded px breaks on scale. Multiply bysalways. - Canvas origin: (0,0) bottom-left. Higher
y= UP. - Double glow: Renderer applies
ggfx::with_outer_glow(). Do NOT add in fn. - Too many layers: Each gets glow wrap. >8 = slow + noisy.
- ID mismatch: Glyph map + manifest + registry must match exact.
- JSON trailing commas: Strict JSON. No trailing comma.
- Missing domain color: Not in
get_cyberpunk_colors()→ render err. Add color first. - Wrong primitives file: Skills →
primitives*.R, agents →agent_primitives.R, teams →team_primitives.R.
→
- enhance-glyph — improve quality / fix / add layers
- audit-icon-pipeline — detect missing
- render-icon-pipeline — full pipeline E2E
- ornament-style-mono — AI img gen alt
- ornament-style-color — color theory
- create-skill — parent workflow triggering glyph
GitHub 仓库
Frequently asked questions
What is the create-glyph skill?
create-glyph is a Claude Skill by pjt222. Skills package instructions and resources that Claude loads on demand, so Claude can perform create-glyph-related tasks without extra prompting.
How do I install create-glyph?
Use the install commands on this page: add create-glyph to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.
What category does create-glyph belong to?
create-glyph is in the Meta category, tagged ai and design.
Is create-glyph free to use?
Yes. create-glyph is listed on AIMCP and free to install. It runs inside Claude, so no separate service account is required to use the skill itself.
相关推荐技能
Content Collections 是一个 TypeScript 优先的构建工具,可将本地 Markdown/MDX 文件转换为类型安全的数据集合。它专为构建博客、文档站和内容密集型 Vite+React 应用而设计,提供基于 Zod 的自动模式验证。该工具涵盖从 Vite 插件配置、MDX 编译到生产环境部署的完整工作流。
这个Claude Skill为开发者提供完整的Polymarket预测市场开发支持,涵盖API调用、交易执行和市场数据分析。关键特性包括实时WebSocket数据流,可监控实时交易、订单和市场动态。开发者可用它构建预测市场应用、实施交易策略并集成实时市场预测功能。
该Skill帮助开发者创建OpenCode插件,用于接入命令、文件、LSP等25+种事件。它提供了插件结构、事件API规范和JavaScript/TypeScript实现模式,适合需要拦截操作、扩展功能或自定义事件处理的场景。开发者可通过它快速构建响应式模块来增强OpenCode AI助手的能力。
SGLang是一个专为LLM设计的高性能推理框架,特别适用于需要结构化输出的场景。它通过RadixAttention前缀缓存技术,在处理JSON、正则表达式、工具调用等具有重复前缀的复杂工作流时,能实现极速生成。如果你正在构建智能体或多轮对话系统,并追求远超vLLM的推理性能,SGLang是理想选择。
