Summary
Today no first-class `commonly_pr_diff(pr_number)` MCP tool exists. When an agent needs to review a PR's file-level diff, they have to either:
- `exec_command` shell out to `gh pr diff` (slow, burns a turn, requires gh CLI present)
- Fall back to "give me a paste" / human handoff
Impact
Surfaced during the 2026-05-23 multi-agent huddle: Cody (cloud-codex) explicitly refused to fake-review PR #434 without the file-level diff, asked Theo for it. That's the right call — but it created a coordination round-trip that a native `commonly_pr_diff` would have eliminated.
For agent-driven code review at scale, having to shell out to `gh` per PR is friction. A native tool would let any agent (any runtime) fetch the diff inline.
Fix shape
New MCP tool in `@commonlyai/mcp`:
```
commonly_pr_diff({
repo: string // "Team-Commonly/commonly"
pr: number // 436
file?: string // optional path filter
}): {
files: Array<{ path: string, additions: number, deletions: number, patch: string }>,
base_sha: string,
head_sha: string,
}
```
Backend implementation: thin proxy to GitHub's REST or GraphQL API. Reuses the runtime-tier `GITHUB_PAT` (per CLAUDE.md memory: `feedback-no-infra-leak-in-public-repo`).
Optional companion tool: `commonly_pr_view` (high-level metadata — title / state / checks / reviewers) for cases where the full diff is overkill.
Composability
This is a kernel-level affordance any agent runtime should be able to use. Add to the openclaw extension's `commonly_*` block AND to `@commonlyai/mcp` (per ADR-010). One tool, two runtimes load it.
Acceptance criteria
Companion
🤖 Generated with Claude Code
Summary
Today no first-class `commonly_pr_diff(pr_number)` MCP tool exists. When an agent needs to review a PR's file-level diff, they have to either:
Impact
Surfaced during the 2026-05-23 multi-agent huddle: Cody (cloud-codex) explicitly refused to fake-review PR #434 without the file-level diff, asked Theo for it. That's the right call — but it created a coordination round-trip that a native `commonly_pr_diff` would have eliminated.
For agent-driven code review at scale, having to shell out to `gh` per PR is friction. A native tool would let any agent (any runtime) fetch the diff inline.
Fix shape
New MCP tool in `@commonlyai/mcp`:
```
commonly_pr_diff({
repo: string // "Team-Commonly/commonly"
pr: number // 436
file?: string // optional path filter
}): {
files: Array<{ path: string, additions: number, deletions: number, patch: string }>,
base_sha: string,
head_sha: string,
}
```
Backend implementation: thin proxy to GitHub's REST or GraphQL API. Reuses the runtime-tier `GITHUB_PAT` (per CLAUDE.md memory: `feedback-no-infra-leak-in-public-repo`).
Optional companion tool: `commonly_pr_view` (high-level metadata — title / state / checks / reviewers) for cases where the full diff is overkill.
Composability
This is a kernel-level affordance any agent runtime should be able to use. Add to the openclaw extension's `commonly_*` block AND to `@commonlyai/mcp` (per ADR-010). One tool, two runtimes load it.
Acceptance criteria
Companion
🤖 Generated with Claude Code