agentleFS
Ldxs001Ldxs001/maby_skills/svg-composer/SKILL.md

svg-composer

Skill0 starsChanged 3 months agoMITView on GitHub

SVG 拼接工具,支持内置 FontAwesome 字符集(0-9, A-Z)和四种拼接模式

  • Installs packages

The file

Files
SKILL.md

SVG 拼接工具 (svg-composer)

将 SVG 符号进行横向/纵向拼接,支持内置字符集和四种拼接模式。

触发场景

正向触发:

  • [拼接 / 组合 / 合成 SVG 图标或字符]
  • [生成 SVG 密码本 / 验证码 / 全排列组合]
  • [制作复合 SVG 图标 / Logo / 徽章]
  • [批量生成 SVG 预览 HTML]

否定条件:

  • 用户要求生成普通图片(PNG/JPG)——不是 SVG 格式
  • 用户要求矢量绘图但非拼接(如画线框图)——请用 draw.io 技能

核心能力

📚 渐进式加载:本技能采用渐进式 MD 体系,SKILL.md 为入口(≤230行),详细内容拆分到 references/*.md 按需加载。

能力说明限制
内置字符集拼接基于 Font Awesome Free 字符,拼接 0-9、A-Z 文本仅 36 个字符,小写自动转大写
四种拼接模式顺序 / 全排列 / 笛卡尔积 / 限制长度笛卡尔积输入 ≤5 字符,length ≤4
自定义符号拼接从外部 SVG 文件加载符号拼接依赖用户提供 .svg 文件
批量预览 HTML自动生成含下载链接的预览页仅内联 SVG 预览,无服务器

渐进式文件索引

文件名分类包含内容审计关联
references/functions.md函数参考完整函数参数与返回值说明无
references/charset.md字符集内置字符集详情与四种拼接模式对比无
references/examples.md使用示例11 个完整使用示例R-25 C-17
references/changelog.md版本日志版本更新记录R-24
references/faq.md常见问题常见问题与排错R-19, R-25 C-19
references/antipatterns.md反模式常见错误做法与正确做法R-18
references/permissions.md权限说明安全风险评估R-15, R-16
references/LICENSE.md许可协议MIT 许可R-26

快速开始

from svg_composer import compose_text

# 基础拼接(黑色)
svg = compose_text("HELLO", fill="black")
with open('hello.svg', 'w', encoding='utf-8') as f:
    f.write(svg)
# 输出: hello.svg — 包含 HELLO 五个字符的横向拼接 SVG

# 纵向排列
svg = compose_text("ABC", direction='vertical', canvas_size=(400, 600))
# 输出: SVG 字符串 — A/B/C 纵向排列,画布 400x600

工作流程

  1. 用户输入文本,选择拼接模式
  2. 指定颜色(black/white)和方向(horizontal/vertical)
  3. 调用对应函数生成 SVG 字符串
  4. 输出 .svg 文件
  5. 可选:调用 generate_preview_html() 生成预览 HTML

能力边界

输入参数范围

  • text 长度: ≤200 字符,仅 0-9、A-Z(小写自动转大写)
  • canvas_size: 宽/高各 100-4000(像素),默认 640×640
  • margin: 0-200(像素),默认 0
  • font_height_ratio: 0.1-1.0,默认 0.8
  • fill 颜色: 仅 black(#000000)和 white(#FFFFFF)
  • 输入字符数: 笛卡尔积 ≤5 且 length ≤4(≤625 组合);全排列 ≤6(≤720 排列)

环境与依赖

  • Python: 3.7+
  • 依赖: svgpathtools(pip install svgpathtools)
  • 输出格式: 仅 SVG 格式,无 PNG/JPG 导出

其他限制

  • 外部 SVG 符号:仅识别含有效 path data(d 属性)的文件
  • 总拼接长度超过画布时自动等比缩放
  • Font Awesome Free 36 字符内置(0-9、A-Z),不可扩展

本技能由 wUwproject 创作并维护。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.