# AI SEO Audit

Fetches a page through context.dev and scores its readability to AI answer engines, returning failing checks and an agent-ready fix prompt.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available by appending `.md` to any URL or sending an `Accept: text/markdown` header. An agent skill is available at [/.well-known/agent-skills/site-skill.md](/.well-known/agent-skills/site-skill.md).



<DocsBaseSwitcher base="flue" agent="ai-seo-audit" />

<AgentPreview
  agent="ai-seo-audit"
  framework="flue"
  inputFields="[
  {
    name: &#x22;url&#x22;,
    label: &#x22;Page URL&#x22;,
    placeholder: &#x22;https://example.com/blog/how-it-works&#x22;,
    type: &#x22;text&#x22;,
  },
]"
/>

## Summary [#summary]

The **AI SEO Audit Agent** evaluates a page for how readable it is to AI answer
engines — ChatGPT, Claude, and Perplexity — rather than classic blue-link
search. It fetches the page through context.dev (never touching the site
directly), scores six categories to a 0–100 total, lists the failing checks by
impact, and returns an **agent-ready fix prompt** you can paste straight into a
coding agent. Reach for it when you want a page to get cited by AI assistants.

## Installation [#installation]

<CodeTabs>
  <TabsList>
    <TabsTrigger value="cli">
      Command
    </TabsTrigger>

    <TabsTrigger value="manual">
      Manual
    </TabsTrigger>
  </TabsList>

  <TabsContent value="cli">
    ```bash
    npx shadcn@latest add @agentcn/flue/ai-seo-audit
    ```
  </TabsContent>

  <TabsContent value="manual">
    <Steps>
      <Step>
        Install the following dependencies:
      </Step>

      ```bash
      npm install @flue/runtime context.dev
      ```

      <Step>
        Copy and paste the following code into your project.
      </Step>

      <ComponentSource src="registry/flue/ai-seo-audit/agents/ai-seo-audit.ts" title="agents/ai-seo-audit.ts" />

      <ComponentSource src="registry/flue/ai-seo-audit/tools/fetch-page.ts" title="tools/fetch-page.ts" />

      <ComponentSource src="registry/flue/ai-seo-audit/skills/seo-audit/SKILL.md" title="skills/seo-audit/SKILL.md" />

      <Step>
        Update the import paths to match your project setup.
      </Step>
    </Steps>
  </TabsContent>
</CodeTabs>

## Composition [#composition]

```text
agents/
└── ai-seo-audit.ts       # Agent: fetch the page, then score and report
tools/
└── fetch-page.ts         # Page Markdown + HTML via the context.dev SDK
skills/
└── seo-audit/
    └── SKILL.md          # Six-category rubric and scoring bands
```

## Customization [#customization]

* **Fetching.** The page is fetched through [context.dev](https://context.dev) —
  the recipe never hits the audited site directly. Set `CONTEXT_DEV_API_KEY`.
* **Tune the rubric.** Edit `skills/seo-audit/SKILL.md` to add checks, reweight
  categories, or change the scoring bands.
* **Reshape the output.** Adjust the agent instructions to emit JSON, a shorter
  summary, or a different fix-prompt format.
* **Swap the model.** Change the `model` on the agent in `agents/ai-seo-audit.ts`.
