unique-id
What it does
This skill checks that every id on a web page is used only once. It is for developers who see broken labels or scripts that pick up the wrong element.
When to use it
- ✓When a page has the same id on more than one element.
- ✓When form labels or ARIA links do not connect to their fields.
- ✓When a component library may have created duplicate IDs.
Skill link
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/unique-id/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“My form labels stop working when I use this component twice on a page. Can you check for duplicate IDs?”
5 new skills a week. 1 minute to read.
How it works
The agent scans the page for repeated id values. It then gives each element a unique id and updates the labels, ARIA references and scripts that use them.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Ensure all IDs are unique
Duplicate IDs break form accessibility (labels don't connect), ARIA relationships fail, and JavaScript getElementById returns wrong elements—causing silent bugs.
Quick Reference
- Each ID must appear only once per HTML document
- Use classes for styling, IDs for unique anchors/references
- Check for duplicates introduced by component libraries
- Duplicate IDs break form labels, ARIA, and getElementById
Check
Scan this HTML document to ensure all ID attributes are unique across the entire page and properly reference related elements.
Fix
Remove duplicate ID values, ensure each ID is used only once per page, and update any references like labels, ARIA attributes, or JavaScript selectors.
Explain
Explain why unique IDs are essential for HTML validity, accessibility (form labels, ARIA), JavaScript functionality, and CSS styling.
Code Review
Review templates, server-rendered HTML, and shared components that output markup related to Ensure all IDs are unique. Flag exact elements, attributes, and routes where the rendered HTML violates the rule.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/html/unique-id
FAQ
Why do duplicate IDs matter?
They break form labels, accessibility links and getElementById calls, which can cause silent bugs.
Should I use IDs for styling?
The skill suggests using classes for styling, and IDs only for unique anchors and references.
Can component libraries cause this?
Yes. The skill says duplicates can be introduced by component libraries.
Details
Original description by the author
Use when reviewing templates, rendered HTML, or shared components related to Ensure all IDs are unique. Validate the final browser-facing markup, not just the source framework abstraction.
Popularity
- GitHub stars
- 75k
- Ranking position
- #3069
- License
- MIT
- Updated
- 10/31/2026
Comments
- …
More skills from this repository
frontendchecklist
75kChecks frontend code and live pages against 380+ rules for accessibility, speed, SEO and security, using a command-line tool.
frontend-checklist-global
75kAudits a frontend project against all 386 Front-End Checklist rules, and gives a specific fix for each issue found.
404-page
75kChecks that your missing-page screen offers helpful links and returns a real 404 status, to help lost visitors find their way.
about-page
75kReviews whether your site has a clear About page that explains who runs it, to build trust with visitors and search engines.
Similar skills
angular-developer
280kHelps your agent create Angular code and give project structure advice. Useful for starting new projects, creating code parts, or improving performance and accessibility.
frontend-a11y
280kHelps your agent make web interfaces accessible to everyone. It ensures websites and apps work well with screen readers and keyboard navigation.
frontend-patterns
280kHas your agent apply modern patterns in frontend development. It optimizes performance, manages state, and follows best practices in React and Next.js.