The problem

Take an online shop in a monorepo: four Symfony services (order, stock, shipping, billing) and the Vue.js front shop. The team adopts coding agents, and the first requests come quickly.

  • "Have an agent run the order release checklist."
  • "Make the CI faster."
  • "Keep the configuration of the four services in sync."
  • "Add a rule to AGENTS.md for every mistake the agent makes."

Each request is legitimate, and each one can automate waste. The checklist updates a CHANGELOG.md that nobody reads. It checks a staging environment that was shut down. The configuration exists in four copies, when one would do.

In a 2022 interview about the Raptor engine, Elon Musk names this mistake. In his view, possibly the single biggest mistake smart engineers make is optimising a thing that should not exist. He then gives a five-step order: question the requirements, delete, optimise, accelerate, and only last, automate.

He adds that he has often done it backwards, to the point of repeating the rule to himself. With coding agents, backwards becomes the easiest path. They make optimising, accelerating and automating almost free. The first two steps stay human: knowing who a step serves, and having the right to remove it.

A step run by an agent no longer bothers anyone, so nobody questions it anymore. It still costs: code to review, CI minutes, context read by every agent.

The options

Automate the process as it is

  • What it solves: a visible gain in the first week, with no discussion with the people who asked for each step.
  • What it costs: the waste is frozen into a script or an instruction. It becomes invisible, and removing it later first means finding it again.

Optimise first

  • What it solves: measurable gains, such as a cached and parallelised CI, or a checklist that is quicker to follow.
  • What it costs: we make efficient some steps that are useless. A useless test, cached, is still a useless test.

Rebuild everything

  • What it solves: we start from a blank page, without the legacy.
  • What it costs: a long project that loses the reasons behind some steps (legal, contractual) and creates useless steps of its own.

Question and delete before automating

  • What it solves: only what survived two filters gets automated. The final process is shorter, and every step has a written reason.
  • What it costs: a start with no demo, discussions with the authors of the steps, and a few reversals.

Our recommendation

Before handing a process to an agent or to the CI, we take it through five steps, in order: question the requirements, delete, simplify, accelerate, automate.

Musk calls the third step "optimise"; we say "simplify", because in a repository it is mostly about merging and deriving.

Step The question In the order release
1. Question Who explains this step, what breaks without it? CHANGELOG.md: no reader, the notes come from the PRs
2. Delete Can we remove it, in a reversible way? The check of the shut-down staging environment
3. Simplify Can what remains be merged or derived? The version read from the tag, no longer copied three times
4. Accelerate What lengthens the cycle? The CI only tests the projects that changed
5. Automate What is left to do by hand? The tag and the image promotion, run by the CI

Delete before automating: an agent also speeds up what is useless Backwards: automate the process as it is Automate Accelerate Optimise Every step stays, useless ones included: the agent runs them faster. In order: each step filters what the next one handles decide: people execute: an agent makes them cheap 1. Question the requirements 2. Delete steps and parts 3. Simplify what remains 4. Accelerate the cycle 5. Automate last Repeat the pass when the process changes

A requirement has someone to explain it

The first question is about a person, not a team. "Security requires it" cannot be discussed; a person on the security team can say why. A step that nobody can explain is the first candidate for deletion.

Delete enough to be wrong sometimes

Musk gives a rule of thumb: if you are not adding back at least 10% of what you deleted, you are not deleting enough. We keep the idea, not the figure. A few reversals show that we deleted enough; none at all shows that we were too cautious.

Deleting one part often deletes another. On the Raptor, Musk wants to integrate the small pipes and wiring, so as to do without the shrouds that protect them. He also gives the limit: as long as a part is sensitive to heat, the shroud stays.

In the monorepo, deleting the four copies of the configuration also deletes the task that keeps them in sync.

The agent investigates, a human decides

The agent helps with the first two steps too, as an investigator. It finds who reads what a step produces: the code, the CI, the documentation, the git history. It cites its evidence. The decision to delete belongs to a person who has the right to make it.

A pass that is repeated

Musk insists: the rule applies recursively. A simplified process fills up with steps again as incidents happen. We repeat the pass with every new automation request that touches it.

The trade-offs we accept

Like any recommendation, this one has a price.

Deleting means being wrong sometimes. A removed step can be missed during a release. This cost is limited by reversible deletions, listed in the pull request with the signal that should bring them back.

A less spectacular start. The first deliverable is a shorter process, not an agent running it. The sponsor of the AI project bears this cost, for the time of the first pass.

Not every requirement can be deleted. Keeping the invoices of billing, or a security requirement, stays. For those, the pass ends with a written reason and a name, not with a deletion.

Time spent talking. Every step has an author, who must be found and heard. The agent's investigation shortens the search, not the conversation.

The signal that should make us review this choice: an automation that runs steps nobody can justify, or the same steps deleted then restored from one pull request to the next. The first says the pass was skipped; the second, that it deleted without hearing the authors.

Implementation

1. Inventory the process as it actually runs

The inventory starts from what really runs: the CI workflows, the scripts, the wiki page, the team's habits. The documentation alone often describes a process that no longer exists.

<!-- docs/processus/release-order.md -->

| Step                              | Who explains it    | What breaks without it         | Decision                      |
| --------------------------------- | ------------------ | ------------------------------ | ----------------------------- |
| Update `CHANGELOG.md`             | nobody             | no reader found                | delete                        |
| Check the staging environment     | nobody             | staging is shut down           | delete                        |
| Copy the version into three files | the front-end lead | the displayed version          | simplify: read the tag        |
| Run every test of the monorepo    | the team           | nothing, if changes are tested | accelerate: affected projects |
| Announce the release to support   | the support lead   | support is not told            | automate                      |

2. Have the agent investigate, without changing anything

The instruction asks for evidence and forbids guessing. It also forbids any change: at this step, the agent decides nothing.

<!-- Instruction given to the agent -->

For each step of docs/processus/release-order.md:

- find who reads what it produces: code, CI, documentation, git history;
- cite the files and commits that prove it;
- write "no reader found" rather than guessing.

Do not change any file.

The reviewer replays the searches that matter, rather than trusting the summary.

# Who reads CHANGELOG.md? The code, the CI, the documentation
rg -n --hidden --glob '!.git' --glob '!CHANGELOG.md' 'CHANGELOG'
# Since when the staging check exists, and why
git log --follow --date=short --format='%h %ad %s' -- scripts/check-recette.sh

3. Delete in a reversible way

The deletions go into a pull request of their own, with a section that lists them. Each says why it goes, and what should bring it back. It is the same logic as the "Not verified" section of an equivalence proof.

<!-- Pull request description -->

## Deleted

- Check of the staging environment: environment shut down, no reader found.
  Restore it if a release breaks a flow that only staging covered.
- Update of `CHANGELOG.md`: the release notes are generated from the pull requests.
  Restore it if a customer or support asks for the history in the repository.

The git history keeps the removed code. Restoring it is a git revert, not a rewrite.

4. Simplify, then accelerate

What remains gets merged or derived. The order version is no longer copied into three files: it is read from the service's latest tag.

# The order version, read from its latest tag (order-v1.4.0)
version="$(git describe --tags --abbrev=0 --match 'order-v*')"
echo "${version#order-v}"

Accelerating comes next. The CI no longer runs every test of the monorepo, only those of the affected projects, as described in the article on pipelines driven by moon. The cycle is measured before and after: from merge to production, from the CI timestamps.

5. Automate what remains, and say why

The remaining steps become a task, run by the CI or by an agent. The agent's instructions point to that task and to the inventory, without repeating its steps.

<!-- AGENTS.md -->

## `order` release

- Run `moon run order:release`; do not reproduce its steps by hand.
- The process and the reason for each step: docs/processus/release-order.md.

6. Apply the pass to the agents' instructions

AGENTS.md is a process too, and it grows with every mistake an agent makes. A rule that a tool already checks has no place there: the linter applies it, the CI enforces it. The pass removes those duplicates, then keeps what no tool can check.

Checklist

  • The process inventoried as it runs, not as it is documented.
  • For each step, a person who explains it, or the word "nobody".
  • The agent investigates and cites its evidence; a person decides to delete.
  • Reversible deletions, listed in the pull request with their restore signal.
  • Legal and security requirements kept, with their written reason.
  • Simplify and accelerate before automating, never the reverse.
  • The agents' instructions point to the automated task, without repeating its steps.
  • The pass repeated with every new request to automate the process.

Sources