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.
In this repository46 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- accessibility-automationSkill
- accessibility-reviewSkill
- accessible-componentsSkill
- accessible-motionSkill
- animation-performanceSkill
- anti-slop-uiSkill
- api-securitySkill
- authentication-sessionsSkill
- authorization-access-controlSkill
- component-engineeringSkill
- core-web-vitalsSkill
- design-directionSkill
- design-system-architectureSkill
- document-head-seoSkill
- font-performanceSkill
- forms-and-validationSkill
- frontend-architectureSkill
- gsap-fundamentalsSkill
- image-asset-optimizationSkill
- independent-reviewSkill
- interactive-storytellingSkill
- javascript-performanceSkill
- keyboard-focusSkill
- modern-cssSkill
- motion-design-systemsSkill
- network-cachingSkill
- performance-auditingSkill
- performance-testingSkill
- premium-landing-pagesSkill
- quickstart-onboardingSkill
- rendering-performanceSkill
- responsive-engineeringSkill
- screen-reader-testingSkill
- scrolltrigger-experiencesSkill
- secrets-configurationSkill
- secure-application-designSkill
- secure-input-outputSkill
- security-reviewSkill
- security-testingSkill
- semantic-accessibilitySkill
- visual-design-reviewSkill
- visual-reference-analysisSkill
- wcag-auditingSkill
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
- Distinctive: line 15
Prefer inline SVG when an icon needs CSS styling, state changes, accessible integration or precise control over its markup.
- Distinctive: line 16
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 …
- Distinctive: line 17
Use a text glyph only when it is genuinely typographic content, not as a substitute for a consistent interface icon.
- Distinctive: line 18
Avoid icon fonts for interface controls when SVG or an existing platform icon system provides more reliable sizing, rendering and …
- Distinctive: line 19
Do not add an icon package or copy an icon collection merely to supply a small number of symbols.
- Distinctive: line 24
Use explicit width/height or a predictable CSS sizing contract to prevent layout shifts.
- Very specific: line 25
Prefer fill="currentColor" and/or stroke="currentColor" when the icon should inherit text color.
- Distinctive: line 26
Keep path geometry and markup minimal.
- Distinctive: line 28
Avoid hard-coded colors unless the icon is intentionally multicolor.
- Distinctive: line 29
Do not rely on CSS transforms to correct a poorly authored viewBox or misaligned source geometry.
- Distinctive: line 30
Test at the actual small sizes, device pixel ratios, zoom levels and themes used by the interface.
- Distinctive: line 38
When adjacent text already provides the complete meaning, remove the SVG from the accessibility tree:
- Very specific: line 48
When the SVG itself communicates information not provided by nearby text, give it an accessible name.
- Distinctive: line 57
Ensure IDs are unique when rendering repeated instances.
- Distinctive: line 71
Prefer visible text when space and design allow.
- Very specific: line 76
Use em when the icon should scale with text, or explicit dimensions when the component contract requires a fixed size.
- Very specific: line 77
Use currentColor for icons that follow text and control states.
- Distinctive: line 79
Keep pointer targets large enough for the control's purpose even when the visible icon is small.
- Distinctive: line 80
Avoid changing layout dimensions on hover.
- Distinctive: line 116
Do not prescribe one animation duration for every interaction.
- Distinctive: line 120
Keep the underlying control state and accessible name correct even when animation is disabled, interrupted or unsupported.
- Distinctive: line 121
Use CSS for a simple visual swap.
- Distinctive: line 122
Avoid animating the only indication of success, error, selection or expanded state.
- Distinctive: line 123
Do not make interaction completion wait for an animation.
- Distinctive: line 125
Avoid continuous decorative motion unless it communicates ongoing status and can be paused or stopped where required.
- Distinctive: line 131
Check the license for the exact icon assets and any font files.
- Distinctive: line 133
Avoid shipping unused icons or entire libraries when tree-shaking or selective asset inclusion is available.
- Distinctive: line 138
Check SVG dimensions, viewBox, stroke/fill consistency and clipping.
- Distinctive: line 141
Test hover, focus-visible, pressed, disabled, selected and state-change behavior without relying on animation.
- Distinctive: line 143
Check for layout shifts, unnecessary asset payload and broken external asset paths.
- Distinctive: line 144
Verify licenses and attribution before redistributing third-party artwork.
- Distinctive: line 148
Use semantic accessibility for general accessible names and HTML semantics.
- Distinctive: line 149
Use accessible components for widget roles, keyboard models and focus lifecycle.
- Distinctive: line 150
Use image asset optimization for broader media delivery and responsive asset performance.
- Distinctive: line 151
Use motion design systems and accessible motion for shared motion tokens and motion accessibility requirements.
≈ “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.
Files
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
- Inspect the project's existing icon source, design system, licensing requirements and rendering constraints before introducing assets or tooling.
- Prefer inline SVG when an icon needs CSS styling, state changes, accessible integration or precise control over its markup.
- 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.
- Use a text glyph only when it is genuinely typographic content, not as a substitute for a consistent interface icon.
- Avoid icon fonts for interface controls when SVG or an existing platform icon system provides more reliable sizing, rendering and accessible behavior.
- 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
viewBoxso 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/orstroke="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
emwhen the icon should scale with text, or explicit dimensions when the component contract requires a fixed size. - Use
currentColorfor 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-motionwith 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
- Inspect the rendered icon at intended sizes, zoom levels, themes and supported browsers.
- Check SVG dimensions, viewBox, stroke/fill consistency and clipping.
- Inspect the accessibility tree to confirm decorative icons are ignored and informative icons or controls have accurate names.
- Operate icon-only controls by keyboard and touch; verify focus visibility and target size.
- Test hover, focus-visible, pressed, disabled, selected and state-change behavior without relying on animation.
- Enable reduced motion and confirm the icon remains understandable and the action remains usable.
- Check for layout shifts, unnecessary asset payload and broken external asset paths.
- 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.
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
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.

