返回 Skill 列表
extension
分类: 开发与工程无需 API Key

perf-audit

在不进行网络调用的情况下对项目执行本地性能审核。当用户说'审核性能'、'检查包大小'、'查找大图片'、'检查重型依赖项'、'运行性能审核'、'我的包有多大'、'优化图片'、'查找过大的资源',或在任何性能优化工作之前使用此技能。此外,在代理需要在进行更改前获取基准指标时也应使用。所有脚本都将结构化的JSON输出到标准输出。

person作者: jakexiaohubgithub

Performance Audit

Run local, deterministic performance audits. All scripts output JSON to stdout, use only standard unix tools, and make zero network calls.

Scripts

Full Audit (start here)

Runs all audits in parallel and produces a unified report with a health score (0-100).

bash <skill-path>/scripts/full-audit.sh /path/to/project

Returns:

{
  "health_score": 85,
  "image_audit": { ... },
  "bundle_audit": { ... },
  "dep_audit": { ... }
}

Image Audit

Scan for oversized images, missing next-gen formats, and dimension info.

bash <skill-path>/scripts/image-audit.sh /path/to/project

Flags images over 500KB as oversized. Uses sips on macOS for dimensions. Reports images without a WebP/AVIF equivalent.

Bundle Audit

Analyze JS and CSS bundle sizes in build output directories (.next, dist, build, out).

bash <skill-path>/scripts/bundle-audit.sh /path/to/project

Reports raw and gzipped sizes for every bundle file. Flags source maps in production. Requires a build to exist -- run the project's build command first if no build output is found.

Dependency Audit

Check package.json for known-heavy dependencies and suggest lighter alternatives.

bash <skill-path>/scripts/dep-audit.sh /path/to/project

Checks against a curated list of heavy packages (moment, lodash, jquery, full icon libraries, etc.) and suggests tree-shakable or lighter replacements.

Workflow

  1. Run full-audit.sh to get the baseline health score
  2. Review each sub-audit for specific issues
  3. Fix issues (optimize images, swap deps, configure tree-shaking)
  4. Re-run full-audit.sh to measure improvement
  5. Include before/after scores in your completion report