More screenshots

    Works with the AI Agents you already use

    Find the Source Line of Any React Element

    by Jaroslav Barov

    1

    It works with the free, open-source react-source-string build plugins.

    Free

    Security scanned
    Find the Source Line of Any React Element

    Find the Source Line of Any React Element

    Example session with this skill installed

    The Pay button on the checkout page at localhost:5173/checkout should say "Pay now", but only there. Fix it.

    • Read your context and instructions
    • Compiled the find the source

    Changed the label on the checkout page only. The shared Button component stays as it was.

    How I found it

    I opened localhost:5173/checkout and looked the button up in the page instead of searching the repository for "Pay":

    __REACT_SOURCE__.find("Pay");
    // [{ source: "src/components/Button.tsx:4", tag: "button", text: "Pay" }]
    
    __REACT_SOURCE__.stack('button[data-source="src/components/Button.tsx:4"]');
    // ["src/components/Button.tsx:4", "src/pages/Checkout.tsx:42", "src/pages/Checkout.tsx:30", "src/App.tsx:12"]
    
    LocationWhat it isEdited
    src/components/Button.tsx:4the shared <button> that every page usesno
    src/pages/Checkout.tsx:42<Button> on the checkout page, the call siteyes
    src/pages/Checkout.tsx:30the order summary card around itno

    A text search for "Pay" finds 3 places in this repository: the checkout page, PaymentMethods.tsx and a test. The source location points to one of them.

    The change

      // src/pages/Checkout.tsx
    - <Button onClick={submit}>Pay</Button>
    + <Button onClick={submit}>Pay now</Button>
    

    After the HMR reload, __REACT_SOURCE__.find("Pay now") returns the same element, and the other two "Pay" labels are unchanged.

    Next steps

    • This project renders many shared wrappers. Turn on preferCallSite: true in the plugin options, and references will point to the call site (Checkout.tsx:42) right away.
    • Alt + click any element on the page to copy its reference, then paste it into the chat.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Your agent sees a "Pay" button on the page and searches the repository for "Pay". If the codebase has three of them, it edits the wrong one. This skill gives the agent the exact file and line instead.

    It works with the free, open-source react-source-string build plugins. In development they add data-source="src/pages/Checkout.tsx:42" to every JSX element. With the overlay on, you can Alt + click an element to copy that reference, and the page gets a window.__REACT_SOURCE__ lookup that an agent calls from its browser tool.

    What the skill teaches your agent

    • Read a pasted reference. You Alt + click an element and paste src/pages/Checkout.tsx:42 <button> "Pay". The agent opens that line and skips the search. The inside: line tells it which parent to edit when the change is about layout or the surrounding list.
    • Look up an element in the browser. Accessibility snapshots from Playwright MCP, Claude in Chrome and other agent browsers drop data-* attributes. The skill has the agent run __REACT_SOURCE__.find("Pay") in the page and get src/pages/Checkout.tsx:42 back.
    • Pick the right line. When a shared <Button> renders the element, __REACT_SOURCE__.stack() lists the component and its call site. The agent changes the checkout page when you mean one button, and the shared component only when you want every button to change.
    • Set up the plugin. If the project has no plugin, the agent tells you and offers to install it. With your OK it adds the dev dependency and the config for Vite, Next.js or Babel, adds a rule to AGENTS.md, and checks that the attributes show up.

    Requirements

    • A React project running in development mode.
    • One of the plugins: vite-plugin-react-source-string (Vite), swc-plugin-react-source-string (Next.js 16.1.7 and later) or babel-plugin-react-source-string (webpack, Rspack, Next.js with a Babel config, Metro). The skill installs it for you if you agree.

    Limitations

    • Production builds have no data-source attributes and no overlay.
    • Elements rendered inside node_modules are not tagged. The agent gets the nearest tagged element from your own code, which is the place that renders the library component.
    • Without a plugin the agent falls back to a text search and tells you the result is a guess.

    The skill and the plugins are open source under the MIT license.

    Only works in development builds. Elements inside node_modules are not tagged. Requires build-time plugin integration (Vite, Next.js, or Babel).

    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 buying a skill.

    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 to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 9 days ago

    • Free with an Agensi account

    Software
    React project in development mode
    Vite, Next.js 16.1.7+
    orBabel
    Node.jsnpm
    pnpm
    orYarn

    Permissions

    Browser
    Read Files
    Write Files
    Terminal / Shell
    Network Access
    Listed9 days ago

    What's inside

    Creator

    Jaroslav Barov

    Jaroslav Barov

    Frequently Asked Questions

    A text search finds every place with that text, including other pages, tests and translations. The plugin writes the file and line into each element when the dev build compiles it, so the agent reads the location of the element that is on the screen.

    Vite, Next.js 16.1.7 and later with SWC, and anything that compiles JSX with Babel: webpack, Rspack, Next.js with a Babel config, Metro. The Alt + click overlay needs Next.js 16.4 or later on SWC.

    Any agent that reads SKILL.md. Pasting an Alt + click reference works in any chat. Looking elements up on the page needs a browser tool that runs JavaScript, such as Playwright MCP or Claude in Chrome.

    No. The plugins run in development only, so production HTML has no data-source attributes and no overlay. Elements rendered inside node_modules are not tagged either; the agent uses the nearest element from your own code.

    No. If the plugin is missing, the agent tells you and asks first. With your OK it adds one dev dependency and a few lines to the bundler config, and checks that the attributes appear on the page.

    New in Frontend & Web Apps

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Frontend & Web Apps.

    Free