From f46af9afbc7f2f04dd5bb75d3b71c5d08d28dd32 Mon Sep 17 00:00:00 2001 From: james-haytko_nwx Date: Fri, 27 Feb 2026 13:39:30 -0600 Subject: [PATCH 1/3] Update reviewer prompt to use per-file subheadings Generated with AI Co-Authored-By: Claude Code --- .github/workflows/claude-documentation-reviewer.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/claude-documentation-reviewer.yml b/.github/workflows/claude-documentation-reviewer.yml index bfce1955c6..44ba738519 100644 --- a/.github/workflows/claude-documentation-reviewer.yml +++ b/.github/workflows/claude-documentation-reviewer.yml @@ -93,10 +93,10 @@ jobs: 2. Review ONLY the added or modified lines from the diff for issues per your instructions. Do not report issues on lines that were not changed. - 3. You MUST write your complete review to `/tmp/review-summary.md` — always, even if there are no issues. Use this exact structure — a flat list of issues in the format from your instructions, with no subheadings, groupings, or extra nesting: + 3. You MUST write your complete review to `/tmp/review-summary.md` — always, even if there are no issues. Use this exact structure — issues organized by file with a subheading for each file, in the format from your instructions: ## Issues in PR changes - + 4. Fix ALL issues directly in the files using the Write and Edit tools. Do not post a PR comment. Do not commit or push. From 241c635e9e44c46ddc6cf5e0199d4a16653907d1 Mon Sep 17 00:00:00 2001 From: james-haytko_nwx Date: Fri, 27 Feb 2026 13:44:58 -0600 Subject: [PATCH 2/3] Add post-processing step to guarantee preexisting issues footer Claude writes issues to /tmp/preexisting-issues.md; a shell step appends the hardcoded footer and posts the PR comment. Generated with AI Co-Authored-By: Claude Code --- .../workflows/claude-documentation-fixer.yml | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/claude-documentation-fixer.yml b/.github/workflows/claude-documentation-fixer.yml index 0461cd8103..ff94bc0f18 100644 --- a/.github/workflows/claude-documentation-fixer.yml +++ b/.github/workflows/claude-documentation-fixer.yml @@ -85,3 +85,39 @@ jobs: --model claude-sonnet-4-5-20250929 --allowedTools "Read,Write,Edit,Bash(vale:*),Bash(gh pr view:*),Bash(gh pr diff:*),Bash(gh pr comment:*),Bash(git config:*),Bash(git add:*),Bash(git commit:*),Bash(git push:*),Bash(git status:*),Bash(git diff:*)" --append-system-prompt "${{ steps.read-prompt.outputs.prompt }}" + + - name: Post preexisting issues comment + if: steps.pr-info.outputs.is_fork == 'false' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ steps.pr-info.outputs.number }} + REPO: ${{ github.repository }} + run: | + python3 << 'PYTHON_EOF' + import os + import subprocess + + summary_path = '/tmp/preexisting-issues.md' + if not os.path.exists(summary_path): + exit(0) + + with open(summary_path) as f: + body = f.read().strip() + + FOOTER = ( + "\n\n---\n\n" + "To apply the suggested fixes to preexisting issues, comment `@claude` on this PR followed by your instructions\n" + "(`@claude fix all issues` or `@claude fix only the first issue`).\n" + "Note: Automated fixes are only available for branches in this repository, not forks." + ) + + body += FOOTER + + pr_number = os.environ['PR_NUMBER'] + repo = os.environ['REPO'] + + subprocess.run( + ['gh', 'pr', 'comment', pr_number, '--repo', repo, '--body', body], + check=True, + ) + PYTHON_EOF From 3159d1af85910f90476c727add808fcbf80e18cb Mon Sep 17 00:00:00 2001 From: james-haytko_nwx Date: Fri, 27 Feb 2026 14:08:37 -0600 Subject: [PATCH 3/3] Handle both file and direct-post cases for preexisting issues footer If Claude writes to /tmp/preexisting-issues.md, post a new comment with the hardcoded footer. If Claude posts directly (bypassing the file), find that comment via the API and edit it to append the footer. Generated with AI Co-Authored-By: Claude Code --- .../workflows/claude-documentation-fixer.yml | 44 +++++++++++++------ 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/.github/workflows/claude-documentation-fixer.yml b/.github/workflows/claude-documentation-fixer.yml index ff94bc0f18..98d41ba139 100644 --- a/.github/workflows/claude-documentation-fixer.yml +++ b/.github/workflows/claude-documentation-fixer.yml @@ -95,14 +95,11 @@ jobs: run: | python3 << 'PYTHON_EOF' import os + import json import subprocess - summary_path = '/tmp/preexisting-issues.md' - if not os.path.exists(summary_path): - exit(0) - - with open(summary_path) as f: - body = f.read().strip() + pr_number = os.environ['PR_NUMBER'] + repo = os.environ['REPO'] FOOTER = ( "\n\n---\n\n" @@ -111,13 +108,32 @@ jobs: "Note: Automated fixes are only available for branches in this repository, not forks." ) - body += FOOTER + FOOTER_MARKER = "Automated fixes are only available" - pr_number = os.environ['PR_NUMBER'] - repo = os.environ['REPO'] - - subprocess.run( - ['gh', 'pr', 'comment', pr_number, '--repo', repo, '--body', body], - check=True, - ) + summary_path = '/tmp/preexisting-issues.md' + if os.path.exists(summary_path): + # Claude wrote to the file as instructed — post a new comment with footer + with open(summary_path) as f: + body = f.read().strip() + subprocess.run( + ['gh', 'pr', 'comment', pr_number, '--repo', repo, '--body', body + FOOTER], + check=True, + ) + else: + # Claude posted directly — find that comment and edit it to add the footer + result = subprocess.run( + ['gh', 'api', f'repos/{repo}/issues/{pr_number}/comments', + '--jq', '[.[] | select(.user.login == "github-actions[bot]")]'], + capture_output=True, text=True, check=True, + ) + comments = json.loads(result.stdout) + for comment in reversed(comments): + body = comment['body'] + if '## Preexisting issues' in body and FOOTER_MARKER not in body: + subprocess.run( + ['gh', 'api', f'repos/{repo}/issues/comments/{comment["id"]}', + '-X', 'PATCH', '-f', f'body={body.rstrip()}{FOOTER}'], + check=True, + ) + break PYTHON_EOF