{"kind":"Skill","metadata":{"namespace":"community","name":"optimizetests","version":"0.1.0"},"spec":{"description":"Optimize OpenClaw slow tests, imports, misplaced coverage, and CI wall time without dropping coverage.","files":{"SKILL.md":"---\nname: optimizetests\ndescription: Optimize OpenClaw slow tests, imports, misplaced coverage, and CI wall time without dropping coverage.\n---\n\n# Optimize Tests\n\nGoal: real OpenClaw test/runtime speedups with coverage intact. Do not add shards,\nskip assertions, weaken gates, or tune runner flags as the main fix.\n\n## Runbook\n\n1. Read `docs/help/testing.md`, `docs/ci.md`, and the scoped `AGENTS.md` files\n   for any subtree you will edit.\n2. Establish evidence before edits:\n   - Full ranking: `pnpm test:perf:groups --full-suite --allow-failures --output .artifacts/test-perf/\u003cname\u003e.json`\n   - Targeted file: `timeout 240 /usr/bin/time -l pnpm test \u003cfile\u003e --maxWorkers=1 --reporter=verbose`\n   - Import suspicion: add `OPENCLAW_VITEST_IMPORT_DURATIONS=1 OPENCLAW_VITEST_PRINT_IMPORT_BREAKDOWN=1`\n3. Attack highest-return hotspots first:\n   - broad barrels or `importActual()` in hot tests\n   - per-test `vi.resetModules()` plus fresh imports\n   - expensive gateway/server/client setup where reset/reuse proves same behavior\n   - core tests asserting extension-owned behavior\n   - duplicated fixture construction or contract assertions\n4. Prefer production-quality fixes:\n   - narrow runtime seams over broad mocks\n   - pure helpers for static parsing/metadata\n   - injected deps over module resets\n   - extension-owned tests for bundled plugin/provider/channel behavior\n5. After each change, rerun the same benchmark and the proving test lane. Record\n   before/after wall time, Vitest duration, and max RSS when available.\n6. Run `pnpm check:changed`; run broader gates (`pnpm check`, `pnpm test`,\n   `pnpm build`) when touched surfaces require them.\n7. Commit scoped changes with `scripts/committer \"\u003cconventional message\u003e\" \u003cpaths...\u003e`.\n   Push when requested. If CI is red, inspect with `gh run list/view`, fix, push,\n   repeat until current CI is green or a blocker is proven unrelated.\n\n## Output\n\nEnd with the pushed commit(s), before/after timings, gates run, current CI state,\nand any remaining tail lanes that need separate optimization.\n","agents/openai.yaml":"interface:\n  display_name: \"Optimize Tests\"\n  short_description: \"Benchmark and speed up OpenClaw tests\"\n  default_prompt: \"Use $optimizetests to benchmark slow OpenClaw tests, optimize imports and duplicated setup, move misplaced core coverage to extensions, verify gates, commit scoped changes, push, and keep CI green without adding shards or dropping coverage.\"\npolicy:\n  allow_implicit_invocation: false\n"},"import":{"commit_sha":"424c6d0a5f4665b803ad6768d08b0be7659deaf4","imported_at":"2026-05-18T20:13:36Z","license_text":"MIT License\n\nCopyright (c) 2025 Peter Steinberger\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","owner":"openclaw","repo":"openclaw/openclaw","source_url":"https://github.com/openclaw/openclaw/tree/424c6d0a5f4665b803ad6768d08b0be7659deaf4/.agents/skills/optimizetests"}},"content_hash":[126,0,216,166,117,120,98,130,117,226,97,106,149,22,251,251,194,48,238,206,74,33,177,151,112,29,12,70,36,21,148,231],"trust_level":"unsigned","yanked":false}
