Svg Audit 标志

Svg Audit

社区
Sagargupta16
svg-audit

审核现有的 SVG 文件或 React 动画场景,按优先级列出发现的问题和修复建议,涵盖渲染目标兼容性(GitHub README 图片代理、浏览器)、无障碍性、动画质量、文件体积和代码规范。先运行随附的验证器,再检查代码检查工具无法发现的问题。用户说“审核这个 SVG”“为什么我的 SVG 在 GitHub 上不播放动画”“检查这张 README 卡片”“这个 SVG 是否支持无障碍访问”“评审我的动画”“缩小这个 SVG”,或运行 /svg-audit [file] 时使用。先报告问题;只有用户要求修复时才编辑文件。

Add to TypingMind

概览

发布者Sagargupta16
代码仓库svg-forge
技能名称svg-audit
星标数
3
复刻数
0
附带文件
仅含指令
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 Sagargupta16 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Svg Audit AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/Sagargupta16/svg-forge/tree/main/skills/svg-audit
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Sagargupta16/svg-forge.git /tmp/svg-forge
mkdir -p .claude/skills
cp -r /tmp/svg-forge/skills/svg-audit .claude/skills/svg-audit
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Svg Audit,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Svg Audit。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Svg Audit 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

svg-audit

Find what is wrong with an SVG or an animated scene, rank it by how much it hurts, and say exactly how to fix each item. Default mode is read-only: print the report and stop. Apply fixes only when the user asks ("fix it", "--fix", "apply").

1. Identify the artifact and its target

ArtifactTargetPrimary references
.svg shown through <img> in a README, docs site or emailstandalonegithub-readme, smil-and-css
.svg inlined in a web pagewebsmil-and-css, accessibility
React component animated with Motionscenemotion, verify

Ask only if the target cannot be inferred from where the file lives or how it is referenced (grep the repo for its filename).

The references above live in the sibling animated-svg and motion-scene skills of the svg-forge plugin; this skill reads them, so install the plugin, not this folder alone.

2. Run the validator (SVG files)

bash
python skills/animated-svg/scripts/validate_svg.py path/to/file.svg --target standalone --strict-contrast --json

Use --target web for inline page SVGs. For one half of a <picture> pair add --theme dark or --theme light; otherwise text with no background of its own is measured on both GitHub pages. Every error is a finding. Warnings become findings when they matter for the target. Quote rule ids (SV0xx) so the user can look them up; SV021-SV023 are WCAG contrast (text 4.5:1, large text and solid shapes 3:1), with each measurement under stats.contrast.

Then render the timeline so motion findings rest on frames, not guesses:

bash
python skills/animated-svg/scripts/frames.py path/to/file.svg --theme both

Read the PNG contact sheet it writes: entrances, overlaps, labels that are hidden at rest, and whether the seam frame matches t=0. Exit 3 means no browser was found; say so in the report instead of guessing.

For a scene component, there is no validator: read the component and its helpers instead, and apply the checks in section 3.

3. Review what the validator cannot see

Work through each lens and record findings with a file and line.

Render-target safety

  • Standalone: anything that needs network, script, or an HTML context fails silently on GitHub. External fonts fall back to system fonts, so check text still fits.
  • Dark and light: text needs 4.5:1 and marks 3:1 on both GitHub themes (the validator measures this), or the file must ship as a <picture> pair. In-SVG prefers-color-scheme does not follow GitHub's theme and fails on WebKit. For a fix, regenerate with forge.py --theme both or a preset; it tunes every color to pass.
  • Paint order: a far edge showing through a near panel, a wire crossing the face of the panel it should end at, a dashed guide over its own plate. The fix is order and an opaque fill, not a mask.
  • Browser quirks: SMIL path morphs are the only morphs Safari plays; calcMode misspelled (calcmod) silently drops keySplines; pathLength together with vector-effect="non-scaling-stroke" stops line draws short in Chrome.

Motion quality

  • Rest frame: read the static attributes as the first frame and judge it as the thumbnail. A flat grid, an empty tray or every element at opacity="0" fails; so does a rest that looks like nothing rendered yet.
  • One highlight: one bright mark at rest; a beat moves it, never adds a second. Two lit places at once is a finding.
  • Loop shape: a loop that opens on an empty stage leaves a half-built poster and frozen frame; opening on the finished state with a clear window, or a static ghost layer under the build-up, is the fix.
  • A state change: at least one beat decides something (a row rejected, a check popped, a slot filled); motion with nothing decided is a polish finding.
  • One clock: beats in a loop should share one duration so they never drift apart.
  • Seamless loop: the last keyframe equals the first, or the restart happens while the element is invisible.
  • Easing: multi-keyframe animations need per-segment easing (keySplines per segment, or an ease array in Motion when times is set).
  • Budget: count animated elements; more than about 12 in one scene, or 40 in one file, reads as noise and costs CPU.
  • Only transform and opacity (plus stroke dash properties for line draws) should animate in scenes.

Accessibility

  • Meaningful graphic: role="img" plus <title> (and <desc> when it carries information) referenced by aria-labelledby, or alt text on the <img>.
  • Decorative graphic: aria-hidden="true" (inline) or empty alt (image).
  • Auto-playing motion longer than 5 s has no pause control inside an image: note it, do not block on it.

Weight and hygiene

  • Size against the budget for the target (standalone: aim under 50 KB, hard stop 100 KB unless the user accepts more). python skills/animated-svg/scripts/optimize_svg.py FILE --check reports what an animation-safe minify would save without writing anything.
  • Embedded rasters at more than twice their drawn size, unused <defs>, duplicated paths that could be <use>.
  • Ids prefixed and unique when the file inlines icons or may be inlined into a page.
  • Deterministic output if the file is generated: same input, same bytes.

4. Report

Print a table ranked by severity, then a short verdict.

| # | severity | where | finding | fix |
| 1 | error    | card.svg:12 | <image href="https://..."> is blocked by GitHub's image proxy | inline it as a data URI under 64 KB, or drop it |
| 2 | warn     | card.svg:40 | 6 s loop with beats on 4 s and 6 s clocks drifts | put every beat on the 6 s clock |
verdict: renders on GitHub after fix 1; 2 is polish.

Severity: error (does not render or is unsafe), warn (renders but looks wrong somewhere or hurts access), polish (quality).

5. Fix mode (only when asked)

  • Apply fixes in severity order, one finding at a time, keeping unrelated markup byte-identical.
  • Re-run the validator after each change; the report's errors must reach zero.
  • For generated files, fix the generator or its input, not the output.
  • Show the diff and the new validator result.

常见问题

Svg Audit AI 技能有什么作用?

审核现有的 SVG 文件或 React 动画场景,按优先级列出发现的问题和修复建议,涵盖渲染目标兼容性(GitHub README 图片代理、浏览器)、无障碍性、动画质量、文件体积和代码规范。先运行随附的验证器,再检查代码检查工具无法发现的问题。用户说“审核这个 SVG”“为什么我的 SVG 在 GitHub 上不播放动画”“检查这张 README 卡片”“这个 SVG 是否支持无障碍访问”“评审我的动画”“缩小这个 SVG”,或运行 /svg-audit [file] 时使用。先报告问题;只有用户要求修复时才编辑文件。

为什么在 TypingMind 中使用 Svg Audit?

因为您只需安装一次,就能搭配任何模型使用。Svg Audit 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Svg Audit?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/Sagargupta16/svg-forge/tree/main/skills/svg-audit。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Svg Audit?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Svg Audit 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Svg Audit 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Svg Audit AI 技能免费吗?

是的。Sagargupta16 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇