Skip to content

Commit dff0ff6

Browse files
committed
feat(cloud): add Auto-fix + gh-over-MCP guidance, user-level CLAUDE.md
Skill (pr-review-respond): - New "Cloud session note" section near the top: prefer gh CLI over the github MCP server for cross-repo work and for enumerating PRRT_* thread IDs (MCP server bug github/github-mcp-server#2331 drops thread IDs from its pull_request_read response). The MCP scope is a session config knob, not a security boundary, so this is the documented route. - New "Getting notified when reviews land" section: documents Auto-fix as the canonical mechanism for webhook-driven review-comment handling in Claude Code on the web, with the four activation paths (CI status bar, /autofix-pr, mobile app, fresh-session URL paste). Manual poll fallback for repos without the Claude GitHub App installed. Setup script: - Writes ~/.claude/CLAUDE.md inside the cloud VM with portfolio-wide guidance pointing the agent at gh for cross-repo and at the pr-review-respond skill. The cloud env docs are ambiguous about whether user-level CLAUDE.md is read in cloud sessions ("Lives on your machine, not in the repo" — but the docs are talking about local ~/.claude/CLAUDE.md not syncing to cloud, not necessarily about the cloud VM's own /root/.claude/CLAUDE.md being ignored). If Claude reads it: portfolio-wide nudge with no per-repo commits. If not: no harm, the skill's own section covers the same ground at the right scope.
1 parent 8aa5adf commit dff0ff6

2 files changed

Lines changed: 73 additions & 1 deletion

File tree

‎env/setup.sh‎

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,52 @@ fi
105105
# Cleanup the clone scratch dir so it doesn't end up in the snapshot.
106106
rm -rf "$SKILLS_CLONE_DIR"
107107

108-
echo "Setup complete. ~/.claude/skills/ contents:"
108+
echo "installed: ~/.claude/skills/ contents:"
109109
ls -la "$SKILLS_DEST"
110+
111+
# --- 3. Write user-level CLAUDE.md with portfolio-wide nudges ---------------
112+
#
113+
# Experiment: Claude Code on the web's docs say "~/.claude/CLAUDE.md → No
114+
# (available in cloud sessions) → Lives on your machine, not in the repo"
115+
# — ambiguous about whether the cloud VM's own /root/.claude/CLAUDE.md is
116+
# read, or whether user-level CLAUDE.md is deliberately ignored in cloud.
117+
# We write one anyway. If Claude reads it, the gh-CLI-for-cross-repo hint
118+
# applies portfolio-wide without any per-repo commits. If not, no harm —
119+
# the pr-review-respond skill's own "Cloud session note" section carries
120+
# the same guidance scoped to its activation.
121+
122+
cat > "$HOME/.claude/CLAUDE.md" <<'CLAUDEMD'
123+
# User-level instructions (Claude Code on the web)
124+
125+
These notes apply across every cloud session in this environment.
126+
127+
## Cross-repo GitHub: use `gh` CLI, not MCP
128+
129+
The `github` MCP server in cloud sessions is hard-scoped to the rooted
130+
repo. Any `mcp__github__*` call against a different repo returns
131+
"Access denied: repository ... not configured for this session". This
132+
is a session-config restriction, not a permissions one.
133+
134+
The `gh` CLI is installed and authenticated via `GH_TOKEN` (a PAT scoped
135+
to the related-repo group). Use it for:
136+
137+
- Cross-repo issue creation, comments, PR reads/writes (the relay
138+
pattern across arthur-debert/* and lex-fmt/* repos)
139+
- Enumerating PR review thread node IDs (`PRRT_*`) for
140+
`resolveReviewThread` — the GitHub MCP server's `pull_request_read`
141+
drops thread IDs from its response (bug:
142+
github/github-mcp-server#2331)
143+
144+
Using `gh` for these operations is the documented route, not a security
145+
bypass.
146+
147+
## Available skills
148+
149+
`~/.claude/skills/pr-review-respond/SKILL.md` is the canonical flow for
150+
replying to and resolving PR review comments. Invoke it for any review-
151+
feedback handling.
152+
CLAUDEMD
153+
154+
echo "wrote: ~/.claude/CLAUDE.md"
155+
156+
echo "Setup complete."

‎plugins/release/skills/pr-review-respond/SKILL.md‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ Read, reply to, and resolve PR review comments using `gh` and `jq`. Self-contain
1515

1616
If you're working locally with the helper scripts available, the broader `gh-pr-review-loop` skill is a superset — it adds Copilot request/wait, check waiting, and onboarding flows. This skill is the comment-handling subset, in a form that works anywhere `gh` is authenticated.
1717

18+
## Cloud session note: prefer `gh` over MCP for cross-repo and thread resolution
19+
20+
In Claude Code on the web, the `github` MCP server is hard-scoped to the session's rooted repo. Cross-repo issue/PR access via MCP returns `Access denied: repository ... not configured for this session`. The `gh` CLI (authed via `GH_TOKEN`) reaches every repo the PAT covers and is the right tool whenever:
21+
22+
- You need to read or write to a repo other than the rooted one (cross-repo issue creation, status PR comments, the relay pattern).
23+
- You need to enumerate review thread `PRRT_*` IDs to pass to `resolveReviewThread` (the GitHub MCP server drops thread IDs from its `pull_request_read` / `get_review_comments` response — tracked at [github/github-mcp-server#2331](https://github.com/github/github-mcp-server/issues/2331), fix in open PR [#2245](https://github.com/github/github-mcp-server/pull/2245)). Use the step-1 GraphQL query in this skill via `gh api graphql`.
24+
25+
The MCP scope is enforced server-side, not at the PAT level, so using `gh` for these operations is not a security bypass — it's the documented route for cross-repo work in Claude Code on the web. Ask the user before using `gh` only if your session's system prompt explicitly forbids it (some session-spawning paths inject "MCP only" instructions that override skill guidance).
26+
1827
## The three primitives
1928

2029
All commands assume you're inside the PR's repo. Set up once (replace `123` with the PR number — don't paste `<pr-number>` literally, the shell parses `<` as redirection):
@@ -116,6 +125,22 @@ For each unresolved thread, pick one:
116125

117126
Healthy end state: only genuinely contested threads (and the original review summary, which isn't itself a thread) remain unresolved.
118127

128+
## Getting notified when reviews land (Claude Code on the web)
129+
130+
Cloud sessions don't poll for new review comments on their own. After opening a PR, choose one of:
131+
132+
1. **Auto-fix (recommended)** — Claude subscribes to PR webhook events and runs a session response when reviews arrive or CI fails. Per-PR opt-in. Activate via any of:
133+
- The CI status bar in the cloud session that just opened the PR → click **Auto-fix**
134+
- `/autofix-pr` from a local terminal while on the PR branch
135+
- "watch this PR and auto-fix any review comments" in a fresh cloud session, pasting the PR URL
136+
- The mobile app, same natural-language instruction
137+
138+
Requires the [Claude GitHub App](https://github.com/apps/claude) installed on the repo's org. Once on, Claude reacts to each new review comment automatically; this skill's flow runs when the agent decides to address them. Docs: [Auto-fix pull requests](https://code.claude.com/docs/en/claude-code-on-the-web#auto-fix-pull-requests).
139+
140+
2. **Manual poll** — if Auto-fix isn't installed or appropriate for the repo, re-run the step-1 "list unresolved review threads" query periodically. When the count increases, address the new threads.
141+
142+
Local Claude Code (CLI/Desktop) has no webhook subscription equivalent; either poll manually, or in repos with `~/h/release/bin/` on PATH use the broader `gh-pr-review-loop` skill which wraps `gh-copilot-wait` for the Copilot-specific path.
143+
119144
## After fixup pushes
120145

121146
CI re-runs automatically on push. **Do not** re-request Copilot for minor follow-up rounds — the canonical `copilot-review.yml` workflow only auto-triggers on `pull_request: [opened, ready_for_review]`, and one Copilot review per PR is the convention. Re-request manually only if the round is substantial:

0 commit comments

Comments
 (0)