--- name: html-template description: This skill should be used when writing or reviewing HTML templates to ensure proper E2E testing attributes (data-what, data-which) and ARIA accessibility attributes are included. Use when creating interactive elements like buttons, inputs, links, forms, dialogs, or any HTML markup requiring testing and accessibility compliance. Works seamlessly with the angular-template skill. --- # HTML Template - Testing & Accessibility Attributes This skill should be used when writing or reviewing HTML templates to ensure proper testing and accessibility attributes are included. ## When to Use This Skill Use this skill when: - Writing or modifying Angular component templates - Creating any HTML templates or markup - Reviewing code for testing and accessibility compliance - Adding interactive elements (buttons, inputs, links, etc.) - Implementing forms, lists, navigation, or dialogs **Works seamlessly with:** - **[angular-template](../angular-template/SKILL.md)** - Angular template syntax, control flow, and modern patterns - **[tailwind](../tailwind/SKILL.md)** - ISA design system styling for visual design - **[logging](../logging/SKILL.md)** - MANDATORY logging in all Angular components using `@isa/core/logging` ## Overview This skill provides comprehensive guidance for two critical HTML attribute categories: ### 1. E2E Testing Attributes Enable automated end-to-end testing by providing stable selectors for QA automation: - **`data-what`**: Semantic description of element's purpose - **`data-which`**: Unique identifier for specific instances - **`data-*`**: Additional contextual information ### 2. ARIA Accessibility Attributes Ensure web applications are accessible to all users, including those using assistive technologies: - **Roles**: Define element purpose (button, navigation, dialog, etc.) - **Properties**: Provide additional context (aria-label, aria-describedby) - **States**: Indicate dynamic states (aria-expanded, aria-disabled) - **Live Regions**: Announce dynamic content changes ## Why Both Are Essential - **E2E Attributes**: Enable reliable automated testing without brittle CSS or XPath selectors - **ARIA Attributes**: Ensure compliance with WCAG standards and improve user experience for people with disabilities - **Together**: Create robust, testable, and accessible web applications ## Quick Reference ### Button Example ```html ``` ### Input Example ```html We'll never share your email ``` ### Dynamic List Example ```html @for (item of items; track item.id) {
Are you sure you want to delete this item?