/ratchet-code:playwright-authoringfrom ratchet-code
Use when writing, reviewing, or de-flaking Playwright or other browser end-to-end tests, or when adding test ids to interface code. Decide what a browser test should cover and how to locate elements with roles, labels, and test ids.
Ships in ratchet-code. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Read every applicable AGENTS.md first. Repository-local policy overrides these defaults. For
rules that apply to every kind of test, use test-authoring.
A browser test is the slowest and least stable test a repository has. Spend it only on what needs a browser.
Keep one spec that visits every route, once for each persona (signed out, a member, an admin), and on each page asserts what every page owes:
console.error from the app;main landmark;Signed out, it also asserts that the page made no request to an endpoint scoped to a viewer, which would only answer 401. List the routes from the router, not by hand, so a new route is swept without anyone adding it.
Open the starting page by URL once, then reach every later page the way a user does: click the
link, button, or control that leads there. Then assert the URL it landed on, so the goto the
test would have typed becomes an assertion.
await page.goto('/reports')
await page.getByRole('link', { name: 'Dismissed' }).click()
await expect(page).toHaveURL('/reports?status=dismissed')
A test that types a later page's URL (page.goto, a navigation helper, a query string such as
?status=dismissed) passes even when no control in the interface leads there, and that missing
control is the failure the test exists to catch.
Open a later page by URL only for a reason, and write the reason in a comment beside the goto:
Select elements the way a user or an assistive tool finds them, in this order:
page.getByRole('button', { name: 'Save' }).page.getByLabel('Email').page.getByTestId('invoice-row').text=. Those change with styling and
copy, and the test fails without the behavior changing.getByTestId. Do not write the attribute selector by hand
(page.locator('[data-testid="invoice-row"]')); it bypasses the configured test id attribute
and cannot be found by a search for test id usage.page.getByTestId('invoice-row').filter({ hasText: 'INV-1042' }).scrollIntoViewIfNeeded()
does nothing when the sentinel is already in view, so the next page may never load.For each new browser test, ask whether an HTTP test or a component test would catch the same
failure. For each locator, ask whether a restyle or a copy change would break it. For each
goto after the first, ask whether a control leads there, and if one does, click it instead,
unless the comment beside it gives one of the reasons above.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub jongleberry/ratchet-stack --plugin ratchet-code12 skills in this plugin
/interface-feedbackUse when writing or reviewing interface code that shows an action button, a toast or error message, or a form's submit, including a review of such a diff. Show only the actions the server allows this viewer and why one is blocked, render errors by code with their details, and check a submit's preconditions so it never succeeds partly in silence./lint-rule-authoringUse when writing or reviewing the code of a lint rule, analyzer, or codemod that walks a syntax tree, such as an ESLint or oxlint rule, a Clippy lint, or a custom AST check, including a request to "write a rule that bans X". Covers finding the rule's subject by what a name is bound to, reporting a name it cannot trace, and the fixtures that prove both./native-app-architectureUse when writing or reviewing native app code, deciding where logic lives, adding a web view, setting up native project files, or planning native CI. Structure a native app (Swift, Kotlin, .NET MAUI) around a portable core library with thin platform views./npm-publishingUse when publishing a new package, moving a package to trusted publishing, writing or reviewing a release workflow that bumps a version and publishes it, or fixing a CI publish that fails with E404 or ENEEDAUTH. Prepare a first npm publish and trusted publishing (OIDC) for a human to run, and set up the GitHub Actions workflow that bumps, tags, and publishes./package-json-checklistUse when writing or reviewing a package.json, adding, upgrading, overriding, patching, or moving a dependency, setting a package's entrypoints or exports, changing workspace metadata such as pnpm-workspace.yaml, or resolving a lockfile change. Checks package metadata, dependencies, entrypoints, and lockfiles./react-app-structureUse when writing or reviewing React components, Next.js pages, layouts, route handlers, forms, navigation, server/client boundaries, data fetching, auth redirects, entity links, or browser configuration. Structure a React or Next.js app so its API calls, links, redirects, and configuration each have one traceable owner.