Skip to content

feat(agents): add /pm-dispatch PM loop and os-dev developer subagent - #4540

Merged
os-zhuang merged 5 commits into
mainfrom
claude/pm-agent-task-dispatch-r4cepu
Aug 2, 2026
Merged

feat(agents): add /pm-dispatch PM loop and os-dev developer subagent#4540
os-zhuang merged 5 commits into
mainfrom
claude/pm-agent-task-dispatch-r4cepu

Conversation

@os-zhuang

@os-zhuang os-zhuang commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

目的

在 Claude Code 中构建「项目经理 agent 派发任务」机制:PM agent 从 issue 清单中挑选、认领并派发任务给并行的开发 agent;开发 agent 完成后以结构化 JSON 回报;PM 逐项复核后派发下一批。过程中遇到需要维护者拍板的不确定性,不猜测,而是创建 needs-user-decision issue 等待确认。

内容

.claude/skills/pm-dispatch/SKILL.md — PM agent 的运行规程(/pm-dispatch 触发):

  • 循环:select → claim → dispatch → collect → review → report → 下一批。
  • 状态全部落在 GitHub(标签 pm:queue / pm:dispatched / needs-user-decision、assignee、PR 关联),不依赖任何本地状态,新会话可直接续跑。
  • 两种派发后端:mode:subagent(默认,会话内并行子 agent,回报无损)与 mode:cloud(每个 issue 一个独立云端会话,经 poke-only trigger 拉起;回报走 issue 评论 + send_later 定时收取)。
  • 多仓库协调(backend objectstack / frontend objectui / cloud):主 backlog 统一在 objectstack,repo:objectui / repo:cloud 标签路由代码落地仓库;跨仓功能按契约优先拆分(父 issue + 每仓 sub-issue,spec/后端先行),Blocked-by: 未合并不派发;联动收尾(如 objectui 合并后的 objectui:refresh 回灌)由 PM 自动生成跟进 issue。
  • 复核以 GitHub 为准而非报告自述:PR 存在且为 draft、Fixes #n、无 content/docs/releases/ 改动、changeset 到位、测试证据是真实输出。裁决 ACCEPT / REWORK(最多返工 2 轮)/ ESCALATE。
  • 升级路径与两条硬性评估轴:所有 [决策] issue 必须沿 ① 项目长远合理性(北极星、no workarounds、contract-first)与 ② 防 AI 写代码犯错、尤其防 AI 写元数据 app 犯错(严格 schema、发布时响亮拒绝、declared = enforced、拒绝消费端宽容回退)两条轴分析各方案并给出建议;两轴冲突时如实呈现交维护者拍板。
  • 硬性护栏:PM 不写代码、不合并 PR;不 force-push;不碰他人已认领的 issue;与 AGENTS.md 冲突时以 AGENTS.md 为准。

.claude/agents/os-dev.md — 单 issue 开发子 agent 定义:

备注

  • 两个文件均在 skills/ 发布目录之外,已按 template-consistency.test.ts 的要求打上 metadata.internal: true(已用同一正则本地校验通过)。
  • .claude/ 工具改动,不发布任何 package,已按门禁要求附空 frontmatter changeset(sanctioned 的 "this PR releases nothing" 声明)。
  • 三个仓库的状态标签与 objectstack 的路由标签已通过初始化 issue 建好并关闭:objectstack#4543、objectui#3176、cloud#998。

🤖 Generated with Claude Code

https://claude.ai/code/session_012C2cd7tL8QDoZ2QKN3djJ5

Adds a project-manager dispatch mechanism for Claude Code sessions:

- .claude/skills/pm-dispatch/SKILL.md — the PM agent protocol: pull ready
  issues from the GitHub backlog (pm:queue label or explicit list), claim
  them, dispatch each to a parallel os-dev subagent, verify the returned
  reports against GitHub (PR exists, scope, test evidence), then dispatch
  the next batch. Uncertainties are escalated as needs-user-decision
  issues for the maintainer instead of guessed at. All loop state lives
  in GitHub (labels/assignees/PRs), so the loop is resumable from a
  fresh session.
- .claude/agents/os-dev.md — the single-issue developer subagent: own
  worktree, branch claude/issue-<n>-<slug>, implementation + tests +
  changeset, draft PR, structured JSON report back to the PM; returns
  needs_decision instead of guessing on contract-shaping ambiguity.

Both are internal agent tooling (metadata.internal: true), outside the
published skills/ catalog.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012C2cd7tL8QDoZ2QKN3djJ5
@vercel

vercel Bot commented Aug 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Aug 2, 2026 1:43am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation size/m labels Aug 2, 2026
claude added 3 commits August 2, 2026 01:32
…pendent cloud session

mode:cloud spawns one fresh cloud session per issue via Claude_Code_Remote
poke-only triggers (create_trigger + fire_trigger), with report collection
through GitHub issue comments and send_later sweeps, since an independent
session has no direct return channel to the PM. Default stays mode:subagent.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012C2cd7tL8QDoZ2QKN3djJ5
…loud)

- One main backlog in objectstack; repo:objectui / repo:cloud labels route
  the dev agent's target repo while the issue stays in the backlog.
- Contract-first splitting for cross-repo features: parent + per-repo
  sub-issues, spec/backend first, Blocked-by lines gate downstream
  dispatch (verified against GitHub at selection time).
- Linkage chores become pm:queue issues (e.g. objectui accept => file the
  objectui:refresh console-bump chore in objectstack).
- Label setup now covers all three repos + routing labels on the backlog.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012C2cd7tL8QDoZ2QKN3djJ5
…lations

Every escalated option must be analyzed on (1) long-term architectural
soundness for this project (North Star, no workarounds, contract-first)
and (2) making AI-written code — especially AI-authored metadata apps —
structurally hard to get wrong (strict schemas, publish-time rejection,
declared = enforced, never lenient consumer fallbacks). Applied to both
the PM's [decision] issue template and the os-dev needs_decision report.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012C2cd7tL8QDoZ2QKN3djJ5
@os-zhuang
os-zhuang marked this pull request as ready for review August 2, 2026 01:51
@os-zhuang
os-zhuang added this pull request to the merge queue Aug 2, 2026
Merged via the queue into main with commit 435415e Aug 2, 2026
17 checks passed
@os-zhuang
os-zhuang deleted the claude/pm-agent-task-dispatch-r4cepu branch August 2, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants