Communitygithub.com

ベンチマーク最適化ループ

ユーザーが「これを20倍速くして」や「50回の再帰的最適化を試して」と依頼した際に、計測可能なループでシステムを実際に改善するスキルです。

ベンチマーク最適化ループ とは?

このスキルは、「20倍高速化」や「50回の再帰的最適化」といった漠然とした要求を、実際にシステムを改善できる、境界のある計測ループに変換します。開発者はこのスキルを使って、ベースライン測定、ボトルネック特定、仮説ベースのバリアント生成、安全性や正確性の検証、最速の安全なバリアントの選定を体系的に実行できます。Claude CodeやCursorなどのAIエージェント上で動作し、レイテンシ、スループット、コスト、メモリ使用量などのメトリクスを追跡します。再帰的最適化やハイパーパラメータ探索では、すべての試行を台帳に記録し、純粋な改善がノイズ範囲内になった時点で自動停止します。最終的には、最良のバリアントをスクリプトや設定としてコード化し、正確な測定値と共に報告します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/benchmark-optimization-loop

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

ベンチマーク最適化ループ は何をしますか?

このスキルを使用して、「20倍高速化」や「50回の再帰的最適化」を、実際にシステムを改善できる境界のある計測ループに変換します。

必要なベースライン

以下のものが揃うまで最適化を開始しないでください:

  • 最適化対象の操作
  • 成功し続けなければならない正確性ゲート
  • メトリクス:ウォールタイム、p95レイテンシ、行/秒、コスト/実行、メモリ、エラー率
  • 現在のベースライン
  • 探索予算:最大バリアント数、最大時間、最大支出、最大データ影響

ユーザーが非現実的な目標を要求した場合、野心は維持しつつも、ループを境界があり計測可能なものにします。

ループ

  1. ベースラインを測定する。
  2. 証拠からボトルネックを特定する。
  3. 各仮説を1つずつ検証するバリアントを生成する。
  4. 同じ入力形状でバリアントを実行する。
  5. 正確性、安全性、再現性に失敗したバリアントを却下する。
  6. 最速の安全なバリアントを昇格させる。
  7. 勝利したパスをスクリプト、コマンド、テスト、設定、またはドキュメントにコード化する。
  8. ベースラインと勝者を再実行して差分を確認する。

バリアントテーブル

次のようにバリアントを追跡します:

バリアント | 仮説 | コマンド | 時間 | 正確? | 備考
ベースライン | 現在のパス | 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/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

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.

関連スキル