Harvest Engineering
Every week the finance team adds up the previous week’s sales. Today someone copies orders from the store into a spreadsheet, one page at a time.
I want to hand that whole change to an agent: pick a week, download its orders, total the sales. And I don’t want to sit watching the chat while it works.
The way I’ve found has the rhythm of a field. I call it Harvest Engineering:
- I prepare and plant. The team and I agree on the outcome, the limits and the checks.
- The field grows on its own. The agent works phase by phase, and each phase proves itself before the next one starts.
- I harvest. I try the result and find out whether it solves the problem for the people who’ll use it.
I can hand off this much at once because the checks were agreed up front. The agent never needs me to say “keep going.”
Prepare the ground

Before planning, I get the project to a state another developer or agent can reproduce:
- Open the project.
- Place a test order.
- Find the command that runs the existing tests.
On a new project, getting this far can be a piece of work in its own right.
Find the question that matters

A good question before the plan saves a fix after it. I ask the person who uses the spreadsheet:
What happens when the week’s orders span two pages?
Their answer changes what we need to test.
- The filter findsThree orders for the week: A, B, and C.
- The screen splitsA and B on the first page. C on the second.
- The CSV includesA, B, and C in one file, whichever page is open.
I don’t always have to ask:
- If the answer is already documented, I go straight to planning.
- If the open question is about the code, I use
/junji research, for example to find where the date filter is applied.
Plan in phases

First, the boundary. This cycle exports every order in the selected date range as a CSV. Scheduling a weekly email can wait.
Then, the phases. With Junji, that’s three commands:
beginsurveys the repository.planchooses an approach.refinebreaks the work into phases.
Each phase carries the check that proves it:
| Phase | How we’ll know it works |
|---|---|
| P1. Fetch the orders in the date range | Given three orders inside the range and one outside, the query returns exactly the expected three, even across page boundaries. |
| P2. Generate the CSV | A test reads the generated file back and recovers the original values, including a name containing a comma. |
| P3. Connect the export to the orders page | With a date filter applied, clicking export downloads a file containing the orders for that period. |
This is where I save the most time. If I spot the pagination gap now, I fix one line of the plan. Once everything is built, the same oversight means reworking the query, the file and the tests.
None of these phases is gated, because nothing in the export is hard to undo. A migration on production data would be different: I’d mark that phase gated, and the run would stop there until I approved it.
Let it run

Once the plan is approved, I hand off the phases. There are two ways.
In my agent’s chat, it’s one line:
/junji goal --until P3
The agent runs each phase in a fresh subagent and reads the board again before it starts the next.
Outside the chat, for longer runs, I start Yokai in a terminal, on a server or in CI:
yokai --headless --max-cost 10
Yokai adds three things:
- a judge that reviews each change;
- recovery when a phase misses its checks;
- a ceiling on what the run may spend.
Either way, I go and do something else. If a test finds only the orders from the first page, the phase stays open and the agent keeps working on the query without me. If I want to work in the same project meanwhile, I use a separate worktree.
Koi doesn’t send me notifications. When it needs me, it stops and says why. Three things bring me back:
- A gated phase. The run waits for my approval before it starts that phase.
- A halt. A check stays red, or the run reaches its cost ceiling.
/junji goalreports the reason in the chat. Headless Yokai prints it and exits with code2, which I wire to a notification of my own. - A delivery ready to try. No phase is left, and Koi points at
/junji consolidate. It never runs that step on its own.
Harvest and check

This time I’m called in because the export is ready. I do what the finance team would do:
- Ask for a summary with
/junji brief. - Filter a week and download the file.
- Open it in the spreadsheet application the team uses.
Suppose every check passed but the amounts come through as text. The orders are all there, yet someone still has to convert the entire column before adding up sales.
No test caught it, because no test opened the file in the team’s spreadsheet. The discovery belongs to the same cycle, so I describe it as a new phase:
/junji iterate When I open the CSV in the team's spreadsheet, the amounts
come through as text. I need to sum the sales column without converting it by hand.
From there:
- I send
/junji goalagain, and the fix runs on its own like the other phases. - I open the new file and try the sum again.
- Once I accept the result, I run
/junji consolidatemyself.
That last step always needs a person. Junji records the deliverable in the project’s documentation and closes the current run.
Carry the lesson forward

Every cycle leaves something for the next. From this one I’d keep:
- a small reference file;
- a note on how the team imports the amounts.
Next time someone changes an export, we’ll know what to check. On another project, the useful change might be a more representative test or a missing setup instruction.
To budget a cycle, I put my time and the machine’s time side by side:
- Investigate
- You0–½
- Koi0–1
- Plan
- You1
- Koi1
- Run the phases
- You0
- Koi2
- Try and fix
- You1
- Koi½
How to read it:
- Running the phases is the biggest share of the cycle, but it’s machine time. I step in only if a gated phase or a halt calls me.
- Planning and trying are my shares. That’s where the question the tests can’t answer lives: can the team add up sales in the spreadsheet?
- Investigating earns a share only when an open question could change the plan.
- Preparing the environment and tending the project between cycles sit outside the budget.
To try a first cycle, pick a small change whose outcome you can check yourself. The getting-started guide walks you through the first phase and then lets the rest run on its own.