Guide · Agent skill
How to use the Fix invalid links agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The Fix invalid links skill teaches an AI agent a checklist for SEO link problems. When you ask it to review a page, it looks through the page's link elements for ones search engine crawlers cannot follow and suggests fixes. This guide explains what the skill does, how to install it, how to trigger it, and where its limits are.
Quick start
- 1Download the ZIP. Get the invalid-links skill ZIP from the skill's page in the directory.
- 2Unzip the skill folder. Unzip the download so the skill folder contains SKILL.md and references/rule.md.
- 3Place the skill. Move the folder into ~/.claude/skills/ for personal use or into a project's .claude/skills/ folder.
- 4Or upload it in the Claude apps. In the Claude apps, go to Settings → Capabilities → Skills and upload the skill.
- 5Ask for a link review. Give the agent your page markup and ask it to review links for crawlability.
- 6Apply the suggested fixes. Replace invalid hrefs with real URLs or fragments, and switch action-only elements to buttons.
What the invalid-links skill makes the agent do
An agent skill is a set of instructions and reference files that an AI agent loads when a request matches the skill's description. This one covers crawlability of links: Google can only follow links declared as valid <a href> elements with crawlable URL values.
When the skill runs, the agent checks the page's <a> elements for empty hrefs, href='javascript:void(0)' links, links with no href at all, and click-only elements styled as links. It reports how many of each type it finds and suggests fixes.
- Empty links such as href='' or a bare href='#' with no meaningful target
- javascript: links such as href='javascript:void(0)'
- <a> elements with no href attribute
- Fragment links pointing to an anchor that does not exist on the page
- Clickable div, span or button elements with onclick navigation and no matching <a href>
Install the invalid-links skill
Download the ZIP from the skill's page on our directory and unzip it. Then put the skill folder in one of these places:
For your personal use across projects, unzip it into ~/.claude/skills/. To share it with one project, unzip it into that project's .claude/skills/ folder.
In the Claude apps, you can instead upload the skill under Settings → Capabilities → Skills.
- Personal: ~/.claude/skills/
- Single project: .claude/skills/ inside the project
- Claude apps: Settings → Capabilities → Skills
Trigger the skill with natural requests
You do not need a special command. The skill is meant to be picked up when your request matches its description, which covers auditing a page's link elements for crawlability, reviewing JavaScript-heavy single-page apps where navigation may not use <a href> tags, and checking that dynamically generated links have valid href values.
Give the agent the page markup or the rendered DOM so it has something to inspect. The skill only looks at the markup it is given.
- Review this page's links for crawlability problems.
- Check this SPA's navigation for links that search engines cannot follow.
- Find any <a> tags with javascript:void or empty href in this component.
Read the report and apply fixes
The skill's fixes depend on the problem. A javascript:void link used for navigation should get a real URL, with JavaScript enhancing the navigation rather than replacing it. An <a> without href should get one if it navigates, or become a <button> if it only performs an action. An empty href should get the correct URL or lose its <a> wrapper. A bare '#' should become a fragment that matches an id on the page.
<a href="javascript:void(0)" onclick="openModal()">View Details</a>
<a href="/products/details" onclick="openModal(event)">View Details</a>What the skill does not check
The skill inspects only the markup it is given. It does not test whether target pages respond, and it has no link-checking script. If you need to confirm that live URLs return working pages, use a separate link-checking tool.
Pages where links are deliberately JavaScript-driven, such as logged-in app dashboards where crawlability is not a goal, are outside its scope.
Safety notes: scripts and network access
The skill requires nothing to be installed beforehand. It does not run scripts and does not use the network, according to its listing. It works by reading the markup you provide.
Tips for better results
Give the agent the rendered DOM when you audit a single-page app, because navigation is often created by JavaScript after load. Ask for counts per problem type if you want a quick summary before you start editing.
Pair the audit with a review of internal linking, since broken link patterns affect discovery of linked pages in the same way.
- Provide rendered markup for SPAs, not only source files
- Ask for a count per type to prioritise fixes
- Check fragment links against the ids that actually exist on the page
What people use it for
- Checking a site's navigation for javascript:void links before launch
- Auditing a single-page app whose menus use click handlers instead of real links
- Reviewing dynamically generated links to confirm they have valid href values
- Finding anchor links that point to ids missing from the page
Frequently asked questions
Is the invalid-links skill free?
It is published under the MIT licence, so you can use it under those terms. Check the licence file in the source repository for the full text.
What do I need to install the invalid-links skill?
Its listing states that nothing is required. You unzip the downloaded ZIP into ~/.claude/skills/ or a project's .claude/skills/ folder, or upload it under Settings → Capabilities → Skills in the Claude apps.
Does the skill check whether links work?
No. It only inspects the markup it is given and does not test whether target pages respond. For live URL checking you need a different tool.
Does this skill run scripts or use the internet?
According to its listing, it runs no scripts and uses no network access. It reads the markup you provide.
Why are javascript:void links a crawlability problem?
Googlebot sees href="javascript:void(0)" and does not follow it, so pages reachable only through such links are not discovered. Google's documentation says crawlable links need an <a> tag with a valid href URL.
Why is my single-page app menu not crawled?
Menus built on onClick handlers without an href are not followed by search engine crawlers. Converting them to <a href> elements with real URLs makes them crawlable.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
This skill suits front-end developers and SEO staff who want a quick, repeatable audit of link markup before launch or when reviewing single-page apps. It is not a substitute for a live link checker, and it is a poor fit for app pages where crawlability does not matter.
Download the skill