Give skill gh access, auto-fix formatting, tighten GAPS.md#774
Give skill gh access, auto-fix formatting, tighten GAPS.md#774
Conversation
Four concrete hardenings to make upstream-release-docs PRs
land-ready without human pre-merge cleanup:
1. Grant `gh` CLI to both skill invocations via claude_args
`--allowed-tools "Bash(gh:*)"`. GH_TOKEN is already in the job
env. Without this, Claude Code's default Bash allowlist blocks
gh and the skill has to work from commit messages only, missing
most of the "why" narrative that PR authors write at open time.
The skill is already designed (SKILL.md) to use gh release view,
gh pr view, gh api compare — we're just unblocking it.
2. Rewrite the Phase 2 step 4 instruction. Previously: "SKIP
writing the why/consumer narrative and append to GAPS.md" —
which guaranteed a "Gaps needing human context" section on
every substantive release. Now: fetch PR descriptions via gh,
write best-effort narrative directly in the docs, defer to
GAPS.md only when rationale demonstrably cannot be derived
from available sources.
3. Tighten the GAPS.md contract. Explicitly exclude environment
limitations (the skill's v0.23.1 run flagged "npm run build
blocked" as a gap — that's not a content gap, PR CI handles
it) and "not a gap" commentary. Require each entry to include
a paste-ready "Helper prompt for local Claude" block so a
reviewer can resolve the gap by pasting into their local
Claude Code rather than reverse-engineering what to ask.
Require no GAPS.md file at all when nothing is genuinely
deferred.
4. Add an auto-fix step after skill_review that runs
`npx prettier --write` and `npx eslint --fix` against
skill-touched files (scoped by git diff vs a pre-skill SHA,
excluding auto-generated reference paths). The skill sandbox
doesn't include these, so formatting drift was landing on PR
CI — v0.23.1 failed the Lint and format checks job on one
file. This matches the project's pre-commit hook behavior for
human contributions.
Also updated:
- Top-of-file comment block (was "Runs the upstream-release-docs
skill (3 passes)").
- The PR body template text at the previous "each ran twice
(three total passes)" line — stale since PR #764 split the
multi-pass inline design into two separate claude-code-action
invocations. Now describes the two-Opus-session architecture.
- The "fill them in before merging" review-guidance text now
points reviewers to the Helper prompt blocks.
- skill_review prompt now explicitly tells the editorial pass
not to touch GAPS.md / NO_CHANGES.md signal files.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR hardens the upstream-release-docs GitHub Actions workflow so Renovate-driven upstream release PRs land with fewer manual fixups, by enabling richer upstream context retrieval and enforcing post-skill formatting.
Changes:
- Grants the Claude skill sessions
ghCLI access so they can fetch upstream PR/issue context for “why” narratives. - Updates the Phase 2 instructions to prefer writing best-effort rationale directly into docs and only create
GAPS.mdwhen truly unavoidable (with paste-ready helper prompts). - Adds a scoped Prettier/ESLint autofix step for files touched by the skill and updates PR-body guidance text accordingly.
| CHANGED=$(git diff --name-only "$BASELINE_SHA..HEAD" -- \ | ||
| ':!docs/toolhive/reference/cli/' \ | ||
| ':!docs/toolhive/reference/crds/' \ | ||
| ':!static/api-specs/' \ | ||
| 2>/dev/null | \ | ||
| grep -E '\.(md|mdx|ts|tsx|js|jsx|mjs|cjs|css|json|jsonc|yaml|yml)$' || true) |
There was a problem hiding this comment.
In the autofix step, git diff --name-only ... -- ':!docs/... uses only negative pathspecs. In git, exclude pathspecs need at least one positive pathspec (commonly .) to match against; otherwise the result set can be empty and the formatter would never run. Add an explicit include pathspec (e.g., -- . ':!docs/...), or switch to filtering out excluded prefixes after collecting the full changed-file list.
| Run /docs-review over every file the previous commit | ||
| changed (use `git show --name-only HEAD` or `git diff | ||
| --name-only HEAD~1 HEAD` to find them). Apply every | ||
| actionable fix per the skill's standard guidance. |
There was a problem hiding this comment.
The skill_review prompt tells Claude to find changed files via git show --name-only HEAD / git diff --name-only HEAD~1 HEAD, but at this point in the workflow there hasn't been a post-skill commit yet (the commit happens later in the separate Commit and push step). Those commands will reflect only the last committed refresh/pre-workflow state and can cause docs-review to miss the actual skill output. Update the instructions to derive the file list from the working tree (e.g., git diff --name-only against HEAD, or git status --porcelain), or explicitly commit skill output before running skill_review.
Four hardenings to make upstream-release-docs PRs land-ready without human pre-merge cleanup. Triggered by gaps surfaced in the first full end-to-end run on PR #759.
1. Grant the skill
ghCLI accessThe skill is designed (see
.claude/skills/upstream-release-docs/SKILL.md) to usegh release view,gh pr view, andgh api comparethroughout its phases. Claude Code's default Bash allowlist insideclaude-code-actionwas blockinggh, so the skill fell back to working from commit messages and the local clone only. This missed most of the "why" narrative that PR authors write at open time.Fix: add
--allowed-tools "Bash(gh:*)"toclaude_argson both theskill_genandskill_reviewinvocations.GH_TOKENis already in the job env.2. Rewrite the Phase 2 step 4 instruction
Previously we instructed the skill to skip writing the "why"/consumer narrative and route every major-feature gap into
GAPS.md. That guaranteed a "Gaps needing human context" section on every substantive release, even when the information was fetchable.Now: fetch PR descriptions via
gh pr view, write a best-effort narrative directly in the docs, and defer toGAPS.mdonly when rationale demonstrably cannot be derived from available sources (internal design doc, multiple plausible consumer narratives, release-timeline confirmation needed from product team, etc.).Reviewers refine "why" prose in normal review — that's the standard path for any PR, and it's lower-friction than requiring pre-merge context collection.
3. Tighten the
GAPS.mdcontractThe v0.23.1 run produced a
GAPS.mdthat included:Explicitly exclude the latter two categories from
GAPS.md. Require noGAPS.mdat all when nothing is genuinely deferred.Every
GAPS.mdentry must now include a paste-ready Helper prompt for local Claude block:A reviewer resolves the gap by pasting the prompt into their local
claudesession. No reverse-engineering "what to ask" required.4. Auto-fix prettier/eslint after the skill runs
npx prettier --writeandnpx eslint --fixaren't in the skill's sandbox, so formatting drift was landing on PR CI. On PR #759 this failed the "Lint and format checks" job on a single file until a human pushed a prettier fix.Added an
autofixstep afterskill_reviewthat:git diff --name-only <pre-skill-sha>..HEADdocs/toolhive/reference/cli/,docs/toolhive/reference/crds/,static/api-specs/) so we don't fight generators.mdx/.ts/.tsx/.js/.jsx"Apply prettier and eslint fixups to skill output") if anything changed — clean history shows skill → formatterMatches what the project's pre-commit hook does for human commits.
Also updated
claude-code-actioninvocations.skill_reviewprompt explicitly tells the editorial pass not to touchGAPS.md/NO_CHANGES.mdsignal files (those are handed to later workflow steps, not part of the docs).Testing
The real test is the next Renovate-opened upstream PR (or a manual
workflow_dispatch). Expected outcomes for that run:GAPS.mdGAPS.mdis present, every entry includes a Helper promptLint and format checksfailure on the resulting PR