[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71NJF4B3P89TYXG929QZWBF":3,"skill-same:01M71NJF4B3P89TYXG929QZWBF":109},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":26,"publishedAt":47,"linkOnly":48,"markdownContent":49,"markdownBody":50,"frontMatter":51,"refName":53,"commitSha":54,"skillDirectory":55,"forksCount":56,"repositoryHtmlUrl":57,"repositoryHomepageUrl":6,"ownerHtmlUrl":58,"ownerBlogUrl":6,"ownerDescription":59,"updatedAt":60,"install":61,"resources":74},"01M71NJF4B3P89TYXG929QZWBF","ln-814-optimization-executor",null,"Executes optimization hypotheses with keep\u002Fdiscard testing loop. Use when applying validated performance improvements.","vitalikpestov\u002FSkills-Catalog","vitalikpestov","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F13882997?v=4","01M71N4QG0CWRXX4R24JQZXDDQ","Vitalik Pestov","01M71N4QGMSYRW607DDSE0CQMM",2,"MIT","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Foptimization-suite\u002Fskills\u002Fln-814-optimization-executor\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],"ln","Optimization","ln 814 optimization executor","executor","use","when","changes","with","keep","line","hex","testing","edit","write","read","loop","Bash","file","performance","MCP","2026-11-10 10:56:23",false,"---\nname: ln-814-optimization-executor\ndescription: \"Executes optimization hypotheses with keep\u002Fdiscard testing loop. Use when applying validated performance improvements.\"\nallowed-tools: Read, Grep, Glob, Bash, mcp__hex-line__outline, mcp__hex-line__read_file, mcp__hex-line__edit_file, mcp__hex-line__write_file, mcp__hex-line__verify, mcp__hex-line__changes\nlicense: MIT\n---\n\n> **Paths:** File paths (`references\u002F`, `..\u002Fln-*`) are relative to this skill directory.\n\n# ln-814-optimization-executor\n\n**Type:** L3 Worker\n**Category:** 8XX Optimization\n\nExecutes optimization hypotheses from the researcher using keep\u002Fdiscard autoresearch loop. Supports multi-file changes, compound baselines, and any optimization type (algorithm, architecture, query, caching, batching).\n\n---\n\n## Overview\n\n| Aspect | Details |\n|--------|---------|\n| **Input** | `.hex-skills\u002Foptimization\u002F{slug}\u002Fcontext.md` OR conversation context (standalone invocation) |\n| **Output** | Optimized code on isolated branch, per-hypothesis results, experiment log |\n| **Pattern** | Strike-first: apply all → test → measure. Bisect only on failure. A\u002FB only for contested alternatives |\n\n---\n\n## Workflow\n\n**Phases:** Pre-flight → Baseline → Strike-First Execution → Report → Gap Analysis\n\n---\n\n## Phase 0: Pre-flight Checks\n\n### Slug Resolution\n\n- If invoked via Agent with contextStore containing `slug` — use directly.\n- If invoked standalone — derive slug from context_file path or ask user.\n\n### Step 1: Load Context\n\nRead `.hex-skills\u002Foptimization\u002F{slug}\u002Fcontext.md` from project root. Contains problem statement, profiling results, research hypotheses, and target metric.\n\nIf file not found: check conversation context for the same data (standalone invocation).\n\n### Step 2: Pre-flight Validation\n\n| Check | Required | Action if Missing |\n|-------|----------|-------------------|\n| Hypotheses provided (H1..H7) | Yes | Block — nothing to execute |\n| Test infrastructure | Yes | Block (see ci_tool_detection.md) |\n| Git clean state | Yes | Block (need clean baseline for revert) |\n| Worktree isolation | Yes | Create per git_worktree_fallback.md |\n| E2E safety test | No (recommended) | Read from context; WARN if null — full test suite as fallback gate |\n\n**MANDATORY READ:** Load `references\u002Fgit_worktree_fallback.md` — use optimization rows.\n**MANDATORY READ:** Load `references\u002Fci_tool_detection.md` — use Test Frameworks + Benchmarks sections.\n\nTool policy: follow host AGENTS.md MCP preferences; load `references\u002Fmcp_tool_preferences.md` and `references\u002Fmcp_integration_patterns.md` only when host policy is absent or MCP behavior is unclear..\n\nUse `hex-line` as the primary path for code\u002Fconfig\u002Fscript edits in this worker. Profilers and benchmarks stay the source of truth; do not treat `hex-graph` as runtime evidence here.\n\n### E2E Safety Test\n\nRead `e2e_test_command` from context file (discovered by profiler during test discovery phase).\n\n| Source | Action |\n|--------|--------|\n| Context has `e2e_test_command` | Use as functional safety gate in Phase 2 |\n| Context has `e2e_test_command = null` | WARN: full test suite is the fallback gate |\n| Standalone (no context) | User must provide test command; block if missing |\n\n---\n\n## Phase 1: Establish Baseline\n\nReuse baseline from performance map (already measured with real metrics).\n\n### From Context File\n\nRead `performance_map.baseline` and `performance_map.test_command` from `.hex-skills\u002Foptimization\u002F{slug}\u002Fcontext.md`.\n\n| Field | Source |\n|-------|--------|\n| `test_command` | Discovered\u002Fcreated test command |\n| `baseline` | Multi-metric snapshot: wall time, CPU, memory, I\u002FO |\n\n### Verification Run\n\nRun `test_command` once to confirm baseline is still valid (code unchanged since profiling):\n\n| Step | Action |\n|------|--------|\n| 1 | Run `test_command` |\n| 2 | IF result within 10% of `baseline.wall_time_ms` → baseline confirmed |\n| 3 | IF result diverges > 10% → re-measure (3 runs, median) as new baseline |\n| 4 | IF test FAILS → BLOCK: \"test fails on unmodified code\" |\n\n---\n\n## Phase 2: Strike-First Execution\n\n**MANDATORY READ:** Load [optimization_categories.md](references\u002Foptimization_categories.md) for pattern reference during implementation.\n\nApply maximum changes at once. Only fall back to A\u002FB testing where sources genuinely disagree on approach.\n\n### Step 1: Triage Hypotheses\n\nSplit hypotheses from researcher into two groups:\n\n| Group | Criteria | Action |\n|-------|----------|--------|\n| **Uncontested** | Clear best approach, no conflicting alternatives | Apply directly in the strike |\n| **Contested** | Multiple approaches exist (e.g., source A says cache, source B says batch) OR `conflicts_with` another hypothesis | A\u002FB test each alternative on top of full implementation |\n\nMost hypotheses should be uncontested — the researcher already ranked them by evidence.\n\n### Step 2: Strike (Apply All Uncontested)\n\n```\n1. APPLY all uncontested hypotheses at once (all file edits)\n2. VERIFY: Run full test suite\n   IF tests FAIL:\n     - IF fixable (typo, missing import) → fix & re-run ONCE\n     - IF fundamental → BISECT (see Step 4)\n3. E2E GATE (if e2e_test_command not null):\n   IF FAIL → BISECT\n4. MEASURE: 5 runs, median\n5. COMPARE: improvement vs baseline\n   IF improvement meets target → DONE. Commit all:\n     git add {all_files}\n     git commit -m \"perf: apply optimizations H1,H2,H3,... (+{improvement}%)\"\n   IF no improvement → BISECT\n```\n\n### Step 3: Contested Alternatives (A\u002FB on top of strike)\n\nFor each contested pair\u002Fgroup, with ALL uncontested changes already applied:\n\n```\nFOR each contested hypothesis group:\n  1. Apply alternative A → test → measure (5 runs, median)\n  2. Revert alternative A, apply alternative B → test → measure\n  3. KEEP the winner. Commit.\n  4. Winner becomes part of the baseline for next contested group.\n```\n\n### Step 4: Bisect (only on strike failure)\n\nIf strike fails tests or shows no improvement:\n\n```\n1. Revert all changes: git checkout -- . && git clean -fd\n2. Binary search: apply first half of hypotheses → test\n   - IF passes → problem in second half\n   - IF fails → problem in first half\n3. Narrow down to the breaking hypothesis\n4. Remove it from strike, re-apply remaining → test → measure\n5. Log removed hypothesis with reason\n```\n\n### Scope Rules\n\n| Rule | Description |\n|------|-------------|\n| File scope | Multiple files allowed (not limited to single function) |\n| Signature changes | Allowed if tests still pass |\n| New files | Allowed (cache wrapper, batch adapter, utility) |\n| New dependencies | Allowed if already in project ecosystem (e.g., using configured Redis) |\n| Time budget | 45 minutes total |\n\n### Revert Protocol\n\n| Scope | Command |\n|-------|---------|\n| Full revert | `git checkout -- . && git clean -fd` (safe in worktree) |\n| Single hypothesis | `git checkout -- {files}` (only during bisect) |\n\n### Safety Rules\n\n| Rule | Description |\n|------|-------------|\n| Traceability | Commit message lists all applied hypothesis IDs |\n| Isolation | All work in isolated worktree; never modify main worktree |\n| Bisect only on failure | Do NOT test hypotheses individually unless strike fails or alternatives genuinely conflict |\n| Crash triage | Runtime crash → fix once if trivial (typo, import), else bisect to find cause |\n\n### Stop Conditions (Execution Loop)\n\n| Condition | Action |\n|-----------|--------|\n| Strike passes + improvement meets target | STOP — commit, proceed to Report |\n| All contested alternatives tested | STOP — commit winner, proceed to Report |\n| Bisect removes all hypotheses | STOP — report \"all hypotheses failed\" with profiling data |\n| Time budget exceeded (45 min) | STOP — report partial results with remaining hypotheses |\n| All tests fail after strike + bisect | STOP — full revert, report diagnostic value only |\n\n---\n\n## Phase 3: Report Results\n\n### Report Schema\n\n| Field | Description |\n|-------|-------------|\n| baseline | Original measurement (metric + value) |\n| final | Final measurement after optimizations |\n| total_improvement_pct | Overall percentage improvement |\n| target_met | Boolean — did we reach the target metric? |\n| strike_result | `clean` (all applied) \u002F `bisected` (some removed) \u002F `failed` |\n| hypotheses_applied | List of hypothesis IDs applied in strike |\n| hypotheses_removed | List removed during bisect (with reasons) |\n| contested_results | Per-contested group: alternatives tested, winner, measurement |\n| branch | Worktree branch name |\n| files_modified | All changed files |\n| e2e_test | `{ command, source, baseline_passed, final_passed }` or null |\n\n### Results Comparison (mandatory)\n\nShow baseline vs final for EVERY metric from `performance_map.baseline`. Include both percentage and multiplier.\n\n```\n| Metric | Baseline | After Strike | Improvement |\n|--------|----------|-------------|-------------|\n| Wall time | 7280ms | 3800ms | 47.8% (1.9x) |\n| CPU time | 850ms | 720ms | 15.3% (1.2x) |\n| Memory peak | 256MB | 245MB | 4.3% |\n| HTTP round-trips | 13 | 2 | 84.6% (6.5x) |\n\nTarget: 5000ms → Achieved: 3800ms ✓ TARGET MET\n```\n\n### Per-Function Delta (if instrumentation available)\n\nIf `instrumented_files` from context is non-empty, run `test_command` once more AFTER strike to capture per-function timing with the same instrumentation the profiler placed:\n\n```\n| Function | Before (ms) | After (ms) | Delta |\n|----------|------------|------------|-------|\n| mt_translate | 3500 | 450 | -87% (7.8x) |\n| tikal_extract | 2800 | 2800 | 0% (unchanged) |\n```\n\nThen clean up: `git checkout -- {instrumented_files}` — remove all profiling instrumentation before final commit.\n\nPresent both tables to user. This is the primary deliverable — numbers the user sees first.\n\n### Experiment Log\n\nWrite to `{project_root}\u002F.hex-skills\u002Foptimization\u002F{slug}\u002Fln-814-log.tsv`:\n\n| Column | Description |\n|--------|-------------|\n| timestamp | ISO 8601 |\n| phase | `strike` \u002F `bisect` \u002F `contested` |\n| hypotheses | Comma-separated IDs applied in this round |\n| baseline_ms | Baseline before this round |\n| result_ms | Measurement after changes |\n| improvement_pct | Percentage change |\n| status | `applied` \u002F `removed` \u002F `alternative_a` \u002F `alternative_b` |\n| commit | Git commit hash |\n| files | Comma-separated modified files |\n| e2e_status | pass \u002F fail \u002F skipped |\n\nAppend to existing file if present (enables tracking across multiple runs).\n\n---\n\n## Phase 4: Gap Analysis (If Target Not Met)\n\nIf target metric not reached after all hypotheses:\n\n| Section | Content |\n|---------|---------|\n| Achievement | What was achieved (original → final, improvement %) |\n| Remaining bottlenecks | From time map: which steps still dominate |\n| Remaining cycles | If coordinator runs multi-cycle: \"{remaining} optimization cycles available for remaining bottlenecks\" |\n| Infrastructure recommendations | If bottleneck requires infra changes (scaling, caching layer, CDN) |\n| Further research | Optimization directions not explored in this run |\n\n---\n\n## Error Handling\n\n| Error | Recovery |\n|-------|----------|\n| Strike fails all tests | Bisect to find breaking hypothesis, remove it, retry |\n| Strike shows no improvement | Bisect to identify ineffective hypotheses |\n| Measurement inconsistent (high variance) | Increase runs to 10, use median |\n| Worktree creation fails | Fall back to branch per git_worktree_fallback.md |\n| Time budget exceeded | Stop loop, report partial results with hypotheses remaining |\n| Multi-file revert fails | `git checkout -- .` in worktree (safe — worktree is isolated) |\n\n---\n\n## References\n\n- [optimization_categories.md](references\u002Foptimization_categories.md) — optimization pattern checklist\n- `references\u002Fci_tool_detection.md` (test + benchmark detection)\n- `references\u002Fgit_worktree_fallback.md` (worktree isolation)\n\n---\n\n## Runtime Summary Artifact\n\n**MANDATORY READ:** Load `references\u002Fcoordinator_summary_contract.md`\n\nEmit an `optimization-worker` summary envelope.\n\nManaged mode:\n- `ln-810` passes deterministic `runId` and exact `summaryArtifactPath`\n- write the summary to the provided `summaryArtifactPath`\n\nStandalone mode:\n- omit `runId` and `summaryArtifactPath`\n- write `.hex-skills\u002Fruntime-artifacts\u002Fruns\u002F{run_id}\u002Foptimization-worker\u002Fln-814--{identifier}.json`\n\n### Monitor Integration (Claude Code 2.1.98+)\n\n**MANDATORY READ:** Load `references\u002Fmonitor_integration_pattern.md`\n\nDuring multi-run optimization cycles (baseline + A\u002FB):\n`Monitor(command=\"{test_command} 2>&1 | grep --line-buffered -E 'run|result|error|FAIL'\", timeout_ms=600000, description=\"optimization run\")`\n\nFallback: if Monitor is unavailable, use `Bash(run_in_background=true)`.\n\n## Definition of Done\n\n- [ ] Baseline established using same metric type as observed problem\n- [ ] Hypotheses triaged: uncontested vs contested\n- [ ] Strike applied: all uncontested hypotheses implemented at once\n- [ ] Tests pass after strike\n- [ ] Contested alternatives A\u002FB tested on top of full implementation\n- [ ] Bisect performed only if strike fails (not preemptively)\n- [ ] E2E safety test passes (or documented as unavailable)\n- [ ] Experiment log written to `.hex-skills\u002Foptimization\u002F{slug}\u002Fln-814-log.tsv`\n- [ ] Report returned with baseline, final, improvement%, strike result\n- [ ] All changes on isolated branch, pushed to remote\n- [ ] Gap analysis provided if target metric not met\n- [ ] Optimization execution artifact written to the shared location\n\n---\n\n**Version:** 2.0.0\n**Last Updated:** 2026-03-14\n","> **Paths:** File paths (`references\u002F`, `..\u002Fln-*`) are relative to this skill directory.\n\n# ln-814-optimization-executor\n\n**Type:** L3 Worker\n**Category:** 8XX Optimization\n\nExecutes optimization hypotheses from the researcher using keep\u002Fdiscard autoresearch loop. Supports multi-file changes, compound baselines, and any optimization type (algorithm, architecture, query, caching, batching).\n\n---\n\n## Overview\n\n| Aspect | Details |\n|--------|---------|\n| **Input** | `.hex-skills\u002Foptimization\u002F{slug}\u002Fcontext.md` OR conversation context (standalone invocation) |\n| **Output** | Optimized code on isolated branch, per-hypothesis results, experiment log |\n| **Pattern** | Strike-first: apply all → test → measure. Bisect only on failure. A\u002FB only for contested alternatives |\n\n---\n\n## Workflow\n\n**Phases:** Pre-flight → Baseline → Strike-First Execution → Report → Gap Analysis\n\n---\n\n## Phase 0: Pre-flight Checks\n\n### Slug Resolution\n\n- If invoked via Agent with contextStore containing `slug` — use directly.\n- If invoked standalone — derive slug from context_file path or ask user.\n\n### Step 1: Load Context\n\nRead `.hex-skills\u002Foptimization\u002F{slug}\u002Fcontext.md` from project root. Contains problem statement, profiling results, research hypotheses, and target metric.\n\nIf file not found: check conversation context for the same data (standalone invocation).\n\n### Step 2: Pre-flight Validation\n\n| Check | Required | Action if Missing |\n|-------|----------|-------------------|\n| Hypotheses provided (H1..H7) | Yes | Block — nothing to execute |\n| Test infrastructure | Yes | Block (see ci_tool_detection.md) |\n| Git clean state | Yes | Block (need clean baseline for revert) |\n| Worktree isolation | Yes | Create per git_worktree_fallback.md |\n| E2E safety test | No (recommended) | Read from context; WARN if null — full test suite as fallback gate |\n\n**MANDATORY READ:** Load `references\u002Fgit_worktree_fallback.md` — use optimization rows.\n**MANDATORY READ:** Load `references\u002Fci_tool_detection.md` — use Test Frameworks + Benchmarks sections.\n\nTool policy: follow host AGENTS.md MCP preferences; load `references\u002Fmcp_tool_preferences.md` and `references\u002Fmcp_integration_patterns.md` only when host policy is absent or MCP behavior is unclear..\n\nUse `hex-line` as the primary path for code\u002Fconfig\u002Fscript edits in this worker. Profilers and benchmarks stay the source of truth; do not treat `hex-graph` as runtime evidence here.\n\n### E2E Safety Test\n\nRead `e2e_test_command` from context file (discovered by profiler during test discovery phase).\n\n| Source | Action |\n|--------|--------|\n| Context has `e2e_test_command` | Use as functional safety gate in Phase 2 |\n| Context has `e2e_test_command = null` | WARN: full test suite is the fallback gate |\n| Standalone (no context) | User must provide test command; block if missing |\n\n---\n\n## Phase 1: Establish Baseline\n\nReuse baseline from performance map (already measured with real metrics).\n\n### From Context File\n\nRead `performance_map.baseline` and `performance_map.test_command` from `.hex-skills\u002Foptimization\u002F{slug}\u002Fcontext.md`.\n\n| Field | Source |\n|-------|--------|\n| `test_command` | Discovered\u002Fcreated test command |\n| `baseline` | Multi-metric snapshot: wall time, CPU, memory, I\u002FO |\n\n### Verification Run\n\nRun `test_command` once to confirm baseline is still valid (code unchanged since profiling):\n\n| Step | Action |\n|------|--------|\n| 1 | Run `test_command` |\n| 2 | IF result within 10% of `baseline.wall_time_ms` → baseline confirmed |\n| 3 | IF result diverges > 10% → re-measure (3 runs, median) as new baseline |\n| 4 | IF test FAILS → BLOCK: \"test fails on unmodified code\" |\n\n---\n\n## Phase 2: Strike-First Execution\n\n**MANDATORY READ:** Load [optimization_categories.md](references\u002Foptimization_categories.md) for pattern reference during implementation.\n\nApply maximum changes at once. Only fall back to A\u002FB testing where sources genuinely disagree on approach.\n\n### Step 1: Triage Hypotheses\n\nSplit hypotheses from researcher into two groups:\n\n| Group | Criteria | Action |\n|-------|----------|--------|\n| **Uncontested** | Clear best approach, no conflicting alternatives | Apply directly in the strike |\n| **Contested** | Multiple approaches exist (e.g., source A says cache, source B says batch) OR `conflicts_with` another hypothesis | A\u002FB test each alternative on top of full implementation |\n\nMost hypotheses should be uncontested — the researcher already ranked them by evidence.\n\n### Step 2: Strike (Apply All Uncontested)\n\n```\n1. APPLY all uncontested hypotheses at once (all file edits)\n2. VERIFY: Run full test suite\n   IF tests FAIL:\n     - IF fixable (typo, missing import) → fix & re-run ONCE\n     - IF fundamental → BISECT (see Step 4)\n3. E2E GATE (if e2e_test_command not null):\n   IF FAIL → BISECT\n4. MEASURE: 5 runs, median\n5. COMPARE: improvement vs baseline\n   IF improvement meets target → DONE. Commit all:\n     git add {all_files}\n     git commit -m \"perf: apply optimizations H1,H2,H3,... (+{improvement}%)\"\n   IF no improvement → BISECT\n```\n\n### Step 3: Contested Alternatives (A\u002FB on top of strike)\n\nFor each contested pair\u002Fgroup, with ALL uncontested changes already applied:\n\n```\nFOR each contested hypothesis group:\n  1. Apply alternative A → test → measure (5 runs, median)\n  2. Revert alternative A, apply alternative B → test → measure\n  3. KEEP the winner. Commit.\n  4. Winner becomes part of the baseline for next contested group.\n```\n\n### Step 4: Bisect (only on strike failure)\n\nIf strike fails tests or shows no improvement:\n\n```\n1. Revert all changes: git checkout -- . && git clean -fd\n2. Binary search: apply first half of hypotheses → test\n   - IF passes → problem in second half\n   - IF fails → problem in first half\n3. Narrow down to the breaking hypothesis\n4. Remove it from strike, re-apply remaining → test → measure\n5. Log removed hypothesis with reason\n```\n\n### Scope Rules\n\n| Rule | Description |\n|------|-------------|\n| File scope | Multiple files allowed (not limited to single function) |\n| Signature changes | Allowed if tests still pass |\n| New files | Allowed (cache wrapper, batch adapter, utility) |\n| New dependencies | Allowed if already in project ecosystem (e.g., using configured Redis) |\n| Time budget | 45 minutes total |\n\n### Revert Protocol\n\n| Scope | Command |\n|-------|---------|\n| Full revert | `git checkout -- . && git clean -fd` (safe in worktree) |\n| Single hypothesis | `git checkout -- {files}` (only during bisect) |\n\n### Safety Rules\n\n| Rule | Description |\n|------|-------------|\n| Traceability | Commit message lists all applied hypothesis IDs |\n| Isolation | All work in isolated worktree; never modify main worktree |\n| Bisect only on failure | Do NOT test hypotheses individually unless strike fails or alternatives genuinely conflict |\n| Crash triage | Runtime crash → fix once if trivial (typo, import), else bisect to find cause |\n\n### Stop Conditions (Execution Loop)\n\n| Condition | Action |\n|-----------|--------|\n| Strike passes + improvement meets target | STOP — commit, proceed to Report |\n| All contested alternatives tested | STOP — commit winner, proceed to Report |\n| Bisect removes all hypotheses | STOP — report \"all hypotheses failed\" with profiling data |\n| Time budget exceeded (45 min) | STOP — report partial results with remaining hypotheses |\n| All tests fail after strike + bisect | STOP — full revert, report diagnostic value only |\n\n---\n\n## Phase 3: Report Results\n\n### Report Schema\n\n| Field | Description |\n|-------|-------------|\n| baseline | Original measurement (metric + value) |\n| final | Final measurement after optimizations |\n| total_improvement_pct | Overall percentage improvement |\n| target_met | Boolean — did we reach the target metric? |\n| strike_result | `clean` (all applied) \u002F `bisected` (some removed) \u002F `failed` |\n| hypotheses_applied | List of hypothesis IDs applied in strike |\n| hypotheses_removed | List removed during bisect (with reasons) |\n| contested_results | Per-contested group: alternatives tested, winner, measurement |\n| branch | Worktree branch name |\n| files_modified | All changed files |\n| e2e_test | `{ command, source, baseline_passed, final_passed }` or null |\n\n### Results Comparison (mandatory)\n\nShow baseline vs final for EVERY metric from `performance_map.baseline`. Include both percentage and multiplier.\n\n```\n| Metric | Baseline | After Strike | Improvement |\n|--------|----------|-------------|-------------|\n| Wall time | 7280ms | 3800ms | 47.8% (1.9x) |\n| CPU time | 850ms | 720ms | 15.3% (1.2x) |\n| Memory peak | 256MB | 245MB | 4.3% |\n| HTTP round-trips | 13 | 2 | 84.6% (6.5x) |\n\nTarget: 5000ms → Achieved: 3800ms ✓ TARGET MET\n```\n\n### Per-Function Delta (if instrumentation available)\n\nIf `instrumented_files` from context is non-empty, run `test_command` once more AFTER strike to capture per-function timing with the same instrumentation the profiler placed:\n\n```\n| Function | Before (ms) | After (ms) | Delta |\n|----------|------------|------------|-------|\n| mt_translate | 3500 | 450 | -87% (7.8x) |\n| tikal_extract | 2800 | 2800 | 0% (unchanged) |\n```\n\nThen clean up: `git checkout -- {instrumented_files}` — remove all profiling instrumentation before final commit.\n\nPresent both tables to user. This is the primary deliverable — numbers the user sees first.\n\n### Experiment Log\n\nWrite to `{project_root}\u002F.hex-skills\u002Foptimization\u002F{slug}\u002Fln-814-log.tsv`:\n\n| Column | Description |\n|--------|-------------|\n| timestamp | ISO 8601 |\n| phase | `strike` \u002F `bisect` \u002F `contested` |\n| hypotheses | Comma-separated IDs applied in this round |\n| baseline_ms | Baseline before this round |\n| result_ms | Measurement after changes |\n| improvement_pct | Percentage change |\n| status | `applied` \u002F `removed` \u002F `alternative_a` \u002F `alternative_b` |\n| commit | Git commit hash |\n| files | Comma-separated modified files |\n| e2e_status | pass \u002F fail \u002F skipped |\n\nAppend to existing file if present (enables tracking across multiple runs).\n\n---\n\n## Phase 4: Gap Analysis (If Target Not Met)\n\nIf target metric not reached after all hypotheses:\n\n| Section | Content |\n|---------|---------|\n| Achievement | What was achieved (original → final, improvement %) |\n| Remaining bottlenecks | From time map: which steps still dominate |\n| Remaining cycles | If coordinator runs multi-cycle: \"{remaining} optimization cycles available for remaining bottlenecks\" |\n| Infrastructure recommendations | If bottleneck requires infra changes (scaling, caching layer, CDN) |\n| Further research | Optimization directions not explored in this run |\n\n---\n\n## Error Handling\n\n| Error | Recovery |\n|-------|----------|\n| Strike fails all tests | Bisect to find breaking hypothesis, remove it, retry |\n| Strike shows no improvement | Bisect to identify ineffective hypotheses |\n| Measurement inconsistent (high variance) | Increase runs to 10, use median |\n| Worktree creation fails | Fall back to branch per git_worktree_fallback.md |\n| Time budget exceeded | Stop loop, report partial results with hypotheses remaining |\n| Multi-file revert fails | `git checkout -- .` in worktree (safe — worktree is isolated) |\n\n---\n\n## References\n\n- [optimization_categories.md](references\u002Foptimization_categories.md) — optimization pattern checklist\n- `references\u002Fci_tool_detection.md` (test + benchmark detection)\n- `references\u002Fgit_worktree_fallback.md` (worktree isolation)\n\n---\n\n## Runtime Summary Artifact\n\n**MANDATORY READ:** Load `references\u002Fcoordinator_summary_contract.md`\n\nEmit an `optimization-worker` summary envelope.\n\nManaged mode:\n- `ln-810` passes deterministic `runId` and exact `summaryArtifactPath`\n- write the summary to the provided `summaryArtifactPath`\n\nStandalone mode:\n- omit `runId` and `summaryArtifactPath`\n- write `.hex-skills\u002Fruntime-artifacts\u002Fruns\u002F{run_id}\u002Foptimization-worker\u002Fln-814--{identifier}.json`\n\n### Monitor Integration (Claude Code 2.1.98+)\n\n**MANDATORY READ:** Load `references\u002Fmonitor_integration_pattern.md`\n\nDuring multi-run optimization cycles (baseline + A\u002FB):\n`Monitor(command=\"{test_command} 2>&1 | grep --line-buffered -E 'run|result|error|FAIL'\", timeout_ms=600000, description=\"optimization run\")`\n\nFallback: if Monitor is unavailable, use `Bash(run_in_background=true)`.\n\n## Definition of Done\n\n- [ ] Baseline established using same metric type as observed problem\n- [ ] Hypotheses triaged: uncontested vs contested\n- [ ] Strike applied: all uncontested hypotheses implemented at once\n- [ ] Tests pass after strike\n- [ ] Contested alternatives A\u002FB tested on top of full implementation\n- [ ] Bisect performed only if strike fails (not preemptively)\n- [ ] E2E safety test passes (or documented as unavailable)\n- [ ] Experiment log written to `.hex-skills\u002Foptimization\u002F{slug}\u002Fln-814-log.tsv`\n- [ ] Report returned with baseline, final, improvement%, strike result\n- [ ] All changes on isolated branch, pushed to remote\n- [ ] Gap analysis provided if target metric not met\n- [ ] Optimization execution artifact written to the shared location\n\n---\n\n**Version:** 2.0.0\n**Last Updated:** 2026-03-14\n",{"name":5,"license":15,"description":7,"allowed-tools":52},"Read, Grep, Glob, Bash, mcp__hex-line__outline, mcp__hex-line__read_file, mcp__hex-line__edit_file, mcp__hex-line__write_file, mcp__hex-line__verify, mcp__hex-line__changes","main","fbfb242f793fdf040f3a1a6b100896c188c228c8","_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Foptimization-suite\u002Fskills\u002Fln-814-optimization-executor",1,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog","https:\u002F\u002Fgithub.com\u002Fvitalikpestov","Listing on crypto exchanges","2026-06-15 22:12:56",{"source":8,"skillName":5,"commands":62,"prompt":72,"zipAvailable":73},[63,66,69],{"tool":64,"command":65},"npx","npx skills add vitalikpestov\u002FSkills-Catalog --skill ln-814-optimization-executor",{"tool":67,"command":68},"bunx","bunx skills add vitalikpestov\u002FSkills-Catalog --skill ln-814-optimization-executor",{"tool":70,"command":71},"pnpm","pnpm dlx skills add vitalikpestov\u002FSkills-Catalog --skill ln-814-optimization-executor","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Foptimization-suite\u002Fskills\u002Fln-814-optimization-executor\u002FSKILL.md",true,[75,81,85,89,93,97,101,105],{"path":76,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":79,"sourceHtmlUrl":80},"references\u002Fci_tool_detection.md","REFERENCE","参考文档",1986,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Foptimization-suite\u002Fskills\u002Fln-814-optimization-executor\u002Freferences\u002Fci_tool_detection.md",{"path":82,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Fcoordinator_summary_contract.md",1009,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Foptimization-suite\u002Fskills\u002Fln-814-optimization-executor\u002Freferences\u002Fcoordinator_summary_contract.md",{"path":86,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fgit_scope_detection.md",2462,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Foptimization-suite\u002Fskills\u002Fln-814-optimization-executor\u002Freferences\u002Fgit_scope_detection.md",{"path":90,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":91,"sourceHtmlUrl":92},"references\u002Fgit_worktree_fallback.md",2936,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Foptimization-suite\u002Fskills\u002Fln-814-optimization-executor\u002Freferences\u002Fgit_worktree_fallback.md",{"path":94,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":95,"sourceHtmlUrl":96},"references\u002Fmcp_integration_patterns.md",1567,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Foptimization-suite\u002Fskills\u002Fln-814-optimization-executor\u002Freferences\u002Fmcp_integration_patterns.md",{"path":98,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":99,"sourceHtmlUrl":100},"references\u002Fmcp_tool_preferences.md",2338,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Foptimization-suite\u002Fskills\u002Fln-814-optimization-executor\u002Freferences\u002Fmcp_tool_preferences.md",{"path":102,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":103,"sourceHtmlUrl":104},"references\u002Fmonitor_integration_pattern.md",2079,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Foptimization-suite\u002Fskills\u002Fln-814-optimization-executor\u002Freferences\u002Fmonitor_integration_pattern.md",{"path":106,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":107,"sourceHtmlUrl":108},"references\u002Foptimization_categories.md",3349,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_AI-Automation\u002Fclaude-code-skills-levnikolaevich\u002Fplugins\u002Foptimization-suite\u002Fskills\u002Fln-814-optimization-executor\u002Freferences\u002Foptimization_categories.md",[110,145,169,184,207,240],{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":126,"publishedAt":144},"01M71V1MC994P553631JZSWVYD","solana-dev","Use when user asks to \"build a Solana dapp\", \"write an Anchor program\", \"create a token\", \"debug Solana errors\", \"set up wallet connection\", \"test my Solana program\", \"deploy to devnet\", or \"explain Solana concepts\" (rent, accounts, PDAs, CPIs, etc.). End-to-end Solana development playbook covering wallet connection, Anchor\u002FPinocchio programs, Codama client generation, LiteSVM\u002FMollusk\u002FSurfpool testing, and security checklists. Integrates with the Solana MCP server for live documentation search. Prefers framework-kit (@solana\u002Fclient + @solana\u002Freact-hooks) for UI, wallet-standard-first connection (incl. ConnectorKit), @solana\u002Fkit for client\u002FRPC code, and @solana\u002Fweb3-compat for legacy boundaries.","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Web3\u002Fsolana-dev\u002Fskill\u002FSKILL.md",[116,117,120,121],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":118,"categoryName":119,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":122,"categoryName":123,"taxonomyType":124,"taxonomyTypeDesc":125},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[127,128,129,130,131,38,132,133,46,134,135,136,137,40,138,139,140,141,142,143],"dev","solana dev","solana","Wallet","search","solana cli","kit","web3","react","create","server","playbook","live","security","ui","concepts","toolchain","2026-11-10 13:02:02",{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":151,"publishedAt":144},"01M71TYQPHE2YGKTT7DG9QCW3K","generating-trading-signals","Generate trading signals using technical indicators (RSI, MACD, Bollinger Bands, etc.).\nCombines multiple indicators into composite signals with confidence scores.\nUse when analyzing assets for trading opportunities or checking technical indicators.\nTrigger with phrases like \"get trading signals\", \"check indicators\", \"analyze for entry\",\n\"scan for opportunities\", \"generate buy\u002Fsell signals\", or \"technical analysis\".","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Trading-Finance\u002Fgenerating-trading-signals\u002FSKILL.md",[],[152,153,154,155,156,157,158,159,160,161,162,163,31,32,43,164,165,166,167,168],"generating trading signals","signals","trading signals","trading","get","technical indicators","for","scan","rsi","trigger","python","technical","analysis","code","io","check","analyze",{"skillNo":170,"name":171,"nameZh":6,"description":172,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":173,"categories":174,"keywords":175,"publishedAt":144},"01M71TY4CR3GKGQ3M12X9WN95Y","prediction-monitor","Prediction Monitor - Auto-activating skill for ML Deployment.\nTriggers on: prediction monitor, prediction monitor\nPart of the ML Deployment skill category.","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Trading-Finance\u002FAI Predictions\u002Fprediction-monitor\u002FSKILL.md",[],[176,177,178,158,179,41,40,39,180,181,182,183,43],"prediction","monitor","prediction monitor","deployment","triggers","grep","auto","ml",{"skillNo":185,"name":186,"nameZh":6,"description":187,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":188,"categories":189,"keywords":190,"publishedAt":144},"01M71TXD9MYXZC39HCPP909HTZ","strategy-advisor","High-level strategic thinking and business decision guidance for planning and direction-setting.\nUse when: making strategic decisions, evaluating business options, setting direction, analyzing\ntrade-offs, or when user mentions strategy, business planning, competitive analysis, or long-term planning.","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Product-Apps\u002Fstrategy-advisor\u002FSKILL.md",[],[191,192,193,194,195,196,197,198,199,158,200,201,202,31,203,204,32,205,164,206],"strategy advisor","strategy","advisor","competitive","setting","thinking","planning","direction","trade-offs","long","decision","strategic","business","apps","decisions","trade",{"skillNo":208,"name":209,"nameZh":6,"description":210,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":211,"sourceHtmlUrl":212,"categories":213,"keywords":220,"publishedAt":144},"01M71TWHBT2R1P1FNWTW67ZREP","app-paywall-pilot","Design, audit, debug, and implement App Store-compliant mobile paywalls, subscription flows, pricing screens, trials, offers, feature gates, and subscription lifecycle UX. Use when the user asks to audit my paywall, fix App Store 3.1.2 rejection, improve trial-to-paid, choose plans\u002Fprices\u002Ftrials, review RevenueCat\u002FAdapty\u002FApphud\u002FSuperwall setup, calculate LTV\u002FROAS, or build paywall implementation.","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Product-Apps\u002Ffrom-dosesync\u002Fapp-paywall-pilot\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Product-Apps\u002Ffrom-dosesync\u002Fapp-paywall-pilot\u002FSKILL.md",[214,217],{"categoryNo":215,"categoryName":216,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":218,"categoryName":219,"taxonomyType":124,"taxonomyTypeDesc":125},"01JBSEEDCAT000000000000032","设计师",[221,222,223,224,225,226,227,228,229,230,231,232,32,233,234,235,236,237,238,239],"app","paywall","app paywall pilot","paid","paywalls","prices","choose","flows","fix","improve","design","app store","review","audit","ux","subscription","mobile","my","calculate",{"skillNo":241,"name":242,"nameZh":6,"description":243,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":244,"licenseFileUrl":245,"sourceHtmlUrl":246,"categories":247,"keywords":250,"publishedAt":144},"01M71TWET8GFKEB7ZHJPMQX29V","figma","Use the Figma MCP server to fetch design context, screenshots, variables, and assets from Figma, and to translate Figma nodes into production code. Trigger when a task involves Figma URLs, node IDs, design-to-code implementation, or Figma MCP setup and troubleshooting.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Product-Apps\u002Ffigma\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Product-Apps\u002Ffigma\u002FSKILL.md",[248,249],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":218,"categoryName":219,"taxonomyType":124,"taxonomyTypeDesc":125},[242,251,252,253,254,161,231,46,31,32,255,256,165,257,137,258,259,260,261,262],"fetch","ids","mcp setup","translate","mcp server","Variables","task","Nodes","figma mcp","code implementation","node","assets"]