magi

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

MAGI

MAGI

Three-agent deliberation system. Spawns Scientist, Mother, and Woman teammates with competing value lenses to explore a question in parallel, then consolidates their proposals for the user.
三Agent研讨系统。生成拥有不同价值视角的Scientist、Mother和Woman协作Agent,并行探索问题,然后为用户整合它们的提案。

Checklist

检查清单

Follow these steps in order.
  1. Clarify the question
  2. Set up agent team
  3. Parallel exploration
  4. Consolidate and present options
  5. Wait for user decision (implement, debate, or done)
  6. Tear down agent team
请按以下顺序执行步骤:
  1. 明确问题
  2. 搭建Agent团队
  3. 并行探索
  4. 整合并呈现选项
  5. 等待用户决策(实施、辩论或结束)
  6. 解散Agent团队

Workflow

工作流程

dot
digraph magi {
    rankdir=TB;
    node [shape=box, style=rounded];

    clarify [label="Lead clarifies question\n(AskUserQuestion if underspecified)"];
    setup [label="Setup 3-agent team"];
    explore [label="Teammates explore in parallel\n(read project, search online, propose 2-3 approaches)"];
    consolidate [label="Lead consolidates proposals\n+ lightweight stance per teammate"];
    present [label="Present options to user\n(AskUserQuestion: Implement / Debate / Done)"];
    decide [label="User decision" shape=diamond];
    debate [label="Debate round\n(peer-to-peer, 1 exchange)"];
    teardown [label="Shut down agent team"];
    handoff [label="Handoff to writing-plans"];

    clarify -> setup;
    setup -> explore;
    explore -> consolidate;
    consolidate -> present;
    present -> decide;
    decide -> debate [label="debate"];
    decide -> teardown [label="done"];
    decide -> teardown [label="implement"];
    teardown -> handoff [label="implement"];
    debate -> present;
}
dot
digraph magi {
    rankdir=TB;
    node [shape=box, style=rounded];

    clarify [label="Lead clarifies question\n(AskUserQuestion if underspecified)"];
    setup [label="Setup 3-agent team"];
    explore [label="Teammates explore in parallel\n(read project, search online, propose 2-3 approaches)"];
    consolidate [label="Lead consolidates proposals\n+ lightweight stance per teammate"];
    present [label="Present options to user\n(AskUserQuestion: Implement / Debate / Done)"];
    decide [label="User decision" shape=diamond];
    debate [label="Debate round\n(peer-to-peer, 1 exchange)"];
    teardown [label="Shut down agent team"];
    handoff [label="Handoff to writing-plans"];

    clarify -> setup;
    setup -> explore;
    explore -> consolidate;
    consolidate -> present;
    present -> decide;
    decide -> debate [label="debate"];
    decide -> teardown [label="done"];
    decide -> teardown [label="implement"];
    teardown -> handoff [label="implement"];
    debate -> present;
}

The Process

流程说明

User Question

用户问题

$ARGUMENTS
$ARGUMENTS

Clarify

明确问题

Before spawning teammates, the lead asks via
AskUserQuestion
to understand the idea or topic:
  • Ask questions one at a time to refine the idea
  • Prefer multiple choice questions when possible, but open-ended is fine too
  • Only one question per message - if a topic needs more exploration, break it into multiple questions
  • Focus on understanding: purpose, constraints, success criteria
Skip if the question is already clear and actionable. Include all clarified context in teammate spawn prompts.
在生成协作Agent之前,主导Agent需通过
AskUserQuestion
询问用户,以理解其想法或主题:
  • 一次只提一个问题,逐步完善想法
  • 尽可能使用选择题,开放式问题也可
  • 每条消息仅包含一个问题——若主题需要进一步探索,拆分为多个问题
  • 重点理解:目标、约束条件、成功标准
若问题已清晰且可执行,则跳过此步骤。将所有明确后的上下文包含在生成协作Agent的提示词中。

Setup

搭建团队

  • Read all 3 template files: MAGI-1.md, MAGI-2.md, MAGI-3.md
  • TeamCreate
    with a descriptive team name
    magi-{topic}
    (e.g.,
    magi-auth-strategy
    )
  • Spawn all 3 teammates in a single message (3 parallel
    Task
    calls):
    • subagent_type
      :
      general-purpose
    • team_name
      : team name from above
    • name
      :
      scientist
      /
      mother
      /
      woman
    • prompt
      : template content + user's question + clarified context from Clarify step + Teammate Checklist (below)
Teammates don't inherit the lead's conversation history -- include all context in the spawn prompt.
  • 阅读全部3个模板文件:MAGI-1.mdMAGI-2.mdMAGI-3.md
  • 通过
    TeamCreate
    创建一个描述性的团队名称,格式为
    magi-{topic}
    (例如:
    magi-auth-strategy
  • 单条消息中生成全部3个协作Agent(3个并行的
    Task
    调用):
    • subagent_type
      :
      general-purpose
    • team_name
      : 上述团队名称
    • name
      :
      scientist
      /
      mother
      /
      woman
    • prompt
      : 模板内容 + 用户问题 + 明确问题步骤中得到的上下文 + 协作Agent检查清单(如下)
协作Agent不会继承主导Agent的对话历史——需将所有上下文包含在生成提示词中。

Explore in Parallel

并行探索

Teammates begin working immediately upon spawning. The lead's role is coordination only:
  • Wait for teammates to send their proposals via
    SendMessage
  • If a teammate sends a clarifying question, forward it to the user via
    AskUserQuestion
    -- note which teammate asked. Do NOT answer teammate questions yourself; only the user answers.
  • Do NOT explore, research, or generate proposals yourself
协作Agent生成后立即开始工作。主导Agent仅负责协调
  • 等待协作Agent通过
    SendMessage
    提交提案
  • 若协作Agent提出明确问题,需通过
    AskUserQuestion
    转发给用户,并注明是哪个Agent提出的。请勿自行回答协作Agent的问题;仅由用户回答。
  • 请勿自行进行探索、研究或生成提案

Teammate Checklist

协作Agent检查清单

Each teammate MUST create a task for each step and complete them in order:
  1. Explore project state -- check files, docs, recent commits
  2. Ask clarifying questions -- if anything is unclear, ask the lead to ask the user. The lead should note which teammate asked. DO NOT skip this.
  3. Search online -- find relevant prior art, docs, discussions. DO NOT skip this.
  4. Evaluate/generate options -- if user is open-ended, generate from scratch; if user supplies options, evaluate those AND propose alternatives. Surface non-obvious ideas -- discover what's missing, don't just analyze what's given.
  5. Propose 2-3 approaches -- with trade-offs from your persona's lens
  6. Tag top pick -- one-line rationale for your recommended option
  7. Report to lead -- send your proposals and top pick to the lead via
    SendMessage
每个协作Agent必须为每个步骤创建任务,并按顺序完成:
  1. 探索项目状态——检查文件、文档、最近的提交记录
  2. 提出明确问题——若有任何不明确之处,请求主导Agent询问用户。主导Agent需注明是哪个Agent提出的。请勿跳过此步骤。
  3. 在线搜索——查找相关的已有成果、文档、讨论。请勿跳过此步骤。
  4. 评估/生成选项——若用户需求开放,则从零开始生成;若用户提供了选项,则评估这些选项并提出替代方案。挖掘非显而易见的想法——发现缺失的内容,而非仅分析已提供的信息。
  5. 提出2-3种方案——从自身角色视角说明权衡利弊
  6. 标记首选方案——用一句话说明推荐该选项的理由
  7. 向主导Agent汇报——通过
    SendMessage
    将提案和首选方案发送给主导Agent

Consolidate + Present

整合 + 呈现

Lead collects all proposals from the 3 teammates, then:
  1. Deduplicates similar proposals (attributing to all teammates who proposed it)
  2. Groups by theme if there are many proposals
  3. Presents each option with:
    • Which teammate(s) proposed it
    • Trade-off analysis from each perspective
    • Who tagged it as their top pick and why
  4. Asks the user via
    AskUserQuestion
    to select an option (one option per choice)
  5. Asks the user via
    AskUserQuestion
    what to do next:
    • Implement — triggers teardown + handoff to
      writing-plans
      with the selected option
    • Debate — teammates critique each other's proposals (triggers debate round below)
    • Done — shut down the agent team, no further action
主导Agent收集所有3个协作Agent的提案后:
  1. 去重相似提案(注明所有提出该提案的Agent)
  2. 若提案较多,按主题分组
  3. 呈现每个选项时需包含:
    • 由哪些Agent提出
    • 各视角下的权衡分析
    • 谁将其标记为首选方案及理由
  4. 通过
    AskUserQuestion
    让用户选择一个选项(每个选项对应一个选择项)
  5. 通过
    AskUserQuestion
    询问用户下一步操作:
    • 实施 —— 触发解散团队流程 + 将选定选项作为上下文转交给
      writing-plans
    • 辩论 —— 协作Agent互相批评对方的提案(触发下方的辩论环节)
    • 结束 —— 解散Agent团队,无后续操作

Optional Debate (user-triggered)

可选辩论(用户触发)

Only runs if the user requests it. When triggered:
  1. Send the consolidated option list to all teammates
  2. Each teammate sends direct messages to each other teammate critiquing their proposals
  3. Each teammate gets one response to defend or concede
  4. Lead collects updated stances and re-presents
仅在用户要求时运行。触发后:
  1. 将整合后的选项列表发送给所有协作Agent
  2. 每个协作Agent向其他协作Agent发送直接消息,批评对方的提案
  3. 每个协作Agent可进行一次回应,为自己辩护或让步
  4. 主导Agent收集更新后的立场并重新呈现给用户

Teardown

解散团队

When to tear down

解散时机

  • User selects Implement
  • User selects Done
  • 用户选择实施
  • 用户选择结束

When NOT to tear down

非解散时机

  • After presenting proposals -- the debate loop requires live teammates
  • 呈现提案后——辩论循环需要保持Agent活跃

Shutdown sequence

解散流程

  1. shutdown_request
    to each teammate (Scientist, Mother, Woman)
  2. Wait for all shutdown approvals
  3. TeamDelete
    (fails if teammates are still active)
  1. 向每个协作Agent(Scientist、Mother、Woman)发送
    shutdown_request
  2. 等待所有Agent确认解散
  3. 执行
    TeamDelete
    (若Agent仍活跃则操作失败)

Handoff (implement path only)

交接(仅实施路径)

After teardown, invoke
writing-plans
skill with the chosen option(s) as context.
解散团队后,调用
writing-plans
技能,并将选定的选项作为上下文传入。