api-extractor-pro — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited api-extractor-pro (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
从前端代码出发,聚焦 扫描接口 → 生成契约 → 产出 Mock → 输出文档 → 校验一致性 → 追踪变更。
contract.json / OpenAPI / MSW本 skill 只做接口治理产物生成与校验:
contract.json、生成 Mock、生成文档、校验一致性、生成 diff 报告页面 API 化改造应由 static-to-api-layer 在前置阶段完成。若项目是静态页面起步,建议先执行:
static-to-api-layer:完成页面 API 化api-extractor-pro:统一生成治理产物若项目本身已存在标准 API 调用,可直接使用本 skill。
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
│ 1. Scan │───▶│2. Contract│───▶│ 3. Confirm│───▶│ 4. Mock │
│ 扫描分析 │ │ 生成契约 │ │ 用户确认 │ │ MSW生成 │
└──────────┘ └──────────┘ └──────────┘ └──────────┘
│
┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ 7. Report│◀───│ 6. Verify│◀───│ 5. Docs │◀─────────┘
│ 变更报告 │ │ 一致性校验│ │ 文档生成 │
└──────────┘ └──────────┘ └──────────┘目标:收集项目中所有 API 调用
执行方式:
python3 scripts/scan.py --project-root <项目根目录> [--scope src/pages,src/views] [--entry-hints src/api,src/services]支持 Axios / Fetch / request 封装 / React Query / SWR 等模式。
输出:scan_result.json
目标:将扫描结果转化为结构化接口契约
执行方式:
python3 scripts/build_contract.py --scan-result scan_result.json --auth-mode bearer --output contract.jsoncontract.json 是整个工作流唯一事实源(SSOT)。
目标:整理接口清单并确认推断项,确认后更新 contract.json。
目标:从 contract.json 生成 MSW handlers 和 mock 数据。
执行方式:
python3 scripts/generate_msw.py --contract contract.json --output-root <项目根目录>目标:从 contract.json 生成 docs/api-docs.md 和 docs/openapi.yaml。
执行方式:
python3 scripts/generate_docs.py --contract contract.json --output-root <项目根目录> --project-name "项目名称"目标:交叉校验 contract ↔ OpenAPI ↔ MSW handlers。
执行方式:
python3 scripts/check_consistency.py \
--contract contract.json \
--openapi docs/openapi.yaml \
--handlers mock/handlers/ \
--report reports/consistency-report.md \
[--strict-mode]目标:对比上次契约与当前契约,生成 reports/api-diff.md。
python3 scripts/run_workflow.py --config config.json| 产物 | 路径 | 说明 |
|---|---|---|
| 扫描结果 | scan_result.json | 原始 API 调用扫描数据 |
| 接口契约 | contract.json | 唯一事实源,结构化接口定义 |
| MSW Handler | mock/handlers/[module].js | 按模块分组的 Mock 拦截器 |
| MSW 数据 | mock/data/[module].json | 贴合业务的 Mock 数据 |
| MSW 入口 | mock/browser.js | Worker 启动入口 |
| 中文文档 | docs/api-docs.md | Markdown 格式接口文档 |
| OpenAPI | docs/openapi.yaml | OpenAPI 3.1 规范 |
| 一致性报告 | reports/consistency-report.md | 三方交叉校验结果 |
| 变更报告 | reports/api-diff.md | 接口变更追踪 |
contract.json 是唯一事实源x-todo-confirmdomain.actionapi/ / services/ / request/,优先扫描这些目录/api/user/:id)baseURL 与鉴权模式static-to-api-layer 的 mock-interceptor-wx.js 提供。本 skill 生成的 MSW Mock 仅适用于 Web 项目(React / Vue)references/contract-schema.mdreferences/patterns-msw.mdreferences/patterns-openapi.mdtemplates/api-doc.mdtemplates/openapi.yamlexamples/mock-handler-example.jsexamples/api-docs-example.md~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.