Communitygithub.com

基准测试优化循环

当用户要求提升性能、尝试多种变体、运行递归优化、基准测试延迟/吞吐量/成本,或通过重复测量测试选择最佳实现时使用。

基准测试优化循环 是什么?

该技能旨在将模糊的性能优化需求(如“使其快20倍”或“尝试50次递归优化”)转化为一个有界的、可测量的循环过程,从而实际改进系统。它要求首先建立基线:包括被优化的操作、正确性检查、具体指标(如墙钟时间、p95延迟、行/秒、运行成本、内存、错误率)以及搜索预算(最大变体数、最大时间、最大花费、最大数据影响)。核心循环包括测量基线、从证据中识别瓶颈、每次测试一个假设生成变体、运行所有变体、拒绝那些通过正确性与安全性检查失败或不可重复的变体,然后推广最快的安全变体,并将获胜路径固化到脚本、命令、测试、配置或文档中。对于递归或超参数优化,它还要求持久化每次运行到日志,与之前接受的获胜者比较,保持留出或回放检查,并在改进在噪声范围内、正确性失败、成本超出预算或搜索开始改变过多变量时停止。最终,一个变体不能成为新默认值,直到正确性测试通过、性能差异可重复或解释、回滚路径清晰、更改已写入源代码或持久化的运行手册,并且最终摘要包含精确的命令和测量结果。该技能支持所有主流AI Agent平台(Claude Code、Cursor、Codex等),并强调了“最佳可测量的安全变体”而非“全局最优”的务实态度。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/ECC/tree/main/skills/benchmark-optimization-loop

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

基准测试优化循环 是做什么的?

使用此技能将“使其快20倍”或“尝试50次递归优化”转化为一个有界的、可测量的循环过程,从而实际改进系统。

所需基线

在以下条件满足之前,不要进行优化:

  • 正在被优化的操作;
  • 必须保持绿色的正确性门控;
  • 指标:墙钟时间、p95延迟、行/秒、运行成本、内存、错误率;
  • 当前基线;
  • 搜索预算:最大变体数、最大时间、最大花费、最大数据影响。

如果用户要求不切实际的目标,则保留其雄心,但使循环有界且可测量。

循环

  1. 测量基线。
  2. 从证据中识别瓶颈。
  3. 生成每次测试一个假设的变体。
  4. 使用相同的输入形状运行变体。
  5. 拒绝那些正确性、安全性或可重复性失败的变体。
  6. 推广最快的安全变体。
  7. 将获胜路径固化到脚本、命令、测试、配置或文档中。
  8. 重新运行基线和获胜者以确认差值。

变体表

像这样跟踪变体:

变体 | 假设 | 命令 | 时间 | 正确? | 备注
baseline | 当前路径 | npm run job | 120s | 是 | 稳定
batch-500 | 减少往返次数 | npm run job -- --batch 500 | 42s | 是 | 胜利者
parallel-8 | 更多工作进程 | npm run job -- --workers 8 | 31s | 否 | 速率受限

递归搜索

对于递归或超参数工作:

  • 持久化每次运行到日志;
  • 与之前接受的获胜者比较,而不仅仅是前一次运行;
  • 保持留出或回放检查;
  • 当改进在噪声范围内、正确性失败、成本超出预算或搜索开始改变比它能够解释的更多的变量时停止。

使用“最佳可测量的安全变体”之类的短语,而非“全局最优”,除非搜索空间实际上是穷举的。

推广门控

一个变体在以下条件满足之前不能成为新的默认值:

  • 正确性测试通过;
  • 性能差异是可重复的或被解释;
  • 回滚路径清晰;
  • 更改已写入源代码控制或持久的运行手册;
  • 最终摘要包含精确的命令和测量结果。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

相关技能