audit-website

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Audit a Website and Fix It

审计网站并修复问题

Run a squirrelscan audit against a website, read the LLM report, map each issue to the code or content that causes it, fix in batches, and re-audit until the score target is met.
Requires the
squirrel
CLI (squirrelscan.com/download; verify with
squirrel --version
). For CLI setup, login, publishing, MCP, and general CLI usage, use the companion
squirrelscan
skill.
对网站执行squirrelscan审计,读取LLM报告,将每个问题映射到引发问题的代码或内容,分批修复并重新审计,直至达到目标评分。
需要安装
squirrel
CLI(下载地址:squirrelscan.com/download;可通过
squirrel --version
验证安装)。关于CLI的设置、登录、发布、MCP及常规使用方法,请参考配套的
squirrelscan
技能。

Rule docs

规则文档

Look up any rule at
https://docs.squirrelscan.com/rules/{rule_category}/{rule_id}
, for example:
可通过以下地址查询任意规则:
https://docs.squirrelscan.com/rules/{rule_category}/{rule_id}
,例如:

Running the audit

执行审计

bash
squirrel audit https://example.com --format llm
  • ALWAYS use
    --format llm
    : it is compact, exhaustive, and made for agents.
  • If the user doesn't provide a URL, ask which site to audit.
  • PREFER auditing the live site: only there do you see true rendering, performance, and redirect behavior. If both a local dev server and a live site exist, suggest the live one; apply the fixes to the local code either way.
  • Audits are cached locally. Re-render later without recrawling:
    squirrel report <audit-id> --format llm
    .
bash
squirrel audit https://example.com --format llm
  • 务必使用
    --format llm
    参数:该格式简洁全面,专为Agent设计。
  • 如果用户未提供URL,请询问需要审计的网站。
  • 优先审计线上网站:只有线上环境才能呈现真实的渲染效果、性能表现和重定向行为。如果同时存在本地开发服务器和线上网站,建议审计线上网站;无论哪种情况,修复操作都应应用到本地代码。
  • 审计结果会在本地缓存。无需重新爬取即可重新生成报告:
    squirrel report <audit-id> --format llm

Scan progression

扫描流程

  1. First pass, quick coverage (the default): a fast, shallow scan to learn the site's structure, technology, and biggest problems without impacting the site.
  2. Second pass, deeper coverage:
    -C surface
    (one page per URL pattern) for template-level coverage, or
    -C full
    for a comprehensive crawl before sign-off.
ModeDefault pagesUse
quick
25First look, CI checks
surface
100Template-level coverage (one sample per pattern like
/blog/{slug}
)
full
500Final verification, deep analysis
Useful flags:
--refresh
(ignore cache, full re-fetch),
--resume
(continue an interrupted crawl),
-m <n>
(page cap),
--verbose
(progress detail).
If the site blocks unknown crawlers (Shopify / Cloudflare), pass Web Bot Auth headers with repeated
-H "Name: Value"
flags. Header values are secrets and are redacted in output. See https://docs.squirrelscan.com/guides/web-bot-auth
  1. 首次扫描:快速覆盖(默认模式):快速浅层扫描,在不影响网站的前提下了解网站结构、技术栈及主要问题。
  2. 二次扫描:深度覆盖:使用
    -C surface
    参数(每个URL模式扫描一个页面)实现模板级覆盖,或使用
    -C full
    参数在验收前进行全面爬取。
模式默认扫描页数适用场景
quick
25初步排查、CI检查
surface
100模板级覆盖(每个URL模式如
/blog/{slug}
扫描一个样本)
full
500最终验证、深度分析
实用参数:
--refresh
(忽略缓存,重新完整爬取)、
--resume
(继续中断的爬取)、
-m <n>
(设置扫描页数上限)、
--verbose
(显示详细进度)。
如果网站拦截未知爬虫(如Shopify / Cloudflare),可通过重复使用
-H "Name: Value"
参数传递Web Bot认证头。头信息值为敏感信息,会在输出中被屏蔽。详情请见:https://docs.squirrelscan.com/guides/web-bot-auth

The fix loop

修复流程

  1. Present the report: score, grade, top issues by severity.
  2. Propose fixes: list the issues you can fix and confirm with the user before changing anything.
  3. Map issues to source: find the template, component, or content file behind each finding.
  4. Fix in batches: apply the approved fixes; use subagents to parallelize independent files.
  5. Re-audit (use
    --refresh
    after deploys or content changes) and show before/after scores.
  6. Repeat until the target is met or only judgment calls remain (for example "should this link be removed?"). Flag those for user review instead of guessing.
After each batch, verify the project still builds and existing checks pass.
  1. 展示报告:呈现评分、等级及按严重程度排序的主要问题。
  2. 提出修复方案:列出可修复的问题,在进行任何修改前与用户确认。
  3. 问题映射到源文件:找到每个问题对应的模板、组件或内容文件。
  4. 分批修复:应用已确认的修复方案;使用子Agent并行处理独立文件。
  5. 重新审计(部署或内容变更后使用
    --refresh
    参数)并展示修复前后的评分对比。
  6. 重复流程:直至达到目标评分或仅剩需人工判断的问题(例如“是否应删除此链接?”)。此类问题需标记给用户审核,而非自行猜测处理。
每批修复完成后,需验证项目仍能正常构建且现有检查全部通过。

Score targets

评分目标

Starting scoreTargetExpected work
< 50 (F)75+ (C)Major fixes
50-70 (D)85+ (B)Moderate fixes
70-85 (C)90+ (A)Polish
> 85 (B+)95+Fine-tuning
A site is only considered COMPLETE and FIXED when it scores 95+ (Grade A) with
--coverage full
.
初始评分目标评分预计工作量
< 50(F级)75+(C级)重大修复
50-70(D级)85+(B级)中度修复
70-85(C级)90+(A级)优化打磨
> 85(B+级)95+精细调整
只有当网站在
--coverage full
模式下评分达到95+(A级)时,才视为完全修复完成。

Issue categories and fix approach

问题类别与修复方法

CategoryFix approachParallelizable
Meta tags / titles / descriptionsEdit page components or metadata configNo
Structured dataAdd JSON-LD to page templatesNo
Missing H1 / heading hierarchyEdit page components + content filesYes (content)
Image alt textEdit content filesYes
Short meta descriptionsExtend frontmatter descriptionsYes
HTTP to HTTPS linksFind and replace in contentYes
Broken linksManual review, flag for userNo
Rules carry a level (error, warning, notice) and a rank (1-10): fix errors first, then high-rank warnings. Code changes and content changes are equally important; treat them the same.
类别修复方法是否可并行处理
元标签/标题/描述编辑页面组件或元数据配置
结构化数据向页面模板添加JSON-LD
缺失H1/标题层级问题编辑页面组件+内容文件是(内容部分)
图片替代文本编辑内容文件
元描述过短扩展前置元描述
HTTP转HTTPS链接在内容中查找替换
失效链接人工审核,标记给用户
规则分为不同级别(错误、警告、通知)和优先级(1-10):优先修复错误,然后处理高优先级警告。代码变更和内容变更同等重要,需同等对待。

Parallelizing with subagents

使用子Agent并行处理

  • Ask the user first: always confirm which fixes to apply before spawning subagents.
  • Group 3-5 files per subagent for the same fix type; only parallelize independent files (no shared components or config).
  • Spawn the subagents in a single message so they run concurrently.
  • 先询问用户:在生成子Agent前,务必确认要应用哪些修复方案。
  • 每个子Agent处理3-5个同类型修复的文件;仅并行处理独立文件(无共享组件或配置)。
  • 在一条消息中生成所有子Agent,使其并行运行。

Verifying regressions

验证回归问题

Compare against a baseline to prove improvement or catch regressions:
bash
squirrel report --diff <baseline-audit-id> --format llm
squirrel report --regression-since example.com --format llm
与基线报告对比,证明修复效果或发现回归问题:
bash
squirrel report --diff <baseline-audit-id> --format llm
squirrel report --regression-since example.com --format llm

Completion

完成标准

Done means: all errors fixed; warnings fixed or documented as needing human review; a re-audit confirms the improvement; and the user has seen the before/after score comparison plus a summary of every change made. Re-audit regularly to keep the site healthy. If the user wants to share results, offer a published report (see the
squirrelscan
skill).
完成标准:所有错误已修复;警告已修复或记录为需人工审核;重新审计确认修复效果;用户已查看修复前后的评分对比及所有变更的总结。定期重新审计以保持网站健康状态。如果用户希望分享结果,可提供发布的报告(参考
squirrelscan
技能)。

Report format

报告格式

The LLM report is a compact XML/text hybrid optimized for token efficiency: summary with health score, issues grouped by category with affected URLs, broken links, and prioritized recommendations. Full spec: OUTPUT-FORMAT.md
LLM报告是一种紧凑的XML/文本混合格式,针对令牌效率进行了优化:包含健康评分摘要、按类别分组的问题(含受影响URL)、失效链接及优先级排序的建议。完整规范请见:OUTPUT-FORMAT.md