Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Stable Test Id Generator

    1

    Adds stable kebab-case test IDs to every interactive element and records each one in a single registry file, so your e2e selectors stay unique and findable

    $5

    /mo

    Subscription · cancel anytime

    Secure checkout via Stripe

    • Always the latest version
    • Delivered live to your agent via MCP
    • Cancel anytime, access ends at period end
    Security scanned
    Stable Test Id Generator

    Stable Test Id Generator

    Example session with this skill installed

    Add test ids to this component for our Playwright tests. We use data-testid already, and the registry is src/test-ids.json, which currently holds only {"checkout-pay-button": "src/components/Checkout.tsx"}.

    src/components/LoginForm.tsx

    export function LoginForm({ onSubmit, providers }: Props) {
      return (
        <form onSubmit={onSubmit}>
          <input name="email" type="email" />
          <input name="password" type="password" />
          <label><input type="checkbox" name="remember" /> Remember me</label>
          <button type="submit">Log in</button>
          <a href="/forgot">Forgot password?</a>
          {providers.map((p) => (
            <button key={p.id} type="button" onClick={() => p.signIn()}>{p.name}</button>
          ))}
        </form>
      );
    }
    
    • Read your context and instructions
    • Compiled the stable test id
    • Generated the UI component

    I added test ids to every interactive element in LoginForm. They use your existing data-testid attribute, which Playwright's getByTestId reads by default, and all of them are in the registry.

    src/components/LoginForm.tsx

    export function LoginForm({ onSubmit, providers }: Props) {
      return (
        <form onSubmit={onSubmit} data-testid="login-form">
          <input name="email" type="email" data-testid="login-email-input" />
          <input name="password" type="password" data-testid="login-password-input" />
          <label><input type="checkbox" name="remember" data-testid="login-remember-checkbox" /> Remember me</label>
          <button type="submit" data-testid="login-submit-button">Log in</button>
          <a href="/forgot" data-testid="login-forgot-password-link">Forgot password?</a>
          {providers.map((p) => (
            <button key={p.id} type="button" onClick={() => p.signIn()} data-testid={`login-provider-button-${p.id}`}>{p.name}</button>
          ))}
        </form>
      );
    }
    

    I only added attributes. Nothing else in the file was reformatted.

    src/test-ids.json

    {
      "checkout-pay-button": "src/components/Checkout.tsx",
      "login-form": "src/components/LoginForm.tsx",
      "login-email-input": "src/components/LoginForm.tsx",
      "login-password-input": "src/components/LoginForm.tsx",
      "login-remember-checkbox": "src/components/LoginForm.tsx",
      "login-submit-button": "src/components/LoginForm.tsx",
      "login-forgot-password-link": "src/components/LoginForm.tsx",
      "login-provider-button-{id}": "src/components/LoginForm.tsx"
    }
    

    Your existing checkout-pay-button entry is unchanged. I kept the registry's current shape (id to file) rather than switching it to a richer one, so anything that already reads the file keeps working.

    Summary

    • Attribute: data-testid, because the project already uses it.
    • Registry: src/test-ids.json. I added new entries at the end and left the existing one alone.
    • Added: 7 ids: 6 fixed ones plus 1 pattern for the provider buttons. None were already present.
    • Collisions: none. Every new id starts with login-, so none clash with checkout-pay-button or with each other.

    Naming: every id follows login-<element>-<role>. The fields are named from their name attributes. The submit button is named for what it does (submit), not its text ("Log in"), so changing the wording won't break tests.

    Things to check

    Provider buttons are a loop. Giving them one fixed id would create duplicates, so each button gets login-provider-button-${p.id}. The registry stores the pattern login-provider-button-{id}, not each value. In a test: page.getByTestId('login-provider-button-google'). This only works if p.id is a readable, stable value like google or github. If it's a UUID or database key, tests can't guess it. In that case, tell me which field is readable (e.g. p.slug) and I'll switch the id to use it.
    2.

    Remember-me checkbox. The id is on the <input>, not the <label> around it, because the checkbox is what a test clicks or checks. The label itself has no id. Tell me if a test needs to check the "Remember me" text.
    3.

    Checked against the registry only. I could only see this file and the registry, so I couldn't search the rest of the codebase. If a test already hard-codes a different selector for these elements, it won't break, but it won't use these ids either until you update it.

    LoginForm.tsx

    TSX · React component

    Generated

    Example file from a real run - the skill writes it into your workspace.

    $5/mo

    Subscription · always the latest version

    • Secure checkout via Stripe
    • Cancel anytime
    • Delivered live via MCP

    About this skill

    Adds test ID attributes to the interactive elements in your components (inputs, buttons, links, toggles, list items) and records every ID it assigns in one registry file for the whole project. Selectors stop drifting, nobody invents a second ID for the same button, and a test author can look up what exists instead of guessing.

    What it does

    It finds the attribute your project already uses (data-testid, data-test, data-cy, data-qa) and the registry if there is one, or creates both. IDs follow a feature-element-role pattern in kebab-case, such as login-submit-button. Each new ID is checked against the registry and against every ID assigned in the same run, and a collision is disambiguated, never reused. Elements rendered in a loop get a dynamic ID built from a stable key, not the array index. Existing registry entries are left untouched. You get the edited files, the updated registry, and a short report of what was added, what was already there, and anything it chose not to tag.

    Try it first

    Point it at a component and say "add test ids to this component for our Playwright tests". Check that every control has an ID, that the IDs read like their elements, and that the registry gained exactly those entries.

    What it needs

    Read and write access to the source, so it can find your existing convention and registry. Works with React, Vue, Svelte, Angular and plain HTML, and with Playwright, Cypress and Testing Library. No network access and no API keys.

    It tags elements; it doesn't write the tests that use them. For elements rendered from data it needs a stable key, and when none is visible it asks rather than falling back to the index. It only knows the IDs in the registry and the files it reads, so a selector hard-coded elsewhere in an old test isn't updated. Third-party components that don't pass attributes through get a note instead of an ID.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 27 days ago

    Permissions

    Browser
    Read Files
    Write Files

    Browser is declared because the skill names Playwright and Cypress, the test runners its IDs are for; it does not drive a browser itself, and only edits source files and the registry.

    Listed27 days ago

    What's inside

    Frequently Asked Questions

    Adds stable kebab-case test IDs to every interactive element and records each one in a single registry file, so your e2e selectors stay unique and findable

    This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

    Connect your AI agent to Agensi through MCP, then ask it to use Stable Test Id Generator on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

    New in Testing & Debugging