@rankcli/agent-runtime
Core SEO engine for RankCLI. 280+ checks, 7 deep analyzers, framework-specific fix generation.
Features
🤖 GEO (Generative Engine Optimization)
First SEO engine with AI search optimization:
- AI crawler detection (GPTBot, ClaudeBot, PerplexityBot, etc.)
- JS rendering analysis for AI crawlers
- LLM-friendliness scoring
- Citation readiness analysis
📊 7 Deep Analyzers
import { analyzers } from '@rankcli/agent-runtime';
const result = await analyzers.analyzeComprehensive(html, url);
const geo = await analyzers.analyzeGEO(html, url, robotsTxt);
const cwv = analyzers.analyzeCoreWebVitals(html, url);
const security = analyzers.analyzeSecurityHeaders(headers, url);
const schema = analyzers.analyzeStructuredData(html, url);
const images = analyzers.analyzeImages(html, url);
const links = analyzers.analyzeInternalLinking(html, url);
const mobile = analyzers.analyzeMobileSEO(html, url);
| GEO | AI crawler access, robots.txt, SSR detection, LLM signals |
| Core Web Vitals | LCP, CLS, INP, TTFB estimation |
| Security | HTTPS, HSTS, CSP, grades A+ to F |
| Structured Data | JSON-LD validation, rich results |
| Images | Alt text, dimensions, formats, lazy loading |
| Internal Links | Anchor text, orphan detection |
| Mobile | Viewport, touch targets, PWA |
🔧 Framework-Specific Fixes
Auto-generate SEO fixes for 25+ frameworks:
import { generateFrameworkFix } from '@rankcli/agent-runtime';
const fix = generateFrameworkFix({
framework: 'nextjs-app',
issue: { code: 'MISSING_TITLE', ... },
siteMeta: { title: 'My Site', description: '...' }
});
Supported:
- React, Next.js, Vue, Nuxt, Angular, Svelte, SvelteKit, Astro, Remix, Gatsby, Solid.js, Qwik
- Rails, Django, Laravel, Spring Boot, ASP.NET Core, Phoenix, Go
- Hugo, Jekyll, Eleventy, Pelican
- HTMX, Hotwire/Turbo
Architecture
Isomorphic engine - works in Node.js, Deno, and WASM:
src/
├── analyzers/ # 7 deep analyzers (GEO, CWV, etc.)
├── audit/ # 280+ individual checks
├── fixer/ # Framework-specific fix generation
├── frameworks/ # Framework detection
├── content/ # Content analysis
├── geo/ # GEO tracking
├── git/ # PR/commit helpers
└── index.ts
Installation
pnpm add @rankcli/agent-runtime
Usage
Full Audit
import { runAudit, generateFixes } from '@rankcli/agent-runtime';
const audit = await runAudit({
url: 'https://example.com',
maxPages: 5,
options: { geo: true }
});
const fixes = await generateFixes(audit.issues);
Generate AI-Friendly robots.txt
import { analyzers } from '@rankcli/agent-runtime';
const robotsTxt = analyzers.generateAIFriendlyRobotsTxt('https://example.com');
Generate Schema Templates
import { analyzers } from '@rankcli/agent-runtime';
const schema = analyzers.generateSchemaTemplate('article', {
siteName: 'My Blog',
siteUrl: 'https://myblog.com',
authorName: 'John Doe'
});
Development
pnpm install
pnpm dev
pnpm test
pnpm build
Related
License
MIT