agentleFS
phatnguyen03022001phatnguyen03022001/agent-skills/optimization/SKILL.md

optimization

Skill2 starsChanged 3 months agoApache-2.0View on GitHub

Use when measured latency, throughput, memory, CPU, network, storage, build time, developer iteration time, cloud spend, or automation cost is materially outside a required budget.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 4

    Distinctive

    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. Distinctive:

    Do not optimize a metric that has no project consequence.

    line 14
  2. Distinctive:

    Use profiling, tracing, query/build analysis, resource metrics, billing data, or controlled experiments appropriate to the system.

    line 18
  3. Very specific:

    Check whether simplicity or reuse-first can remove work entirely before making the remaining work faster.

    line 34
  4. Distinctive:

    Prefer optimizations that preserve conceptual integrity and have a rollback path.

    line 38
  5. Distinctive:

    Avoid speculative caches, parallelism, batching, denormalization, larger machines, or new services without evidence that they address the …

    line 40
  6. Very specific:

    Use debugging when a regression may be caused by incorrect behavior rather than resource constraints.

    line 52

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “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

Optimization

Optimize from evidence: measure → identify constraint → change → re-measure.

Define the target

State the workload, metric, baseline, required budget, and measurement environment. Distinguish user-visible performance from microbenchmarks and total cost from a single unit price.

Do not optimize a metric that has no project consequence.

Find the constraint

Use profiling, tracing, query/build analysis, resource metrics, billing data, or controlled experiments appropriate to the system. Attribute the dominant cost before changing code or infrastructure.

Consider:

  • algorithmic work and allocations;
  • database/query behavior;
  • serialization and payload size;
  • network round trips;
  • concurrency and queueing;
  • cache effectiveness and invalidation cost;
  • storage/read-write patterns;
  • build/test/CI critical path;
  • cloud resource sizing and idle capacity;
  • developer feedback-loop latency;
  • Actions or external-service fan-out.

Check whether simplicity or reuse-first can remove work entirely before making the remaining work faster.

Change one meaningful variable

Prefer optimizations that preserve conceptual integrity and have a rollback path. Record expected benefit and trade-offs, including complexity, reliability, security, portability, and dollar cost.

Avoid speculative caches, parallelism, batching, denormalization, larger machines, or new services without evidence that they address the measured bottleneck.

Prefer removal of unnecessary work before clever acceleration. A deleted network hop, query, build step, dependency, or redundant transformation often improves both performance and maintainability. For model/runtime control-plane work, first remove redundant synchronization such as a focused happy-path suite already subsumed by the mandatory full suite; then batch safe deterministic checks into an EXECUTION BUNDLE.

Measure synchronization mechanically against an equivalent predicate-preserving serial plan: if the one-command-per-check baseline needs N model/runtime boundaries and the bundled plan needs M, reduction is (N - M) / N. Count the same assurance predicates on both sides. Parallel execution is allowed only with no shared mutable state, no ordering dependency, no conflicting externally rate-limited dependency, no material resource contention, and independently attributable results; otherwise serialize. Wall-clock telemetry may supplement this count when trustworthy, but it is not authority or a substitute for correctness.

Re-measure

Repeat the same representative measurement after the change. Report absolute and relative effect, variance, and any shifted bottleneck. If the result is noise or fails the target, do not declare success.

Cost optimization follows the same rule: verify current billing model and actual usage, reduce waste or right-size where evidence supports it, and do not weaken correctness or required reliability merely to lower a line item.

Use debugging when a regression may be caused by incorrect behavior rather than resource constraints. Use reliability when optimization changes failure behavior or capacity margins.

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.