mcpField
L
ln-810-performance-optimization-coordinator

ln-810-performance-optimization-coordinator

github.com/levnikolaevichDevelopment58437 installsUpdated 2d ago
Repository

About ln-810-performance-optimization-coordinator

A coordinator skill that routes performance-optimization work to algorithm, query, and runtime workers based on a target or audit report. It gathers their isolated-branch results and reports verified changes.

Key features

  1. 01Selects workers based on input
  2. 02Runs independent workers in parallel
  3. 03Collects isolated-branch reports
  4. 04Aggregates optimization outcomes
  5. 05Checks preconditions before delegation

Use cases

  1. 01Optimize a specified target file or function
  2. 02Apply findings from a persistence audit
  3. 03Coordinate separate query and runtime fixes

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-810-performance-optimization-coordinator

After installing, type/ln-810-performance-optimization-coordinatorin Claude Code to confirm it loaded.

Details

From the project README

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.

ln-810-performance-optimization-coordinator

Type: L2 Domain Coordinator Category: 8XX Optimization

Coordinates performance optimization by delegating to L3 workers: ln-811 (algorithm), ln-812 (query), ln-813 (runtime). Workers run in parallel when inputs are independent.


Overview

AspectDetails
InputTarget file/module OR audit report (ln-650 output)
OutputOptimized code with verification proof
Workersln-811 (algorithm), ln-812 (query), ln-813 (runtime)

Workflow

Phases: Pre-flight → Analyze Input → Delegate → Collect → Verify → Report


Phase 0: Pre-flight Checks

CheckRequiredAction if Missing
Target file OR audit reportYesBlock optimization
Git clean stateYesBlock (need clean baseline for revert)
Test infrastructureYesBlock (workers need tests for keep/discard)

MANDATORY READ: Load shared/references/ci_tool_detection.md for test/build detection.


Phase 1: Analyze Input

Input Sources
SourceDetectionWorkers Activated
docs/project/persistence_audit.mdln-650 output existsln-812 (query) + ln-813 (runtime)
Target file + functionUser-specifiedln-811 (algorithm)
Full audit reportAll ln-65X sections presentAll three workers
Worker Selection
Conditionln-811ln-812ln-813
Target function specifiedYesNoNo
ln-651 findings presentNoYesNo
ln-653 findings presentNoNoYes
All audit findingsConditional*YesYes

*ln-811 activated only if specific algorithmic inefficiency identified in audit.


Phase 2: Delegate to Workers

CRITICAL: All delegations use Agent tool with subagent_type: "general-purpose" and isolation: "worktree" — each worker creates its own branch per shared/references/git_worktree_fallback.md.

Delegation Protocol
FOR each selected worker:
  Agent(description: "Optimize via ln-81X",
       prompt: "Execute optimization worker.

Step 1: Invoke worker:
  Skill(skill: \"ln-81X-{worker}\")

CONTEXT:
{delegationContext}",
       subagent_type: "general-purpose",
       isolation: "worktree")
Delegation Context
FieldTypeDescription
projectPathstringAbsolute path to project
auditReportstringPath to persistence_audit.md (if applicable)
targetFilestringTarget file path (if applicable)
targetFunctionstringTarget function name (if applicable)
options.runTestsboolRun tests after optimization
options.runLintboolRun lint after optimization
Parallelism
WorkersCan ParallelReason
ln-812 + ln-813YesDifferent files, different fix types
ln-811 + ln-812DependsOnly if targeting different files
ln-811 + ln-813DependsOnly if targeting different files

Rules:

  • If workers target the SAME file, run sequentially (ln-811 first, then ln-812/813).
  • Dependent workers share branch: If worker B depends on worker A's output (e.g., ln-813 needs ln-812's query changes), launch worker B in worker A's branch — so B sees A's changes.

Phase 3: Collect Results

Each worker produces an isolated branch. Coordinator aggregates branch reports.

Worker Branches
WorkerBranch PatternContents
ln-811optimize/ln-811-{function}-{ts}Algorithm optimizations with benchmarks
ln-812optimize/ln-812-{ts}Query optimizations
ln-813optimize/ln-813-{ts}Runtime optimizations
Result Schema
FieldTypeDescription
workerstringln-811, ln-812, or ln-813
statusenumsuccess, partial, failed
branchstringWorker's result branch name
fixes_appliedintNumber of kept optimizations
fixes_discardedintNumber of discarded attempts
detailsobjectWorker-specific report

Phase 4: Aggregate Reports

Each worker verified independently in its branch (tests, build, lint run by worker itself). Coordinator does NOT rerun verification or revert worker changes.

On Failure
  1. Branch with failing tests logged as "failed" in report
  2. User reviews failed branch independently

Phase 5: Report Summary

Report Schema
FieldDescription
input_sourceAudit report or target file
workers_activatedWhich workers ran
total_fixes_appliedSum across all workers
total_fixes_discardedSum across all workers
build_verifiedPASSED or FAILED
per_worker[]Individual worker reports
algorithm_improvementBenchmark improvement % (ln-811 only)

Configuration

Options:
  # Input
  audit_report: "docs/project/persistence_audit.md"
  target_file: ""
  target_function: ""

  # Workers
  enable_algorithm: true
  enable_query: true
  enable_runtime: true

  # Verification
  run_tests: true
  run_build: true
  run_lint: true

  # Safety
  revert_on_build_failure: true

Error Handling

Recoverable Errors
ErrorRecovery
Worker timeoutLog timeout, continue with other workers
Single worker failureRevert worker changes, report partial success
Build failureRevert last worker, re-verify
Fatal Errors
ErrorAction
No workers activatedReport "no optimization targets found"
All workers failedReport failures, suggest manual review
Dirty git stateBlock with "commit or stash changes first"

References

  • ../ln-811-algorithm-optimizer/SKILL.md
  • ../ln-812-query-optimizer/SKILL.md
  • ../ln-813-runtime-optimizer/SKILL.md
  • shared/references/ci_tool_detection.md

Definition of Done

  • Input analyzed (audit report or target file/function)
  • Appropriate workers selected based on input type
  • Workers delegated with worktree isolation (isolation: "worktree")
  • Each worker produces isolated branch, pushed to remote
  • Coordinator report aggregates per-worker results (branch, fixes, status)

Phase 6: Meta-Analysis

MANDATORY READ: Load shared/references/meta_analysis_protocol.md

Skill type: optimization-coordinator. Run after all phases complete. Output to chat using the optimization-coordinator format.


Version: 1.0.0 Last Updated: 2026-03-08

Comments

Markdown supported