🔧 SEO Agent Integration for Cline
Build an autonomous SEO quality agent in Cline with SEODiff API access.
Cline (formerly Claude Dev) is an autonomous coding agent that runs in VS Code. It can make API calls, edit files, and iterate until tests pass. By giving Cline access to SEODiff’s evaluation API, you create a self-correcting SEO agent that fixes issues before committing code.
System Prompt / Configuration
Copy this prompt and paste it into your IDE’s AI configuration:
# SEO Agent System Prompt for Cline
# Add to Cline's custom instructions
You have access to the SEODiff API for evaluating page SEO quality.
API endpoint: https://seodiff.io/api/v1/agent/evaluate
Authentication: Bearer token in Authorization header
When working on web pages:
1. After creating or modifying a page, evaluate it:
POST /api/v1/agent/evaluate with the page URL and assertions
2. Use these default assertions:
- has_h1, has_meta_description, has_schema
- no_placeholders, min_word_count: 200
- max_token_bloat: 8.0, max_js_ghost_ratio: 0.1
3. If assertions fail, fix the issues and re-evaluate
4. Continue iterating until all assertions pass
5. Report the final ACRI score
For async evaluations (pages that take time to build):
- Set "wait": false to get a status_url
- Poll GET /api/v1/agent/evaluate/{id} until status != "processing"
For regression detection:
- Pass "baseline_eval_id" from a previous evaluation to detect regressionsSetup
# In Cline settings, add environment variable: SEODIFF_API_KEY=your_api_key_here # Or configure as an MCP tool for direct API access
Example Interaction
Cline autonomously:
1. Generates 5 pSEO city pages from a template
2. Evaluates all 5 via /agent/evaluate (batch)
3. Finds: no_placeholders FAILED on 2 pages ({{population}} leaked)
4. Fixes the data binding for population field
5. Re-evaluates: 5/5 pass, avg ACRI: 72
6. Commits with message: "Add city pages, SEODiff validated (ACRI 72)"Assertion Rules to Use
The best assertion rules for AI agent workflows:
has_h1
Ensure every page has exactly one H1 heading tag.
has_schema
Ensure every page has valid JSON-LD schema markup for rich results.
no_placeholders
Find template variables like {{city}} or [TBD] that leaked into production HTML.
max_token_bloat
Detect when boilerplate overwhelms useful content for LLM crawlers.
max_js_ghost_ratio
Flag pages where content is rendered client-side and invisible to crawlers.
min_word_count
Prevent thin content by requiring a minimum number of words per page.