perf-flow

perf-flow is a skill for Claude Code, Codex from movebrickschi/harness-engineering-mcp. It costs 80 tokens per session (1,069 once invoked), scanned A, original, MIT.

A measured workflow for improving software performance: establish a benchmark, profile the system to find bottlenecks, change one variable, and benchmark again. A bottleneck is the part limiting speed, throughput, memory use, or another target measure.

In plain words
What is it for?
Use it for slow pages, APIs, background jobs, high memory or CPU use, large bundles, and web performance metrics. It covers baselines, profiling, single-change experiments, comparison reports, quality checks, and follow-up monitoring.
Why use it?
It replaces guesses about what is slow with measurements under known conditions. Comparing before and after results shows whether an optimization helped without breaking functionality.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/movebrickschi/harness-engineering-mcp/perf-flow
Any agent
npx skills add movebrickschi/harness-engineering-mcp --skill perf-flow
Clone the repo
git clone --depth 1 https://github.com/movebrickschi/harness-engineering-mcp

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for perf-flow

README.md
[![agentmods](https://agentmods.dev/badge/skills/movebrickschi/harness-engineering-mcp/perf-flow.svg)](https://agentmods.dev/skills/movebrickschi/harness-engineering-mcp/perf-flow)
Your own site
<a href="https://agentmods.dev/skills/movebrickschi/harness-engineering-mcp/perf-flow"><img src="https://agentmods.dev/badge/skills/movebrickschi/harness-engineering-mcp/perf-flow.svg" alt="Measured on agentmods" height="20"></a>
Per session 80 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,069 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00080 $0.01069
Opus 5 $0.00040 $0.00535
Sonnet 5 $0.00016 $0.00214
Haiku 4.5 $0.00008 $0.00107

Measured 4d ago against content hash 5a3a5aec375a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

perf-flow scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

assets/skills/perf-flow/SKILL.md · 103 lines

What it actually says

perf-flow

适用场景

页面慢、接口慢、内存高、CPU 高、bundle 大等性能问题。

前置条件

确认 _playbook.md Part B.3 启动参数;额外 perf_target(待优化的页面/接口/作业)+ perf_metric(耗时?吞吐?内存?)+ perf_goal(目标值)。

流程步骤

阶段 0 · 上下文初始化

move_agent_to_root;建知识库目录(极简 META.md)。

阶段 1 · 基线 benchmark

  • /benchmark(前端 web vitals)或 cursor-ide-browserbrowser_profile_start/stop(性能录制)建立基线
  • 后端:用现有 APM、日志、ab/wrk/k6 跑基准
  • 输出 PERF_BASELINE.md:当前数值 + 测试条件 + 数据样本

阶段 2 · Profile 找瓶颈

  • 前端:Chrome Performance、browser_profile_*/benchmark 的 web vitals 拆解
  • 后端:APM 火焰图、慢日志、DB explain
  • 输出 BOTTLENECK.md:top 3 热点 + 数据证据

阶段 3 · 优化方案 + 卡点

prompt: "瓶颈定位完成(BOTTLENECK.md)。优化方案:"
options:
  - "方案 A(首选)"
  - "方案 B(更激进)"
  - "需要更多 profile"

阶段 4 · 单一变量优化

  • 每次只改一处,commit perf(scope): 优化 [瓶颈点]
  • 改完立刻 micro-benchmark 对比,写入 PERF_DIFF_[step].md

阶段 5 · 全量 re-benchmark

  • 用阶段 1 同条件再跑一遍 /benchmark
  • 输出 PERF_FINAL.md:基线 vs 终态对比
  • 未达 perf_goal → 回阶段 2 再 profile

阶段 6 · 自查

/qa(确保功能未退化)+ /review

阶段 7 · 上线

/ship/land-and-deploy/canary(重点监控同指标)。

阶段 8 · 复盘

append _lessons.md:瓶颈类型 + 优化手法 + 收益数据。

错误处理

  • 优化后功能 broken → 立即 revert,回阶段 2 找新瓶颈
  • benchmark 数据波动太大 → 增加样本数 / 固定测试环境
  • 达不到 goal 但已无明显瓶颈 → 与用户讨论调整 goal 或更换方案

产物清单

META.mdPERF_BASELINE.mdBOTTLENECK.md、若干 PERF_DIFF_*.mdPERF_FINAL.md、PR 链接。

支持的修饰符

无标准修饰符;可叠加 M4(如优化包含建索引/分表)→ 必出 MIGRATION_PLAN.md

与其他 skill 的关系

  • 通常被 /dev-flow 路由到(也可被用户直接触发)
  • 强依赖 /benchmarkcursor-ide-browser profile 工具
  • 自查:/qa/review
  • 上线:/ship/land-and-deploy/canary

附录

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 103 lines · 80 tokens per session scan A 5a3a5aec375a

Subscribe to this mod's changes

perf-flow is a skill published in the GitHub repository movebrickschi/harness-engineering-mcp (2 stars, last pushed 3mo ago), licensed MIT. It adds 80 tokens to every session and 1,069 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens