Skill Tracer
Skills › Compound Engineering › ce-optimize

ce-optimize

skill · 64 lines · MIT · skills/ce-optimize/SKILL.md

The facts

Its description

Optimize a named target with a measured loop: attribute a workload's cost, or score variants and keep winners. Use when a working system's metric should move and the winning change is not already known. Use ce-debug when the job is diagnosis; use ce-work when the change is already known.

The description the agent reads to decide when to use it.

From its settingsline 3

When it starts

A person asks to move a measurable metric of a working system — cost, latency, memory, throughput, or a quality score — where the winning change is not already known and the same target can be measured more than once. The agent picks it for that optimization job rather than for diagnosing a failure or for making a change that is already decided.

Things a person might say (the model's guesses)

  • “Find the smallest memory limit that keeps this service stable under our load test.”
  • “Tune our issue-clustering parameters so we stop collapsing everything into one giant cluster.”
  • “Make this summarization prompt cheaper without hurting the quality of the summaries.”

A model's summary of when it is used.

A model's reading

What it takes when started

[path to optimization spec YAML, or describe the optimization goal]

What to type after its name when you start it.

From its settingsline 4

Starts other agents

4 lines mention starting other agents

Lines in the file that mention starting another agent. Found by matching words, so treat them as pointers.

Found by matching wordsline 17 line 23 line 31 line 60

Files it mentions

references/persistence.md, references/spec.md, references/measurement.md, references/loop.md (first 5 of 6 lines)

Files the text names, such as ones to read or write. Found by matching words, so treat them as pointers.

Found by matching wordsline 23 line 45 line 53 line 60 line 62

What it leads to

Other skills this one hands off to, calls, requires or offers instead, as a model read them.

A model's reading

What leads to it

Other skills that hand off to this one, call it, require it or offer it instead, as a model read them.

A model's reading

Licence

MIT, from LICENSE

The terms its author shares it under, which let it be shown here.

From the repositorylicence text
Other files in this skill (21) Close

The text

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1---
2name: ce-optimize
3description: "Optimize a named target with a measured loop: attribute a workload's cost, or score variants and keep winners. Use when a working system's metric should move and the winning change is not already known. Use ce-debug when the job is diagnosis; use ce-work when the change is already known."
4argument-hint: "[path to optimization spec YAML, or describe the optimization goal]"
5---
6
7# Optimize a measurable target
8
9**Outcome:** confirmed improvements to the named target live on an `optimize/<spec-name>` branch, with a disk log. The user takes over at wrap-up.
11**Intent:** the next action is the cheapest step that would change what gets implemented. Attribute the cost of a named workload before searching implementations. Search and keep a scored variant space without requiring a profile.
13**Done when:** a stopping criterion was met, every declared required target is met or another stop was met first, the final state is written and verified on disk, and the user has been given the post-completion options. If the run instead stopped at a check it could not pass, say what blocked it.
15Invoking this skill authorizes reading the repo, building the harness, and (after the Phase 1 approval gate) isolated experiments and keep/revert commits on `optimize/<spec-name>`. Ask when spend is uncapped, when a new dependency appears, when wrap-up would push or open a PR, or when only the user can choose among the post-completion options. Do not ask again to run the next experiment inside those limits.
17Independent calls and dispatches go in one response; serialize only real dependencies.
19Report findings, user decisions, blockers, and results. During longer work, give occasional updates on what was learned and what remains. Routine preparation and phase or batch transitions need no announcement. Keep accounting in the log and final recap unless it affects a current decision.
21Explain the target, evidence, and decision in ordinary task language. Workflow labels (such as 'harness') belong in artifacts unless the user asks about those mechanics. State unknown duration or cost as unknown; caps are limits, not forecasts.
23A step is done only after it ran. Describing a measurement, dispatch, or checkpoint is not doing it. Do not end a turn while in-scope work remains merely described. Outstanding work may outlive the turn only with a verified checkpoint and either bounded automatic resumption or an explicit manual-resume handback, as `references/persistence.md` defines.

Optimize a measurable target

Outcome: confirmed improvements to the named target live on an optimize/<spec-name> branch, with a disk log. The user takes over at wrap-up.

Intent: the next action is the cheapest step that would change what gets implemented. Attribute the cost of a named workload before searching implementations. Search and keep a scored variant space without requiring a profile.

Done when: a stopping criterion was met, every declared required target is met or another stop was met first, the final state is written and verified on disk, and the user has been given the post-completion options. If the run instead stopped at a check it could not pass, say what blocked it.

Invoking this skill authorizes reading the repo, building the harness, and (after the Phase 1 approval gate) isolated experiments and keep/revert commits on optimize/<spec-name>. Ask when spend is uncapped, when a new dependency appears, when wrap-up would push or open a PR, or when only the user can choose among the post-completion options. Do not ask again to run the next experiment inside those limits.

Independent calls and dispatches go in one response; serialize only real dependencies.

Report findings, user decisions, blockers, and results. During longer work, give occasional updates on what was learned and what remains. Routine preparation and phase or batch transitions need no announcement. Keep accounting in the log and final recap unless it affects a current decision.

Explain the target, evidence, and decision in ordinary task language. Workflow labels (such as 'harness') belong in artifacts unless the user asks about those mechanics. State unknown duration or cost as unknown; caps are limits, not forecasts.

A step is done only after it ran. Describing a measurement, dispatch, or checkpoint is not doing it. Do not end a turn while in-scope work remains merely described. Outstanding work may outlive the turn only with a verified checkpoint and either bounded automatic resumption or an explicit manual-resume handback, as references/persistence.md defines.

Raw lines 1 to 24
Names a skill ce-debug :3
Starts an agent dispatches :17
Starts an agent dispatch :23
Reads a file references/persistence.md :23
25## Interaction Method
27Use the host's blocking question tool already in the current tool list (match by capability, not by a host-specific name). Presence in the current tool list is proof the tool exists; never call a user-facing question tool to discover whether it exists. If a matching tool is listed but unloaded, use the host's tool-discovery primitive to load that capability: do not search for another host's tool name. Fall back to numbered options on the host's chat surface only when no such tool is in the list or a real question call errors. Never skip the question silently.

Interaction Method

Use the host's blocking question tool already in the current tool list (match by capability, not by a host-specific name). Presence in the current tool list is proof the tool exists; never call a user-facing question tool to discover whether it exists. If a matching tool is listed but unloaded, use the host's tool-discovery primitive to load that capability: do not search for another host's tool name. Fall back to numbered options on the host's chat surface only when no such tool is in the list or a real question call errors. Never skip the question silently.

Raw lines 25 to 28
29## Execution Surface
31Three capabilities decide where run state lives, how the loop waits, and where experiments run. A **durable state root** is a writable location the harness names that persists across turns and context resets, outside the repo checkout; without one, state lives under `.context/compound-engineering/ce-optimize/<spec-name>/`. A **wake after turn end** is a way to be re-invoked by an external event or timer without holding a tool call open; without one, the loop runs inside this session, and a wait it cannot hold ends the turn as a checkpoint with a resume invocation. A **detached worker** is a dispatch whose result arrives as a pushed ref, a store file, or a host-delivered message, not as edits in the local tree; `execution.backend: remote` needs one; without one that spec runs on `worktree`. Presence in the current tool list, or in context the harness gave you, is proof; a missing binary or environment variable proves nothing. Take a fallback without asking.

Execution Surface

Three capabilities decide where run state lives, how the loop waits, and where experiments run. A durable state root is a writable location the harness names that persists across turns and context resets, outside the repo checkout; without one, state lives under .context/compound-engineering/ce-optimize/<spec-name>/. A wake after turn end is a way to be re-invoked by an external event or timer without holding a tool call open; without one, the loop runs inside this session, and a wait it cannot hold ends the turn as a checkpoint with a resume invocation. A detached worker is a dispatch whose result arrives as a pushed ref, a store file, or a host-delivered message, not as edits in the local tree; execution.backend: remote needs one; without one that spec runs on worktree. Presence in the current tool list, or in context the harness gave you, is proof; a missing binary or environment variable proves nothing. Take a fallback without asking.

Raw lines 29 to 32
Starts an agent dispatch :31
33## Artifact Root
35<!-- ce-docs-root:start -->
36**Resolve the CE artifact root `<root>` before composing any artifact path.**
38- **Read** `docs_root` from `<repo-root>/.compound-engineering/config.yaml` only (`<repo-root>` = `git rev-parse --show-toplevel`). Do not read it from `config.local.yaml`. Unset -> `<root>` is `docs`, exactly as before.
39- **Validate** a set value: a repo-relative directory whose real, symlink-resolved path stays inside the repo and is neither the repo root nor under `.git/`. Otherwise stop with an error naming `docs_root` and the value -- never fall back to `docs`.
40- **Use** `<root>` as the sole artifact location: create it if absent, compose each path as `<root>/<subdir>` with this skill's own subdirectory, and never also read `docs`.
41<!-- ce-docs-root:end -->

Artifact Root

<!-- ce-docs-root:start --> **Resolve the CE artifact root <root> before composing any artifact path.**

  • Read docs_root from <repo-root>/.compound-engineering/config.yaml only (<repo-root> = git rev-parse --show-toplevel). Do not read it from config.local.yaml. Unset -> <root> is docs, exactly as before.
  • Validate a set value: a repo-relative directory whose real, symlink-resolved path stays inside the repo and is neither the repo root nor under .git/. Otherwise stop with an error naming docs_root and the value -- never fall back to docs.
  • Use <root> as the sole artifact location: create it if absent, compose each path as <root>/<subdir> with this skill's own subdirectory, and never also read docs.

<!-- ce-docs-root:end -->

Raw lines 33 to 42
43## Persistence Discipline
45The experiment log on disk is the source of truth. Write order is measure, write, verify, then show the user. **Read `references/persistence.md` now** for checkpoints CP-0 through CP-5, the state root layout, and resume.

Persistence Discipline

The experiment log on disk is the source of truth. Write order is measure, write, verify, then show the user. **Read references/persistence.md now** for checkpoints CP-0 through CP-5, the state root layout, and resume.

Raw lines 43 to 46
Reads a file references/persistence.md :45
47## The phases
49Four phases run in order; each names the reference it cannot start without. A fresh run skips none: a harder optimization spends longer in a phase, not fewer phases.
51**A resume is not a fresh run.** On a resume, re-enter Phase 0 only far enough to detect the run and to recover any `result.yaml` markers the log is missing. Then continue from the phase the log records and skip the work it proves finished. A checkpoint proves the work that produced it; a user decision counts only while the log records it. The Phase 1 approval record is bound to the spec digest and the caps it approved; present that gate again when it is absent or no longer matches.
53**Phase 0: Setup.** The input is a goal or a spec YAML path, from the user or a calling skill. **Read `references/spec.md`**: it asks for the input when neither supplied one, then loads or builds the spec to save (CP-0). **Read `references/measurement.md`** for the rest of Phase 0 and Phase 1.
55**Phase 1: Measurement scaffolding.** Build or validate the harness, write the baseline (CP-1), probe parallelism, check the worktree budget. Two gates stop the run:
57- **Clean-tree gate.** Do not continue while any file in `scope.mutable` or `scope.immutable` has uncommitted changes. The reference defines the check and what to ask for.
58- **User approval gate.** Present what Phase 1 assembled and offer proceed, fix issues, and adjust spec; the reference lists what to include. Disclose which spend is capped and which is uncapped. **Do not enter Phase 2 until the user explicitly approves.** Then record the approval and re-read the spec and baseline from disk.
60**Phase 2: Hypothesis generation.** Analyze the current approach, rank the hypotheses, record the backlog (CP-2). Do not dispatch an implementation experiment while a cheaper locating measurement would change keep or skip. **Read `references/loop.md`** for this phase and Phase 3. One gate: **dependency pre-approval** of every new dependency across all hypotheses, as one bulk list.
62**Phase 3: Optimization loop.** Follow the tick protocol in `references/loop.md`, including per-result persistence and batch checkpoints. Stop as soon as any one of eight criteria holds: every declared required target is met, max iterations, max active hours, the wall-clock backstop, a spend cap reached, plateau, a user interrupt, or no runnable hypothesis left. `references/loop.md` states each one exactly. Otherwise start the next tick.
64**Phase 4: Wrap-up.** **Read `references/wrap-up.md`** for the summary and the post-completion options to present. CP-5 marks the log final. **Write it only after the user picks an option that does not return to Phase 3.** Two options do return: Continue, and approving a deferred dependency.

The phases

Four phases run in order; each names the reference it cannot start without. A fresh run skips none: a harder optimization spends longer in a phase, not fewer phases.

A resume is not a fresh run. On a resume, re-enter Phase 0 only far enough to detect the run and to recover any result.yaml markers the log is missing. Then continue from the phase the log records and skip the work it proves finished. A checkpoint proves the work that produced it; a user decision counts only while the log records it. The Phase 1 approval record is bound to the spec digest and the caps it approved; present that gate again when it is absent or no longer matches.

Phase 0: Setup. The input is a goal or a spec YAML path, from the user or a calling skill. **Read references/spec.md: it asks for the input when neither supplied one, then loads or builds the spec to save (CP-0). Read references/measurement.md** for the rest of Phase 0 and Phase 1.

Phase 1: Measurement scaffolding. Build or validate the harness, write the baseline (CP-1), probe parallelism, check the worktree budget. Two gates stop the run:

  • Clean-tree gate. Do not continue while any file in scope.mutable or scope.immutable has uncommitted changes. The reference defines the check and what to ask for.
  • User approval gate. Present what Phase 1 assembled and offer proceed, fix issues, and adjust spec; the reference lists what to include. Disclose which spend is capped and which is uncapped. Do not enter Phase 2 until the user explicitly approves. Then record the approval and re-read the spec and baseline from disk.

Phase 2: Hypothesis generation. Analyze the current approach, rank the hypotheses, record the backlog (CP-2). Do not dispatch an implementation experiment while a cheaper locating measurement would change keep or skip. **Read references/loop.md for this phase and Phase 3. One gate: dependency pre-approval** of every new dependency across all hypotheses, as one bulk list.

Phase 3: Optimization loop. Follow the tick protocol in references/loop.md, including per-result persistence and batch checkpoints. Stop as soon as any one of eight criteria holds: every declared required target is met, max iterations, max active hours, the wall-clock backstop, a spend cap reached, plateau, a user interrupt, or no runnable hypothesis left. references/loop.md states each one exactly. Otherwise start the next tick.

Phase 4: Wrap-up. **Read references/wrap-up.md for the summary and the post-completion options to present. CP-5 marks the log final. Write it only after the user picks an option that does not return to Phase 3.** Two options do return: Continue, and approving a deferred dependency.

Raw lines 47 to 64
Reads a file references/spec.md :53
Reads a file references/measurement.md :53
Starts an agent dispatch :60
Reads a file references/loop.md :60
Reads a file references/wrap-up.md :64

From EveryInc/compound-engineering-plugin at 3449230, 2026-10-31. Skills read by DeepSeek V4.1 Flash on 2026-11-04. Summary and techniques by Claude Opus 5.5 on 2026-11-06.