audit-website

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

网站审计技能

Website Audit Skill

使用 squirrelscan 的 CLI 工具
squirrel
,对网站进行 SEO、技术、内容、性能和安全性审计。
squirrel 支持 macOS、Windows、Linux,通过模拟浏览器与搜索爬虫,结合 140+ 条规则分析站点结构与内容,输出问题列表及修复建议。
Use the CLI tool
squirrel
from squirrelscan to audit websites for SEO, technical aspects, content, performance, and security.
squirrel supports macOS, Windows, and Linux. It simulates browsers and search crawlers, analyzes site structure and content with over 140 rules, and outputs issue lists along with repair suggestions.

链接

Links

规则文档模板:
https://docs.squirrelscan.com/rules/{rule_category}/{rule_id}

示例:https://docs.squirrelscan.com/rules/links/external-links

Rule documentation template:
https://docs.squirrelscan.com/rules/{rule_category}/{rule_id}

Example: https://docs.squirrelscan.com/rules/links/external-links

本技能能做什么

What This Skill Can Do

支持 AI 智能体按 20+ 类别、140+ 条规则审计网站,包括:
  • SEO:Meta 标签、title、description、canonical、Open Graph
  • 技术:死链、重定向链、页面速度、移动友好性
  • 性能:加载时间、资源使用、缓存
  • 内容:标题结构、图片 alt、内容分析
  • 安全:泄露密钥、HTTPS、安全头、混合内容
  • 无障碍:alt、色彩对比、键盘导航
  • 可用性:表单校验、错误处理、用户流程
  • 链接:内外链死链检测
  • E-E-A-T:经验、专业、权威、可信度
  • 移动端:移动友好、响应式、触控元素
  • 可抓取性:robots.txt、sitemap.xml 等
  • Schema:Schema.org、结构化数据、富摘要
  • 法律:隐私政策、服务条款等合规
  • 社交:Open Graph、Twitter 卡片及 schema 校验
  • URL 结构:长度、连字符、关键词
  • 关键词:堆砌检测
  • 图片:alt、对比度、尺寸、格式
  • 本地 SEO:NAP 一致性、地理元数据
  • 视频:VideoObject schema、无障碍
审计会爬取站点、按规则分析页面,并生成报告,包含:
  • 整体健康分(0–100)
  • 按类别 breakdown(核心 SEO、技术 SEO、内容、安全等)
  • 具体问题及受影响 URL
  • 死链列表
  • 可执行的改进建议

Supports AI agents to audit websites based on over 20 categories and 140+ rules, including:
  • SEO: Meta tags, title, description, canonical, Open Graph
  • Technical: Broken links, redirect chains, page speed, mobile-friendliness
  • Performance: Load time, resource usage, caching
  • Content: Heading structure, image alt text, content analysis
  • Security: Exposed secrets, HTTPS, security headers, mixed content
  • Accessibility: Alt text, color contrast, keyboard navigation
  • Usability: Form validation, error handling, user flows
  • Links: Broken internal and external link detection
  • E-E-A-T: Experience, expertise, authority, trustworthiness
  • Mobile: Mobile-friendliness, responsiveness, touch elements
  • Crawlability: robots.txt, sitemap.xml, etc.
  • Schema: Schema.org, structured data, rich snippets
  • Legal: Compliance with privacy policies, terms of service, etc.
  • Social: Open Graph, Twitter Cards, and schema validation
  • URL Structure: Length, hyphens, keywords
  • Keywords: Keyword stuffing detection
  • Images: Alt text, contrast, size, format
  • Local SEO: NAP consistency, geographic metadata
  • Videos: VideoObject schema, accessibility
The audit will crawl the site, analyze pages against rules, and generate a report including:
  • Overall health score (0–100)
  • Breakdown by category (Core SEO, Technical SEO, Content, Security, etc.)
  • Specific issues and affected URLs
  • Broken link list
  • Actionable improvement suggestions

何时使用

When to Use

在以下场景使用本技能:
  • 分析网站健康度
  • 排查技术 SEO 问题
  • 修复上述各类问题
  • 检查死链
  • 校验 meta 与结构化数据
  • 生成站点审计报告
  • 对比改版前后健康度
  • 提升性能、无障碍、SEO、安全等

Use this skill in the following scenarios:
  • Analyze website health
  • Troubleshoot technical SEO issues
  • Fix the various issues mentioned above
  • Check for broken links
  • Verify meta tags and structured data
  • Generate site audit reports
  • Compare health scores before and after website revamps
  • Improve performance, accessibility, SEO, security, etc.

前置条件

Prerequisites

本技能依赖 squirrel CLI,需已安装并加入 PATH。
This skill depends on the squirrel CLI, which must be installed and added to your PATH.

安装(macOS / Linux)

Installation (macOS / Linux)

bash
curl -fsSL https://squirrelscan.com/install | bash
将会:
  • 下载最新二进制
  • 安装到
    ~/.local/share/squirrel/releases/{version}/
  • ~/.local/bin/squirrel
    创建软链
  • ~/.squirrel/settings.json
    初始化配置
~/.local/bin
不在 PATH 中,在 shell 配置里添加:
bash
export PATH="$HOME/.local/bin:$PATH"
bash
curl -fsSL https://squirrelscan.com/install | bash
This will:
  • Download the latest binary
  • Install to
    ~/.local/share/squirrel/releases/{version}/
  • Create a symlink at
    ~/.local/bin/squirrel
  • Initialize configuration at
    ~/.squirrel/settings.json
If
~/.local/bin
is not in your PATH, add this to your shell configuration:
bash
export PATH="$HOME/.local/bin:$PATH"

Windows 安装

Windows Installation

PowerShell:
powershell
irm https://squirrelscan.com/install.ps1 | iex
将下载并安装到
%LOCALAPPDATA%\squirrel\
,并加入 PATH。若用 CMD,可能需要重启终端使 PATH 生效。
PowerShell:
powershell
irm https://squirrelscan.com/install.ps1 | iex
This will download and install to
%LOCALAPPDATA%\squirrel\
and add it to your PATH. If using CMD, you may need to restart the terminal for the PATH changes to take effect.

验证安装

Verify Installation

bash
squirrel --version

bash
squirrel --version

配置

Configuration

在项目目录执行
squirrel init
会生成
squirrel.toml
每个项目应有唯一的 project name(默认可用被审计站点名),用于数据库区分多次审计:
bash
squirrel init --project-name my-project
或:
bash
squirrel config set project.name my-project
若当前目录没有
squirrel.toml
,必须先执行
squirrel init
,并用
-n
指定项目名(可推断)。
项目名用于数据库标识,存储在
~/.squirrel/projects/

Running
squirrel init
in your project directory will generate
squirrel.toml
.
Each project should have a unique project name (defaults to the audited site name) to distinguish multiple audits in the database:
bash
squirrel init --project-name my-project
Or:
bash
squirrel config set project.name my-project
If there is no
squirrel.toml
in the current directory, you must first run
squirrel init
and specify the project name with
-n
(can be inferred).
The project name is used for database identification and stored in
~/.squirrel/projects/
.

使用方式

Usage

概述

Overview

有三个子命令,结果都会写入本地项目数据库:
  • crawl:执行或继续爬取
  • analyze:分析爬取结果
  • report:按指定格式输出报告(llm、text、console、html 等)
audit
是上述三步的封装,按顺序执行:
bash
squirrel audit https://example.com --format llm
优先使用
--format llm
:为 LLM 设计的紧凑、完整输出格式。
There are three subcommands, and all results are written to the local project database:
  • crawl: Execute or resume crawling
  • analyze: Analyze crawled results
  • report: Output reports in specified formats (llm, text, console, html, etc.)
audit
is a wrapper for the above three steps, executed in sequence:
bash
squirrel audit https://example.com --format llm
Prioritize using
--format llm
: A compact, complete output format designed for LLMs.

审计目标选择

Selecting Audit Targets

  • 若用户未提供 URL:从当前目录、环境变量(如 Vercel 项目、记忆或代码中的引用)推断可能站点。
  • 若当前目录能启动本地 dev 服务:可对本地站点做审计。
  • 若发现多个可审计站点:让用户选择。
  • 若无法推断任何站点:询问用户要审计的 URL。
优先审计线上站点,更能反映真实性能与渲染问题。若同时有本地与线上,提示用户选择,并建议选线上。可在线上审计发现问题后,在本地代码中修复。
  • If no URL is provided by the user: Infer possible sites from the current directory, environment variables (e.g., Vercel projects, memory, or references in code).
  • If a local dev server can be started in the current directory: Audit the local site.
  • If multiple auditable sites are found: Ask the user to select one.
  • If no sites can be inferred: Ask the user for the URL to audit.
Prioritize auditing live sites as they better reflect real performance and rendering issues. If both local and live sites are available, prompt the user to select and recommend the live site. After identifying issues in the live site audit, fix them in the local code.

实施修复时

When Implementing Fixes

  • 可将大范围修复拆成可并行的子任务,用 subagent 加速。
  • 修复完成后,如环境有 typecheck/format 工具(如 ruff、biome、tsc),对生成代码跑一遍。
  • Split large-scale fixes into parallel subtasks and use subagents to accelerate the process.
  • After fixes are complete, run typecheck/format tools (e.g., ruff, biome, tsc) on the generated code if available in the environment.

基本流程

Basic Workflow

  1. 执行审计(写入数据库,并输出到终端)
  2. 按格式导出报告
bash
undefined
  1. Execute Audit (writes to database and outputs to terminal)
  2. Export Report in Specified Format
bash
undefined

1. 执行审计(默认 console 输出)

1. Execute audit (default console output)

squirrel audit https://example.com
squirrel audit https://example.com

2. 导出为 LLM 格式

2. Export as LLM format

squirrel report <audit-id> --format llm
undefined
squirrel report <audit-id> --format llm
undefined

常用选项

Common Options

爬取更多页面:
bash
squirrel audit https://example.com --max-pages 200
忽略缓存、强制重新爬取:
bash
squirrel audit https://example.com --refresh
恢复中断的爬取:
bash
squirrel audit https://example.com --resume
调试时详细输出:
bash
squirrel audit https://example.com --verbose

Crawl more pages:
bash
squirrel audit https://example.com --max-pages 200
Ignore cache and force a full recrawl:
bash
squirrel audit https://example.com --refresh
Resume an interrupted crawl:
bash
squirrel audit https://example.com --resume
Detailed output for debugging:
bash
squirrel audit https://example.com --verbose

命令选项

Command Options

audit

audit

选项别名说明默认
--format <fmt>
-f
输出格式:console, text, json, html, markdown, llmconsole
--max-pages <n>
-m
最大爬取页数(最大 500)500
--refresh
-r
忽略缓存,全部重新抓取false
--resume
-恢复中断的爬取false
--verbose
-v
详细输出false
--debug
-调试日志false
OptionAliasDescriptionDefault
--format <fmt>
-f
Output format: console, text, json, html, markdown, llmconsole
--max-pages <n>
-m
Maximum number of pages to crawl (max 500)500
--refresh
-r
Ignore cache and fully recrawlfalse
--resume
-Resume interrupted crawlfalse
--verbose
-v
Detailed outputfalse
--debug
-Debug logsfalse

report

report

选项别名说明
--format <fmt>
-f
console, text, json, html, markdown, xml, llm
OptionAliasDescription
--format <fmt>
-f
console, text, json, html, markdown, xml, llm

输出格式

Output Formats

  • console(默认):彩色、带进度的可读输出。
  • llm:面向 LLM 的紧凑 XML/文本混合,token 更省(比冗长 XML 约小 40%),包含:
    • 摘要:健康分与核心指标
    • 按规则分类的问题(核心 SEO、技术、内容、安全等)
    • 死链列表(内链 + 外链)
    • 按优先级排列的改进建议

  • console (default): Colorful, readable output with progress.
  • llm: Compact XML/text hybrid designed for LLMs, saving about 40% more tokens than verbose XML, including:
    • Summary: Health score and core metrics
    • Issues categorized by rules (Core SEO, Technical, Content, Security, etc.)
    • Broken link list (internal + external)
    • Improvement suggestions sorted by priority

示例

Examples

1. 快速站点审计(LLM 输出)

1. Quick Site Audit (LLM Output)

bash
squirrel audit https://squirrelscan.com --format llm
bash
squirrel audit https://squirrelscan.com --format llm

2. 大站深度审计

2. Deep Audit for Large Sites

bash
squirrel audit https://myblog.com --max-pages 500 --format llm
bash
squirrel audit https://myblog.com --max-pages 500 --format llm

3. 改版后重新审计(忽略缓存)

3. Re-audit After Website Revamp (Ignore Cache)

bash
squirrel audit https://example.com --refresh --format llm
bash
squirrel audit https://example.com --refresh --format llm

4. 两步流程(复用已有审计)

4. Two-Step Workflow (Reuse Existing Audit)

bash
squirrel audit https://example.com
bash
squirrel audit https://example.com

记下输出的 audit-id,如 a1b2c3d4

Note the output audit-id, e.g., a1b2c3d4

squirrel report a1b2c3d4 --format llm

---
squirrel report a1b2c3d4 --format llm

---

输出

Output

审计与修复完成后,给用户一个所有改动的摘要

After completing the audit and fixes, provide the user with a summary of all changes.

故障排除

Troubleshooting

squirrel
找不到

squirrel
command not found

  1. 安装:
    curl -fsSL https://squirrelscan.com/install | bash
  2. 加入 PATH:
    export PATH="$HOME/.local/bin:$PATH"
  3. 验证:
    squirrel --version
  1. Install:
    curl -fsSL https://squirrelscan.com/install | bash
  2. Add to PATH:
    export PATH="$HOME/.local/bin:$PATH"
  3. Verify:
    squirrel --version

权限错误

Permission Errors

bash
chmod +x ~/.local/bin/squirrel
bash
chmod +x ~/.local/bin/squirrel

爬取超时或很慢

Crawl Timeouts or Slow Speed

大站可能需较长时间,加
--verbose
查看进度:
bash
squirrel audit https://example.com --format llm --verbose
Large sites may take longer; use
--verbose
to check progress:
bash
squirrel audit https://example.com --format llm --verbose

无效 URL

Invalid URL

务必包含协议(
http://
https://
):
bash
undefined
Always include the protocol (
http://
or
https://
):
bash
undefined

✗ 错误

✗ Incorrect

squirrel audit example.com
squirrel audit example.com

✓ 正确

✓ Correct

squirrel audit https://example.com

---
squirrel audit https://example.com

---

工作流程

Workflow

  1. Crawl:从基础 URL 发现并抓取页面
  2. Analyze:对每页执行审计规则
  3. External Links:检查外链可用性
  4. Report:生成 LLM 优化报告
审计结果保存在本地数据库,之后可用
squirrel report
按不同格式导出。

  1. Crawl: Discover and fetch pages from the base URL
  2. Analyze: Execute audit rules on each page
  3. External Links: Check availability of external links
  4. Report: Generate an LLM-optimized report
Audit results are saved in the local database and can later be exported in different formats using
squirrel report
.

延伸资源

Additional Resources