agentleFS
AWSKnown publisherawslabs/do-agent-aws/Container-Root/agent/skills/multi-phase-optimization-campaign/SKILL.md

multi-phase-optimization-campaign

Skill3 starsChanged 2 days agoApache-2.0View on GitHub

Use when planning or running a phased performance optimization campaign that requires cumulative metrics tracking, gap analysis against a reference baseline, cross-layer synergy mapping, and decision gates that can short-circuit later phases. Distinct from phase-tracker (generic project phases) because this handles optimization-specific concerns: gap closure percentages, synergy matrices, config-before-code ordering, and rollback flags per technique.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Document in OPTIMIZATION_ROADMAP.md.

    line 65
  2. Distinctive:

    Every technique gets a kill switch:

    line 75
  3. Very specific:

    Update STATUS.md after every measurement.

    line 106

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Multi-Phase Optimization Campaign

Phased optimization rollouts: config-only first, decision gates to prevent wasted effort.

Campaign Initialization

Create campaign/STATUS.md:

## Target
| Metric    | Value            |
|-----------|------------------|
| Reference | {ref} {unit}     |
| Starting  | {start} {unit}   |
| Gap       | {gap} ({pct}%)   |
| Target    | <{tgt} {unit}    |
| Success   | >=75% gap closure |

## Progress
| Phase | Optimization | Status | Measured | Improvement | Cumulative |
|-------|-------------|--------|----------|-------------|------------|
| 0     | Baseline    | ...    | ...      | -           | 0%         |
| 0.5   | Config-only | ...    | ...      | ...         | ...        |

Rule: Phase 0.5 (config/env, zero code) is mandatory: configuration alone can close more than the whole gap to the reference.

Phase Structure

Each phase requires: prerequisites (prior phase measured), technique, rollback flag, decision gate.

Decision Gates

IF cumulative >= target:  STOP, document victory.
IF phase delta < 2%:      SKIP (diminishing returns).
IF correctness regresses: ROLLBACK, investigate.

Cumulative Metrics

Track gap closure from the original start, not the previous phase:

Gap closure % = (starting - current) / (starting - reference) * 100

Example (650us start, 450us ref, 200us gap):

PhaseResultDeltaGap Closed
0.5400us-38%125%
1250us-37%200%
4210us-5%220%

Over 100% means you beat the reference system.

Cross-Layer Synergy Tracking

Document in OPTIMIZATION_ROADMAP.md. Co-deploy synergistic techniques:

L1 coalescing + L3 doorbell batching:
  Separate: 1000->16 ops + 1000->32 doorbells
  Combined: 16 ops -> 1 doorbell = 1000x total

Rollback Strategy

Every technique gets a kill switch:

TypeMechanismExample
ConfigEnv var removalunset FI_EFA_USE_DEVICE_RDMA
WrapperDrop LD_PRELOAD entryRemove adaptive_proxy.so
PatchCompile-time guard#ifndef USE_PUT_SIGNAL

Maintain rollback_all_optimizations.sh for single-command revert.

Common Mistakes

MistakeFix
Skip Phase 0.5Always measure config-only first
Delta from previous phase, not baselineTrack cumulative gap closure from start
Synergistic techniques in separate phasesCo-deploy pairs that multiply
No rollback flagEvery technique needs a kill switch
Estimated metrics treated as measuredMark estimates, re-order after real data

File Layout

campaign/STATUS.md                       # Cumulative table
analysis/call_chain/OPTIMIZATION_ROADMAP.md  # Synergies, priority
analysis/call_chain/L{N}_{name}/techniques/  # Versioned techniques
optimizations/deploy_all_optimizations.sh
optimizations/rollback_all_optimizations.sh
env/PHASE0_*.env                         # Config-only variables

Update STATUS.md after every measurement. Never overwrite rows; append with timestamps.

<!-- imported on 2026-10-31 by tools/import-skills.py from a native Claude Code instance's skill library; the source site's names, ids, hosts and paths are scrubbed to <placeholders>; its other files were not copied -->

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.