协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
do-code-review【开发与工程】Review a branch or PR by dispatching this repo's specialized review agents in parallel, verifying every finding, and reporting what survives by severity. Optional: merges need only AgentOS's own independent review of the PR's head, so run this when a change is risky enough to want a deeper look first. Use when: (1) the user asks for a PR or code revi…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Run the relevant review agents from .claude/agents/ in parallel, have review-finding-verifier check every finding against the code, and report what survives in one list ranked by severity. Then fix.
This review is optional and costs about nine agents. What merges require is the orchestrator's independent review of the PR's exact head (lib/tasks/code-review.ts, enforced by sign_off and stacks' land), which AgentOS runs itself. Run this one when the change is risky enough to want a deeper look before the PR, or when the user asks for it. For a narrower look, run only the agents that matter.
Changed files. With a PR number: gh pr diff <NUMBER> --name-only (right for stacked PRs too). Otherwise: git diff main...HEAD --name-status -M plus git status --short --untracked-files=all, so uncommitted, new and renamed files count. For a stacked task, diff against the branch the PR targets, not main.
The goal: what this change was asked to do. Take the first of these that exists, and add the next ones when they add detail:
gh pr view <NUMBER> --json title,bodylh CLI; load the lh skill first)docs/plans/ the prompt or card points at (local only, gitignored)Write it as a short brief: what was asked for, the "done when" list, and the links. With no goal at all, skip review-spec-compliance and say so at the top of the report.
| Condition | Agent |
|---|---|
| A goal was found in step 1 | review-spec-compliance |
server.ts, lib/security/, lib/connect/, app/api/, mcp/, bin/, scripts/, lib/orchestrator/, lib/chat/, lib/lumifyhub/, or any file calling exec/spawn/execFile, reading a request, a header, a path or a file, or building a prompt | review-security |
lib/orchestrator/, lib/tasks/, lib/stacks/, lib/tasks/brief.ts, or a route or tool that starts, approves, merges or drops work | review-orchestrator-safety |
lib/chat/, lib/db/, server.ts, lib/stacks/, lib/tasks/, a watcher or background loop, or any app/api/ route | review-durability |
app/ pages and layouts, components/, hooks/, data/, stores/, contexts/, styles/ (not app/api/) | review-frontend |
Any .ts/.tsx implementation or *.test.ts(x) file, vitest.config.mts or vitest.setup.ts | review-test-quality |
Skip agents whose condition isn't met. When in doubt about review-security, run it: it's the one that's expensive to skip.
Send one message with one Agent call per selected agent (subagent_type = the agent's name). Claude Code registers agent types when a session starts, so in a session started before these files existed (or in a worktree that didn't have them yet), use subagent_type: "general-purpose" and begin the prompt with "Read .claude/agents/<name>.md and follow it exactly." Each prompt includes the changed-file list (with status letters), the base (main or the stack's parent branch), the PR number if any, the goal brief, and: "Follow your review process and output format."
Number every finding the agents returned. Send them to review-finding-verifier in batches of up to 5, all batches in one message. Each finding carries the agent that raised it, file:line, the claim, the failure scenario, and the suggested fix; include the goal brief in batches with spec-compliance findings.
Keep CONFIRMED findings and drop REJECTED ones. Apply a severity change only when the verifier gives evidence for it. Don't argue a rejection back in unless the verifier's evidence is plainly wrong about the code.
.claude/skills/README.md says a convention change updates its doc, the skill that writes it and the agent that reviews it together. Check the diff for:
README.md (or docs/setup/).Report misses as Medium findings, found by "docs check".
## Code Review
**Reviewed by:** review-spec-compliance, review-security, review-durability (7 findings, 2 rejected in verification)
### Blocking
**#1: Upgrade path trusts loopback behind a proxy** `server.ts:171`
A tunnelled WebSocket upgrade arrives from cloudflared on loopback, but gateUpgrade() is called without the tunnel socket's mark, so a remote client gets loopback trust.
Failure: any client through Connect opens /ws/terminal with no device token.
Fix: pass `tunnel: isTunnelSocket(req.socket)` to authorize() for upgrades, as gateRequest does.
_Found by: review-security_
### High
...
No "Code review" section is needed in the PR body: the gate goes by AgentOS's own review of the head, not by anything the body says.
The agents carry the detail; this is the short list. (The orchestrator's own independent reviewer gets the agents' "Rules" sections from the base branch as its checklist, so a rule written there is checked twice.)
lib/security/gate.ts; loopback trust needs a loopback peer, a loopback Host and no proxy header (proxied()); tailnet trust needs Tailscale's interface and IPs; device tokens are hashed at rest; actions that mint devices or open the network need local trust; approvals of hard lines need a fresh WebAuthn assertion bound to that ask; any exception in the auth path denies.execFile/spawn with an argument array, never a shell string with interpolated input; -- before user-supplied git refs or paths; tmux calls pass -S and the target explicitly.untrusted() and redacted; it never becomes a command, a path or a tool argument without validation.--match-head-commit at the sha that was judged; hard lines go to ask_saad, never around it; the reviewer subprocess has no shell, no settings from the PR, no MCP.NODE_ENV; no reliance on the author's machine (real ~/.agent-os, LibreSSL, tmux socket, limits.json).