Expand description
magi plan: the interview that turns an idea into a task file worth
competing.
A competition is only as good as its task statement. A vague task buys
three vague candidates and a coin-toss tally, and the operator finds that
out forty minutes and several dollars later. So this module sits in front of
crate::queue: an agent interviews the operator about the idea, writes a
full task file, and magi files that file rather than the one-liner the
operator would otherwise have typed.
§magi does not host the conversation
There is no chat loop in here and there must not be one. The operator
already has claude, opencode and agy, each with years of work in its
own terminal UI - streaming, editing, file pickers, permission prompts. A
conversation reimplemented over captured pipes would be worse than all
three, and it is not what magi is for.
What magi does instead is narrow and mechanical:
- Write a briefing - the idea, the repository, and
TASK_FILE_SPEC- to a file, telling the agent to interview the operator and write its task file to a named output path. - Spawn the agent with stdin, stdout and stderr inherited, so the operator is talking to that CLI directly, in its own UI, with no magi in the middle. Nothing is captured and there is no timeout: a human deciding what to build takes as long as it takes.
- When the agent exits, read the output path, run it through
crate::advise’s headless design deliberation, check the result withreview_draft, and file it.
§The draft is never thrown away
The output path is under crate::run::home/drafts from the start, not a
temporary file, and nothing in this module deletes it. A twenty-minute
interview that ends in a validation failure must leave the operator holding
the draft, named in the error message, so the fix is an edit and
magi task add --file rather than a second interview. That is the single
most important behaviour here. [vet] is the only place that can break it
by failing validation; crate::advise::run keeps the same contract for
its own, different kind of failure - it never writes its synthesis over
the draft until it has one complete enough to write.
Structs§
- Opts
- What
magi planwas asked to do.
Constants§
- SHORT_
DRAFT - The problem
review_draftreports for a draft that is merely suspiciously short. - TASK_
FILE_ SPEC - The task-file shape the leader is asked to produce.
Functions§
- installed
- Can this agent’s CLI actually be run on this machine?
- pick
- Choose the agent that will conduct the interview.
- plan
- Interview the operator, then file the resulting task.
- review_
draft - Is this draft usable as a magi task?