[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CZBE53XNMNNYCMWHXHN32G":3,"skill-same:01M7CZBE53XNMNNYCMWHXHN32G":60},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":32,"commitSha":33,"skillDirectory":34,"forksCount":35,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":36,"ownerBlogUrl":37,"ownerDescription":38,"updatedAt":39,"install":40,"resources":53},"01M7CZBE53XNMNNYCMWHXHN32G","padosoft-frontend-testability",null,"Use this skill when writing or reviewing user-interface markup or components — a page, a form, a modal, a list, a widget, a screen — in a project that has end-to-end tests or will have them. Also when the user says a test broke after a purely visual refactor, that a test waits on a timer, that a selector depends on a generated class name, that a test cannot tell loading from empty, or asks how to make the interface testable. It gives the locator hierarchy the markup has to support, the eight contract rules, and the observable states every asynchronous action owes its test. Do not use it to write the tests themselves (padosoft-test-integrity), to design the interface, or to pick a testing framework.","padosoft\u002Fskills","padosoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F10467753?v=4","01M7CZ3FRSM851DK225E3KK2VF","01M7CZ3FSY016E21VS6EABM21V",1,"MIT","https:\u002F\u002Fgithub.com\u002Fpadosoft\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fpadosoft-frontend-testability\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: padosoft-frontend-testability\ndescription: >-\n  Use this skill when writing or reviewing user-interface markup or components — a page, a form, a modal, a\n  list, a widget, a screen — in a project that has end-to-end tests or will have them. Also when the user\n  says a test broke after a purely visual refactor, that a test waits on a timer, that a selector depends on\n  a generated class name, that a test cannot tell loading from empty, or asks how to make the interface\n  testable. It gives the locator hierarchy the markup has to support, the eight contract rules, and the\n  observable states every asynchronous action owes its test. Do not use it to write the tests themselves\n  (padosoft-test-integrity), to design the interface, or to pick a testing framework.\nlicense: MIT\ncompatibility: >-\n  Web and native user interfaces. Examples use HTML roles and test identifiers; the same contract holds for\n  a native component tree, where the accessible role and the test identifier are the equivalent anchors.\nmetadata:\n  version: 0.1.0\n  author: Padosoft\n  summary: The markup owes the test a stable anchor and an observable state.\n  profiles: laravel, node, react-native\n  scope: project\n  repository: https:\u002F\u002Fgithub.com\u002Fpadosoft\u002Fskills\n  keywords: testability, e2e, playwright, selectors, accessibility, data-testid, aria, loading state\n---\n\n# Frontend testability contracts\n\nA brittle end-to-end suite is usually not the tests' fault. The interface gave them nothing stable to hold\non to, so they held on to a class name and a delay.\n\n**The rule: the markup owes the test a stable anchor and an observable state. Both are part of the\ninterface's contract, like an API response shape.**\n\n---\n\n## 1. The locator hierarchy the markup has to support\n\nFrom most to least resilient. Whoever writes the interface decides how high the test can climb.\n\n| # | Anchor | Survives |\n|---|---|---|\n| 1 | **the accessible role and name** | restyling, restructuring, copy changes in most cases |\n| 2 | **the form label** | anything except renaming the label |\n| 3 | the placeholder | last resort for a field with no label |\n| 4 | visible text | only for **stable** text — page titles, fixed labels |\n| 5 | **an explicit test identifier** | everything, because it exists for this |\n| 6 | a style selector | nothing. Requires a written justification |\n\nMarkup that forces the test down to level 6 is a contract violation, and it is the interface that has to\nchange.\n\n## 2. The eight rules\n\n**A. Semantically stable markup.** Buttons, links, inputs, dialogs and checkboxes expose a role and an\naccessible name that do not depend on a class or the shape of the tree.\n\n```html\n\u003C!-- ❌ -->   \u003Cdiv class=\"btn-primary\" onclick=\"addToCart()\">🛒\u003C\u002Fdiv>\n\u003C!-- ✅ -->   \u003Cbutton type=\"button\" aria-label=\"Add to cart\">🛒\u003C\u002Fbutton>\n\n\u003C!-- ❌ -->   \u003Cdiv class=\"modal-wrapper-v2\">…\u003C\u002Fdiv>\n\u003C!-- ✅ -->   \u003Cdiv role=\"dialog\" aria-labelledby=\"checkout-title\">\u003Ch2 id=\"checkout-title\">Checkout\u003C\u002Fh2>\n```\n\n**B. Every input has a real label**, associated by identifier or via an accessible equivalent. Without one,\nthe field cannot be found by the anchor that is most stable for it.\n\n**C. A test identifier is a public contract, not a dump.** Add one only where the semantic anchor is not\nenough — an icon-only control, a repeated list item, a dynamic widget — and then treat it like a published\ninterface. One naming convention, `scope-element-variant`, and a separate attribute for the row key rather\nthan baking an identifier into the name.\n\n**D. Never anchor to volatile copy.** Marketing text changes without warning, and a test that matches it\nbreaks on the next campaign. Give such elements a stable accessible name **and** a test identifier, so the\nvisible text is free to move.\n\n**E. Never let a generated class name be the only way in.** Utility classes, hashed module classes and\ncomponent-library internals are rebuilt on every change. They may exist; they must not be the anchor.\n\n**F. Loading, success and error are observable states**, not animations.\n\n```html\n\u003Cdiv role=\"status\" aria-live=\"polite\" data-testid=\"orders-loading\">Loading…\u003C\u002Fdiv>\n\u003Cdiv role=\"status\" data-testid=\"save-success\">Saved\u003C\u002Fdiv>\n\u003Cdiv role=\"alert\" data-testid=\"checkout-error\">Payment refused\u003C\u002Fdiv>\n\u003Cbutton type=\"submit\" data-testid=\"checkout-submit\" disabled>Processing…\u003C\u002Fbutton>\n```\n\nThe submit control reflects the state too. A spinner with no role and no identifier tells a test nothing,\nand \"it looks done\" is not a signal.\n\n**G. Asynchronous work ends with a signal, not a duration.** A modern runner waits on the anchor by itself —\nbut only if the interface eventually exposes a finished state. When it does not, the test is forced to wait\na fixed time, which is both slow and flaky. Expose the end of the work; never make the test guess.\n\n**H. The four states of a data view are all distinguishable.** Initial, loading, success and error each need\ntheir own observable marker — and **empty is not the same as ready**, nor the same as failed. A test that\ncannot tell them apart will pass on the broken one; see **`padosoft-test-integrity`** and, for the\nback-office case, **`padosoft-admin-interface`**.\n\n## 3. Native interfaces\n\nSame contract, different names. The accessible role and label are the first anchor; the test identifier is\nthe explicit one. Two additions:\n\n- **A test identifier on a list row must be stable across re-renders**, which means derived from the data,\n  not from the index.\n- **The state markers matter more**, because there is no document to inspect: if the screen does not expose\n  that it is loading, the only alternative is a timer.\n\n## 4. When the interface cannot change today\n\nWrite the exception down where the test is, with the reason and what would remove it. An undocumented style\nselector is indistinguishable from an oversight, and the next refactor deletes it without knowing.\n\n---\n\n## Gotchas\n\n- **The test that breaks on a restyle is evidence about the markup**, not about the test. Fix the anchor.\n- **An accessible name is not the visible text.** Giving a promotional button a stable name lets the copy\n  change freely — and it is the same work that makes the button usable with a screen reader.\n- **A test identifier added everywhere stops meaning anything**, and becomes a second naming system nobody\n  maintains. Few, deliberate, on business-critical nodes.\n- **A generated identifier attribute changes between renders**, so it is the worst possible anchor while\n  looking like a good one.\n- **`aria-live` without a role is often not announced**, and is equally invisible to a test looking for the\n  role.\n- **Disabling the submit button during the request** is the single cheapest observable state, and it doubles\n  as protection against a double submission.\n\n## Checklist\n\n- [ ] Interactive elements expose a role and an accessible name\n- [ ] Every input has a real label or an accessible equivalent\n- [ ] Test identifiers only where the semantic anchor is insufficient, with one naming convention\n- [ ] No anchor on marketing copy; stable name plus identifier where the text may change\n- [ ] No generated class name as the only way to reach an element\n- [ ] Loading, success and error exposed with a role **and** an identifier; the submit control reflects state\n- [ ] Every asynchronous action ends with an observable signal, never a duration\n- [ ] Initial, loading, empty, success and error are all distinguishable\n- [ ] List rows keyed by data, not by index\n- [ ] Every style-selector exception documented with the reason and its exit condition\n\n## Final report\n\n```\nSurface: \u003Cpage \u002F screen \u002F component>\nAnchors: role+name \u003Cn> · label \u003Cn> · testid \u003Cn> · style selector \u003Cn> (justified? \u003C…>)\nStates exposed: initial \u003C…> · loading \u003C…> · empty \u003C…> · success \u003C…> · error \u003C…>\nAsync signals: \u003Cwhat marks the end of each action>\nContract violations found: none | \u003Celement → what is missing>\nExceptions: \u003Cselector, reason, what would remove it>\n```\n","# Frontend testability contracts\n\nA brittle end-to-end suite is usually not the tests' fault. The interface gave them nothing stable to hold\non to, so they held on to a class name and a delay.\n\n**The rule: the markup owes the test a stable anchor and an observable state. Both are part of the\ninterface's contract, like an API response shape.**\n\n---\n\n## 1. The locator hierarchy the markup has to support\n\nFrom most to least resilient. Whoever writes the interface decides how high the test can climb.\n\n| # | Anchor | Survives |\n|---|---|---|\n| 1 | **the accessible role and name** | restyling, restructuring, copy changes in most cases |\n| 2 | **the form label** | anything except renaming the label |\n| 3 | the placeholder | last resort for a field with no label |\n| 4 | visible text | only for **stable** text — page titles, fixed labels |\n| 5 | **an explicit test identifier** | everything, because it exists for this |\n| 6 | a style selector | nothing. Requires a written justification |\n\nMarkup that forces the test down to level 6 is a contract violation, and it is the interface that has to\nchange.\n\n## 2. The eight rules\n\n**A. Semantically stable markup.** Buttons, links, inputs, dialogs and checkboxes expose a role and an\naccessible name that do not depend on a class or the shape of the tree.\n\n```html\n\u003C!-- ❌ -->   \u003Cdiv class=\"btn-primary\" onclick=\"addToCart()\">🛒\u003C\u002Fdiv>\n\u003C!-- ✅ -->   \u003Cbutton type=\"button\" aria-label=\"Add to cart\">🛒\u003C\u002Fbutton>\n\n\u003C!-- ❌ -->   \u003Cdiv class=\"modal-wrapper-v2\">…\u003C\u002Fdiv>\n\u003C!-- ✅ -->   \u003Cdiv role=\"dialog\" aria-labelledby=\"checkout-title\">\u003Ch2 id=\"checkout-title\">Checkout\u003C\u002Fh2>\n```\n\n**B. Every input has a real label**, associated by identifier or via an accessible equivalent. Without one,\nthe field cannot be found by the anchor that is most stable for it.\n\n**C. A test identifier is a public contract, not a dump.** Add one only where the semantic anchor is not\nenough — an icon-only control, a repeated list item, a dynamic widget — and then treat it like a published\ninterface. One naming convention, `scope-element-variant`, and a separate attribute for the row key rather\nthan baking an identifier into the name.\n\n**D. Never anchor to volatile copy.** Marketing text changes without warning, and a test that matches it\nbreaks on the next campaign. Give such elements a stable accessible name **and** a test identifier, so the\nvisible text is free to move.\n\n**E. Never let a generated class name be the only way in.** Utility classes, hashed module classes and\ncomponent-library internals are rebuilt on every change. They may exist; they must not be the anchor.\n\n**F. Loading, success and error are observable states**, not animations.\n\n```html\n\u003Cdiv role=\"status\" aria-live=\"polite\" data-testid=\"orders-loading\">Loading…\u003C\u002Fdiv>\n\u003Cdiv role=\"status\" data-testid=\"save-success\">Saved\u003C\u002Fdiv>\n\u003Cdiv role=\"alert\" data-testid=\"checkout-error\">Payment refused\u003C\u002Fdiv>\n\u003Cbutton type=\"submit\" data-testid=\"checkout-submit\" disabled>Processing…\u003C\u002Fbutton>\n```\n\nThe submit control reflects the state too. A spinner with no role and no identifier tells a test nothing,\nand \"it looks done\" is not a signal.\n\n**G. Asynchronous work ends with a signal, not a duration.** A modern runner waits on the anchor by itself —\nbut only if the interface eventually exposes a finished state. When it does not, the test is forced to wait\na fixed time, which is both slow and flaky. Expose the end of the work; never make the test guess.\n\n**H. The four states of a data view are all distinguishable.** Initial, loading, success and error each need\ntheir own observable marker — and **empty is not the same as ready**, nor the same as failed. A test that\ncannot tell them apart will pass on the broken one; see **`padosoft-test-integrity`** and, for the\nback-office case, **`padosoft-admin-interface`**.\n\n## 3. Native interfaces\n\nSame contract, different names. The accessible role and label are the first anchor; the test identifier is\nthe explicit one. Two additions:\n\n- **A test identifier on a list row must be stable across re-renders**, which means derived from the data,\n  not from the index.\n- **The state markers matter more**, because there is no document to inspect: if the screen does not expose\n  that it is loading, the only alternative is a timer.\n\n## 4. When the interface cannot change today\n\nWrite the exception down where the test is, with the reason and what would remove it. An undocumented style\nselector is indistinguishable from an oversight, and the next refactor deletes it without knowing.\n\n---\n\n## Gotchas\n\n- **The test that breaks on a restyle is evidence about the markup**, not about the test. Fix the anchor.\n- **An accessible name is not the visible text.** Giving a promotional button a stable name lets the copy\n  change freely — and it is the same work that makes the button usable with a screen reader.\n- **A test identifier added everywhere stops meaning anything**, and becomes a second naming system nobody\n  maintains. Few, deliberate, on business-critical nodes.\n- **A generated identifier attribute changes between renders**, so it is the worst possible anchor while\n  looking like a good one.\n- **`aria-live` without a role is often not announced**, and is equally invisible to a test looking for the\n  role.\n- **Disabling the submit button during the request** is the single cheapest observable state, and it doubles\n  as protection against a double submission.\n\n## Checklist\n\n- [ ] Interactive elements expose a role and an accessible name\n- [ ] Every input has a real label or an accessible equivalent\n- [ ] Test identifiers only where the semantic anchor is insufficient, with one naming convention\n- [ ] No anchor on marketing copy; stable name plus identifier where the text may change\n- [ ] No generated class name as the only way to reach an element\n- [ ] Loading, success and error exposed with a role **and** an identifier; the submit control reflects state\n- [ ] Every asynchronous action ends with an observable signal, never a duration\n- [ ] Initial, loading, empty, success and error are all distinguishable\n- [ ] List rows keyed by data, not by index\n- [ ] Every style-selector exception documented with the reason and its exit condition\n\n## Final report\n\n```\nSurface: \u003Cpage \u002F screen \u002F component>\nAnchors: role+name \u003Cn> · label \u003Cn> · testid \u003Cn> · style selector \u003Cn> (justified? \u003C…>)\nStates exposed: initial \u003C…> · loading \u003C…> · empty \u003C…> · success \u003C…> · error \u003C…>\nAsync signals: \u003Cwhat marks the end of each action>\nContract violations found: none | \u003Celement → what is missing>\nExceptions: \u003Cselector, reason, what would remove it>\n```\n",{"name":5,"license":14,"metadata":23,"description":7,"compatibility":31},{"scope":24,"author":25,"summary":26,"version":27,"keywords":28,"profiles":29,"repository":30},"project","Padosoft","The markup owes the test a stable anchor and an observable state.","0.1.0","testability, e2e, playwright, selectors, accessibility, data-testid, aria, loading state","laravel, node, react-native","https:\u002F\u002Fgithub.com\u002Fpadosoft\u002Fskills","Web and native user interfaces. Examples use HTML roles and test identifiers; the same contract holds for a native component tree, where the accessible role and the test identifier are the equivalent anchors.","main","8ff266762b08cab7f5be5551fa221309dc9db48b","skills\u002Fpadosoft-frontend-testability",0,"https:\u002F\u002Fgithub.com\u002Fpadosoft","https:\u002F\u002Fwww.padosoft.com","Software House","2026-10-19 01:02:17",{"source":8,"skillName":5,"commands":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add padosoft\u002Fskills --skill padosoft-frontend-testability",{"tool":46,"command":47},"bunx","bunx skills add padosoft\u002Fskills --skill padosoft-frontend-testability",{"tool":49,"command":50},"pnpm","pnpm dlx skills add padosoft\u002Fskills --skill padosoft-frontend-testability","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpadosoft\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fpadosoft-frontend-testability\u002FSKILL.md",true,[54],{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"evals\u002Fqueries.json","REFERENCE","参考文档",1466,"https:\u002F\u002Fgithub.com\u002Fpadosoft\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fpadosoft-frontend-testability\u002Fevals\u002Fqueries.json",[61,68,74,81,88,94],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":18},"01M7CZNKCTMWK7F2J6KKPAR8YM","report-opus","Writes the weekly status report from the team's tickets. Use when the user asks for the weekly report or a status summary. Do not use it for incident reports.","https:\u002F\u002Fgithub.com\u002Fpadosoft\u002Fskills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill-audit\u002Fproject\u002Fdot-claude\u002Fskills\u002Freport-opus\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":18},"01M7CZNFEN8XK6S8NC6KGREYGS","report-haiku","https:\u002F\u002Fgithub.com\u002Fpadosoft\u002Fskills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill-audit\u002Fproject\u002Fdot-claude\u002Fskills\u002Freport-haiku\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":18},"01M7CZND182TKGGM7R4134ND00","kitt-stub","Builds the guided-tour reference for an admin page. Use when the user asks for the tour reference. Trigger \"tour\", \"reference\", \"guided tour\".","https:\u002F\u002Fgithub.com\u002Fpadosoft\u002Fskills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill-audit\u002Fproject\u002Fdot-claude\u002Fskills\u002Fkitt-stub\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":18},"01M7CZN9F2A6BFTFW5RSRNAGB1","good-skill","Generates the release notes of a project from its merged pull requests. Use this skill when the user asks for release notes, a changelog entry or a summary of what shipped since the last tag. Do not use it to write commit messages, that is the job of a commit skill.","https:\u002F\u002Fgithub.com\u002Fpadosoft\u002Fskills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill-audit\u002Fproject\u002Fdot-claude\u002Fskills\u002Fgood-skill\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":18},"01M7CZN6BJASPD4DH8DFR63GQF","broken-frontmatter","https:\u002F\u002Fgithub.com\u002Fpadosoft\u002Fskills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill-audit\u002Fproject\u002Fdot-claude\u002Fskills\u002Fbroken-frontmatter\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":18},"01M7CZN498TRNC30GSYMMAZNXM","Bad_Skill","I can help you with reports.","https:\u002F\u002Fgithub.com\u002Fpadosoft\u002Fskills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill-audit\u002Fproject\u002Fdot-claude\u002Fskills\u002Fbad-skill\u002FSKILL.md",[],[]]