Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问许可证需确认审计异常

ln-814-optimization-executorln 814 优化执行器

Agent Skill

ln-814-optimization-executor 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,398

周安装

97

GitHub Stars

441

下载量

753
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ln-814-optimization-executor(ln 814 优化执行器)
来源仓库:https://github.com/levnikolaevich/claude-code-skills
仓库路径:skills/ln-814-optimization-executor
安装命令:
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-814-optimization-executor
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-814-optimization-executor

简介

用于查找、检索和筛选相关信息。ln-814-optimization-executor 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

  • 适合根据关键词或任务场景快速定位候选结果。
  • 可结合来源仓库和原始 README 核验具体用法。
  • 安装前建议确认权限范围和维护状态。
  • 注意是否会触发联网、命令执行或文件读写操作。

SKILL.md

Paths: File paths (shared/, references/, ../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root. If shared/ is missing, fetch files via WebFetch from https://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}.

ln-814-optimization-executor

Type: L3 Worker Category: 8XX Optimization

Executes optimization hypotheses from the researcher using keep/discard autoresearch loop. Supports multi-file changes, compound baselines, and any optimization type (algorithm, architecture, query, caching, batching).


Overview

AspectDetails
Input.hex-skills/optimization/{slug}/context.md OR conversation context (standalone invocation)
OutputOptimized code on isolated branch, per-hypothesis results, experiment log
PatternStrike-first: apply all → test → measure. Bisect only on failure. A/B only for contested alternatives

Workflow

Phases: Pre-flight → Baseline → Strike-First Execution → Report → Gap Analysis


Phase 0: Pre-flight Checks

Slug Resolution

  • If invoked via Agent with contextStore containing slug — use directly.
  • If invoked standalone — derive slug from context_file path or ask user.

Step 1: Load Context

Read .hex-skills/optimization/{slug}/context.md from project root. Contains problem statement, profiling results, research hypotheses, and target metric.

If file not found: check conversation context for the same data (standalone invocation).

Step 2: Pre-flight Validation

CheckRequiredAction if Missing
Hypotheses provided (H1..H7)YesBlock — nothing to execute
Test infrastructureYesBlock (see ci_tool_detection.md)
Git clean stateYesBlock (need clean baseline for revert)
Worktree isolationYesCreate per git_worktree_fallback.md
E2E safety testNo (recommended)Read from context; WARN if null — full test suite as fallback gate

MANDATORY READ: Load shared/references/git_worktree_fallback.md — use optimization rows. MANDATORY READ: Load shared/references/ci_tool_detection.md — use Test Frameworks + Benchmarks sections.

MANDATORY READ: Load shared/references/mcp_tool_preferences.md and shared/references/mcp_integration_patterns.md.

Use hex-line as the primary path for code/config/script edits in this worker. Profilers and benchmarks stay the source of truth; do not treat hex-graph as runtime evidence here.

E2E Safety Test

Read e2e_test_command from context file (discovered by profiler during test discovery phase).

SourceAction
Context has e2e_test_commandUse as functional safety gate in Phase 2
Context has e2e_test_command = nullWARN: full test suite is the fallback gate
Standalone (no context)User must provide test command; block if missing

Phase 1: Establish Baseline

Reuse baseline from performance map (already measured with real metrics).

From Context File

Read performance_map.baseline and performance_map.test_command from .hex-skills/optimization/{slug}/context.md.

FieldSource
test_commandDiscovered/created test command
baselineMulti-metric snapshot: wall time, CPU, memory, I/O

Verification Run

Run test_command once to confirm baseline is still valid (code unchanged since profiling):

StepAction
1Run test_command
2IF result within 10% of baseline.wall_time_ms → baseline confirmed
3IF result diverges > 10% → re-measure (3 runs, median) as new baseline
4IF test FAILS → BLOCK: "test fails on unmodified code"

Phase 2: Strike-First Execution

MANDATORY READ: Load optimization_categories.md for pattern reference during implementation.

Apply maximum changes at once. Only fall back to A/B testing where sources genuinely disagree on approach.

Step 1: Triage Hypotheses

Split hypotheses from researcher into two groups:

GroupCriteriaAction
UncontestedClear best approach, no conflicting alternativesApply directly in the strike
ContestedMultiple approaches exist (e.g., source A says cache, source B says batch) OR conflicts_with another hypothesisA/B test each alternative on top of full implementation

Most hypotheses should be uncontested — the researcher already ranked them by evidence.

Step 2: Strike (Apply All Uncontested)

1. APPLY all uncontested hypotheses at once (all file edits)
2. VERIFY: Run full test suite
   IF tests FAIL:
     - IF fixable (typo, missing import) → fix & re-run ONCE
     - IF fundamental → BISECT (see Step 4)
3. E2E GATE (if e2e_test_command not null):
   IF FAIL → BISECT
4. MEASURE: 5 runs, median
5. COMPARE: improvement vs baseline
   IF improvement meets target → DONE. Commit all:
     git add {all_files}
     git commit -m "perf: apply optimizations H1,H2,H3,... (+{improvement}%)"
   IF no improvement → BISECT

Step 3: Contested Alternatives (A/B on top of strike)

For each contested pair/group, with ALL uncontested changes already applied:

FOR each contested hypothesis group:
  1. Apply alternative A → test → measure (5 runs, median)
  2. Revert alternative A, apply alternative B → test → measure
  3. KEEP the winner. Commit.
  4. Winner becomes part of the baseline for next contested group.

Step 4: Bisect (only on strike failure)

If strike fails tests or shows no improvement:

1. Revert all changes: git checkout -- . && git clean -fd
2. Binary search: apply first half of hypotheses → test
   - IF passes → problem in second half
   - IF fails → problem in first half
3. Narrow down to the breaking hypothesis
4. Remove it from strike, re-apply remaining → test → measure
5. Log removed hypothesis with reason

Scope Rules

RuleDescription
File scopeMultiple files allowed (not limited to single function)
Signature changesAllowed if tests still pass
New filesAllowed (cache wrapper, batch adapter, utility)
New dependenciesAllowed if already in project ecosystem (e.g., using configured Redis)
Time budget45 minutes total

Revert Protocol

ScopeCommand
Full revertgit checkout --. && git clean -fd (safe in worktree)
Single hypothesisgit checkout -- {files} (only during bisect)

Safety Rules

RuleDescription
TraceabilityCommit message lists all applied hypothesis IDs
IsolationAll work in isolated worktree; never modify main worktree
Bisect only on failureDo NOT test hypotheses individually unless strike fails or alternatives genuinely conflict
Crash triageRuntime crash → fix once if trivial (typo, import), else bisect to find cause

Stop Conditions (Execution Loop)

ConditionAction
Strike passes + improvement meets targetSTOP — commit, proceed to Report
All contested alternatives testedSTOP — commit winner, proceed to Report
Bisect removes all hypothesesSTOP — report "all hypotheses failed" with profiling data
Time budget exceeded (45 min)STOP — report partial results with remaining hypotheses
All tests fail after strike + bisectSTOP — full revert, report diagnostic value only

Phase 3: Report Results

Report Schema

FieldDescription
baselineOriginal measurement (metric + value)
finalFinal measurement after optimizations
total_improvement_pctOverall percentage improvement
target_metBoolean — did we reach the target metric?
strike_resultclean (all applied) / bisected (some removed) / failed
hypotheses_appliedList of hypothesis IDs applied in strike
hypotheses_removedList removed during bisect (with reasons)
contested_resultsPer-contested group: alternatives tested, winner, measurement
branchWorktree branch name
files_modifiedAll changed files
e2e_test{command, source, baseline_passed, final_passed} or null

Results Comparison (mandatory)

Show baseline vs final for EVERY metric from performance_map.baseline. Include both percentage and multiplier.

| Metric | Baseline | After Strike | Improvement |
|--------|----------|-------------|-------------|
| Wall time | 7280ms | 3800ms | 47.8% (1.9x) |
| CPU time | 850ms | 720ms | 15.3% (1.2x) |
| Memory peak | 256MB | 245MB | 4.3% |
| HTTP round-trips | 13 | 2 | 84.6% (6.5x) |

Target: 5000ms → Achieved: 3800ms ✓ TARGET MET

Per-Function Delta (if instrumentation available)

If 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:

| Function | Before (ms) | After (ms) | Delta |
|----------|------------|------------|-------|
| mt_translate | 3500 | 450 | -87% (7.8x) |
| tikal_extract | 2800 | 2800 | 0% (unchanged) |

Then clean up: git checkout -- {instrumented_files} — remove all profiling instrumentation before final commit.

Present both tables to user. This is the primary deliverable — numbers the user sees first.

Experiment Log

Write to {project_root}/.hex-skills/optimization/{slug}/ln-814-log.tsv:

ColumnDescription
timestampISO 8601
phasestrike / bisect / contested
hypothesesComma-separated IDs applied in this round
baseline_msBaseline before this round
result_msMeasurement after changes
improvement_pctPercentage change
statusapplied / removed / alternative_a / alternative_b
commitGit commit hash
filesComma-separated modified files
e2e_statuspass / fail / skipped

Append to existing file if present (enables tracking across multiple runs).


Phase 4: Gap Analysis (If Target Not Met)

If target metric not reached after all hypotheses:

SectionContent
AchievementWhat was achieved (original → final, improvement %)
Remaining bottlenecksFrom time map: which steps still dominate
Remaining cyclesIf coordinator runs multi-cycle: "{remaining} optimization cycles available for remaining bottlenecks"
Infrastructure recommendationsIf bottleneck requires infra changes (scaling, caching layer, CDN)
Further researchOptimization directions not explored in this run

Error Handling

ErrorRecovery
Strike fails all testsBisect to find breaking hypothesis, remove it, retry
Strike shows no improvementBisect to identify ineffective hypotheses
Measurement inconsistent (high variance)Increase runs to 10, use median
Worktree creation failsFall back to branch per git_worktree_fallback.md
Time budget exceededStop loop, report partial results with hypotheses remaining
Multi-file revert failsgit checkout --. in worktree (safe — worktree is isolated)

References

  • optimization_categories.md — optimization pattern checklist
  • shared/references/ci_tool_detection.md (test + benchmark detection)
  • shared/references/git_worktree_fallback.md (worktree isolation)

Runtime Summary Artifact

MANDATORY READ: Load shared/references/coordinator_summary_contract.md

Emit an optimization-worker summary envelope.

Managed mode:

  • ln-810 passes deterministic runId and exact summaryArtifactPath
  • write the summary to the provided summaryArtifactPath

Standalone mode:

  • omit runId and summaryArtifactPath
  • write .hex-skills/runtime-artifacts/runs/{run_id}/optimization-worker/ln-814--{identifier}.json

Monitor Integration (Claude Code 2.1.98+)

MANDATORY READ: Load shared/references/monitor_integration_pattern.md

During multi-run optimization cycles (baseline + A/B): Monitor(command="{test_command} 2>&1 | grep --line-buffered -E 'run|result|error|FAIL'", timeout_ms=600000, description="optimization run")

Fallback: if Monitor is unavailable, use Bash(run_in_background=true).

Definition of Done

  • Baseline established using same metric type as observed problem
  • Hypotheses triaged: uncontested vs contested
  • Strike applied: all uncontested hypotheses implemented at once
  • Tests pass after strike
  • Contested alternatives A/B tested on top of full implementation
  • Bisect performed only if strike fails (not preemptively)
  • E2E safety test passes (or documented as unavailable)
  • Experiment log written to .hex-skills/optimization/{slug}/ln-814-log.tsv
  • Report returned with baseline, final, improvement%, strike result
  • All changes on isolated branch, pushed to remote
  • Gap analysis provided if target metric not met
  • Optimization execution artifact written to the shared location

Version: 2.0.0 Last Updated: 2026-03-14

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.87%
按下载量换算270

Claude

29.96%
按下载量换算226

Cursor

20.16%
按下载量换算152

Gemini CLI

8.77%
按下载量换算66

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills