agentleFS
MissSophieSterlingMissSophieSterling/agent-skills/skills/workflow-optimizer/SKILL.md

workflow-optimizer

Skill0 starsChanged 54 days agoMITView on GitHub

Make a recurring job cheaper. Measure a baseline, test cheaper variants against the same quality check, keep the winner as a skill. Use when the user wants a repeat workflow (reports, content batches, triage, builds) to cost less ("optimize this workflow", "get this under 1% of my usage").

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. About 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

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

    Write a pass/fail quality check: tests pass, output matches the format, a reviewer checklist.

    line 21
  2. Distinctive:

    Run the job once as it is today and record the cost with whatever meter the host has:

    line 25
  3. Distinctive:

    Keep a change only if the check still passes.

    line 55
  4. Distinctive:

    Stop when the experiment budget is spent or two ideas in a row save next to nothing.

    line 56
  5. Very specific:

    Write the winning procedure as a skill (see skillify), with scripts for the deterministic parts and the quality check as its final step.

    line 60
  6. Very specific:

    No host documents giving the model its own plan usage today (see usage-budget), so the model can't check a target like that by itself.

    line 68

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Workflow optimizer

A one-off task isn't worth optimizing. A job you run every day or week is: spend some usage once to find the cheap way, and every run after that costs less. Treat cost like any other bug. Measure, change one thing, measure again, with a quality check that stops "cheaper" from quietly meaning "worse".

0. Is it worth it?

Experiments cost roughly (baseline cost) × (number of test runs). If the job won't run enough times to pay that back, stop here and say so.

1. Pin the job and the quality bar

  • Fix one set of test inputs and reuse it for every run.
  • Write a pass/fail quality check: tests pass, output matches the format, a reviewer checklist. Without one, no saving can be trusted.

2. Measure a baseline

Run the job once as it is today and record the cost with whatever meter the host has:

HostMeter
Claude Code/usage before and after (plan share); per-session tokens from the local logs, e.g. npx ccusage@latest session
Codex/status before and after; npx ccusage@latest codex daily
Gemini CLI/stats model; npx ccusage@latest gemini daily
APIthe usage fields on each response

Plan meters move in coarse steps, so a small job can show no change at all; use token counts where you can. Also note tool calls, files read and wall time. They explain where the cost went.

3. Candidate changes, roughly cheapest first

  1. Hand it the inputs (paths, templates, IDs) instead of letting it search. See the pinpoint skill.
  2. Move deterministic steps into a script: renaming, packaging, formatting, API calls with fixed parameters.
  3. Batch several items per run when they share context, instead of one run per item.
  4. Send mechanical steps to a cheaper model and keep review on the strong one. See cheap-subagents.
  5. Quiet the tools and shorten the replies. See quiet-tools and short-answers.
  6. Switch off tools, plugins and MCP servers the job never uses. See context-audit.
  7. Lower the reasoning effort for the mechanical parts only.

4. Experiment

  • One change (or one small bundle) per run, same inputs, same quality check.
  • Log every run:
#ChangeCostvs baselineQuality checkNotes
0baselinepass
  • Keep a change only if the check still passes. Drop changes that save almost nothing: complexity has a cost too.
  • Stop when the experiment budget is spent or two ideas in a row save next to nothing.

5. Lock it in

Write the winning procedure as a skill (see skillify), with scripts for the deterministic parts and the quality check as its final step. Record the measured cost per run inside it, so drift shows up later.

6. Report

Baseline vs optimized cost per unit, how many runs, what changed, what didn't help. Say plainly that small samples on one input set are indicative, not proof, and re-check on real inputs.

About "get this under 1% of my limit"

No host documents giving the model its own plan usage today (see usage-budget), so the model can't check a target like that by itself. State the target anyway, so it aims for it, and measure between runs yourself as above.

Before you finish

  • Baseline and every variant measured with the same meter and the same inputs.
  • The quality check passed for the version that was kept.
  • The winner is saved as a skill, or the reason it wasn't is stated.

Part of agent-skills · MIT · improvements welcome as issues.

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.