Skip to content
Development
Skill

/x-audit-perf

独立性能巡检 skill。不在 x-dev → x-verify-spec → x-qa-gate 主流程内,由用户手动触发或在大里程碑后调用。 调子 agent 做全项目视角的性能审查:N² 嵌套、不必要循环、大对象拷贝、同步阻塞、数据库 N+1、缓存失效、不必要的 await。 触发:用户说"性能巡检"、"audit perf"、"看看有没有性能问题"、"perf review",或大版本发布前。

From plugin
x-dev-pipeline
1223 skills

Claude Code

$ npx -y skills add KtKID/x-dev-pipeline --skill x-audit-perf --agent claude-code

SKILL.md

x-audit-perf.SKILL.md
name: x-audit-perf
description: |
  独立性能巡检 skill。不在 x-dev → x-verify-spec → x-qa-gate 主流程内,由用户手动触发或在大里程碑后调用。
  调子 agent 做全项目视角的性能审查:N² 嵌套、不必要循环、大对象拷贝、同步阻塞、数据库 N+1、缓存失效、不必要的 await。
  触发:用户说"性能巡检"、"audit perf"、"看看有没有性能问题"、"perf review",或大版本发布前。

x-audit-perf · 性能巡检

x-audit-perf 是独立巡检 skill,**不在 x-dev → x-verify-spec → x-qa-gate 主流程内**。它由用户手动触发或大里程碑后调用,做全项目视角的性能审查。

为什么独立

性能问题通常需要**全局视角**才有意义——单个任务级别揪 N² 是过度工程,得看整个调用链;缓存失效要看跨服务流。塞进每个任务的 gate 是噪音,所以剥离出来。

流程

1. 用户触发(手动调用 / 大里程碑)。 2. dispatch 一个子 agent,prompt 包含本 SKILL.md 的检查清单 + 项目代码。 3. 子 agent 输出 audit-perf 报告。 4. 写到 `reports/audit/audit-perf-YYYYMMDD-HHmmss.md`。 5. 不自动触发 x-fix——由用户决定哪些问题进入 backlog。

子 agent dispatch

Agent({
  description: "Performance audit",
  subagent_type: "general-purpose",
  prompt: <本 SKILL.md 的"检查清单"段 + 项目代码 + 输出格式>
})

报告顶部必须填写 `Completed by model`。

检查清单

1. 算法复杂度

  • 嵌套循环:O(n²) 以上是否必要?能否用 hash / index 降到 O(n)?
  • 在循环内做 I/O / 重复扫描数据?
  • 排序 / 查找算法选择是否合理?

2. 数据结构使用

  • 用 list 做频繁查找(应该用 set / dict)?
  • 大对象拷贝(应传引用 / 用 slice)?
  • 频繁字符串拼接(应用 builder / join)?

3. I/O 模式

  • 同步阻塞 I/O 在异步上下文中?
  • 数据库 N+1(在循环里查数据库)?
  • 文件 / 网络请求未批量化?

4. 缓存与状态

  • 重复计算未缓存(纯函数 expensive call)?
  • 缓存失效策略缺失或过激进?
  • 内存泄漏(持有不必要的引用)?

5. 并发与并行

  • 不必要的 await / lock 串行化?
  • 临界区过大?
  • 能并行的串行执行了?

输出

写入 `reports/audit/audit-perf-YYYYMMDD-HHmmss.md`,模板见 `templates/audit-perf-template.md`。

不在范围

  • 单任务级别的 perf 审查(应在 x-qa-gate R2 boundary 里捎带 P1 即可)
  • 微优化(编译器能搞定的事)
  • 硬件相关(CPU 缓存、SIMD 等,不在 AI 评审范围)
Read more
@ktkid
Ships withx-dev-pipeline

An auditable development workflow for AI coding agents: requirement contracts, implementation evidence, deterministic checks, and risk-matched review.

Stars on GitHub

Momentum

stars in total
12
Star history of KtKID/x-dev-pipeline on GitHub, a chart by star-history.com

Other skills on x-dev-pipeline.

x-cr

x-cr

软件正确性调查 skill。用于用户说“XX 不太对”“这个功能有 bug”“结果和预期不一致”“帮我查原因”,也用于 review 模块、文件、diff 或 PR…

x-dev

x-dev

开发任务执行 skill。读取单个 task 的 dev-checklist.md,按行序以"先测试后实现"的方式逐行执行,dev-report 只记验证结论(全绿或 N 个 🔴),全部行验证通过后交付。触发:`x-dev…

x-fix

x-fix

Bug 修复执行 skill。分三种入口: 1. 用户直接报告 Bug → 定位根因 → 修复 → 产出 fix-report-*.md 或 fix-note-*.md(无需 CR 报告) 2. 有 x-cr 的 CR 报告 → 按稳定 Bn/INV-ID…

x-qa-gate

x-qa-gate

verify 通过后的质量审查。Q2/Q3 各由一个 reviewer 在单轮内按 q1-intent、q2-correctness、q3-evidence 三个独立 lens 穷尽检查;Q3 使用完整高风险输入和逐 lens 回执。发现 P0/P1 后登记…

x-req3

x-req3

x-spec3 的任务拆解 skill。读取 `docs/spec/{spec-name}/spec.md` 的目标、边界与不变量、判断依据、验收清单和直接 GWT Scenarios,生成…

x-spec3

x-spec3

在开发方案已经讨论清楚、需要固化保存时使用。也适用于用户明确要求保存方案、编写规格文档,或希望在开发前明确目标、边界、约束和验收标准的场景。将已确认的方案整理成可供后续任务拆解、开发和验证共同使用的规格文档。

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about x-audit-perf.

Which coding agents can use x-audit-perf?
x-audit-perf installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.