返回技能列表

create-glyph

pjt222
更新于 6 days ago
22 次查看
17
2
17
在 GitHub 上查看
aidesign

关于

This skill creates R-based pictogram glyphs for entity icons in the visualization layer using ggplot2 and a primitives library. It handles the entire workflow from concept and color strategy to registration, pipeline rendering, and verification of the neon-glow output. Use it when adding a new entity needing a visual icon, replacing an existing glyph, 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-almanac
Git 克隆备选方式
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/create-glyph

在 Claude Code 中复制并粘贴此命令以安装该技能

技能文档

造符

viz/ 視層造 R 基象圖符為技、代、團標。各符為純 ggplot2 函,於 100x100 畫繪可識形、以霓暈效渲為透 WebP。

  • 新技、代、團已加須視標
  • 存符須換或重設
  • 為新技域批造符
  • 試視喻為項概

  • :項型 — skillagentteam
  • :項 ID(如 create-glyphmysticr-package-review)與域(技時)
  • :視概——符當繪何
  • :考符以評複
  • :自定 --glow-sigma 值(默:4)

一:概——設視喻

識所符項並擇視喻。

  1. 讀項源以曉核概:
    • 技:skills/<id>/SKILL.md
    • 代:agents/<id>.md
    • 團:teams/<id>.md
  2. 擇喻型:
    • 實物:實驗用瓶、安用盾
    • 抽符:併用箭、迭用螺
    • :合 2-3 簡形(如文+筆)
  3. 參存符以校複:
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        |
+----------+--------+-------------------------------------------+
  1. 定函名:glyph_<descriptive_name>(snake_case、獨)

得: 形之明心圖含 2-6 計層。

敗: 概過抽→退至相關實物。參同域存符為靈。

二:組——書符函

書生 ggplot2 層之 R 函。

  1. 函簽(不變約):

    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
      }
    
  2. 施比因 * s 於諸寸為一致:

    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
    
  3. 以可用原建幾:

    ggplot2::geom_polygon(data, .aes(x, y), ...)填形
    ggplot2::geom_path(data, .aes(x, y), ...)開線/曲
    ggplot2::geom_segment(data, .aes(x, xend, y, yend), ...)線段、箭
    ggplot2::geom_rect(data, .aes(xmin, xmax, ymin, ymax), ...)
    ggforce::geom_circle(data, .aes(x0, y0, r), ...)
  4. 施色策:

    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                |
    +----------------------+------------+--------------------------+
    
  5. 返平 list() 層(渲器迭而以暈包各)

  6. 按項型置函於合原檔:

    • :19 原檔按域組
    • viz/R/agent_primitives.R
    • viz/R/team_primitives.R

得: 返 2-6 ggplot2 層之可用 R 函。

敗: ggforce::geom_circle 誤→保 ggforce 裝。坐偏→記畫 100x100、(0,0) 於左下。交互試:

source("viz/R/utils.R"); source("viz/R/primitives.R")
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)

三:註——映項至符

於合符映檔加項符映。

技:viz/R/glyphs.R、於域塊內按字母序加 "skill-id" = "glyph_function_name", 代:viz/R/agent_glyphs.R、於 AGENT_GLYPHS 加同樣項 團:viz/R/team_glyphs.R、於 TEAM_GLYPHS 加同樣項

驗目列無重 ID。

得:*_GLYPHS 列含新映。

敗: 構報「No glyph mapped」→復察項 ID 合備與庫。

四:備——加標項

於合備檔註標。

技: 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"
}

代: viz/data/agent-icon-manifest.json(用 agentIdpublic/icons/cyberpunk/agents/<agent-id>.webp

團: viz/data/team-icon-manifest.json(用 teamIdpublic/icons/cyberpunk/teams/<team-id>.webp

得: 有效 JSON 含新項置於同型兄弟。

敗: 驗 JSON 文法。常誤:末陣元後遺逗、缺引。

五:渲——生標

行標流渲新符。恆用 build.sh 為入——理平台辨與 R 二擇。見 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 行全流(palette → data → manifest → render → terminal glyphs)。

出位:

  • 技:viz/public/icons/<palette>/<domain>/<skill-id>.webp
  • 代:viz/public/icons/<palette>/agents/<agent-id>.webp
  • 團:viz/public/icons/<palette>/teams/<team-id>.webp

得: 誌顯 OK: <entity> (seed=XXXXX, XX.XKB) 而 WebP 檔存。

敗:

  • "No glyph mapped" — 步三映缺或錯
  • "Unknown domain" — 域不於 palettes.Rget_palette_colors()
  • R 包誤 — 先行 install.packages(c("ggplot2", "ggforce", "ggfx", "ragg", "magick"))
  • 渲崩→交互試符函

六:驗——視察

察渲出合質準。

  1. 驗檔存且寸合:

    ls -la viz/public/icons/cyberpunk/<type-path>/<entity-id>.webp
    # Expected: 15-80 KB typical range
    
  2. 以像視開 WebP 察:

    • 形於全寸(1024x1024)清讀
    • 霓暈存而不蓋
    • 背透(無黑白矩)
    • 畫邊無裁
  3. 於小寸察(力圖中標渲於~40-160px):

    • 形仍可識
    • 細不化噪
    • 暈不蓋形

得: 清、可識之象圖含透背之均霓暈。

敗:

  • 暈強→以 --glow-sigma 2 重渲
  • 暈弱→以 --glow-sigma 8 重渲
  • 小寸不讀→簡符、粗筆、增 .lw(s, base)
  • 邊裁→減形寸或移中

七:迭——若需則精

調而重渲。

  1. 常調:

    • 粗筆:增 .lw(s, base) — 試 base = 3.03.5
    • 更顯填:alpha 自 0.10 增至 0.15-0.20
    • 形比:調 s 之乘(如 20 * s -> 24 * s
    • 加/減細層:總層保於 2-6
  2. 改後重渲:刪存標、用合構令重渲

  3. 滿時驗備態顯 "done"

得: 終標通步六諸察。

敗: 3+ 迭後符仍不讀→考全異視喻(返步一)。

域與項色盤

58 域色(技)定於 viz/R/palettes.R(唯真源)。代與團色亦理於 palettes.R。cyberpunk 色盤於 get_cyberpunk_colors()

source("viz/R/palettes.R")
get_palette_colors("cyberpunk")$domains[["design"]]
get_palette_colors("cyberpunk")$agents[["mystic"]]
get_palette_colors("cyberpunk")$teams[["tending"]]

加新域時於 palettes.R 三處加:PALETTE_DOMAIN_ORDER(字母)、get_cyberpunk_colors() 域列、行 bash viz/build.sh 重生。

符函錄

  • viz/R/primitives.Rviz/R/primitives_19.R(按域組)
  • viz/R/agent_primitives.R
  • viz/R/team_primitives.R

助函

.lw(s, base)(scale, base=2.5)比覺線寬
.aes(...)ggplot2::aes簡美映
hex_with_alpha(hex, alpha)(string, 0-1)加 alpha 於 hex 色
brighten_hex(hex, factor)(string, factor=1.3)亮 hex 色
dim_hex(hex, factor)(string, factor=0.4)暗 hex 色

  • 符函循 glyph_<name>(cx, cy, s, col, bright) -> list()
  • 諸寸用 * s 比因
  • 色策填用 col、廓用 bright、透用 hex_with_alpha()
  • 函置於合項型與域之原檔
  • 符映項加於合 *_glyphs.R
  • 備項含正項 ID、路、"status": "pending"
  • 構令無誤行(先試行)
  • 渲 WebP 存於期路
  • 檔寸於期範(15-80 KB)
  • 標於 1024px 與~40px 顯寸皆清讀
  • 透背(符後無實矩)
  • 成渲後備態更為 "done"

  • * s:硬碼素值比變時破
  • 畫原惑:(0,0) 於左下、非左上
  • 雙暈:渲器已施 ggfx::with_outer_glow()、勿於符函內加暈
  • 層過多:過 8 層渲慢且視噪
  • ID 不合:符映、備、庫之項 ID 須皆合
  • JSON 末逗:備為嚴 JSON、末陣元後無逗
  • 域色缺:域不於 get_cyberpunk_colors()→渲誤
  • 誤原檔:技於 primitives*.R、代於 agent_primitives.R、團於 team_primitives.R

GitHub 仓库

pjt222/agent-almanac
路径: i18n/wenyan-ultra/skills/create-glyph
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

相关推荐技能

content-collections

Content Collections 是一个 TypeScript 优先的构建工具,可将本地 Markdown/MDX 文件转换为类型安全的数据集合。它专为构建博客、文档站和内容密集型 Vite+React 应用而设计,提供基于 Zod 的自动模式验证。该工具涵盖从 Vite 插件配置、MDX 编译到生产环境部署的完整工作流。

查看技能

polymarket

这个Claude Skill为开发者提供完整的Polymarket预测市场开发支持,涵盖API调用、交易执行和市场数据分析。关键特性包括实时WebSocket数据流,可监控实时交易、订单和市场动态。开发者可用它构建预测市场应用、实施交易策略并集成实时市场预测功能。

查看技能

creating-opencode-plugins

该Skill帮助开发者创建OpenCode插件,用于接入命令、文件、LSP等25+种事件。它提供了插件结构、事件API规范和JavaScript/TypeScript实现模式,适合需要拦截操作、扩展功能或自定义事件处理的场景。开发者可通过它快速构建响应式模块来增强OpenCode AI助手的能力。

查看技能

sglang

SGLang是一个专为LLM设计的高性能推理框架,特别适用于需要结构化输出的场景。它通过RadixAttention前缀缓存技术,在处理JSON、正则表达式、工具调用等具有重复前缀的复杂工作流时,能实现极速生成。如果你正在构建智能体或多轮对话系统,并追求远超vLLM的推理性能,SGLang是理想选择。

查看技能