dsh-agent-team-presets 0.3.2 → 0.3.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.
Files changed (101) hide show
  1. package/NOTICE +57 -3
  2. package/README.md +73 -398
  3. package/README.zh.md +79 -404
  4. package/assets/card-patches/catalog.json +20 -0
  5. package/assets/card-patches/dsh-context-0.85.0.client.js.gz +0 -0
  6. package/assets/card-patches/dsh-context-0.85.1.client.js.gz +0 -0
  7. package/assets/skills/agent-leader-communication/SKILL.md +100 -0
  8. package/assets/skills/agent-subagent-orchestration/SKILL.md +56 -0
  9. package/assets/skills/agent-subagent-orchestration/references/executor-parallel-execution.md +56 -0
  10. package/assets/skills/agent-subagent-orchestration/references/leader-discovery.md +53 -0
  11. package/assets/skills/agent-subagent-orchestration/references/subagent-communication.md +58 -0
  12. package/assets/skills/backend-architecture-workflow/SKILL.md +55 -0
  13. package/assets/skills/backend-architecture-workflow/references/README.md +9 -0
  14. package/assets/skills/backend-architecture-workflow/references/architecture-audit.md +70 -0
  15. package/assets/skills/backend-architecture-workflow/references/architecture-decay-risks.md +75 -0
  16. package/assets/skills/backend-architecture-workflow/references/architecture-design.md +151 -0
  17. package/assets/skills/backend-architecture-workflow/references/bugfix-regression.md +63 -0
  18. package/assets/skills/backend-architecture-workflow/references/complex-bug-diagnosis.md +104 -0
  19. package/assets/skills/executor-short-task-workflow/SKILL.md +48 -0
  20. package/assets/skills/executor-short-task-workflow/references/agent-communication.md +44 -0
  21. package/assets/skills/executor-short-task-workflow/references/verification-and-reporting.md +45 -0
  22. package/assets/skills/frontend-engineering-workflow/SKILL.md +47 -0
  23. package/assets/skills/frontend-engineering-workflow/references/README.md +7 -0
  24. package/assets/skills/frontend-engineering-workflow/references/frontend-implementation.md +46 -0
  25. package/assets/skills/frontend-engineering-workflow/references/visual-design.md +43 -0
  26. package/assets/skills/frontend-engineering-workflow/references/visual-qa.md +126 -0
  27. package/assets/skills/fullstack-advisor/SKILL.md +50 -0
  28. package/assets/skills/fullstack-advisor/references/brooks-principles.md +51 -0
  29. package/assets/skills/fullstack-advisor/references/consultant-communication.md +51 -0
  30. package/assets/skills/fullstack-advisor/references/consultation-workflow.md +71 -0
  31. package/assets/skills/git-release-hygiene/SKILL.md +33 -21
  32. package/assets/skills/git-release-hygiene/references/git-safety.md +66 -0
  33. package/assets/skills/git-release-hygiene/references/pr-changelog.md +98 -0
  34. package/assets/skills/git-release-hygiene/references/release-standard.md +139 -0
  35. package/assets/skills/git-release-hygiene/references/validation-checklist.md +42 -0
  36. package/assets/skills/github-repository-presentation/SKILL.md +49 -130
  37. package/assets/skills/github-repository-presentation/references/bilingual-writing.md +43 -0
  38. package/assets/skills/github-repository-presentation/references/documentation-architecture.md +156 -0
  39. package/assets/skills/github-repository-presentation/references/readme-standard.md +273 -0
  40. package/assets/skills/github-repository-presentation/references/release-notes.md +70 -0
  41. package/assets/skills/github-repository-presentation/references/validation-checklist.md +47 -0
  42. package/assets/skills/independent-code-review-workflow/SKILL.md +60 -0
  43. package/assets/skills/independent-code-review-workflow/references/README.md +9 -0
  44. package/assets/skills/independent-code-review-workflow/references/decay-risks.md +99 -0
  45. package/assets/skills/independent-code-review-workflow/references/review-checklist.md +53 -0
  46. package/assets/skills/independent-code-review-workflow/references/review-methodology.md +113 -0
  47. package/assets/skills/independent-code-review-workflow/references/review-severity.md +49 -0
  48. package/assets/skills/independent-code-review-workflow/references/test-quality-review.md +71 -0
  49. package/assets/skills/leader-long-task-orchestration/SKILL.md +49 -0
  50. package/assets/skills/leader-long-task-orchestration/references/delivery-plan-template.md +73 -0
  51. package/assets/skills/leader-long-task-orchestration/references/product-alignment.md +46 -0
  52. package/assets/skills/leader-long-task-orchestration/references/rolling-wave-planning.md +32 -0
  53. package/assets/skills/leader-long-task-orchestration/references/technical-decisions-and-escalation.md +34 -0
  54. package/assets/skills/leader-medium-task-workflow/SKILL.md +55 -0
  55. package/assets/skills/leader-medium-task-workflow/references/task-board-and-leader-todo.md +41 -0
  56. package/docs/builtin-team-skills.md +82 -0
  57. package/docs/builtin-team-skills.zh.md +82 -0
  58. package/docs/builtin-teams.md +62 -0
  59. package/docs/builtin-teams.zh.md +62 -0
  60. package/docs/developer/architecture.md +54 -0
  61. package/docs/developer/architecture.zh.md +54 -0
  62. package/docs/guide/install.md +86 -0
  63. package/docs/guide/install.zh.md +86 -0
  64. package/docs/guide/integrations.md +50 -0
  65. package/docs/guide/integrations.zh.md +50 -0
  66. package/docs/guide/team-skills.md +56 -0
  67. package/docs/guide/team-skills.zh.md +56 -0
  68. package/docs/guide/using-teams.md +92 -0
  69. package/docs/guide/using-teams.zh.md +92 -0
  70. package/docs/index.md +53 -0
  71. package/docs/index.zh.md +53 -0
  72. package/docs/reference/tools-and-permissions.md +62 -0
  73. package/docs/reference/tools-and-permissions.zh.md +62 -0
  74. package/docs/reference/troubleshooting.md +59 -0
  75. package/docs/reference/troubleshooting.zh.md +59 -0
  76. package/lib/client.js +515 -85
  77. package/lib/index.js +442 -87
  78. package/lib/typert.host.js +15 -15
  79. package/lib/typert.remote-client.d.ts.map +1 -1
  80. package/lib/typert.remote-client.js +15 -15
  81. package/lib/types/client/CardPatchView.js +21 -1
  82. package/lib/types/client/ComposerTeamSelect.js +24 -8
  83. package/lib/types/client/TeamAgentView.d.ts +1 -1
  84. package/lib/types/client/TeamAgentView.js +11 -6
  85. package/lib/types/client/TeamSkillsView.d.ts +2 -1
  86. package/lib/types/client/TeamSkillsView.js +10 -5
  87. package/lib/types/client/locales.d.ts +41 -2
  88. package/lib/types/client/locales.js +125 -0
  89. package/lib/types/index.js +52 -12
  90. package/lib/types/team-catalog.d.ts +50 -3
  91. package/lib/types/team-catalog.js +214 -43
  92. package/lib/types/team-mode.d.ts +48 -0
  93. package/lib/types/team-mode.js +64 -0
  94. package/lib/types/team-skills/index.d.ts +13 -3
  95. package/lib/types/team-skills/index.js +21 -2
  96. package/lib/types/team-skills/manager.d.ts +21 -12
  97. package/lib/types/team-skills/manager.js +88 -53
  98. package/lib/types/team-skills/service.js +18 -7
  99. package/lib/types/team-skills/store.d.ts +11 -0
  100. package/lib/types/team-skills/store.js +32 -1
  101. package/package.json +18 -2
package/lib/index.js CHANGED
@@ -7807,16 +7807,131 @@ const OFFICIAL_REPOSITORY_SKILLS = [{
7807
7807
  roleName: "repository-specialist"
7808
7808
  }];
7809
7809
  /**
7810
- * The shipped delivery skills, assigned by default to the `executor` role
7811
- * of software engineering Teams.
7810
+ * The leader workflow skills, assigned by default to the `team-lead` captain of
7811
+ * every software engineering Team: dispatching and reporting, the bounded
7812
+ * medium-task board, the long-running delivery plan, and the subagent
7813
+ * orchestration rules a captain needs before it may explore in parallel.
7812
7814
  */
7813
- const OFFICIAL_EXECUTOR_SKILLS = [{
7814
- skillId: "github-repository-presentation",
7815
- roleName: "executor"
7816
- }, {
7817
- skillId: "git-release-hygiene",
7818
- roleName: "executor"
7815
+ const OFFICIAL_LEADER_SKILLS = [
7816
+ {
7817
+ skillId: "agent-leader-communication",
7818
+ roleName: "team-lead"
7819
+ },
7820
+ {
7821
+ skillId: "leader-medium-task-workflow",
7822
+ roleName: "team-lead"
7823
+ },
7824
+ {
7825
+ skillId: "leader-long-task-orchestration",
7826
+ roleName: "team-lead"
7827
+ },
7828
+ {
7829
+ skillId: "agent-subagent-orchestration",
7830
+ roleName: "team-lead"
7831
+ }
7832
+ ];
7833
+ /**
7834
+ * The advisory workflow skill, assigned by default to the `fullstack-advisor`
7835
+ * role. The advisor stays single-threaded, so it never receives the subagent
7836
+ * orchestration skill.
7837
+ */
7838
+ const OFFICIAL_ADVISOR_SKILLS = [{
7839
+ skillId: "fullstack-advisor",
7840
+ roleName: "fullstack-advisor"
7819
7841
  }];
7842
+ /**
7843
+ * The delivery skills, assigned by default to the `executor` role of software
7844
+ * engineering Teams: the bounded implementation workflow, the parallel
7845
+ * work-package orchestration rules, and the two repository delivery skills.
7846
+ */
7847
+ const OFFICIAL_DEVELOPMENT_EXECUTOR_SKILLS = [
7848
+ {
7849
+ skillId: "executor-short-task-workflow",
7850
+ roleName: "executor"
7851
+ },
7852
+ {
7853
+ skillId: "agent-subagent-orchestration",
7854
+ roleName: "executor"
7855
+ },
7856
+ {
7857
+ skillId: "git-release-hygiene",
7858
+ roleName: "executor"
7859
+ },
7860
+ {
7861
+ skillId: "github-repository-presentation",
7862
+ roleName: "executor"
7863
+ }
7864
+ ];
7865
+ /**
7866
+ * The default assignments of a software engineering Team that carries an
7867
+ * advisory role: leader, advisor, then executor. `agent-subagent-orchestration`
7868
+ * is deliberately bound to two roles and to no third one.
7869
+ */
7870
+ const OFFICIAL_DEVELOPMENT_SKILLS = [
7871
+ ...OFFICIAL_LEADER_SKILLS,
7872
+ ...OFFICIAL_ADVISOR_SKILLS,
7873
+ ...OFFICIAL_DEVELOPMENT_EXECUTOR_SKILLS
7874
+ ];
7875
+ /**
7876
+ * The professional-role workflows, one main skill per specialist role: the
7877
+ * UI frontend engineer, the backend architect, and the independent reviewer.
7878
+ *
7879
+ * Each is a progressive-loading entry point — the detailed methods live in its
7880
+ * own `references/` folder and are read on demand, never registered as skills
7881
+ * of their own. The reviewer keeps the subagent orchestration rules because a
7882
+ * large, high-risk review may fan out; the two advisory-side roles never
7883
+ * dispatch.
7884
+ */
7885
+ const OFFICIAL_PROFESSIONAL_SKILLS = [
7886
+ {
7887
+ skillId: "frontend-engineering-workflow",
7888
+ roleName: "ui-designer"
7889
+ },
7890
+ {
7891
+ skillId: "backend-architecture-workflow",
7892
+ roleName: "backend-architect"
7893
+ },
7894
+ {
7895
+ skillId: "independent-code-review-workflow",
7896
+ roleName: "reviewer"
7897
+ },
7898
+ {
7899
+ skillId: "agent-subagent-orchestration",
7900
+ roleName: "reviewer"
7901
+ }
7902
+ ];
7903
+ /**
7904
+ * The reviewer's bindings alone.
7905
+ *
7906
+ * The 标准研发团队 has no specialist role, so it declares the leader, advisor,
7907
+ * executor, and reviewer defaults and nothing that names a role it does not
7908
+ * carry — a declaration with no matching role would never resolve, and the
7909
+ * catalog is what the Host reconciles against.
7910
+ */
7911
+ const OFFICIAL_STANDARD_SKILLS = [
7912
+ ...OFFICIAL_LEADER_SKILLS,
7913
+ ...OFFICIAL_ADVISOR_SKILLS,
7914
+ {
7915
+ skillId: "independent-code-review-workflow",
7916
+ roleName: "reviewer"
7917
+ },
7918
+ {
7919
+ skillId: "agent-subagent-orchestration",
7920
+ roleName: "reviewer"
7921
+ },
7922
+ ...OFFICIAL_DEVELOPMENT_EXECUTOR_SKILLS
7923
+ ];
7924
+ /**
7925
+ * The default assignments of the 全栈软件研发团队, whose advisor work is split
7926
+ * into two specialist roles: leader, the frontend and backend workflows, the
7927
+ * reviewer pair, and the executor's own delivery skills. There is no single
7928
+ * `fullstack-advisor` binding, because that Team does not carry that role.
7929
+ */
7930
+ const OFFICIAL_SPECIALIST_SKILLS = [
7931
+ ...OFFICIAL_LEADER_SKILLS,
7932
+ ...OFFICIAL_PROFESSIONAL_SKILLS,
7933
+ ...OFFICIAL_DEVELOPMENT_EXECUTOR_SKILLS
7934
+ ];
7820
7935
  /** Every official Team, in install order: the three development Teams, then the six work modes. */
7821
7936
  const BUILTIN_TEAM_CATALOG = [
7822
7937
  {
@@ -7827,28 +7942,28 @@ const BUILTIN_TEAM_CATALOG = [
7827
7942
  "version": 1,
7828
7943
  "team": {
7829
7944
  "name": "轻量研发团队",
7830
- "description": "适合小型功能与模块迭代。队长划分任务,架构顾问按需处理技术决策,研发执行者承担编码、调试、测试与修复。",
7945
+ "description": "适合中小型功能迭代与多阶段开发。队长负责需求对齐、任务分级、并行探查与验收;顾问按需提供技术方案和验收契约;执行者负责并行实现、集成与验证。",
7831
7946
  "captain": {
7832
7947
  "name": "team-lead",
7833
- "description": "确定目标、任务写入边界和验收证据,按需调度与最终风险裁决。",
7834
- "systemPrompt": "你是工程团队队长,负责范围、调度、依赖、风险和最终验收。具体实现交执行者,专业决策咨询对应顾问。\n1. 仅在用户明确要求团队协作时召集成员;先确认目标平台、项目规则、权限与实际可用工具、验收标准。不得假定服务、浏览器或设备可用,不索取明文秘密。\n2. 任务板按切片记录交付物、验收、依赖、负责人及文件写入范围;仅并行互不冲突的工作。接口契约未确定不得盲目实现;已有任务不重复派发,以消息和状态事件推进,避免空转查询。\n3. 按任务召集 executor 完成实现和验证;涉及新模块、跨层契约或关键技术阻塞时,再咨询 fullstack-advisor。顾问不参与常规调试循环,队长依据测试证据验收。\n4. 交接优先使用变更路径、简要差异、测试命令和结果、证据位置、待决风险;详情按需读取,不要求复制完整日志。共享浏览器实行单操作者交接;视觉结论需实际查看落盘截图,缺少证据则标记未验证。\n5. 高风险问题修复后复验;同一问题两轮未解决须重新分析根因。必要验收缺证据不得放行;仍有运行中成员或未闭环任务时不得宣布完成。\n6. 最终汇总交付内容、验证结果、未验证项及风险。Git 暂存与提交遵守项目规则和用户授权;push、发布、改写历史分别取得授权。成员默认不继续委派,例外需明确授权并确认工具支持及隔离范围。",
7948
+ "description": "负责需求对齐、任务分级、团队调度、风险控制与最终验收。",
7949
+ "systemPrompt": "你是团队队长,负责需求对齐、任务分级、成员调度、结果整合与最终验收;仅在用户明确要求团队协作时召集成员。\n\n1. 确认目标、范围、验收、项目规则与权限。产品功能、流程、界面及重大范围由用户裁决;基线内技术方案由团队决定。\n2. 按规模路由:短程直接派发;中程用 `leader-medium-task-workflow`;长程用 `leader-long-task-orchestration`。通信使用 `agent-leader-communication`。\n3. 存在两个或以上独立工程探查方向时,必须用 `agent-subagent-orchestration` 并行探查,不得仅因即时委派成本而默认串行。\n4. 派发时明确任务范围、发现责任和验收;只传递必要事实、路径和符号,避免重复背景。多个独立编码工作包拆分后交执行者按其工作流处理。\n5. 父代理负责整合与最终验收;仅依据可复核证据报告完成,并列明未验证项、阻塞和风险。",
7835
7950
  "color": "#4c8dff"
7836
7951
  },
7837
7952
  "members": [{
7838
7953
  "name": "fullstack-advisor",
7839
- "description": "按需提供跨层技术方案与可执行验收契约,不负责具体编码。",
7840
- "systemPrompt": "你是全栈架构顾问,负责技术方案与实施契约,不修改生产代码、测试或生成脚本。\n1. 围绕具体问题查阅项目规则、相关实现与必要文档,沿用既有技术栈,不扩大重构范围。\n2. 按需确定模块边界、数据流、接口字段与错误语义,并提示涉及的权限、安全、迁移兼容及性能风险;列出假设和待决事项。\n3. 输出给执行者的简洁契约:关键决定、关联文件或接口、验收条件、阻塞及风险。仅在关键技术取舍、方案变更或明确阻塞时重新介入。\n4. 只写获指派的契约文档;静态分析不能冒充运行验证。默认不继续委派,也不接管常规编码、调试和测试。",
7954
+ "description": "按需提供跨层技术决策、方案权衡、风险分析与可执行验收契约;不承担编码。",
7955
+ "systemPrompt": "你是全栈技术顾问,不负责编码、项目调度或产品裁决,保持单线程,不创建孙代理。使用 fullstack-advisor Skill 执行咨询工作流。\n1. 接收队长的决策问题、约束和事实来源;只调查影响判断的必要范围,复用已有调查。\n2. 输出首选方案、关键理由、主要权衡与风险、必要证据位置及可验证验收条件;区分事实、推断和假设。\n3. 功能、业务规则、用户流程和界面歧义交队长向用户确认;技术细节在已批准边界内自主分析。重大范围、兼容、预算或安全影响须标记升级。\n4. 默认只返回决策摘要,详细论证按需展开。不得修改生产代码、测试或脚本;不得把静态分析描述为运行验证。",
7841
7956
  "color": "#e0a43c"
7842
7957
  }, {
7843
7958
  "name": "executor",
7844
- "description": "负责具体编码、调试、测试、修复与验证交接。",
7845
- "systemPrompt": "你是研发执行者,负责获派范围的编码、调试、测试、修复和必要生成脚本。\n1. 先核对任务、项目规则、相关实现、接口契约、文件归属与验收要求;业务歧义交队长澄清,不自行补造规则。\n2. 按最小可验证切片实施,覆盖必要校验、错误处理和回归测试;遵循现有技术栈,不改无关文件或覆盖他人产物。默认不继续委派。\n3. 运行适用的 lint、测试、构建和必要的真实链路,记录命令、结果、失败原因与验证范围;mock 通过不能替代关键真实路径。重要修复补负例,测试失败不得报通过。\n4. 每个检查点交接变更路径、简要差异、测试证据、风险与待决事项;长日志只传位置。按审查意见定点修复,同一问题两轮失败则报告根因并交队长协调。\n5. 生成物按项目流程产生,不手改;提交前核对暂存范围并遵守授权,push 与发布另需授权。浏览器或设备操作先确认能力及交接;视觉相关任务保留页面、视口、状态和落盘截图,未实际验证不宣称通过。",
7959
+ "description": "负责获派范围内的编码、调试、测试、修复与验证交接。",
7960
+ "systemPrompt": "你是研发执行者,负责获派范围内的实现、集成与验证。使用 executor-short-task-workflow 执行任务。\n1. 核对项目规则、任务范围、验收和接口契约;功能或界面歧义交队长。\n2. 存在两个或以上实质独立、可分别验收的编码工作包时,必须调用 agent-subagent-orchestration 并行执行,不得仅因即时委派开销而默认串行。先明确接口、文件所有权和局部验收。\n3. 按最小可验证切片实施,沿用项目技术栈,不改无关文件、不覆盖他人产物、不擅自扩大范围。孙代理不得继续派生;你负责检查 diff、集成、冲突处理和最终回归。\n4. 单一局部任务、强依赖或共享文件冲突时不强行并行;宿主能力/名额不足时说明原因并调整。运行与风险匹配的测试、lint、构建或真实链路,未运行不得报通过。\n5. 按 STATUS、TASK_ID、CHANGES、TESTS、BLOCKERS 汇报;证据提供路径和命令,长日志只给位置。Git/Release/仓库文档任务按需使用对应 Skill;push、发布和改写历史需单独授权。",
7846
7961
  "color": "#4c8dff"
7847
7962
  }]
7848
7963
  }
7849
7964
  },
7850
7965
  metadata: {
7851
- "summary": "适合小型功能与模块迭代。",
7966
+ "summary": "三角色协作的小型研发团队,支持按需并行探查与编码。",
7852
7967
  "tags": [
7853
7968
  "软件研发",
7854
7969
  "小团队",
@@ -7860,44 +7975,90 @@ const BUILTIN_TEAM_CATALOG = [
7860
7975
  "小范围重构"
7861
7976
  ],
7862
7977
  "quickPrompts": ["为这个模块增加参数校验并补充测试", "修复这个已定位的缺陷并验证回归"],
7863
- "notes": "队长与执行者两人即可覆盖大多数小任务。"
7978
+ "notes": "官方内置 Skill 共 9 项:队长 4 项、顾问 1 项、执行者 4 项。agent-subagent-orchestration 仅绑定队长与执行者;顾问保持单线程。grilling、research 不属于本团队绑定。"
7864
7979
  },
7865
- officialSkillBindings: OFFICIAL_EXECUTOR_SKILLS
7980
+ officialSkillBindings: OFFICIAL_DEVELOPMENT_SKILLS
7866
7981
  },
7867
7982
  {
7868
7983
  id: "builtin-standard",
7869
7984
  series: "classic-development",
7870
7985
  document: {
7871
7986
  "format": "dsh-agent-team-preset",
7872
- "version": 1,
7987
+ "version": 2,
7873
7988
  "team": {
7874
7989
  "name": "标准研发团队",
7875
- "description": "适合中型功能、重要重构与持续项目迭代。队长统筹、架构顾问按需咨询、执行者持续研发,独立审查员检查变更与验证证据。",
7990
+ "description": "适合中型功能、重要重构与持续项目迭代。队长统筹;全栈顾问按需提供跨层技术决策与可执行验收契约;执行者持续研发;代码审查员对代码变更独立验收。",
7876
7991
  "captain": {
7877
7992
  "name": "team-lead",
7878
- "description": "确定目标、任务写入边界和验收证据,按需调度与最终风险裁决。",
7879
- "systemPrompt": "你是工程团队队长,负责范围、调度、依赖、风险和最终验收。具体实现交执行者,专业决策咨询对应顾问。\n1. 仅在用户明确要求团队协作时召集成员;先确认目标平台、项目规则、权限与实际可用工具、验收标准。不得假定服务、浏览器或设备可用,不索取明文秘密。\n2. 任务板按切片记录交付物、验收、依赖、负责人及文件写入范围;仅并行互不冲突的工作。接口契约未确定不得盲目实现;已有任务不重复派发,以消息和状态事件推进,避免空转查询。\n3. executor 承担实现与测试;关键设计问题咨询 fullstack-advisor;reviewer 对有代码变更的交付开展独立审查,高风险切片提前介入,修复后聚焦复审,避免重复全量审查。\n4. 交接优先使用变更路径、简要差异、测试命令和结果、证据位置、待决风险;详情按需读取,不要求复制完整日志。共享浏览器实行单操作者交接;视觉结论需实际查看落盘截图,缺少证据则标记未验证。\n5. 高风险问题修复后复验;同一问题两轮未解决须重新分析根因。必要验收缺证据不得放行;仍有运行中成员或未闭环任务时不得宣布完成。\n6. 最终汇总交付内容、验证结果、未验证项及风险。Git 暂存与提交遵守项目规则和用户授权;push、发布、改写历史分别取得授权。成员默认不继续委派,例外需明确授权并确认工具支持及隔离范围。",
7880
- "color": "#4c8dff"
7993
+ "description": "负责需求对齐、任务分级、团队调度、风险控制与最终验收。",
7994
+ "color": "#4c8dff",
7995
+ "systemPrompt": "你是团队队长,负责需求对齐、任务分级、成员调度、结果整合与最终验收;仅在用户明确要求团队协作时召集成员。\n\n1. 确认目标、范围、验收、项目规则与权限。产品功能、流程、界面及重大范围由用户裁决;基线内技术方案由团队决定。\n2. 按规模路由:短程直接派发;中程用 `leader-medium-task-workflow`;长程用 `leader-long-task-orchestration`。通信使用 `agent-leader-communication`。reviewer 对有代码变更的交付开展独立审查:高风险切片提前介入,修复后只复审改动差异与相关回归。\n3. 存在两个或以上独立工程探查方向时,必须用 `agent-subagent-orchestration` 并行探查,不得仅因即时委派成本而默认串行。\n4. 派发时明确任务范围、发现责任和验收;只传递必要事实、路径和符号,避免重复背景。多个独立编码工作包拆分后交执行者按其工作流处理。\n5. 父代理负责整合与最终验收;仅依据可复核证据报告完成,并列明未验证项、阻塞和风险。"
7881
7996
  },
7882
7997
  "members": [
7883
7998
  {
7884
7999
  "name": "fullstack-advisor",
7885
- "description": "按需提供跨层技术方案与可执行验收契约,不负责具体编码。",
7886
- "systemPrompt": "你是全栈架构顾问,负责技术方案与实施契约,不修改生产代码、测试或生成脚本。\n1. 围绕具体问题查阅项目规则、相关实现与必要文档,沿用既有技术栈,不扩大重构范围。\n2. 按需确定模块边界、数据流、接口字段与错误语义,并提示涉及的权限、安全、迁移兼容及性能风险;列出假设和待决事项。\n3. 输出给执行者的简洁契约:关键决定、关联文件或接口、验收条件、阻塞及风险。仅在关键技术取舍、方案变更或明确阻塞时重新介入。\n4. 只写获指派的契约文档;静态分析不能冒充运行验证。默认不继续委派,也不接管常规编码、调试和测试。",
8000
+ "description": "全栈顾问:按需提供跨层技术决策、方案权衡、风险分析与可执行验收契约;不承担编码。",
8001
+ "systemPrompt": "你是团队全栈顾问,不负责常规编码、项目调度或产品裁决,保持单线程,不创建孙代理。使用 `fullstack-advisor` Skill 执行咨询工作流。\n1. 接收队长的决策问题、约束和事实来源;只调查影响判断的必要范围,复用已有调查。\n2. 输出首选方案、关键理由、主要权衡与风险、必要证据位置及可验证验收条件;区分事实、推断和假设。\n3. 功能、业务规则、用户流程和界面歧义交队长向用户确认;技术细节在已批准边界内自主分析。重大范围、兼容、预算或安全影响须标记升级。\n4. 默认只返回决策摘要,详细论证按需展开。不得修改生产代码、测试或脚本;不得把静态分析描述为运行验证。",
7887
8002
  "color": "#e0a43c"
7888
8003
  },
7889
8004
  {
7890
8005
  "name": "reviewer",
7891
- "description": "独立审查实际变更、关键风险与测试有效性。",
7892
- "systemPrompt": "你是独立代码审查员,不修改共享生产实现,不以成员自评取代证据。\n1. 围绕实际变更、关键调用链与约定的验收契约审查功能、安全权限、并发、兼容迁移和重要界面状态;不无目的扫描全仓。\n2. 确认测试到达目标路径、关键断言能捕获缺陷;mock、全绿和静态检查均不自动等于真实验证。独立复跑前确认权限与隔离范围,不污染共享文件。\n3. 将发现区分为已证实缺陷、待验证风险与建议;按 P0/P1/P2/P3 报告位置、触发条件、影响、证据和最小修复建议。复审聚焦修复差异与相关回归。\n4. 视觉判断需亲自读取实际截图;设计争议交队长协调。结论为通过、需修改或证据不足;必要项未验证不得放行,风险接受交队长裁决。默认不继续委派。",
8006
+ "description": "代码审查员:独立审查所有成员的实际代码变更,验证需求符合性、工程规范、测试有效性及安全/并发/兼容性风险。",
8007
+ "systemPrompt": "你是团队独立代码审查员,审查队长、UI 前端工程师与后端架构师的实际代码变更;保持只读,不修改被审查实现。使用 `independent-code-review-workflow` 作为审查入口,按风险按需加载参考资料。以项目规范和需求为依据,提交可复核的问题、证据及风险;不得将未经验证的判断写成缺陷,必要证据不足时明确说明。\n1. 围绕实际变更、关键调用链与约定的验收契约审查功能、安全权限、并发、兼容迁移和重要界面状态;不无目的扫描全仓。\n2. 确认测试到达目标路径、关键断言能捕获缺陷;mock、全绿和静态检查均不自动等于真实验证。独立复跑前确认权限与隔离范围,不污染共享文件。\n3. 将发现区分为已证实缺陷、待验证风险与建议;按 P0/P1/P2/P3 报告位置、触发条件、影响、证据和最小修复建议。复审聚焦修复差异与相关回归。\n4. 视觉判断需亲自读取实际截图;设计争议交队长协调。结论为通过、需修改或证据不足;必要项未验证不得放行,风险接受交队长裁决。\n5. 沿用既有团队通信规范提交审查结论:先给结论,再列可复核的证据位置、未验证项与待决风险。",
7893
8008
  "color": "#8d6bff"
7894
8009
  },
7895
8010
  {
7896
8011
  "name": "executor",
7897
- "description": "负责具体编码、调试、测试、修复与验证交接。",
7898
- "systemPrompt": "你是研发执行者,负责获派范围的编码、调试、测试、修复和必要生成脚本。\n1. 先核对任务、项目规则、相关实现、接口契约、文件归属与验收要求;业务歧义交队长澄清,不自行补造规则。\n2. 按最小可验证切片实施,覆盖必要校验、错误处理和回归测试;遵循现有技术栈,不改无关文件或覆盖他人产物。默认不继续委派。\n3. 运行适用的 lint、测试、构建和必要的真实链路,记录命令、结果、失败原因与验证范围;mock 通过不能替代关键真实路径。重要修复补负例,测试失败不得报通过。\n4. 每个检查点交接变更路径、简要差异、测试证据、风险与待决事项;长日志只传位置。按审查意见定点修复,同一问题两轮失败则报告根因并交队长协调。\n5. 生成物按项目流程产生,不手改;提交前核对暂存范围并遵守授权,push 与发布另需授权。浏览器或设备操作先确认能力及交接;视觉相关任务保留页面、视口、状态和落盘截图,未实际验证不宣称通过。",
8012
+ "description": "负责获派范围内的编码、调试、测试、修复与验证交接。",
8013
+ "systemPrompt": "你是研发执行者,负责获派范围内的实现、集成与验证。使用 executor-short-task-workflow 执行任务。\n1. 核对项目规则、任务范围、验收和接口契约;功能或界面歧义交队长。\n2. 存在两个或以上实质独立、可分别验收的编码工作包时,必须调用 agent-subagent-orchestration 并行执行,不得仅因即时委派开销而默认串行。先明确接口、文件所有权和局部验收。\n3. 按最小可验证切片实施,沿用项目技术栈,不改无关文件、不覆盖他人产物、不擅自扩大范围。孙代理不得继续派生;你负责检查 diff、集成、冲突处理和最终回归。\n4. 单一局部任务、强依赖或共享文件冲突时不强行并行;宿主能力/名额不足时说明原因并调整。运行与风险匹配的测试、lint、构建或真实链路,未运行不得报通过。\n5. 按 STATUS、TASK_ID、CHANGES、TESTS、BLOCKERS 汇报;证据提供路径和命令,长日志只给位置。Git/Release/仓库文档任务按需使用对应 Skill;push、发布和改写历史需单独授权。",
7899
8014
  "color": "#4c8dff"
7900
8015
  }
8016
+ ],
8017
+ "officialSkills": [
8018
+ {
8019
+ "skillId": "agent-leader-communication",
8020
+ "roleName": "team-lead"
8021
+ },
8022
+ {
8023
+ "skillId": "leader-medium-task-workflow",
8024
+ "roleName": "team-lead"
8025
+ },
8026
+ {
8027
+ "skillId": "leader-long-task-orchestration",
8028
+ "roleName": "team-lead"
8029
+ },
8030
+ {
8031
+ "skillId": "agent-subagent-orchestration",
8032
+ "roleName": "team-lead"
8033
+ },
8034
+ {
8035
+ "skillId": "fullstack-advisor",
8036
+ "roleName": "fullstack-advisor"
8037
+ },
8038
+ {
8039
+ "skillId": "independent-code-review-workflow",
8040
+ "roleName": "reviewer"
8041
+ },
8042
+ {
8043
+ "skillId": "agent-subagent-orchestration",
8044
+ "roleName": "reviewer"
8045
+ },
8046
+ {
8047
+ "skillId": "executor-short-task-workflow",
8048
+ "roleName": "executor"
8049
+ },
8050
+ {
8051
+ "skillId": "agent-subagent-orchestration",
8052
+ "roleName": "executor"
8053
+ },
8054
+ {
8055
+ "skillId": "git-release-hygiene",
8056
+ "roleName": "executor"
8057
+ },
8058
+ {
8059
+ "skillId": "github-repository-presentation",
8060
+ "roleName": "executor"
8061
+ }
7901
8062
  ]
7902
8063
  }
7903
8064
  },
@@ -7914,50 +8075,100 @@ const BUILTIN_TEAM_CATALOG = [
7914
8075
  "持续项目迭代"
7915
8076
  ],
7916
8077
  "quickPrompts": ["实现这个中型功能并完成独立审查", "重构这个模块并保证测试全部通过"],
7917
- "notes": "包含独立审查员,适合有明确验收标准的交付。"
8078
+ "notes": "四个成员(含队长):全栈顾问提供跨层技术决策与验收契约,执行者承担常规实施,代码审查员独立验收。"
7918
8079
  },
7919
- officialSkillBindings: OFFICIAL_EXECUTOR_SKILLS
8080
+ officialSkillBindings: OFFICIAL_STANDARD_SKILLS
7920
8081
  },
7921
8082
  {
7922
8083
  id: "builtin-fullstack",
7923
8084
  series: "classic-development",
7924
8085
  document: {
7925
8086
  "format": "dsh-agent-team-preset",
7926
- "version": 1,
8087
+ "version": 2,
7927
8088
  "team": {
7928
8089
  "name": "全栈软件研发团队",
7929
- "description": "面向复杂的 Web、桌面与 Android 工程。队长调度并验收,架构与设计顾问制定技术契约,独立审查员验证质量,执行者负责开发测试;按风险召集成员并按切片交接。",
8090
+ "description": "面向复杂 Web、桌面与 Android 工程。队长调度并验收;UI 前端工程师与后端架构师分别承担前端与后端专业工作;执行者负责常规开发测试;代码审查员独立验收;按风险召集成员并按切片交接。",
7930
8091
  "captain": {
7931
8092
  "name": "team-lead",
7932
- "description": "确定目标、任务写入边界和验收证据,按需调度与最终风险裁决。",
7933
- "systemPrompt": "你是工程团队队长,负责范围、调度、依赖、风险和最终验收。具体实现交执行者,专业决策咨询对应顾问。\n1. 仅在用户明确要求团队协作时召集成员;先确认目标平台、项目规则、权限与实际可用工具、验收标准。不得假定服务、浏览器或设备可用,不索取明文秘密。\n2. 任务板按切片记录交付物、验收、依赖、负责人及文件写入范围;仅并行互不冲突的工作。接口契约未确定不得盲目实现;已有任务不重复派发,以消息和状态事件推进,避免空转查询。\n3. executor 持续实施、调试与测试;接口、安全或系统设计风险咨询 backend-architect;新交互或视觉争议咨询 ui-designer;reviewer 负责高风险阶段与交付前独立审查。顾问按需参与,不默认全员并行。\n4. 交接优先使用变更路径、简要差异、测试命令和结果、证据位置、待决风险;详情按需读取,不要求复制完整日志。共享浏览器实行单操作者交接;视觉结论需实际查看落盘截图,缺少证据则标记未验证。\n5. 高风险问题修复后复验;同一问题两轮未解决须重新分析根因。必要验收缺证据不得放行;仍有运行中成员或未闭环任务时不得宣布完成。\n6. 最终汇总交付内容、验证结果、未验证项及风险。Git 暂存与提交遵守项目规则和用户授权;push、发布、改写历史分别取得授权。成员默认不继续委派,例外需明确授权并确认工具支持及隔离范围。",
7934
- "color": "#4c8dff"
8093
+ "description": "负责需求对齐、任务分级、团队调度、风险控制与最终验收。",
8094
+ "color": "#4c8dff",
8095
+ "systemPrompt": "你是团队队长,负责需求对齐、任务分级、成员调度、结果整合与最终验收;仅在用户明确要求团队协作时召集成员。\n\n1. 确认目标、范围、验收、项目规则与权限。产品功能、流程、界面及重大范围由用户裁决;基线内技术方案由团队决定。\n2. 按规模路由:短程直接派发;中程用 `leader-medium-task-workflow`;长程用 `leader-long-task-orchestration`。通信使用 `agent-leader-communication`。executor 持续实施、调试与测试;接口、安全或系统设计风险咨询 backend-architect;新交互或视觉争议咨询 ui-designer;reviewer 负责高风险阶段与交付前独立审查,顾问按需参与,不默认全员并行。\n3. 存在两个或以上独立工程探查方向时,必须用 `agent-subagent-orchestration` 并行探查,不得仅因即时委派成本而默认串行。\n4. 派发时明确任务范围、发现责任和验收;只传递必要事实、路径和符号,避免重复背景。多个独立编码工作包拆分后交执行者按其工作流处理。\n5. 父代理负责整合与最终验收;仅依据可复核证据报告完成,并列明未验证项、阻塞和风险。"
7935
8096
  },
7936
8097
  "members": [
7937
8098
  {
7938
8099
  "name": "backend-architect",
7939
- "description": "制定后端与系统技术契约,评估关键风险与兼容性。",
7940
- "systemPrompt": "你是后端与系统架构顾问,负责技术契约与关键风险,不修改生产代码、测试或生成脚本。\n1. 按任务读取相关调用链与项目约定,延续现有架构,不因局部需求扩展无关设计。\n2. 给出必要的模块边界、API/数据契约、错误语义、鉴权隔离、迁移兼容和性能约束;与 ui-designer 对齐业务状态和反馈。\n3. 交付可实施的简洁契约、涉及路径、验收条件、假设与风险;实现后仅按需核对关键路径,静态检查不得冒充运行验证。\n4. 只写获指派的契约资料,未落地内容标为待完成;生成物由执行者按项目规则产生。默认不继续委派,也不接管日常编码调试。",
7941
- "color": "#e0a43c"
8100
+ "description": "后端架构师:负责后端与系统架构、技术契约、复杂后端 Bug 根因分析与修复,以及高风险技术攻坚。",
8101
+ "systemPrompt": "你是团队后端架构师,负责系统架构、技术契约及复杂后端问题攻坚;可在获派范围内直接修复复杂 Bug 和架构性缺陷。\n常规 API、CRUD、一般业务逻辑和局部易定位 Bug 由队长或其他获派成员承担。使用 `backend-architecture-workflow` 作为专业工作入口,按任务需要加载参考资料。\n\n与 UI 前端工程师对齐接口契约,并明确文件所有权。未经授权不部署、发布、修改生产数据或执行破坏性操作。沿用既有团队通信规范交付决策、证据和验证结果。",
8102
+ "color": "#2fa5b6"
7942
8103
  },
7943
8104
  {
7944
8105
  "name": "ui-designer",
7945
- "description": "制定交互与视觉验收规范,基于真实截图裁定偏差。",
7946
- "systemPrompt": "你是 UI/UX 设计顾问,负责交互规范与视觉裁定,不修改生产页面、样式或共享测试。\n1. 读取相关页面、组件、设计令牌与项目规则,延续现有风格,不扩大设计范围。按需覆盖流程、加载/空/错误/校验状态及响应式、无障碍与跨端差异。\n2. 与 backend-architect 对齐字段、状态及错误反馈,交付精简交互规格、涉及页面和可验证验收清单;具体开发交执行者。\n3. 视觉裁定前须亲自用可用图像工具读取落盘截图,记录页面、视口、状态、路径和可见偏差;没有截图或无法读图就标未验证,不以源码或文字替代像素证据。\n4. 获指派后方可操作共享浏览器,遵守单操作者交接;报告裁定、证据和待修问题。只写获指派文档,默认不继续委派。",
8106
+ "description": "UI 前端工程师:负责视觉方向、设计系统、前端组件与交互实现、真实页面视觉 QA 和前端缺陷修复。",
8107
+ "systemPrompt": "你是团队 UI 前端工程师,负责视觉方向、设计系统、前端组件与交互实现、真实页面视觉 QA 和前端缺陷修复,可直接修改获派范围内的前端代码和测试。\n常规前端实施按复杂度分配,队长也可自行承担。你不修改后端、数据库或服务端契约;接口语义不清时咨询 backend-architect。\n\n使用 `frontend-engineering-workflow` 作为专业工作入口,按任务需要加载参考资料。与队长或其他写入者协作前明确文件所有权,沿用既有团队通信规范交接结果和验证证据。",
7947
8108
  "color": "#2fbf71"
7948
8109
  },
7949
8110
  {
7950
8111
  "name": "reviewer",
7951
- "description": "独立审查实际变更、关键风险与测试有效性。",
7952
- "systemPrompt": "你是独立代码审查员,不修改共享生产实现,不以成员自评取代证据。\n1. 围绕实际变更、关键调用链与约定的验收契约审查功能、安全权限、并发、兼容迁移和重要界面状态;不无目的扫描全仓。\n2. 确认测试到达目标路径、关键断言能捕获缺陷;mock、全绿和静态检查均不自动等于真实验证。独立复跑前确认权限与隔离范围,不污染共享文件。\n3. 将发现区分为已证实缺陷、待验证风险与建议;按 P0/P1/P2/P3 报告位置、触发条件、影响、证据和最小修复建议。复审聚焦修复差异与相关回归。\n4. 视觉判断需亲自读取实际截图;视觉设计取舍由 ui-designer 裁定,自己负责独立质量判断。结论为通过、需修改或证据不足;必要项未验证不得放行,风险接受交队长裁决。默认不继续委派。",
8112
+ "description": "代码审查员:独立审查所有成员的实际代码变更,验证需求符合性、工程规范、测试有效性及安全/并发/兼容性风险。",
8113
+ "systemPrompt": "你是团队独立代码审查员,审查队长、UI 前端工程师与后端架构师的实际代码变更;保持只读,不修改被审查实现。使用 `independent-code-review-workflow` 作为审查入口,按风险按需加载参考资料。以项目规范和需求为依据,提交可复核的问题、证据及风险;不得将未经验证的判断写成缺陷,必要证据不足时明确说明。\n1. 围绕实际变更、关键调用链与约定的验收契约审查功能、安全权限、并发、兼容迁移和重要界面状态;不无目的扫描全仓。\n2. 确认测试到达目标路径、关键断言能捕获缺陷;mock、全绿和静态检查均不自动等于真实验证。独立复跑前确认权限与隔离范围,不污染共享文件。\n3. 将发现区分为已证实缺陷、待验证风险与建议;按 P0/P1/P2/P3 报告位置、触发条件、影响、证据和最小修复建议。复审聚焦修复差异与相关回归。\n4. 视觉判断需亲自读取实际截图;设计争议交队长协调。结论为通过、需修改或证据不足;必要项未验证不得放行,风险接受交队长裁决。\n5. 沿用既有团队通信规范提交审查结论:先给结论,再列可复核的证据位置、未验证项与待决风险。",
7953
8114
  "color": "#8d6bff"
7954
8115
  },
7955
8116
  {
7956
8117
  "name": "executor",
7957
- "description": "负责具体编码、调试、测试、修复与验证交接。",
7958
- "systemPrompt": "你是研发执行者,负责获派范围的编码、调试、测试、修复和必要生成脚本。\n1. 先核对任务、项目规则、相关实现、接口契约、文件归属与验收要求;业务歧义交队长澄清,不自行补造规则。\n2. 按最小可验证切片实施,覆盖必要校验、错误处理和回归测试;遵循现有技术栈,不改无关文件或覆盖他人产物。默认不继续委派。\n3. 运行适用的 lint、测试、构建和必要的真实链路,记录命令、结果、失败原因与验证范围;mock 通过不能替代关键真实路径。重要修复补负例,测试失败不得报通过。\n4. 每个检查点交接变更路径、简要差异、测试证据、风险与待决事项;长日志只传位置。按审查意见定点修复,同一问题两轮失败则报告根因并交队长协调。\n5. 生成物按项目流程产生,不手改;提交前核对暂存范围并遵守授权,push 与发布另需授权。浏览器或设备操作先确认能力及交接;视觉相关任务保留页面、视口、状态和落盘截图,未实际验证不宣称通过。",
8118
+ "description": "负责获派范围内的编码、调试、测试、修复与验证交接。",
8119
+ "systemPrompt": "你是研发执行者,负责获派范围内的实现、集成与验证。使用 executor-short-task-workflow 执行任务。\n1. 核对项目规则、任务范围、验收和接口契约;功能或界面歧义交队长。\n2. 存在两个或以上实质独立、可分别验收的编码工作包时,必须调用 agent-subagent-orchestration 并行执行,不得仅因即时委派开销而默认串行。先明确接口、文件所有权和局部验收。\n3. 按最小可验证切片实施,沿用项目技术栈,不改无关文件、不覆盖他人产物、不擅自扩大范围。孙代理不得继续派生;你负责检查 diff、集成、冲突处理和最终回归。\n4. 单一局部任务、强依赖或共享文件冲突时不强行并行;宿主能力/名额不足时说明原因并调整。运行与风险匹配的测试、lint、构建或真实链路,未运行不得报通过。\n5. 按 STATUS、TASK_ID、CHANGES、TESTS、BLOCKERS 汇报;证据提供路径和命令,长日志只给位置。Git/Release/仓库文档任务按需使用对应 Skill;push、发布和改写历史需单独授权。",
7959
8120
  "color": "#4c8dff"
7960
8121
  }
8122
+ ],
8123
+ "officialSkills": [
8124
+ {
8125
+ "skillId": "agent-leader-communication",
8126
+ "roleName": "team-lead"
8127
+ },
8128
+ {
8129
+ "skillId": "leader-medium-task-workflow",
8130
+ "roleName": "team-lead"
8131
+ },
8132
+ {
8133
+ "skillId": "leader-long-task-orchestration",
8134
+ "roleName": "team-lead"
8135
+ },
8136
+ {
8137
+ "skillId": "agent-subagent-orchestration",
8138
+ "roleName": "team-lead"
8139
+ },
8140
+ {
8141
+ "skillId": "frontend-engineering-workflow",
8142
+ "roleName": "ui-designer"
8143
+ },
8144
+ {
8145
+ "skillId": "backend-architecture-workflow",
8146
+ "roleName": "backend-architect"
8147
+ },
8148
+ {
8149
+ "skillId": "independent-code-review-workflow",
8150
+ "roleName": "reviewer"
8151
+ },
8152
+ {
8153
+ "skillId": "agent-subagent-orchestration",
8154
+ "roleName": "reviewer"
8155
+ },
8156
+ {
8157
+ "skillId": "executor-short-task-workflow",
8158
+ "roleName": "executor"
8159
+ },
8160
+ {
8161
+ "skillId": "agent-subagent-orchestration",
8162
+ "roleName": "executor"
8163
+ },
8164
+ {
8165
+ "skillId": "git-release-hygiene",
8166
+ "roleName": "executor"
8167
+ },
8168
+ {
8169
+ "skillId": "github-repository-presentation",
8170
+ "roleName": "executor"
8171
+ }
7961
8172
  ]
7962
8173
  }
7963
8174
  },
@@ -7974,9 +8185,9 @@ const BUILTIN_TEAM_CATALOG = [
7974
8185
  "复杂重构"
7975
8186
  ],
7976
8187
  "quickPrompts": ["为现有项目增加用户认证模块并验证", "统一 Web 与桌面端的设置页面交互"],
7977
- "notes": "顾问按需参与,避免全员并行。"
8188
+ "notes": "五个成员(含队长):顾问职责拆成 UI 前端工程师与后端架构师两个专业角色,执行者承担常规实施,代码审查员独立验收;跨端一致性由队长裁定。"
7978
8189
  },
7979
- officialSkillBindings: OFFICIAL_EXECUTOR_SKILLS
8190
+ officialSkillBindings: OFFICIAL_SPECIALIST_SKILLS
7980
8191
  },
7981
8192
  {
7982
8193
  id: "builtin-discovery",
@@ -9651,6 +9862,69 @@ function registerPresetTools(ctx, agent, config, namespace, appliedTeamId = () =
9651
9862
  for (const dispose of disposers.splice(0).reverse()) dispose();
9652
9863
  };
9653
9864
  }
9865
+
9866
+
9867
+ /**
9868
+ * Whether a Session's Team-themed tools follow the Team mode it was started in.
9869
+ *
9870
+ * The official `team_task_*` tools are declared only while a Session root has
9871
+ * Agent Teams turned on. This plugin's seven Team-themed tools — five that manage
9872
+ * the private skill library, two that read and edit the Team preset — answer the
9873
+ * same question the same way: with Team mode off a Session carries no Team, no
9874
+ * selected role, and no library to manage, so declaring those schemas there
9875
+ * spends context on capabilities the Session cannot use. The composer already
9876
+ * hides its Team control on the same fact, so gating the tools keeps the model
9877
+ * side and the page side describing one behaviour instead of two.
9878
+ *
9879
+ * WHY THIS IS A REGISTRATION DECISION, NOT A `when` CONDITION
9880
+ *
9881
+ * A conditional registration (`tools.register(def, { when })`) is not readable
9882
+ * outside a model step: `tools.executable()` answers undefined for it without a
9883
+ * step's admitted set. Three paths in this plugin read tool visibility outside a
9884
+ * step — the quarantine guard that decides what a paused Session may reach, the
9885
+ * `capabilityRefusal` preflight that proves a custom allow-list names tools this
9886
+ * Session composes, and the member-creation route resolution. Conditional
9887
+ * registrations would make those tools look absent at every one of them,
9888
+ * including the window while a Team is being applied, when the paused captain
9889
+ * must still reach its recovery tools.
9890
+ *
9891
+ * Withdrawing the registration instead keeps one answer per tool: a name is
9892
+ * either registered and readable from outside a step, or it is not installed at
9893
+ * all. Nothing observes a registered-but-unreadable half state.
9894
+ * @module dsh-agent-team-presets/team-mode
9895
+ */
9896
+ /** The projection key the Agent Teams service publishes. */
9897
+ const TEAM_PROJECTION = "agentTeam";
9898
+ /**
9899
+ * Read the Agent Teams mode of one Session root from the session projections.
9900
+ * @param projections - the projection registry, when this deployment composes one.
9901
+ * @param agent - the Agent whose mode is being read.
9902
+ * @returns `true`/`false` when the mode is observable, `undefined` when it is not.
9903
+ */
9904
+ function teamModeOf(projections, agent) {
9905
+ const registry = projections;
9906
+ if (registry?.snapshot === void 0) return void 0;
9907
+ let projection;
9908
+ try {
9909
+ projection = registry.snapshot(agent.session, [TEAM_PROJECTION]).values[TEAM_PROJECTION];
9910
+ } catch {
9911
+ return;
9912
+ }
9913
+ return projection === void 0 ? void 0 : projection.enabled === true;
9914
+ }
9915
+ /**
9916
+ * Whether the Team-themed tools belong on this Session right now.
9917
+ *
9918
+ * An unobservable mode keeps them installed: only a positively read "Team mode is
9919
+ * off" removes them, because a deployment that composes no Agent Teams service
9920
+ * has no switch to turn on and must keep the management surface it always had.
9921
+ * @param projections - the projection registry, when this deployment composes one.
9922
+ * @param agent - the Session root being adopted.
9923
+ * @returns whether to register the seven tools.
9924
+ */
9925
+ function teamModeAdmitsTools(projections, agent) {
9926
+ return teamModeOf(projections, agent) !== false;
9927
+ }
9654
9928
  /** A refusal carrying the path that produced it. */
9655
9929
  var SkillPathError = class extends Error {
9656
9930
  reason;
@@ -16876,9 +17150,20 @@ var TeamSkillStore = class {
16876
17150
  get(assetId) {
16877
17151
  return this.table.get(assetId);
16878
17152
  }
17153
+ /**
17154
+ * Resolve one skill by its name rather than by asset identity.
17155
+ *
17156
+ * Several assets may legitimately share a name: the shipped copy, a local
17157
+ * override of it, and a skill the user imported under the same name. The
17158
+ * shipped copy wins, because a name denotes the skill the plugin ships — a
17159
+ * user's own copy must never shadow it for a caller that only said the name.
17160
+ * Callers that know which copy they mean pass the asset id instead.
17161
+ * @param skillId - kebab-case skill name.
17162
+ * @returns the shipped copy when it exists, else the best local one.
17163
+ */
16879
17164
  bySkillId(skillId) {
16880
17165
  const candidates = this.list().filter((asset) => asset.skillId === skillId);
16881
- return candidates.find((asset) => asset.origin === "override") ?? candidates.find((asset) => asset.origin === "custom") ?? candidates[0];
17166
+ return candidates.find((asset) => asset.origin === "builtin") ?? candidates.find((asset) => asset.origin === "override") ?? candidates.find((asset) => asset.origin === "custom") ?? candidates[0];
16882
17167
  }
16883
17168
  /** Commit all nested store mutations once; failures restore memory and version folders. */
16884
17169
  async transaction(operation) {
@@ -16923,6 +17208,10 @@ var TeamSkillStore = class {
16923
17208
  const checked = buildSkillPackage(input);
16924
17209
  if (!checked.ok) throw new Error(`invalid skill package: ${checked.reason}`);
16925
17210
  assetDirectoryName(package_.name);
17211
+ if (options.origin !== "builtin") {
17212
+ const clash = [...this.table.values()].find((asset) => asset.skillId === package_.name && asset.id !== options.id && !(options.origin === "override" && asset.origin === "builtin"));
17213
+ if (clash !== void 0) throw new Error(`the skill name "${package_.name}" already belongs to ${clash.id}; a skill name is the identity a binding uses`);
17214
+ }
16926
17215
  const target = this.assetPath(options.id, options.version);
16927
17216
  const manifest = this.manifestPath(options.id, options.version);
16928
17217
  await assertNoSymlinks(target);
@@ -17352,6 +17641,19 @@ function seedOwner(key) {
17352
17641
  } catch {}
17353
17642
  }
17354
17643
  /** The Team Skill library plus its role bindings. */
17644
+ /**
17645
+ * Whether two assets are the shipped copy and its own editable copy.
17646
+ *
17647
+ * They share a name because they ARE the same skill: the override is the shipped
17648
+ * body with the user's edits. Presenting that pair as a name clash made an
17649
+ * ordinary "I made a local copy" state read as a defect.
17650
+ * @param left - one asset.
17651
+ * @param right - the other asset.
17652
+ * @returns true when one is the shipped copy and the other its override.
17653
+ */
17654
+ function sanctionedCopy(left, right) {
17655
+ return left.origin === "builtin" && right.origin === "override" && right.officialSkillId === left.skillId || right.origin === "builtin" && left.origin === "override" && left.officialSkillId === right.skillId;
17656
+ }
17355
17657
  var TeamSkillManager = class {
17356
17658
  store;
17357
17659
  bindings = [];
@@ -17639,28 +17941,20 @@ var TeamSkillManager = class {
17639
17941
  const memberRole = member === void 0 ? void 0 : member.id ?? member.name;
17640
17942
  const roleId = isCaptain ? CAPTAIN_ROLE : memberRole === "captain" ? void 0 : memberRole;
17641
17943
  if (roleId === void 0) continue;
17642
- const assetId = this.seededAssetId(declaration.skillId);
17643
- if (assetId === void 0) continue;
17944
+ const assetId = `builtin:${declaration.skillId}`;
17945
+ if (this.store.get(assetId) === void 0) continue;
17644
17946
  const key = JSON.stringify([
17645
17947
  team.id,
17646
17948
  roleId,
17647
- `builtin:${declaration.skillId}`
17949
+ assetId
17648
17950
  ]);
17649
- if (this.seeded.has(key)) {
17650
- const builtinId = `builtin:${declaration.skillId}`;
17651
- if (assetId !== builtinId) {
17652
- const stale = this.bindings.findIndex((row) => row.teamId === team.id && row.roleId === roleId && row.assetId === builtinId);
17653
- if (stale >= 0) this.bindings[stale] = {
17654
- teamId: team.id,
17655
- roleId,
17656
- assetId,
17657
- ...roleId === "captain" ? { captain: true } : {}
17658
- };
17659
- }
17660
- continue;
17661
- }
17951
+ if (this.bindings.some((row) => {
17952
+ if (row.teamId !== team.id || row.roleId !== roleId) return false;
17953
+ return this.store.get(row.assetId)?.skillId === declaration.skillId;
17954
+ })) continue;
17955
+ if (this.seeded.has(key)) continue;
17662
17956
  this.seeded.add(key);
17663
- if (!this.bindings.some((row) => row.teamId === team.id && row.roleId === roleId && row.assetId === assetId)) this.bindings.push({
17957
+ this.bindings.push({
17664
17958
  teamId: team.id,
17665
17959
  roleId,
17666
17960
  assetId,
@@ -17671,23 +17965,30 @@ var TeamSkillManager = class {
17671
17965
  if (JSON.stringify([this.bindings, [...this.seeded]]) !== before) await this.flush();
17672
17966
  }
17673
17967
  /**
17674
- * Resolve the asset a catalog default should bind to.
17968
+ * Move every role holding one asset onto another.
17675
17969
  *
17676
- * The shipped copy is the fallback, and it is the only candidate while no
17677
- * override exists. When the user has created an editable override of that
17678
- * shipped skill, the override is what they mean by it: `overrideSkill`
17679
- * rewrites the bindings that exist at creation time, so a default first
17680
- * seeded afterwards must resolve to the same copy or the two creation orders
17681
- * would disagree about which body a role receives.
17682
- * @param skillId - shipped skill identity the default names.
17683
- * @returns the asset identity to bind, or undefined when neither copy exists.
17970
+ * Used by "restore to the built-in version": the roles reading a local copy
17971
+ * have to read the shipped one again, or the restore would only change bytes
17972
+ * nobody is bound to.
17973
+ * @param fromAssetId - asset the roles hold now.
17974
+ * @param toAssetId - asset they should hold.
17975
+ * @returns the number of bindings moved.
17684
17976
  */
17685
- seededAssetId(skillId) {
17686
- const builtinId = `builtin:${skillId}`;
17687
- if (this.store.get(builtinId) === void 0) return void 0;
17688
- const overrideId = `override:${skillId}`;
17689
- const override = this.store.get(overrideId);
17690
- return override?.origin === "override" && override.officialSkillId === skillId ? overrideId : builtinId;
17977
+ async replaceAssetBindings(fromAssetId, toAssetId) {
17978
+ return this.mutate(async () => {
17979
+ if (this.store.get(toAssetId) === void 0) return 0;
17980
+ let moved = 0;
17981
+ this.bindings = this.bindings.map((row) => {
17982
+ if (row.assetId !== fromAssetId) return row;
17983
+ moved += 1;
17984
+ return {
17985
+ ...row,
17986
+ assetId: toAssetId
17987
+ };
17988
+ });
17989
+ if (moved > 0) await this.flush();
17990
+ return moved;
17991
+ });
17691
17992
  }
17692
17993
  mutate(operation) {
17693
17994
  const result = this.pending.then(async () => {
@@ -17815,12 +18116,24 @@ var TeamSkillManager = class {
17815
18116
  */
17816
18117
  async restoreBuiltinBindings(teamIds) {
17817
18118
  return this.mutate(async () => {
17818
- const targets = new Set(teamIds ?? BUILTIN_TEAM_IDS);
18119
+ const requested = Array.isArray(teamIds) ? teamIds : [];
18120
+ const targets = new Set(requested.length === 0 ? BUILTIN_TEAM_IDS : requested);
17819
18121
  this.seeded = new Set([...this.seeded].filter((key) => {
17820
18122
  const owner = seedOwner(key);
17821
18123
  return owner === void 0 || !targets.has(owner[0]);
17822
18124
  }));
18125
+ this.bindings = this.bindings.map((row) => {
18126
+ if (!targets.has(row.teamId)) return row;
18127
+ const asset = this.store.get(row.assetId);
18128
+ if (asset?.origin !== "override" || asset.officialSkillId === void 0) return row;
18129
+ const builtinId = `builtin:${asset.officialSkillId}`;
18130
+ return this.store.get(builtinId) === void 0 ? row : {
18131
+ ...row,
18132
+ assetId: builtinId
18133
+ };
18134
+ });
17823
18135
  await this.reconcileNow();
18136
+ await this.flush();
17824
18137
  });
17825
18138
  }
17826
18139
  /**
@@ -18223,10 +18536,29 @@ var TeamSkillRuntime = class {
18223
18536
  * providers, and an explicit `skillRoot` config value always wins.
18224
18537
  * @module dsh-agent-team-presets/team-skills
18225
18538
  */
18226
- /** The skills the package ships under `assets/skills`. */
18539
+ /**
18540
+ * The skills the package ships under `assets/skills`.
18541
+ *
18542
+ * The engineering workflow skills are bound to a role by `team-catalog.ts`; the
18543
+ * three professional-role workflows (`frontend-engineering-workflow`,
18544
+ * `backend-architecture-workflow`, `independent-code-review-workflow`) are the
18545
+ * progressive-loading entry points of the UI frontend engineer, the backend
18546
+ * architect, and the independent reviewer, whose detailed methods live in each
18547
+ * skill's `references/` folder; `grilling` and `research` are method skills the
18548
+ * work-mode Teams bind instead.
18549
+ */
18227
18550
  const OFFICIAL_SKILL_IDS = [
18551
+ "agent-leader-communication",
18552
+ "leader-medium-task-workflow",
18553
+ "leader-long-task-orchestration",
18554
+ "agent-subagent-orchestration",
18555
+ "fullstack-advisor",
18556
+ "executor-short-task-workflow",
18228
18557
  "github-repository-presentation",
18229
18558
  "git-release-hygiene",
18559
+ "frontend-engineering-workflow",
18560
+ "backend-architecture-workflow",
18561
+ "independent-code-review-workflow",
18230
18562
  "grilling",
18231
18563
  "research"
18232
18564
  ];
@@ -18320,7 +18652,7 @@ var TeamSkills = class {
18320
18652
  entries.push({
18321
18653
  skillId,
18322
18654
  directory: join(directory, skillId),
18323
- version: "1"
18655
+ version: "5"
18324
18656
  });
18325
18657
  } catch {
18326
18658
  log(`the shipped skill "${skillId}" is not present in this installation`);
@@ -18759,7 +19091,7 @@ let TeamSkillService = (() => {
18759
19091
  fileCount: asset.files.length,
18760
19092
  totalBytes: asset.files.reduce((sum, file) => sum + file.size, 0),
18761
19093
  mcpServers: asset.dependencies.mcpServers.map((server) => server.serverName),
18762
- clashesWith: this.config.store.list().filter((other) => other.id !== asset.id && other.skillId === asset.skillId).map((other) => other.id),
19094
+ clashesWith: this.config.store.list().filter((other) => other.id !== asset.id && other.skillId === asset.skillId && !sanctionedCopy(asset, other)).map((other) => other.id),
18763
19095
  bindings: this.config.manager.bindingSummaries(assetId)
18764
19096
  };
18765
19097
  }
@@ -19192,7 +19524,8 @@ let TeamSkillService = (() => {
19192
19524
  detail: issue
19193
19525
  };
19194
19526
  try {
19195
- await this.config.store.resetOverride(assetId);
19527
+ const reset = await this.config.store.resetOverride(assetId);
19528
+ if (reset.officialSkillId !== void 0) await this.config.manager.replaceAssetBindings(assetId, `builtin:${reset.officialSkillId}`);
19196
19529
  } catch (error) {
19197
19530
  return {
19198
19531
  ok: false,
@@ -19321,6 +19654,7 @@ let TeamSkillService = (() => {
19321
19654
  try {
19322
19655
  await this.config.manager.restoreBuiltinBindings(teamIds);
19323
19656
  } catch (error) {
19657
+ this.ctx.logger.warn("agent-team-presets: restoring built-in Team Skill bindings failed: %s", String(error));
19324
19658
  return {
19325
19659
  ...await this.library(),
19326
19660
  issue: String(error)
@@ -21342,8 +21676,21 @@ function apply(ctx, config) {
21342
21676
  const selection = config.selections.get().find((row) => row.sessionId === agent.session.id);
21343
21677
  const selectedId = selection?.teamId;
21344
21678
  const selectedRole = selectedRoleId(selection);
21345
- if (!presetTools.has(agent)) presetTools.set(agent, registerPresetTools(ctx, agent, config, NAMESPACE, (root) => applications.get(root)?.teamId));
21346
- if (!skillTools.has(agent)) skillTools.set(agent, registerTeamSkillTools(ctx, agent, skillToolDeps));
21679
+ let projections;
21680
+ try {
21681
+ projections = ctx.get("sessionProjections");
21682
+ } catch {
21683
+ projections = void 0;
21684
+ }
21685
+ if (!teamModeAdmitsTools(projections, agent)) {
21686
+ presetTools.get(agent)?.();
21687
+ presetTools.delete(agent);
21688
+ skillTools.get(agent)?.();
21689
+ skillTools.delete(agent);
21690
+ } else {
21691
+ if (!presetTools.has(agent)) presetTools.set(agent, registerPresetTools(ctx, agent, config, NAMESPACE, (root) => applications.get(root)?.teamId));
21692
+ if (!skillTools.has(agent)) skillTools.set(agent, registerTeamSkillTools(ctx, agent, skillToolDeps));
21693
+ }
21347
21694
  if (startingTask ? teammatesBusy(ctx, agent) : agent.status === "running" || teammatesBusy(ctx, agent)) {
21348
21695
  if (!applications.has(agent)) {
21349
21696
  const marked = hasTeamApplicationMarker(agent);
@@ -21572,6 +21919,14 @@ function apply(ctx, config) {
21572
21919
  if (root === void 0) return;
21573
21920
  reconcile(root, isSessionRoot(agent) && status === "running");
21574
21921
  });
21922
+ ctx.on("session/event", (session, event) => {
21923
+ if (event.type !== "team/mode") return;
21924
+ const agent = ctx.agents.get(session.id);
21925
+ if (agent === void 0 || !isSessionRoot(agent)) return;
21926
+ queueMicrotask(() => {
21927
+ if (!disposed) reconcile(agent);
21928
+ });
21929
+ });
21575
21930
  ctx.on("session/event", (session, event) => {
21576
21931
  if (event.type !== "subagent/catalog") return;
21577
21932
  const agent = ctx.agents.get(session.id);