swarm: 成员细分角色(subrole) + 职责(duty) 模型#4
Open
ybz21 wants to merge 1 commit into
Open
Conversation
给每个蜂群成员加两个一等公民属性:细分角色(产品/架构/前后端/测试…, 固定枚举+自定义兜底) 与 职责(长期负责什么),贯通 存储→CLI→prompt→前端→leader。 设计见 docs/design/蜂群成员角色模型设计.md(含 mockups/swarm-roles.html)。 底层(Go CLI): - members 表 +subrole/+duty(建表 + 旧库 ALTER 迁移);MemberSpec/SwarmMember 带上。 - SubroleNorm 归一中英文别名→key;CLI swarm add 新增 --subrole/--duty。 Prompt(后端): - 注册表 subroles.go(key→label/icon)+ prompts/roles/<key>.md 角色片段。 - renderMemberPrompt 注入 SubroleLabel/Duty/RoleTrait;worker.md.tmpl 头部改造。 前端: - 办公室 desk:帽色/帽形=细分角色 + 桌前名牌 + 职责 hover;NodeDrawer 加细分角色徽章+职责段。 - 加成员弹窗加细分角色下拉 + 职责框;i18n(zh/en) 角色文案;index.css 帽形/名牌。 Leader:auto_leader.md.tmpl + cc-swarm/decompose.md 派活带 --subrole/--duty(组班子)。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
按 docs/design/蜂群成员角色模型设计.md 实现。给每个蜂群成员加两个一等公民属性:细分角色 subrole(产品/架构/前后端/测试…,固定枚举 + 自定义兜底)与 职责 duty(长期负责什么),贯通 存储 → CLI → prompt → 前端 → leader。
分层
members表 +subrole/+duty(建表 + 旧库ALTER迁移);MemberSpec/SwarmMember带上;SubroleNorm归一中英文别名→key;swarm add新增--subrole/--duty。含单测。subroles.go(key→label/icon)+prompts/roles/<key>.md角色片段;renderMemberPrompt注入SubroleLabel/Duty/RoleTrait;worker.md.tmpl头部改造(身份/职责/工作方式)。NodeDrawer加细分角色徽章 + 职责段;加成员弹窗加细分角色下拉 + 职责框;i18n(zh/en);index.css帽形/名牌。auto_leader.md.tmpl+cc-swarm/decompose.md派活带--subrole/--duty(组班子)。验证
go build/go vet+ 新增单测(SubroleNorm归一、subrole/duty 存取往返)通过。go build+ prompt 渲染验证(前端→前端工程师+ 职责 + 角色片段)。tsc --noEmit+vite build通过。docs/design/mockups/swarm-roles.html(复用线上办公室 CSS,已截图核对)。兼容
旧蜂群
subrole/duty空 → UI 退回大角色、prompt 走通用 worker,无破坏。范围说明
本 MR 只含角色模型,刻意不含工作区里并行进行的 speech/ASR、chrome/ttmux 产物统一、App.tsx 等改动。
GET /api/swarm/subroles端点处理器已就绪(subroles.go),但因server.go正被并行修改、且前端用本地注册表不依赖它,本 MR 未挂路由。🤖 Generated with Claude Code