Communityコーディング&開発github.com

テスト最適化

OpenClawの遅いテスト、インポート、カバレッジの不一致、CIウォールタイムをカバレッジを落とさずに最適化します。

テスト最適化 とは?

このスキルは、OpenClawプロジェクトのテストスイートのパフォーマンスを体系的に最適化するためのものです。具体的には、低速なテスト、過剰なインポート、誤ったカバレッジ、CIのウォールタイムを削減しながら、テストカバレッジを維持することを目的としています。本スキルは、まず `docs/help/testing.md` や `docs/ci.md` などの関連ドキュメントを読むことから始め、ベンチマークを取得して証拠を確立します。その後、ブロードなバレルインポートや `importActual()`、高価なゲートウェイ/サーバー/クライアントのセットアップなど、最もリターンの高いホットスポットを優先的に修正します。修正はプロダクション品質を優先し、変更後は同じベンチマークとテストレーンを再実行して前後比較を記録します。最終的には、変更をコミットし、CIの状態を確認して完了します。対応プラットフォームはClaude Code、Cursor、Codexなど、AIエージェントが利用できる環境全般です。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/clawdbot/clawdbot/tree/main/.agents/skills/optimizetests

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

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

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

ドキュメント

テスト最適化 は何をしますか?

目標:実際のOpenClawテスト/ランタイムの高速化を、カバレッジを維持したまま達成する。シャードを追加したり、アサーションをスキップしたり、ゲートを弱めたり、ランナーフラグを調整したりしないでください。これらは主な修正方法ではありません。

実行手順

  1. docs/help/testing.md、docs/ci.md、および編集するサブツリーのスコープ付きAGENTS.mdファイルを読む。
  2. 編集前に証拠を確立する:
    • 全ランキング:pnpm test:perf:groups --full-suite --allow-failures --output .artifacts/test-perf/<name>.json
    • 対象ファイル:timeout 240 /usr/bin/time -l pnpm test <file> --maxWorkers=1 --reporter=verbose
    • インポートの疑い:OPENCLAW_VITEST_IMPORT_DURATIONS=1 OPENCLAW_VITEST_PRINT_IMPORT_BREAKDOWN=1を追加する
  3. 最もリターンの高いホットスポットから優先的に攻める:
    • ブロードなバレルインポートまたはホットテストでのimportActual()
    • テストごとのvi.resetModules()と新しいインポート
    • 高価なゲートウェイ/サーバー/クライアントのセットアップ(リセット/再利用で同じ動作が証明される場合)
    • 拡張機能が所有する振る舞いをアサートするコアテスト
    • 重複したフィクスチャ構築またはコントラクトアサーション
  4. プロダクション品質の修正を優先する:
    • ブロードなモックよりも狭いランタイムシーム
    • 静的パース/メタデータ用の純粋ヘルパー
    • モジュールリセットよりも依存性注入
    • バンドルされたプラグイン/プロバイダー/チャネル動作のための拡張機能所有テスト
  5. 各変更後、同じベンチマークと証明テストレーンを再実行する。利用可能な場合は、前後のウォールタイム、Vitestの実行時間、最大RSSを記録する。
  6. pnpm check:changedを実行する。影響を受けるサーフェスがある場合は、より広範なゲート(pnpm check、pnpm test、pnpm build)を実行する。
  7. スコープ付きの変更をscripts/committer "<conventional message>" <paths...>でコミットする。リクエストがあればプッシュする。CIが赤の場合、gh run list/viewで検査し、修正、プッシュ、現在のCIが緑になるか、ブロッカーが無関係であると証明されるまで繰り返す。

出力

プッシュされたコミット、前後のタイミング、実行されたゲート、現在のCI状態、および別途最適化が必要な残りのテールレーンで終了する。

Individual skills in this repo

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

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

acp-router

Route plain-language requests for Claude Code, Cursor, Copilot, OpenClaw ACP, OpenCode, Gemini CLI, Grok Build, Qwen, Kiro, Kimi, iFlow, Factory Droid, Kilocode, or explicit ACP harness work into either OpenClaw ACP runtime sessions or direct acpx-driven sessions ("telephone game" flow). For coding-agent thread requests, read this skill first, then use only `sessions_spawn` for thread creation. Codex chat binding defaults to the native Codex app-server plugin unless ACP is explicit or background spawn needs ACP.

add-model-provider

Add and live-prove a model provider with non-interactive config one-liners, without exposing credentials.

agent-transcript

Requested GitHub PR/issue agent transcripts: redact, trim, preview, and insert safely.

apple-notes

Create, view, edit, delete, search, move, or export Apple Notes via the memo CLI on macOS.

apple-reminders

List, add, edit, complete, or delete Apple Reminders and reminder lists via remindctl.

auto-qa

Run OpenClaw-wide autonomous QA and live/stress campaigns across independent subsystem lanes, with verified fixes and a resumable evidence report.

autoreview

Structured code review through the shared OpenClaw agent-skills installation.

bear-notes

Create, search, and manage Bear notes via grizzly CLI.

blacksmith-testbox

Run Blacksmith Testbox for CI-parity checks, secrets, hosted services, migrations, or builds local cannot reproduce.

block-kit

Use proactively for structured or interactive Slack replies, and when asked to author or validate native Slack Block Kit JSON.

blogwatcher

Monitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.

blucli

BluOS CLI (blu) for discovery, playback, grouping, and volume.

bluebubbles

Send and manage iMessages via BlueBubbles, including attachments, tapbacks, edits, replies, and groups.

browser-automation

Use when controlling web pages with the OpenClaw browser tool, especially multi-step flows, login checks, tab management, or recovery from stale refs/timeouts.

camsnap

Capture frames or clips from RTSP/ONVIF cameras and local webcams, including USB pan/tilt/zoom control.

canvas

Present HTML on connected OpenClaw node canvases, navigate/eval/snapshot, and debug canvas host URLs.

channel-message-flows

Use when running QA Lab channel message flow evidence.

clawdtributor

Clawtributor PRs here, last week or another window: discover conversation refs, recheck GitHub, rank by impact.

clawhub

Search ClawHub for plugins by default, or skills when explicitly requested; install, verify, update, uninstall, publish, or sync skills.

関連スキル