| name | site-analyzer |
| description | 大型商业网站深度分析工具。基于 neo 项目理念,通过被动捕获 + 主动探索 + 视觉理解,完整解析网站操作逻辑。支持 API 逆向、模式提取、知识库生成。 |
| version | 1.1 |
| allowed-tools | Bash(neo:*), Bash(browser-use:*), Bash(curl:*), Bash(jq:*) |
Site Analyzer
大型商业网站深度分析框架,整合三种分析方式:
- 被动捕获 - neo Chrome 扩展拦截所有 API 流量
- 主动探索 - browser-use 进行交互式测试
- 视觉理解 - VL 模型辅助页面语义分析
完成标准
触发此 skill 时,任务完成必须满足:
错误处理
| 错误类型 | 处理方式 |
|---|
| Chrome 连接失败 | 检查 CDP 端口,重启浏览器 |
| 扩展未捕获 | 重新加载扩展,检查权限 |
| API 解析失败 | 手动标注,跳过复杂 schema |
| 超时 | 增加 capture 时间或分批处理 |
Token 效率优化
- 分批捕获(每批 100 请求)
- 压缩 API 输出(仅保留关键字段)
- 分页生成知识库
neo capture list target-site.com --limit 20 --json | \
jq '[.[] | {method, path, status, has_body}]'
Orchestrator-Workers 模式
复杂网站分析采用分工协作:
┌─────────────────┐
│ Orchestrator │ 协调分析任务
└────────┬────────┘
│
┌────┼────┐
▼ ▼ ▼
┌──────┐ ┌──────┐ ┌──────┐
│捕获层│ │分析层│ │生成层│
└──────┘ └──────┘ └──────┘
│ │ │
▼ ▼ ▼
neo flows SKILL.md
capture deps openapi.yaml
Orchestrator 职责
analyze_site() {
local site="$1"
mkdir -p "site-analysis/$site"
neo capture start "$site" &
capture_pid=$!
wait $capture_pid
neo schema generate "$site" > "site-analysis/$site/schema.json"
neo flows "$site" > "site-analysis/$site/flows.json"
neo export-skill "$site" > "site-analysis/$site/SKILL.md"
}
Workers 分工
| Worker | 工具 | 输出 |
|---|
| 捕获 Worker | neo capture | traffic.har |
| 分析 Worker | neo flows/deps | flows.json, deps.json |
| 生成 Worker | neo export-skill | SKILL.md, openapi.yaml |
核心理念
用户操作 → Neo 捕获 API → Schema 自动生成 → 知识库输出
↓ ↓ ↓
UI 探索 → 数据流分析 → 可复用 Skill
↓ ↓ ↓
VL 理解 → 模式提取 → 测试用例
前置条件
1. 安装 neo CLI
git clone https://github.com/4ier/neo.git
cd neo && npm install && npm run build
npm link
2. 安装 browser-use
npm install -g browser-use
browser-use doctor
3. 配置 VL 模型
环境变量已在 ~/.config/fish/config.fish 中配置:
DASHSCOPE_API_KEY ✅
DASHSCOPE_BASE_URL ✅
工作流
Phase 1: 捕获阶段
neo connect 9222
neo open https://target-site.com
neo status
neo capture summary
Phase 2: 分析阶段
neo capture list target-site.com --limit 20
neo schema generate target-site.com
neo flows target-site.com
neo deps target-site.com
neo label target-site.com
Phase 3: 知识生成
neo schema openapi target-site.com > api-spec.yaml
neo export-skill target-site.com > SKILL.md
neo workflow discover target-site.com
命令详解
捕获命令
neo capture watch target-site.com
neo capture list target-site.com --since 2h
neo capture search "CreateTweet" --method POST
neo capture export target-site.com --format har > traffic.har
neo capture stats target-site.com
API 重放
neo replay <capture-id> --tab target-site.com
neo exec <url> --method POST \
--body '{"key":"value"}' \
--tab target-site.com \
--auto-headers
neo api target-site.com HomeTimeline
UI 自动化
neo snapshot
neo click @1
neo fill @2 "search query"
neo press Enter
neo screenshot page.png --full --annotate
分析模板
电商网站分析
neo open https://shop.example.com
neo capture list shop.example.com --since 1h
neo flows shop.example.com
neo capture search "product" --method GET
neo capture search "cart" --method POST
neo schema generate shop.example.com
neo export-skill shop.example.com
SaaS 平台分析
neo open https://app.example.com/login
neo capture list app.example.com --since 30m
neo label app.example.com
neo workflow discover app.example.com
neo workflow show <workflow-name>
API 密集型应用
neo capture watch api-app.com
neo deps api-app.com --min-confidence 2
neo schema openapi api-app.com > openapi.yaml
与其他 Skills 协作
配合 visual-analyzer
python ~/skills/visual-analyzer/tools/page-analyzer.py \
--url https://target-site.com \
--output analysis.json
neo capture list target-site.com --json > api-data.json
python ~/skills/knowledge-generator/tools/merge-analysis.py \
--visual analysis.json \
--api api-data.json \
--output final-report.md
配合 api-pattern-extractor
python ~/skills/api-pattern-extractor/tools/extract-patterns.py \
--schema $(neo schema show target-site.com --json) \
--output patterns.yaml
输出结构
site-analysis/
├── captures/ # 原始捕获数据
│ ├── traffic.har
│ └── captures.json
├── schemas/ # API Schema
│ ├── schema.json
│ └── openapi.yaml
├── analysis/ # 分析结果
│ ├── flows.json
│ ├── deps.json
│ └── labels.json
├── knowledge/ # 知识库
│ ├── SKILL.md
│ └── workflows/
└── tests/ # 测试用例
└── test-cases.yaml
高级技巧
1. 自动化探索脚本
#!/bin/bash
TARGET=$1
neo open "https://$TARGET"
neo snapshot > "snapshots/home.json"
neo snapshot | jq -r '.[] | select(.role == "link") | .@ref' | head -10 | while read ref; do
neo click "$ref"
sleep 2
neo snapshot > "snapshots/nav-$ref.json"
neo capture list "$TARGET" --since 5m >> "captures/session.log"
done
2. API 依赖图生成
neo deps target-site.com --format dot > deps.dot
dot -Tpng deps.dot -o deps.png
3. Mock 服务器
neo mock target-site.com --port 8080 --latency 100
故障排除
Chrome 连接问题
neo discover
neo connect 9222
扩展未捕获数据
neo doctor
neo reload
neo inject --persist
参考资源