agentleFS
ViviBeriViviBeri/webcraft-pro/skills/icon-engineering/SKILL.md

icon-engineering

Skill11 starsChanged 10 days agoMITView on GitHub

Use when selecting, authoring, integrating, styling or reviewing SVG icons, icon assets and icon-only controls in web interfaces.

The file

Show its rules and text

We split this skill into the rules it gives an agent

35 rules. About 0 are common, 31 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈31

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Prefer inline SVG when an icon needs CSS styling, state changes, accessible integration or precise control over its markup.

    line 15
  2. Distinctive:

    Use an external SVG file through an image or background when the graphic is static and does not need internal styling or an accessible name …

    line 16
  3. Distinctive:

    Use a text glyph only when it is genuinely typographic content, not as a substitute for a consistent interface icon.

    line 17
  4. Distinctive:

    Avoid icon fonts for interface controls when SVG or an existing platform icon system provides more reliable sizing, rendering and …

    line 18
  5. Distinctive:

    Do not add an icon package or copy an icon collection merely to supply a small number of symbols.

    line 19
  6. Distinctive:

    Use explicit width/height or a predictable CSS sizing contract to prevent layout shifts.

    line 24
  7. Very specific:

    Prefer fill="currentColor" and/or stroke="currentColor" when the icon should inherit text color.

    line 25
  8. Distinctive:

    Keep path geometry and markup minimal.

    line 26
  9. Distinctive:

    Avoid hard-coded colors unless the icon is intentionally multicolor.

    line 28
  10. Distinctive:

    Do not rely on CSS transforms to correct a poorly authored viewBox or misaligned source geometry.

    line 29
  11. Distinctive:

    Test at the actual small sizes, device pixel ratios, zoom levels and themes used by the interface.

    line 30
  12. Distinctive:

    When adjacent text already provides the complete meaning, remove the SVG from the accessibility tree:

    line 38
  13. Very specific:

    When the SVG itself communicates information not provided by nearby text, give it an accessible name.

    line 48
  14. Distinctive:

    Ensure IDs are unique when rendering repeated instances.

    line 57
  15. Distinctive:

    Prefer visible text when space and design allow.

    line 71
  16. Very specific:

    Use em when the icon should scale with text, or explicit dimensions when the component contract requires a fixed size.

    line 76
  17. Very specific:

    Use currentColor for icons that follow text and control states.

    line 77
  18. Distinctive:

    Keep pointer targets large enough for the control's purpose even when the visible icon is small.

    line 79
  19. Distinctive:

    Avoid changing layout dimensions on hover.

    line 80
  20. Distinctive:

    Do not prescribe one animation duration for every interaction.

    line 116
  21. Distinctive:

    Keep the underlying control state and accessible name correct even when animation is disabled, interrupted or unsupported.

    line 120
  22. Distinctive:

    Use CSS for a simple visual swap.

    line 121
  23. Distinctive:

    Avoid animating the only indication of success, error, selection or expanded state.

    line 122
  24. Distinctive:

    Do not make interaction completion wait for an animation.

    line 123
  25. Distinctive:

    Avoid continuous decorative motion unless it communicates ongoing status and can be paused or stopped where required.

    line 125
  26. Distinctive:

    Check the license for the exact icon assets and any font files.

    line 131
  27. Distinctive:

    Avoid shipping unused icons or entire libraries when tree-shaking or selective asset inclusion is available.

    line 133
  28. Distinctive:

    Check SVG dimensions, viewBox, stroke/fill consistency and clipping.

    line 138
  29. Distinctive:

    Test hover, focus-visible, pressed, disabled, selected and state-change behavior without relying on animation.

    line 141
  30. Distinctive:

    Check for layout shifts, unnecessary asset payload and broken external asset paths.

    line 143
  31. Distinctive:

    Verify licenses and attribution before redistributing third-party artwork.

    line 144
  32. Distinctive:

    Use semantic accessibility for general accessible names and HTML semantics.

    line 148
  33. Distinctive:

    Use accessible components for widget roles, keyboard models and focus lifecycle.

    line 149
  34. Distinctive:

    Use image asset optimization for broader media delivery and responsive asset performance.

    line 150
  35. Distinctive:

    Use motion design systems and accessible motion for shared motion tokens and motion accessibility requirements.

    line 151

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Icon Engineering

Objective

Deliver icons that remain crisp, understandable, accessible, themeable and efficient across supported browsers and input modes. Prefer platform capabilities and existing project conventions over adding an icon dependency.

1. Choose the right representation

  1. Inspect the project's existing icon source, design system, licensing requirements and rendering constraints before introducing assets or tooling.
  2. Prefer inline SVG when an icon needs CSS styling, state changes, accessible integration or precise control over its markup.
  3. Use an external SVG file through an image or background when the graphic is static and does not need internal styling or an accessible name beyond the surrounding content.
  4. Use a text glyph only when it is genuinely typographic content, not as a substitute for a consistent interface icon.
  5. Avoid icon fonts for interface controls when SVG or an existing platform icon system provides more reliable sizing, rendering and accessible behavior.
  6. Do not add an icon package or copy an icon collection merely to supply a small number of symbols. Check package maintenance, bundle impact and asset licenses first.

2. Author robust SVG

  • Include a meaningful viewBox so the graphic scales independently of its rendered dimensions.
  • Use explicit width/height or a predictable CSS sizing contract to prevent layout shifts.
  • Prefer fill="currentColor" and/or stroke="currentColor" when the icon should inherit text color.
  • Keep path geometry and markup minimal; remove editor metadata and unused definitions from production assets.
  • Preserve required title, desc, IDs, gradients, masks and definitions. Do not run destructive optimization that changes rendering or removes accessibility information.
  • Avoid hard-coded colors unless the icon is intentionally multicolor.
  • Do not rely on CSS transforms to correct a poorly authored viewBox or misaligned source geometry.
  • Test at the actual small sizes, device pixel ratios, zoom levels and themes used by the interface.

3. Apply the correct accessibility model

Decide whether the icon is decorative or conveys information in context.

Decorative icon

When adjacent text already provides the complete meaning, remove the SVG from the accessibility tree:

<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24">
  <path d="..." />
</svg>

Informative standalone icon

When the SVG itself communicates information not provided by nearby text, give it an accessible name. Use a title referenced by aria-labelledby, or provide an equivalent accessible name through the surrounding component.

<svg role="img" aria-labelledby="status-title" viewBox="0 0 24 24">
  <title id="status-title">Connection secure</title>
  <path d="..." />
</svg>

Ensure IDs are unique when rendering repeated instances. Do not label an SVG as informative if the same meaning is already conveyed by visible adjacent text.

Icon-only control

Name the interactive control, not merely the decorative SVG inside it:

<button type="button" aria-label="Close dialog">
  <svg aria-hidden="true" focusable="false" viewBox="0 0 24 24">
    <path d="..." />
  </svg>
</button>

Prefer visible text when space and design allow. Keep the accessible name aligned with the action and update it when the action changes. A tooltip alone is not a reliable accessible name.

4. Style icons consistently

  • Establish a small set of semantic size tokens and align icons to the surrounding text baseline.
  • Use em when the icon should scale with text, or explicit dimensions when the component contract requires a fixed size.
  • Use currentColor for icons that follow text and control states.
  • Preserve a visible focus indicator on the interactive control; do not rely on icon color or motion alone to indicate focus.
  • Keep pointer targets large enough for the control's purpose even when the visible icon is small.
  • Avoid changing layout dimensions on hover. Use color, opacity or a restrained transform only when it improves feedback.

5. Use CSS for simple visual states

CSS is suitable for hover, focus-visible and pressed feedback. The interactive control must remain fully functional without animation.

.icon-button {
  display: inline-grid;
  place-items: center;
  min-inline-size: 2.75rem;
  min-block-size: 2.75rem;
  border: 0;
  border-radius: 0.5rem;
  color: var(--icon-color, currentColor);
  background: transparent;
  transition: color 160ms ease, background-color 160ms ease;
}

.icon-button:hover {
  color: var(--icon-color-hover, currentColor);
  background: var(--icon-background-hover, transparent);
}

.icon-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .icon-button {
    transition: none;
  }
}

Do not prescribe one animation duration for every interaction. Choose timing according to the component, user preference and motion system. Do not claim that transform or opacity is automatically GPU-accelerated or free; profile when performance matters.

6. Animate icon state only when it adds meaning

  • Keep the underlying control state and accessible name correct even when animation is disabled, interrupted or unsupported.
  • Use CSS for a simple visual swap; use a motion library only when sequencing, orchestration or measured requirements justify it.
  • Avoid animating the only indication of success, error, selection or expanded state.
  • Do not make interaction completion wait for an animation.
  • Respect prefers-reduced-motion with a static state or a substantially reduced effect.
  • Avoid continuous decorative motion unless it communicates ongoing status and can be paused or stopped where required.

7. Optimize and license assets safely

  • Optimize SVGs with a maintained tool only after checking visual output and preserving required accessibility metadata.
  • Reuse shared symbols or sprites only when they reduce duplication without complicating styling, caching, accessibility or deployment.
  • Check the license for the exact icon assets and any font files. A repository's source-code license may not cover separately licensed artwork.
  • Record provenance and required attribution for assets that are redistributed.
  • Avoid shipping unused icons or entire libraries when tree-shaking or selective asset inclusion is available.

8. Verify

  1. Inspect the rendered icon at intended sizes, zoom levels, themes and supported browsers.
  2. Check SVG dimensions, viewBox, stroke/fill consistency and clipping.
  3. Inspect the accessibility tree to confirm decorative icons are ignored and informative icons or controls have accurate names.
  4. Operate icon-only controls by keyboard and touch; verify focus visibility and target size.
  5. Test hover, focus-visible, pressed, disabled, selected and state-change behavior without relying on animation.
  6. Enable reduced motion and confirm the icon remains understandable and the action remains usable.
  7. Check for layout shifts, unnecessary asset payload and broken external asset paths.
  8. Verify licenses and attribution before redistributing third-party artwork.

Boundaries

  • Use semantic accessibility for general accessible names and HTML semantics.
  • Use accessible components for widget roles, keyboard models and focus lifecycle.
  • Use image asset optimization for broader media delivery and responsive asset performance.
  • Use motion design systems and accessible motion for shared motion tokens and motion accessibility requirements.

Completion criteria

Icons have an intentional representation, correct accessible treatment, consistent sizing and styling, safe asset provenance, and verified behavior across relevant themes, input modes and motion preferences. No dependency is added without a demonstrated need.

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.