Back to docs

Tool Remediation

Get actionable code patches to fix AI-unfriendly patterns. The Remediation Engine analyzes issues from the Agent-Ready Audit and generates copy-paste fixes.

Quick Start

npx cbrowser remediation-patches "https://example.com"

CLI Options

npx cbrowser remediation-patches "https://example.com" \
  --format html                # Output format (json, html, console)
  --output patches.html        # Save to file
  --categories findability,accessibility  # Filter by category
  --min-impact high            # Only high-impact fixes

MCP Tools

remediation_patches

Generate code patches for issues.

{
  "tool": "remediation_patches",
  "params": {
    "url": "https://example.com"
  }
}

llms_txt_generate

Generate llms.txt file from site content.

{
  "tool": "llms_txt_generate",
  "params": {
    "url": "https://example.com"
  }
}

structured_data_suggest

Suggest JSON-LD improvements.

{
  "tool": "structured_data_suggest",
  "params": {
    "url": "https://example.com"
  }
}

Patch Categories

Buttons & Labels

Add ARIA labels to unlabeled buttons and inputs.

Before:

<button class="btn-primary">
  <svg class="icon-search"/>
</button>

After:

<button class="btn-primary" aria-label="Search products">
  <svg class="icon-search" aria-hidden="true"/>
</button>

Custom Selects

Convert hidden selects to accessible combobox patterns.

Before:

<select id="country" style="display: none;">
  <option value="us">United States</option>
  <option value="uk">United Kingdom</option>
</select>
<div class="custom-select">
  <span>Select country</span>
  <ul class="options">...</ul>
</div>

After:

<div role="combobox"
     aria-expanded="false"
     aria-haspopup="listbox"
     aria-controls="country-listbox"
     aria-label="Select country">
  <input type="text"
         aria-autocomplete="list"
         aria-controls="country-listbox">
  <ul id="country-listbox" role="listbox">
    <li role="option" data-value="us">United States</li>
    <li role="option" data-value="uk">United Kingdom</li>
  </ul>
</div>

Machine Metadata

Add JSON-LD structured data and OpenGraph.

JSON-LD for Product:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Widget Pro",
  "description": "Professional widget for enterprise",
  "offers": {
    "@type": "Offer",
    "price": "99.99",
    "priceCurrency": "USD"
  }
}
</script>

OpenGraph:

<meta property="og:title" content="Widget Pro - Enterprise Widget">
<meta property="og:description" content="Professional widget for enterprise">
<meta property="og:type" content="product">
<meta property="og:url" content="https://example.com/products/widget-pro">

Effort/Impact Matrix

Patches are prioritized by effort vs impact:

Effort Impact Priority Example
Low High 1 - Do First Add aria-label to button
Low Medium 2 Add data-testid attributes
Medium High 3 Convert custom dropdown
Medium Medium 4 Add JSON-LD to pages
High High 5 Refactor infinite scroll
High Medium 6 - Consider Full a11y overhaul

Output Format

{
  "url": "https://example.com",
  "patches": [
    {
      "id": "patch-001",
      "category": "findability",
      "issue": "Button without accessible name",
      "selector": "button.submit-btn",
      "effort": "low",
      "impact": "high",
      "before": "<button class=\"submit-btn\"><svg.../></button>",
      "after": "<button class=\"submit-btn\" aria-label=\"Submit form\"><svg... aria-hidden=\"true\"/></button>",
      "explanation": "Screen readers and AI agents cannot determine button purpose without accessible name"
    }
  ],
  "summary": {
    "totalPatches": 12,
    "byEffort": { "low": 8, "medium": 3, "high": 1 },
    "byImpact": { "high": 5, "medium": 4, "low": 3 }
  }
}

Integration with Audit

Run audit with patches in one command:

npx cbrowser agent-ready-audit "https://example.com" --patches

This combines the audit results with actionable remediation steps.

Related


Copyright: (c) 2026 Alexa Eden.

License: MIT License

From the Blog