openteam 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,189 +1,200 @@
1
1
  # OpenTeam
2
2
 
3
- 面向 OpenCode Agent 团队协作插件,负责多 Agent 协作、会话编排和多实例管理。
3
+ Agent team collaboration framework. Pluggable CLI backend (Claude Code / OpenCode).
4
4
 
5
- ## 核心能力
5
+ ## What it does
6
6
 
7
- - Leader-成员协作模型,支持异步消息通信。
8
- - 同一 agent 支持多实例(不同 `cwd` 下并行运行)。
9
- - Daemon 统一管理团队生命周期(serve、pane、健康检查)。
10
- - `dashboard` 实时仪表盘查看团队状态。
7
+ - Multi-agent teams with async messaging (MCP-based)
8
+ - Built-in task board with dependency tracking and auto-notification
9
+ - Daemon manages the full lifecycle: server, agent panes, health checks, respawn
10
+ - Real-time dashboard (embedded TUI)
11
+ - Works with tmux or zellij
11
12
 
12
- ## 环境要求
13
+ ## Requirements
13
14
 
14
- | 依赖 | 要求 |
15
- |------|------|
15
+ | Dependency | Version |
16
+ |---|---|
16
17
  | Node.js | 18+ |
17
- | tmux zellij | 任一 |
18
+ | tmux or zellij | any |
18
19
 
19
- ## 安装
20
+ ## Install
20
21
 
21
22
  ```bash
22
23
  npm install -g openteam
23
24
  ```
24
25
 
25
- ## 快速开始
26
+ ## Quick Start
26
27
 
27
- ### 1) 配置 OpenCode 插件
28
-
29
- `~/.opencode/opencode.json` 中添加:
28
+ ```bash
29
+ # 1. Install a built-in team template
30
+ openteam setup
30
31
 
31
- ```json
32
- {
33
- "plugin": ["openteam"]
34
- }
32
+ # 2. Start the team
33
+ openteam start dev
35
34
  ```
36
35
 
37
- ### 2) 创建团队配置
36
+ `openteam setup` walks you through:
38
37
 
39
- 创建 `~/.opencode/agents/<team>/team.json`:
40
-
41
- ```json
42
- {
43
- "name": "myteam",
44
- "leader": "pm",
45
- "host": "127.0.0.1",
46
- "port": 0,
47
- "agents": ["pm", "architect", "developer", "qa"]
48
- }
49
38
  ```
50
-
51
- - `leader` 必须包含在 `agents` 中。
52
- - `port: 0` 表示自动在 `4096-4200` 之间分配可用端口。
53
-
54
- ### 3) 创建 Agent 提示词
55
-
56
- `~/.opencode/agents/<team>/` 下创建对应角色文件(如 `pm.md`、`developer.md`)。
57
-
58
- ### 4) 启动团队
59
-
60
- ```bash
61
- openteam start myteam
39
+ Available team templates:
40
+
41
+ 1) dev-team
42
+ A four-role agent team for software development.
43
+ agents: pm, architect, developer, qa
44
+
45
+ Install "dev-team"? (Y/n): Y
46
+ Team name (team1): dev
47
+ Default CLI (claude-code):
48
+ Enable yolo mode? (y/N): y
49
+
50
+ Team "dev" installed
51
+
52
+ Template: dev-team
53
+ Config: ~/.openteam/teams/dev/team.json
54
+ Leader: pm
55
+ Agents: pm, architect, developer, qa
56
+ CLI: claude-code
57
+ Agent defs: 4 → ~/.openteam/agents
58
+ Skills: 12 → ~/.openteam/skills
62
59
  ```
63
60
 
64
- ## 示例:Dev Team
61
+ ## CLI Commands
65
62
 
66
- `examples/dev-team/` 提供了一个完整的四角色开发团队配置,开箱即用。
63
+ | Command | Description |
64
+ |---|---|
65
+ | `openteam setup` | Install a built-in team template (interactive) |
66
+ | `openteam start [team]` | Start team (creates tmux/zellij session + daemon) |
67
+ | `openteam start [team] -d` | Start in background |
68
+ | `openteam list` / `openteam ls` | List running team instances |
69
+ | `openteam list -a` | List all teams (including stopped) |
70
+ | `openteam stop <target>` | Stop team (by name or instance ID) |
71
+ | `openteam inspect <team>` | Show runtime status and agent online state |
67
72
 
68
- ### 角色
73
+ The same team can run in multiple project directories simultaneously. Use `--dir` to target a specific instance when ambiguous.
69
74
 
70
- | Agent | 角色 | 职责 |
71
- |-------|------|------|
72
- | **pm**(leader) | 产品经理 | 澄清需求、编写 PRD、协调团队 |
73
- | **architect** | 架构师 | 阅读代码库、设计实现方案、架构评审 |
74
- | **developer** | 开发者 | 按方案实现代码、编写单元测试 |
75
- | **qa** | 测试工程师 | 设计测试计划、执行验收测试、提交 Bug |
75
+ ## Team Tools (MCP)
76
76
 
77
- ### 协作流程
77
+ Agents communicate through two MCP tools exposed by the openteam server:
78
78
 
79
- ```
80
- 用户需求 → PM 澄清需求 & 编写 PRD
81
- ↓ ↓
82
- Architect 设计 QA 设计测试计划
83
- 实现方案 (并行)
84
-
85
- Developer 实现 + 单元测试
86
-
87
- QA 执行验收测试
88
-
89
- PM 向用户汇报结果
90
- ```
79
+ | Tool | Access | Description |
80
+ |---|---|---|
81
+ | `msg` | All agents (leader can broadcast) | Async messaging between agents |
82
+ | `taskboard` | `create`: leader only; `done`/`list`: all | Task management with dependency tracking |
91
83
 
92
- ### 内置 Skills
84
+ Messages are delivered to agent queues and injected into the CLI via PTY. Offline agents receive messages when they reconnect.
93
85
 
94
- - **PM**: `requirement-clarification`、`prd-generation`、`system-discovery`
95
- - **Architect**: `codebase-mapping`、`implementation-planning`、`architecture-review`
96
- - **QA**: `test-plan-design`、`acceptance-testing`、`bug-reporting`
86
+ ## Example: Dev Team
97
87
 
98
- ### 部署
88
+ `examples/dev-team/` provides a complete four-role development team, ready to use.
99
89
 
100
- ```bash
101
- # 复制团队配置
102
- mkdir -p ~/.opencode/agents/dev-team
103
- cp examples/dev-team/team.json ~/.opencode/agents/dev-team/
90
+ ### Roles
104
91
 
105
- # 复制角色提示词
106
- cp examples/dev-team/{pm,architect,developer,qa}.md ~/.opencode/agents/dev-team/
92
+ | Agent | Role | Responsibilities |
93
+ |---|---|---|
94
+ | **pm** (leader) | Product Manager | Clarify requirements, write PRDs, coordinate |
95
+ | **architect** | Architect | Read codebase, design implementation plans, review |
96
+ | **developer** | Developer | Implement per plan, write unit tests |
97
+ | **qa** | QA Engineer | Design test plans, run acceptance tests, report bugs |
107
98
 
108
- # 安装 skills
109
- cp -r examples/dev-team/skills/* ~/.opencode/skills/
99
+ ### Workflow
110
100
 
111
- # 启动
112
- openteam start dev-team
101
+ ```
102
+ User request → PM clarifies requirements & writes PRD
103
+ ↓ ↓
104
+ Architect designs QA designs test plan
105
+ implementation plan (in parallel)
106
+
107
+ Developer implements + unit tests
108
+
109
+ QA runs acceptance tests
110
+
111
+ PM reports results to user
113
112
  ```
114
113
 
115
- ## CLI 命令
116
-
117
- | 命令 | 说明 |
118
- |------|------|
119
- | `openteam start [team]` | 启动团队(创建 tmux/zellij session + daemon) |
120
- | `openteam start [team] -d` | 后台启动 |
121
- | `openteam start [team] --dir <directory>` | 指定项目目录 |
122
- | `openteam list` / `openteam ls` | 列出所有已配置团队及运行状态 |
123
- | `openteam inspect <team>` | 查看运行状态与会话有效性 |
124
- | `openteam inspect <team> --dir <directory>` | 指定项目目录 |
125
- | `openteam stop <target>` | 停止团队(SIGTERM daemon) |
126
-
127
- 同一团队可在不同项目目录启动多个实例。当存在多个实例时,`inspect`、`stop` 需要 `--dir` 指定目标实例。
114
+ ### Built-in Skills
128
115
 
129
- ## 团队工具
116
+ - **PM**: `requirement-clarification`, `prd-generation`, `system-discovery`
117
+ - **Architect**: `codebase-mapping`, `implementation-planning`, `architecture-review`
118
+ - **QA**: `test-plan-design`, `acceptance-testing`, `bug-reporting`
130
119
 
131
- | 工具 | 权限 | 说明 |
132
- |------|------|------|
133
- | `msg` | 全员可用(仅 leader 可广播) | 异步消息;目标离线会自动唤醒并建会话 |
134
- | `command` | 仅 leader | `status` / `free` / `redirect` |
135
- | `taskboard` | create 仅 leader;done/list 全员 | 任务管理:创建、完成、查看。完成后自动通知下游 |
120
+ ## Configuration
136
121
 
137
- ### `command` 行为说明
122
+ ### Team config (`~/.openteam/teams/<team>/team.json`)
138
123
 
139
- - `status`: 查看成员实例状态。
140
- - `free`: 让成员实例下线;若该成员有多个实例,必须指定 `cwd` 或 `alias`。
141
- - `redirect`: 清空目标成员当前实例后,在新目录创建实例。
124
+ ```json
125
+ {
126
+ "name": "dev",
127
+ "leader": "pm",
128
+ "agents": ["pm", "architect", "developer", "qa"],
129
+ "default_cli": "claude-code",
130
+ "cli_config": {
131
+ "claude-code": {
132
+ "args": ["--permission-mode", "bypassPermissions"]
133
+ }
134
+ }
135
+ }
136
+ ```
142
137
 
143
- ## 运行时文件
138
+ - `leader` must be in `agents`.
139
+ - `cli_config` passes extra arguments to the underlying CLI.
140
+ - `port` (optional): fixed port; default `0` auto-selects from 4096-4200.
144
141
 
145
- 团队配置和运行时数据分为两级:
142
+ ### Directory layout
146
143
 
147
- ```text
148
- ~/.opencode/agents/<team>/
149
- ├── team.json # 团队配置(团队级)
150
- ├── <agent>.md # agent 提示词(团队级)
151
- └── <hash>/ # 项目级状态目录(hash = projectDir 的 SHA-256 前 8 位)
152
- ├── .runtime.json # daemon/serve/mux 运行状态
153
- └── .active-sessions.json # agent → [{ sessionId, cwd }] 会话映射
154
144
  ```
145
+ ~/.openteam/
146
+ ├── settings.json # Global settings
147
+ ├── agents/ # Agent definitions (shared across teams)
148
+ │ ├── pm.md
149
+ │ ├── architect.md
150
+ │ └── ...
151
+ ├── skills/ # Skill definitions
152
+ │ ├── requirement-clarification/
153
+ │ └── ...
154
+ └── teams/
155
+ └── <team>/
156
+ ├── team.json # Team config
157
+ └── <hash>/ # Project-scoped runtime state
158
+ ├── .state.json # daemon/server/mux state
159
+ └── .tasks.json # Task board data
160
+ ```
161
+
162
+ Project isolation: `<hash>` = first 8 hex chars of SHA-256(projectDir).
155
163
 
156
- - `.runtime.json` 包含 `daemon.pid`、`serve.pid/port/host`、`mux.type/session` 等字段。
157
- - `.active-sessions.json` 持久化 agent 的多实例会话映射。
164
+ ## Architecture
158
165
 
159
- ## 注意事项
166
+ ```
167
+ bin/openteam.js CLI entry (Commander routing)
168
+
169
+ src/
170
+ ├── interfaces/ Who's calling
171
+ │ ├── cli.js Commands: setup, start, stop, list, inspect
172
+ │ ├── daemon/ Daemon lifecycle (server + panes + health)
173
+ │ └── dashboard/ Embedded TUI (blessed)
174
+ ├── server/ Communication layer
175
+ │ ├── hub.js In-memory message queue
176
+ │ ├── mcp.js MCP tools (msg + taskboard)
177
+ │ └── routes.js REST API (register/messages/status/tasks)
178
+ ├── adapters/ CLI abstraction (claude-code / opencode)
179
+ ├── wrapper/ PTY bridge (register → MCP config → spawn CLI → poll)
180
+ ├── capabilities/ Business logic (taskboard)
181
+ └── foundation/ Infrastructure (config, state, terminal, logger)
182
+ ```
160
183
 
161
- - 插件仅在 `OPENTEAM_TEAM` 环境变量存在时启用,始终通过 `openteam start` 启动。
162
- - `stop` 向 daemon 发送 SIGTERM;daemon 负责停止 serve 和清理 runtime,CLI 会在 daemon 退出后兜底销毁 mux session。
184
+ Dependency rule: `Interfaces Capabilities Foundation`. No reverse dependencies.
163
185
 
164
- ## 调试与日志
186
+ ## Debugging
165
187
 
166
188
  ```bash
167
- # 启用日志
189
+ # Enable logging
168
190
  OPENTEAM_LOG=1 openteam start myteam
169
191
 
170
- # 设置日志级别 (debug/info/warn/error)
192
+ # Set log level (debug/info/warn/error)
171
193
  OPENTEAM_LOG=1 OPENTEAM_LOG_LEVEL=debug openteam start myteam
172
194
  ```
173
195
 
174
- - 日志文件:`~/.openteam/openteam.log`
175
-
176
- ## 上游依赖说明
177
-
178
- 代码通过 `@opencode-ai/plugin/tool` 子路径导入,绕过上游根入口在 Node ESM 下的扩展名问题。
179
-
180
- ## 更多文档
181
-
182
- - 架构与模块边界:`docs/architecture.md`
183
- - 开发与验证:`docs/development-guide.md`
184
- - 示例团队:`examples/dev-team/readme.md`
185
- - 历史设计记录:`docs/archive/`
196
+ Log file: `~/.openteam/openteam.log`
186
197
 
187
- ## 许可证
198
+ ## License
188
199
 
189
200
  MIT
@@ -1,4 +1,5 @@
1
1
  ---
2
+ name: architect
2
3
  description: Architect — system design, code structure stewardship, and technical decision-making
3
4
  skills:
4
5
  - codebase-mapping
@@ -1,4 +1,5 @@
1
1
  ---
2
+ name: developer
2
3
  description: Developer — code implementation, unit testing, and disciplined execution
3
4
  skills:
4
5
  - incremental-implementation
@@ -1,4 +1,5 @@
1
1
  ---
2
+ name: pm
2
3
  description: Product Manager — requirements ownership, clarification, and team coordination
3
4
  skills:
4
5
  - requirement-clarification
@@ -1,4 +1,5 @@
1
1
  ---
2
+ name: qa
2
3
  description: QA Engineer — independent verification, acceptance testing, and quality gate
3
4
  skills:
4
5
  - test-plan-design
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openteam",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Agent-centric team collaboration framework",
5
5
  "type": "module",
6
6
  "bin": {