agent-team

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

agent-team

agent-team

Manages AI team roles using git worktrees + terminal multiplexer tabs. Each role runs in its own isolated worktree (branch
team/<name>
) and opens as a full-permission AI session in a new tab.
For directory layout and bidirectional communication details, see references/details.md.
借助git worktrees + 终端多路复用器标签页管理AI团队角色。每个角色在独立的工作树(分支
team/<name>
)中运行,并在新标签页中以全权限AI会话的形式打开。
有关目录结构和双向通信的详细信息,请参阅references/details.md

Install

安装

bash
brew tap JsonLee12138/agent-team && brew install agent-team
bash
brew tap JsonLee12138/agent-team && brew install agent-team

Upgrade

升级

bash
brew update && brew upgrade agent-team
bash
brew update && brew upgrade agent-team

Usage

使用方法

Run from within a project git repository:
bash
agent-team <command>
Use tmux backend (default is WezTerm):
bash
AGENT_TEAM_BACKEND=tmux agent-team <command>
在项目的Git仓库内运行:
bash
agent-team <command>
使用tmux后端(默认是WezTerm):
bash
AGENT_TEAM_BACKEND=tmux agent-team <command>

Brainstorming (Required Before Assign)

头脑风暴(分配前必须执行)

When the user intends to assign new work to a role, you MUST brainstorm first:
  1. Explore context — check the role's
    prompt.md
    , existing
    openspec/specs/
    , and project state
  2. Ask clarifying questions — one at a time, prefer multiple choice when possible
  3. Propose 2-3 approaches — with trade-offs and your recommendation
  4. User confirms design — get explicit approval
  5. Write proposal — save the confirmed design to a temp file
  6. Execute assign — run
    agent-team assign <name> "<desc>" --proposal <file>
Rules:
  • Brainstorming is mandatory for new work assignments
  • Can be skipped when user explicitly says "just assign" or provides a complete design
  • One question at a time. YAGNI. Explore alternatives before settling.
当用户打算为角色分配新工作时,必须先进行头脑风暴:
  1. 探索上下文 — 检查角色的
    prompt.md
    、现有
    openspec/specs/
    以及项目状态
  2. 提出澄清问题 — 一次一个问题,尽可能使用选择题形式
  3. 提出2-3种方案 — 说明权衡取舍并给出你的推荐
  4. 用户确认设计 — 获取明确的批准
  5. 撰写提案 — 将确认后的设计保存到临时文件
  6. 执行分配 — 运行
    agent-team assign <name> "<desc>" --proposal <file>
规则:
  • 对于新工作分配,头脑风暴是强制性
  • 当用户明确表示“直接分配”或提供完整设计时,可以跳过
  • 一次只提一个问题。遵循YAGNI原则。在确定方案前探索替代选项。

Commands

命令

Create a role

创建角色

bash
agent-team create <name>
Creates
team/<name>
git branch + worktree at
.worktrees/<name>/
. Generates:
  • agents/teams/<name>/config.yaml
    — provider, description, pane tracking
  • agents/teams/<name>/prompt.md
    — role system prompt (edit this to define the role)
  • openspec/
    — OpenSpec project structure for change management
After creating, guide the user to edit
prompt.md
to define the role's expertise and behavior.
bash
agent-team create <name>
创建
team/<name>
Git分支 + 工作树至
.worktrees/<name>/
。生成以下内容:
  • agents/teams/<name>/config.yaml
    — 提供商、描述、面板跟踪配置
  • agents/teams/<name>/prompt.md
    — 角色系统提示词(编辑此文件定义角色)
  • openspec/
    — 用于变更管理的OpenSpec项目结构
创建完成后,引导用户编辑
prompt.md
以定义角色的专业领域和行为。

Open a role session

打开角色会话

bash
agent-team open <name> [claude|codex|opencode] [--model <model>]
  • Generates
    CLAUDE.md
    in worktree root from
    prompt.md
    (auto-injected as system context)
  • Spawns a new terminal tab titled
    <name>
    running the chosen AI provider
  • Provider priority: CLI argument >
    config.yaml default_provider
    > claude
  • Model priority:
    --model
    flag >
    config.yaml default_model
    > provider default
bash
agent-team open <name> [claude|codex|opencode] [--model <model>]
  • prompt.md
    在工作树根目录生成
    CLAUDE.md
    (自动注入为系统上下文)
  • 在新的终端标签页中启动标题为
    <name>
    的指定AI提供商会话
  • 提供商优先级:CLI参数 >
    config.yaml
    中的
    default_provider
    > claude
  • 模型优先级:
    --model
    标志 >
    config.yaml
    中的
    default_model
    > 提供商默认模型

Open all sessions

打开所有会话

bash
agent-team open-all [claude|codex|opencode] [--model <model>]
Opens every role that has a config.yaml.
bash
agent-team open-all [claude|codex|opencode] [--model <model>]
打开所有拥有
config.yaml
的角色会话。

Assign a change

分配任务

bash
agent-team assign <name> "<description>" [claude|codex|opencode] [--model <model>] [--proposal <file>]
  1. Creates an OpenSpec change at
    openspec/changes/<timestamp>-<slug>/
  2. Writes the proposal file from
    --proposal
    flag (or empty if not provided)
  3. Auto-opens the role session if not running
  4. Sends a
    [New Change Assigned]
    notification to the running session
The role will then use
/opsx:continue
to proceed through specs → design → tasks → apply.
bash
agent-team assign <name> "<description>" [claude|codex|opencode] [--model <model>] [--proposal <file>]
  1. openspec/changes/<timestamp>-<slug>/
    创建OpenSpec变更记录
  2. --proposal
    标志指定的文件写入提案内容(未提供则为空)
  3. 如果角色会话未运行,则自动启动
  4. 向运行中的会话发送
    [New Change Assigned]
    通知
角色随后将使用
/opsx:continue
按规范→设计→任务→实施的流程推进。

Reply to a role

回复角色

bash
agent-team reply <name> "<answer>"
Sends a reply to a role's running session, prefixed with
[Main Controller Reply]
.
bash
agent-team reply <name> "<answer>"
向角色的运行中会话发送回复,前缀为
[Main Controller Reply]

Reply to main controller (used by roles)

回复主控制器(角色使用)

bash
agent-team reply-main "<message>"
Sends a message from the role back to the main controller's session, prefixed with
[Role: <name>]
. Automatically detects the current role from the worktree directory and reads the controller's pane ID from
config.yaml
.
bash
agent-team reply-main "<message>"
从角色向主控制器会话发送消息,前缀为
[Role: <name>]
。会自动从工作树目录检测当前角色,并从
config.yaml
读取控制器的面板ID。

Check status

查看状态

bash
agent-team status
Shows all roles, session status (running/stopped), and active OpenSpec changes.
bash
agent-team status
显示所有角色、会话状态(运行中/已停止)以及活跃的OpenSpec变更记录。

Merge completed work

合并已完成工作

bash
agent-team merge <name>
Merges
team/<name>
into the current branch with
--no-ff
. Run
delete
afterward to clean up.
bash
agent-team merge <name>
使用
--no-ff
team/<name>
分支合并到当前分支。之后运行
delete
命令清理。

Delete a role

删除角色

bash
agent-team delete <name>
Closes the running session (if any), removes the worktree, and deletes the
team/<name>
branch.
bash
agent-team delete <name>
关闭运行中的会话(如果存在),移除工作树,并删除
team/<name>
分支。