Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Audits websites against 230+ rules across 21 categories (SEO, security, performance, accessibility) using the squirrelscan CLI.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/OUTPUT-FORMAT.md
1# LLM Format Output Reference23## Overview45The `--format llm` output is a compact, token-optimized hybrid XML/text format designed specifically for AI agent consumption. It provides structured audit data in a format that balances machine readability with token efficiency.67## Key Characteristics89- **40-70% smaller** than verbose XML format10- **1-space indentation** for minimal token usage11- **Hybrid structure**: XML tags + text prefixes for metadata12- **Inline attributes**: Metadata stored as XML attributes, not nested elements13- **Comma-separated lists**: Pages and arrays formatted inline14- **Flattened hierarchy**: Reduced nesting depth compared to verbose XML1516## Format Structure1718### 1. Document Header1920```xml21<?xml version="1.0" encoding="UTF-8"?>22<audit version="0.0.24">23```2425### 2. Site Information2627```xml28<site url="https://example.com" crawled="51" date="2025-01-18T10:30:00Z"/>29```3031Attributes:32- `url` - Base URL audited33- `crawled` - Number of pages crawled34- `date` - ISO 8601 timestamp3536### 3. Health Score3738```xml39<score overall="85" grade="B">40<cat name="Core SEO" score="92"/>41<cat name="Technical SEO" score="88"/>42<cat name="Content Quality" score="76"/>43</score>44```4546Attributes:47- `overall` - 0-100 health score48- `grade` - Letter grade (A-F)49- Categories with individual scores5051### 4. Summary5253```xml54<summary passed="120" warnings="15" failed="8"/>55```5657Attributes:58- `passed` - Number of passed checks59- `warnings` - Number of warnings60- `failed` - Number of failed checks6162### 5. Issues Section6364Issues are grouped by category with compact inline metadata:6566```xml67<issues>68<category name="Core SEO" errors="2" warnings="3">69<rule id="core/meta-title" severity="error" status="fail">70Missing or empty meta title tags71Desc: Every page should have a unique meta title72Fix: Add descriptive <title> tags to each page73Pages (2): https://example.com/about, https://example.com/contact74Items (2):75- https://example.com/about76- https://example.com/contact77</rule>78<rule id="core/meta-description" severity="warning" status="warn">79Desc: Pages should have meta descriptions80Fix: Add <meta name="description"> tags81Pages (5): https://example.com/page1, https://example.com/page2, ...82</rule>83</category>84<category name="Performance" errors="0" warnings="1">85...86</category>87</issues>88```8990#### Rule Structure9192Each `<rule>` element contains:9394**Attributes:**95- `id` - Rule identifier (e.g., `core/meta-title`)96- `severity` - `error`, `warning`, or `info`97- `status` - `pass`, `warn`, or `fail`9899**Text Content (in order):**1001. **Message** (optional) - Human-readable issue summary1012. **Desc:** - Rule description (what's being checked)1023. **Fix:** - Recommended solution (how to fix)1034. **Pages (n):** - Comma-separated list of affected URLs1045. **Items (n):** - Dash-prefixed list of specific items with metadata105106### 6. Items Format107108Items provide detailed context about affected elements:109110```xml111Items (3):112- https://example.com/missing-title (title: "")113- https://example.com/duplicate-title (title: "Home Page") (from: https://example.com/other)114- /broken-link [status: 404, type: internal] (from: https://example.com/contact)115```116117Item format:118- `- <id>` - Primary identifier (URL, selector, etc.)119- `(<label>)` - Optional human-readable label if different from id120- `[key: value, ...]` - Metadata in square brackets121- `(from: <sources>)` - Source pages where item appears122123## Diff Output (LLM Format)124125When using `squirrel report --diff` or `--regression-since` with `--format llm`,126the output is a compact XML diff format:127128```xml129<?xml version="1.0" encoding="UTF-8"?>130<diff version="0.0.24">131<baseline id="a7b3c2d1" url="https://example.com" date="2026-01-17T10:30:00Z" pages="42" score="87" grade="B"/>132<current id="b9c4e1f2" url="https://example.com" date="2026-01-18T10:30:00Z" pages="44" score="84" grade="B"/>133<summary added="3" removed="1" changed="2" regressions="1" improvements="1"/>134<added>135<issue fp="abc123" rule="core/meta-title" severity="error" status="fail" check="meta-title" category="core" weight="8">136Missing page title137Target: page /about138</issue>139</added>140<removed>141...142</removed>143<changed>144<change type="regression" fp="def456" rule="links/broken-links" severity="warning" status="fail" check="broken-links">145warn→fail: Broken link count increased146Before:147<issue ...> ... </issue>148After:149<issue ...> ... </issue>150</change>151</changed>152</diff>153```154155Key fields:156- `fp`: deterministic fingerprint for the issue instance157- `rule`, `check`, `severity`, `status`: rule and check metadata158- `Target:`: item/page/check target159- `change type`: `regression`, `improvement`, or `change`160161## Example Output162163```xml164<?xml version="1.0" encoding="UTF-8"?>165<audit version="0.0.24">166<site url="https://example.com" crawled="51" date="2025-01-18T10:30:00Z"/>167<score overall="78" grade="C">168<cat name="Core SEO" score="85"/>169<cat name="Technical SEO" score="92"/>170<cat name="Performance" score="65"/>171</score>172<summary passed="98" warnings="12" failed="5"/>173<issues>174<category name="Core SEO" errors="2" warnings="1">175<rule id="core/meta-title" severity="error" status="fail">176Missing meta title on 2 pages177Desc: Every page should have a unique meta title178Fix: Add descriptive <title> tags to each page179Pages (2): https://example.com/about, https://example.com/contact180Items (2):181- https://example.com/about182- https://example.com/contact183</rule>184</category>185</issues>186</audit>187```188189## Usage190191The LLM format is available via both `audit` and `report` commands:192193```bash194# Direct LLM output (single step)195squirrel audit https://example.com --format llm196197# Or two-step workflow198squirrel audit https://example.com199squirrel report <audit-id> --format llm200201# Pipe directly to AI agent202squirrel audit https://example.com --format llm | claude203```204205The `audit` command supports `--format llm` directly for convenience. Use the two-step workflow when you need to generate reports in multiple formats from a single audit.206207## Comparison with Other Formats208209| Format | Size | Structure | Best For |210|--------|------|-----------|----------|211| `xml` | 209KB | Verbose, 2-space indent, fully nested | Enterprise integration, archival |212| `llm` | 125KB | Compact, 1-space indent, hybrid | AI agents, token-limited contexts |213| `json` | 180KB | Structured data | Programmatic processing |214| `text` | 45KB | Plain text, no structure | Simple piping, grep |215216## Token Efficiency217218The LLM format achieves 40-70% size reduction compared to verbose XML through:2192201. **1-space indentation** instead of 2-4 spaces2212. **Inline attributes** instead of nested elements2223. **Text prefixes** (Desc:, Fix:) instead of XML tags2234. **Comma-separated lists** instead of multiple elements2245. **Flattened hierarchy** - fewer nesting levels225226## XML Character Escaping227228Special characters are properly escaped:229- `&` → `&`230- `<` → `<`231- `>` → `>`232- `"` → `"`233- `'` → `'`234235## Design Philosophy236237The LLM format is optimized for:2381. **Token efficiency** - Critical for API cost and context limits2392. **Easy parsing** - XML structure for reliable extraction2403. **Human readability** - AI agents can explain issues naturally2414. **Progressive disclosure** - Summary → Categories → Rules → Items2425. **Actionable insights** - Fix recommendations included inline243244## Implementation Notes245246- Generated by `generateLlmReport()` in `app/src/reports/output/llm.ts`247- Empty issues section renders as self-closing: `<issues/>`248- All text content is XML-escaped for safety249- Indentation uses spaces only (no tabs)250- Line endings are Unix-style (`\n`)251