Skip to content

[codex] Add generic PR-batch continuation prompt - #49

Merged
justin808 merged 14 commits into
mainfrom
jg-codex/generic-pr-batch-continuation
Jul 1, 2026
Merged

[codex] Add generic PR-batch continuation prompt#49
justin808 merged 14 commits into
mainfrom
jg-codex/generic-pr-batch-continuation

Conversation

@justin808

Copy link
Copy Markdown
Member

Summary

  • Add a canonical saved clipboard prompt for continuing PR-batch closeout from pasted handoffs, final-bucket tables, PR URLs, or GitHub shorthand refs.
  • Route pr-batch, plan-pr-batch, restart, and skill-usage docs to the canonical continuation/resume prompts.
  • Extend the plan-pr-batch prompt-size guard to pin the continuation wording and pressure scenarios.

Validation

  • ruby skills/plan-pr-batch/scripts/check_goal_prompt_size.rb
  • bin/validate

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@justin808, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 25 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 090f2608-fc40-4f8b-a696-6f8512f6623c

📥 Commits

Reviewing files that changed from the base of the PR and between 65841d2 and 003db60.

📒 Files selected for processing (8)
  • bin/install-agent-workflows-test.bash
  • bin/validate
  • docs/agent-runner-restarts.md
  • docs/pr-batch-skills.md
  • skills/plan-pr-batch/SKILL.md
  • skills/plan-pr-batch/scripts/check_goal_prompt_size.rb
  • skills/pr-batch/SKILL.md
  • workflows/pr-processing.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jg-codex/generic-pr-batch-continuation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread workflows/pr-processing.md Outdated
Comment thread docs/agent-runner-restarts.md
Comment thread skills/plan-pr-batch/scripts/check_goal_prompt_size.rb Outdated
@claude

claude Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review summary

This PR adds a canonical "Generic PR-Batch Continuation Prompt" to workflows/pr-processing.md, routes several skill docs to it, and extends check_goal_prompt_size.rb to validate the canonical wording. Overall the change is well-scoped and the goal (a single saved prompt for resuming PR-batch closeout from handoffs) is sound. Found 3 issues, left as inline comments — most-severe first:

  1. workflows/pr-processing.md:1106-1107 (portability) — The new "pressure scenarios" hardcode specific, real-looking PR numbers (#4259, #4260, #4277, #4278, #4282, #4283, #4281, #4268, #4266, #4264) directly into a shared, generic workflow file, and check_goal_prompt_size.rb now hard-fails CI unless that exact text is present. AGENTS.md's Editing Rules ask shared skills/workflows to avoid baking in consumer-repo-specific references; these sequential numbers read like they came from one real repo's tracker rather than generic placeholders (cf. OWNER/REPO#123 used elsewhere in the same prompt). Recommend swapping in clearly-generic numbers.

  2. docs/agent-runner-restarts.md:61-71 — Replaces the prior "copy the exact prompt text... to keep a single authoritative source" guidance with a third inline literal copy of the "Resume batch processing now." prompt. check_goal_prompt_size.rb only validates the copy in workflows/pr-processing.md, never this file, so the two copies can silently drift with nothing in bin/validate catching it.

  3. skills/plan-pr-batch/scripts/check_goal_prompt_size.rb:119-129 (minor) — Adds two more near-identical "abort if phrase missing" loops, bringing the total to four copy-pasted variants; could be factored into a shared helper. Also inconsistent: the resume snippet is checked via exact full-text match while the continuation snippet is checked only via fragmented substrings, so prose reordering would go undetected for the latter but not the former.

🤖 Generated with Claude Code

Comment thread workflows/pr-processing.md Outdated
Comment thread workflows/pr-processing.md
Comment thread skills/plan-pr-batch/scripts/check_goal_prompt_size.rb Outdated
@claude

claude Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Summary

Reviewed the diff for correctness, security, portability, and shell/Ruby helper safety. This is a docs/skills-only change (no behavior in bin/ scripts touched); overall it's well-scoped and the new check_goal_prompt_size.rb guard is a nice piece of engineering — it enforces exact-text sync between the canonical continuation/resume snippets in workflows/pr-processing.md and docs/agent-runner-restarts.md, and actively blocklists a set of consumer-specific PR numbers from leaking into the shared workflow doc, which is exactly the kind of portability guard AGENTS.md calls for.

I verified:

  • The new #generic-pr-batch-continuation-prompt anchor and its relative-path links from docs/pr-batch-skills.md and skills/pr-batch/SKILL.md resolve correctly.
  • All CANONICAL_CONTINUATION_SNIPPET_PHRASES / PRESSURE_SCENARIOS / CANONICAL_RESUME_SNIPPET strings in the Ruby script match the prose in workflows/pr-processing.md and docs/agent-runner-restarts.md verbatim.
  • merge_authority: ask in the new prompt is a valid enum value (none | ask | auto_merge_when_gates_pass), not a stray placeholder.
  • The abbreviated preflight bullets in the new prompt (vs. the fuller untrusted-input/trust-config language in the canonical $pr-batch goal-prompt shape) are fine, since $pr-batch's own SKILL.md already carries the authoritative untrusted-input/pr-security-preflight rules and is loaded regardless of what the pasted prompt says.

Left 3 minor/nit inline comments, nothing blocking:

  1. The new "Generic PR-Batch Continuation Prompt" section is nested under "Pausing For An Agent-Runner Restart" even though it's explicitly for continuing from any pasted handoff, not just post-restart recovery — worth its own top-level heading for clarity.
  2. The bounded-status-recovery resume snippet dropped the "(.agents/workflows/pr-processing.md in consumer repos)" pointer that a sibling cross-reference a few lines up still keeps, making it inconsistent with the rest of the doc.
  3. CONSUMER_SPECIFIC_EXAMPLE_REFS in check_goal_prompt_size.rb is an unexplained magic list of PR numbers — a short comment or a more general check would make the guard's intent clearer and more durable.

@justin808
justin808 marked this pull request as ready for review July 1, 2026 03:53

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f1cbf9383f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/plan-pr-batch/scripts/check_goal_prompt_size.rb Outdated
Comment thread skills/plan-pr-batch/scripts/check_goal_prompt_size.rb
@claude

claude Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review

This PR adds a canonical, self-contained "Generic PR-Batch Continuation Prompt" to workflows/pr-processing.md, routes pr-batch/plan-pr-batch/restart-docs/skill-usage docs to it, and hardens check_goal_prompt_size.rb to enforce byte-for-byte sync of the restart resume snippet and the new continuation prompt/pressure-scenario wording, while explicitly guarding against leaking consumer-specific example refs (e.g. #4259) into the canonical workflow text.

I verified by hand (Bash execution of ruby/python3 was sandboxed in my session, so I cross-checked via grep/Read instead of running the script directly):

  • The CANONICAL_RESUME_SNIPPET constant in check_goal_prompt_size.rb matches, character-for-character, the resume snippet now duplicated in both workflows/pr-processing.md:1034-1036 and docs/agent-runner-restarts.md:66-68.
  • Every phrase in CANONICAL_CONTINUATION_SNIPPET_PHRASES and PRESSURE_SCENARIOS is present verbatim in the new #### Generic PR-Batch Continuation Prompt section.
  • All new/updated cross-file markdown links (docs/pr-batch-skills.md, skills/pr-batch/SKILL.md, skills/plan-pr-batch/SKILL.mdworkflows/pr-processing.md#generic-pr-batch-continuation-prompt) resolve to the correct relative paths and anchor slug.
  • No occurrences of the CONSUMER_SPECIFIC_EXAMPLE_REFS (real PR numbers like #4259) remain in any of the touched files — good, the new content uses only generic placeholders (#101-#105, OWNER/REPO#123, etc.), consistent with the "no hardcoded consumer refs" rule in AGENTS.md.
  • bin/validate already runs check_goal_prompt_size.rb, so this new guard is wired into CI.

One finding, left as an inline comment: the new CONSUMER_SPECIFIC_EXAMPLE_REFS leak-guard (lines 141-145) only scans workflow_text (workflows/pr-processing.md), not docs/agent-runner-restarts.md, either SKILL.md, or docs/pr-batch-skills.md — all of which now carry related continuation-prompt wording. A future edit could reintroduce a consumer-specific ref into one of those and this check wouldn't catch it.

No security, performance, or shell/Ruby-safety issues found — the script only reads local repo files (no shell-out, no user input, no eval), and no files under bin/ or skills/*/bin/ are touched by this PR. Everything else looks clean and well-guarded.

Comment thread workflows/pr-processing.md Outdated
@claude

claude Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Summary

Reviewed the diff (docs/agent-runner-restarts.md, docs/pr-batch-skills.md, skills/plan-pr-batch/SKILL.md, skills/plan-pr-batch/scripts/check_goal_prompt_size.rb, skills/pr-batch/SKILL.md, workflows/pr-processing.md).

Overall: This is a docs/prompt-only change (plus a Ruby validation guard) that adds a canonical "Generic PR-Batch Continuation Prompt" and routes several skill docs to it. Portability looks good — no hardcoded consumer-repo commands, labels, branches, or paths were introduced; the placeholder PR numbers (#101-#105, #201-#205) used in the pressure-scenario examples are explicitly enforced to stay placeholders by check_goal_prompt_size.rb's ALLOWED_PRESSURE_SCENARIO_REFS allowlist, which is a nice touch. Markdown anchors/relative links for the new cross-references all resolve correctly. I manually diffed the new CANONICAL_RESUME_SNIPPET / CANONICAL_CONTINUATION_SNIPPET_PHRASES / PRESSURE_SCENARIOS constants in the Ruby script against the actual prose in workflows/pr-processing.md and docs/agent-runner-restarts.md — they match byte-for-byte, so the drift guard should pass (I could not execute the script directly in this sandboxed session to confirm at runtime).

One inline finding: the new "Terminal states allowed" list in the continuation prompt (workflows/pr-processing.md) omits ready-gates-clean, which is one of the 7 canonical completion states used consistently everywhere else in this repo. See inline comment for the failure scenario this could cause.

No other bugs, security issues, or performance concerns found — the changes are documentation/prompt text plus a self-contained validation script with no shell/eval risk.

Comment thread skills/plan-pr-batch/scripts/check_goal_prompt_size.rb
@claude

claude Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review summary

Reviewed the diff for correctness, portability, and Ruby helper safety.

Portability — The new Generic PR-Batch Continuation Prompt and the edited resume snippet stay generic (placeholder OWNER/REPO#123/#101-style refs, no hardcoded consumer commands, labels, branches, or paths). The edit to the resume snippet in docs/agent-runner-restarts.md/workflows/pr-processing.md actually improves portability by dropping the consumer-specific .agents/workflows/pr-processing.md aside. Good adherence to the AGENTS.md editing rules for this diff.

Ruby helper (check_goal_prompt_size.rb) — Left one inline comment: read_repo_file for workflows/pr-processing.md has no existence guard, unlike the skill_path read just above it, so a missing file raises an unhandled Errno::ENOENT instead of the script's usual clean FAIL: message. Otherwise the new drift-detection logic (canonical resume snippet exact-match, continuation-prompt phrase checks, pressure-scenario placeholder-ref allowlist) is internally consistent — I traced every required phrase and the pressure-scenario markers against the actual workflows/pr-processing.md content and they line up.

Minor nit (non-blocking)skills/plan-pr-batch/SKILL.md's new pointer to the continuation prompt (workflows/pr-processing.md) is plain text, while the equivalent references in skills/pr-batch/SKILL.md and docs/pr-batch-skills.md use a clickable relative anchor link (../../workflows/pr-processing.md#generic-pr-batch-continuation-prompt). Not a bug, just an inconsistency in navigability.

Note (out of scope for this PR)check_goal_prompt_size.rb's pre-existing fixture data (unchanged by this PR) hardcodes https://github.com/shakacode/react_on_rails/issues/... example URLs. That predates this PR and isn't part of this diff, but flagging since it's a consumer-repo reference in a shared skill script per the AGENTS.md portability rule — may be worth a follow-up to replace with a placeholder org/repo.

No security or performance concerns — this PR only touches Markdown docs and a local validation script that reads repo files; no new external input handling.

@claude

claude Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review

Focused, low-risk change: adds a canonical saved continuation prompt for PR-batch closeout and hardens check_goal_prompt_size.rb to guard against drift between the workflow doc, the restart-docs snippet, and the skill prompt templates. Went through the diff line by line plus the surrounding context (installer behavior, AGENTS.md seam rules, related SKILL.md files).

Portability — clean. No consumer-repo commands, labels, branches, or release trackers are hardcoded in any of the changed skills//workflows/ text. The new continuation prompt and cross-links (workflows/pr-processing.md#generic-pr-batch-continuation-prompt) are generic and consistent with the existing .agents/workflows/pr-processing.md seam convention used elsewhere in the repo.

Script correctness (skills/plan-pr-batch/scripts/check_goal_prompt_size.rb) — the new bin/validate-presence heuristic for making the docs/agent-runner-restarts.md drift check optional is a reasonable way to distinguish "running from the source checkout" (which has bin/validate and the docs file) from "running from an installed pack" (<target>/workflows/* is installed, but docs/* and bin/validate are not, per docs/installation-and-upgrades.md). Verified the exact canonical snippets and required phrases match the corresponding prose in workflows/pr-processing.md / docs/agent-runner-restarts.md word-for-word, and the pressure-scenario ref allowlist (#101-#105, #201-#205) matches what's actually in the doc. No logic bugs found. (Wasn't able to execute the Ruby script directly in this sandbox — approval for ruby invocations was denied — so this is from static reading rather than an actual run; worth confirming ruby skills/plan-pr-batch/scripts/check_goal_prompt_size.rb and bin/validate are green in CI.)

Nit (pre-existing, unrelated to this diff)check_goal_prompt_size.rb's oversized-fixture generator (lines ~188/196, unchanged by this PR) hardcodes shakacode/react_on_rails issue URLs. Since this PR substantially expands this same script and the repo's own editing rules call out avoiding consumer-repo paths in shared skill code, it'd be a good opportunity for a follow-up to swap that for a placeholder org/repo. Not blocking, and GitHub wouldn't let me anchor an inline comment to those unchanged lines.

No security, performance, or shell-safety concerns — this PR touches only Markdown prose and one Ruby validation script (no shell scripts), and doesn't shell out, read untrusted input, or write outside the repo.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bca2cbed38

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread workflows/pr-processing.md Outdated
Comment thread workflows/pr-processing.md Outdated
Comment thread workflows/pr-processing.md Outdated
Comment thread skills/plan-pr-batch/scripts/check_goal_prompt_size.rb Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 211f5ba9d3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/pr-batch/SKILL.md Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef74558d0b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/plan-pr-batch/scripts/check_goal_prompt_size.rb Outdated
Comment thread docs/pr-batch-skills.md Outdated
Comment thread skills/plan-pr-batch/scripts/check_goal_prompt_size.rb Outdated
Comment thread skills/plan-pr-batch/scripts/check_goal_prompt_size.rb
@claude

claude Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Summary

This PR adds a canonical "Generic PR-Batch Continuation Prompt" to workflows/pr-processing.md, routes pr-batch/plan-pr-batch/restart docs to it, and extends check_goal_prompt_size.rb to pin/verify that the prompt text, the restart resume snippet, and the pressure-scenario placeholders don't drift or leak real (non-placeholder) PR numbers.

Portability check (AGENTS.md "Editing Rules"): the new/changed prose in docs/, skills/*/SKILL.md, and workflows/pr-processing.md stays generic — no hardcoded consumer commands, labels, branches, or paths were introduced. The pre-existing react_on_rails fixture URLs in the validator's test fixtures are untouched by this diff, so out of scope here. The new ALLOWED_PRESSURE_SCENARIO_REFS guard is a nice mechanism to actively prevent real PR numbers from leaking into the shared workflow doc as examples.

Two findings from a close read of skills/plan-pr-batch/scripts/check_goal_prompt_size.rb (posted inline):

  1. skills/plan-pr-batch/scripts/check_goal_prompt_size.rb:163-165 — The new source-checkout detection uses File.exist?(REPO_ROOT/"bin/validate") as a proxy for "am I in the source repo." This holds for a full install-agent-workflows install (which never ships bin/validate), but AGENTS.md also permits "repository-pinned copies" of skills//workflows/ directly into a consumer repo root. A consumer repo that happens to have its own unrelated bin/validate and pins this skill without vendoring docs/agent-runner-restarts.md would get a confusing hard-abort unrelated to anything they changed. Worth using a less incidental signal.
  2. skills/plan-pr-batch/scripts/check_goal_prompt_size.rb:14-37CANONICAL_CONTINUATION_SNIPPET_PHRASES/PRESSURE_SCENARIOS duplicate the prompt text from workflows/pr-processing.md as ~15 separate substring checks. Any future wording tweak now needs to be mirrored exactly in two places, and a mismatch only reports "missing phrase," not what changed. An exact-block match (as already done for CANONICAL_RESUME_SNIPPET) would reduce the double-maintenance surface.

Nothing else surfaced that looked like a functional bug — the drift/self-checks in the script appear internally consistent with the doc content on a static read (I wasn't able to execute ruby in this sandbox to run it directly).

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9e5123fe43

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/plan-pr-batch/scripts/check_goal_prompt_size.rb Outdated
Comment thread skills/plan-pr-batch/scripts/check_goal_prompt_size.rb Outdated
Comment thread bin/install-agent-workflows-test.bash Outdated
@claude

claude Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Summary

Reviewed the diff for portability, shell/Ruby helper safety, and correctness of the new prompt-drift guard. Overall this is solid: the new "Generic PR-Batch Continuation Prompt" content and its Ruby drift-check (check_goal_prompt_size.rb) are exact-string-matched against workflows/pr-processing.md/docs/agent-runner-restarts.md, and I verified byte-for-byte that every pinned phrase/snippet in the script matches the corresponding markdown exactly (including the two-line CANONICAL_RESUME_SNIPPET, all CANONICAL_CONTINUATION_SNIPPET_PHRASES, and the PRESSURE_SCENARIOS text). Cross-references between skills/pr-batch/SKILL.md, skills/plan-pr-batch/SKILL.md, docs/pr-batch-skills.md, and the new ### Generic PR-Batch Continuation Prompt anchor all resolve correctly.

Portability: No hardcoded consumer-repo commands/labels/branches/paths were introduced in skills/ or workflows/ by this diff. Notably, this PR actually removes a consumer-path aside (.agents/workflows/pr-processing.md in consumer repos) from the resume snippet, which is a portability improvement. The pre-existing react_on_rails fixture URLs in check_goal_prompt_size.rb's test data are untouched by this PR, so out of scope here, but worth revisiting separately per the AGENTS.md editing rules if this file gets touched again.

Left two inline comments, both low-severity:

  1. source_checkout?'s 4-signal heuristic for "am I in the source repo" could misclassify an unusual consumer install layout (installing to the repo root itself), producing a confusing hard failure.
  2. The new bash test test_installed_prompt_guard_ignores_unrelated_target_validate doesn't actually exercise any code path that reads bin/validate — the fixture it creates isn't consulted anywhere in check_goal_prompt_size.rb, so it reads as vestigial coverage from an earlier iteration of the guard logic.

Note: I was unable to execute bin/validate, the Ruby guard script, or bin/install-agent-workflows-test.bash in this sandbox (Bash execution was blocked by the environment's approval policy), so I relied on careful static/textual verification of the exact-match logic rather than a live test run. Recommend confirming CI is green on this PR before merge.

Comment thread bin/install-agent-workflows-test.bash Outdated
@claude

claude Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review summary

This PR adds a canonical, saved-clipboard "Generic PR-Batch Continuation Prompt" to workflows/pr-processing.md, links pr-batch/plan-pr-batch/docs to it instead of letting each surface improvise continuation wording, and extends check_goal_prompt_size.rb to pin that prompt (plus the restart resume snippet and pressure scenarios) against drift between workflows/pr-processing.md, docs/agent-runner-restarts.md, and the skill.

What I checked:

  • Traced check_goal_prompt_size.rb's new source_checkout?, extract_section, and require_phrases helpers against the actual heading structure of workflows/pr-processing.md (### Generic PR-Batch Continuation Prompt at line 1071, followed by ### Cancelling Or Stopping A Batch at 1117) — the section-extraction regex terminates on the correct heading.
  • Verified the CANONICAL_RESUME_SNIPPET heredoc matches character-for-character in both workflows/pr-processing.md and docs/agent-runner-restarts.md, and confirmed all CANONICAL_CONTINUATION_SNIPPET_PHRASES/PRESSURE_SCENARIOS substrings are present verbatim in the new workflow text.
  • Checked relative links (../../workflows/pr-processing.md, ../workflows/pr-processing.md#generic-pr-batch-continuation-prompt, etc.) against the actual install layout (bin/install-agent-workflows creates $target/skills, $target/workflows, $target/bin) — the .. depth is correct from every referencing file, and the anchor is unique repo-wide (no -1 suffix collision).
  • Portability: the new prompt/doc text is generic (placeholder refs like #101#105, OWNER/REPO#123); the one hardcoded string in the script, "shakacode/agent-workflows", is used only to detect "am I running inside the source repo" (for the docs-drift check), not as a consumer-repo value, so it doesn't violate the AGENTS.md "no hardcoded consumer repo values in shared skills" rule. Nice catch removing the previously-hardcoded `.agents/workflows/pr-processing.md` in consumer repos aside from the source workflow — that was itself a portability smell.
  • Ran through the new bash test (test_installed_prompt_guard_ignores_unrelated_target_validate) and the ruby script logic for the source_checkout vs. installed-copy branches (present/absent docs/agent-runner-restarts.md) — behavior matches the test's expectations.

No correctness, security, or performance issues found. One minor nit posted inline: a new bash test doesn't actually exercise the behavior its name implies, since check_goal_prompt_size.rb never touches bin/validate.

Comment thread skills/plan-pr-batch/scripts/check_goal_prompt_size.rb
Comment thread bin/install-agent-workflows-test.bash Outdated
@claude

claude Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Summary

Reviewed for portability, correctness, shell/Ruby helper safety, and general code quality.

Portability: The new "Generic PR-Batch Continuation Prompt" and its routing changes across docs/pr-batch-skills.md, skills/plan-pr-batch/SKILL.md, and skills/pr-batch/SKILL.md stay generic — no hardcoded consumer-repo labels, branches, or paths were introduced. (Note: skills/plan-pr-batch/scripts/check_goal_prompt_size.rb already contained hardcoded shakacode/react_on_rails example URLs in its fixture data before this PR — pre-existing, not introduced here, but worth a follow-up if this repo wants to hold itself to its own portability rule.)

Design: The AGENT_WORKFLOWS_SOURCE_CHECKOUT env-gated drift check is a reasonable way to avoid false failures on customized docs in installed/consumer copies, and the new bin/install-agent-workflows-test.bash test correctly exercises that an unset env var + unowned docs still passes.

Left two inline comments on issues worth addressing:

  1. Doc/enforcement gap in skills/plan-pr-batch/scripts/check_goal_prompt_size.rb — the skill's own documented "Self-Check" command no longer matches what bin/validate/CI actually enforce (missing AGENT_WORKFLOWS_SOURCE_CHECKOUT=1), so a contributor following the docs could get a false "All checks passed." on drifted restart docs.
  2. Dead code / misleading test name in bin/install-agent-workflows-test.bash — the new test creates and chmods a $target/bin/validate stub that's never called.

No security or performance concerns found; shell scripts use set -euo pipefail and proper quoting throughout.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5efd1c12fe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread workflows/pr-processing.md Outdated
Comment thread workflows/pr-processing.md Outdated
@claude

claude Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Summary

Reviewed the full diff (docs, skills, workflows/pr-processing.md, bin/validate, bin/install-agent-workflows-test.bash, and skills/plan-pr-batch/scripts/check_goal_prompt_size.rb).

Overall: solid, well-scoped change. The new check_goal_prompt_size.rb logic is careful about portability:

  • docs/agent-runner-restarts.md is read optionally and only drift-checked against the canonical snippet when AGENT_WORKFLOWS_SOURCE_CHECKOUT=1 is set, which correctly avoids assuming an installed target's docs/ directory is owned by agent-workflows (confirmed against bin/install-agent-workflows, which never installs docs/, and against the new test_installed_prompt_guard_ignores_unowned_docs test, which exercises exactly this).
  • The new ALLOWED_PRESSURE_SCENARIO_REFS guard is a nice touch — it prevents the "Pressure scenarios" section from ever containing a real (non-placeholder) issue/PR number, which is exactly the kind of portability leak this repo's AGENTS.md Editing Rules warn about.
  • All new prose (skills/docs/workflow) uses generic OWNER/REPO#123 / <OWNER/REPO> placeholders consistent with the rest of the file; no consumer-repo-specific labels, branches, or paths were introduced.
  • REPO_ROOT is derived from __dir__, so the script works correctly whether invoked from the source repo or from an installed (copy or symlink) target.
  • Shell test additions in bin/install-agent-workflows-test.bash follow the file's existing mktemp/set +e/assert_* conventions; no quoting or injection concerns.

One non-blocking item left as an inline comment: merge_authority: ask is hardcoded as a literal value in the new "Generic PR-Batch Continuation Prompt," whereas every other merge_authority reference in the repo uses the <none | ask | auto_merge_when_gates_pass> placeholder for the operator to choose. Worth a quick confirmation of whether that's an intentional conservative default.

No security, performance, or portability blockers found.

Comment thread skills/plan-pr-batch/SKILL.md Outdated
Comment thread workflows/pr-processing.md Outdated
@claude

claude Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Summary

Reviewed with a focus on correctness, security, performance, portability of shared skills/workflows, and shell/Ruby helper safety.

Overall: solid change. The PR does what it says: adds a single canonical "Generic PR-Batch Continuation Prompt," routes pr-batch/plan-pr-batch/restart/skill-usage docs to it instead of duplicating prompt text, and extends check_goal_prompt_size.rb to pin both the resume snippet and the new continuation prompt against drift.

Portability check (the main focus area):

  • Good catch/fix: the resume snippet in workflows/pr-processing.md had its old hardcoded `.agents/workflows/pr-processing.md` in consumer repos path reference removed — that's exactly the kind of consumer-repo-specific path the shared workflows should avoid.
  • The new AGENT_WORKFLOWS_SOURCE_CHECKOUT gating in check_goal_prompt_size.rb, combined with test_installed_prompt_guard_ignores_unowned_docs in bin/install-agent-workflows-test.bash, correctly verifies that an installed copy of the guard script won't fail just because a consumer's local docs/agent-runner-restarts.md (which isn't part of the install payload — confirmed install-agent-workflows only copies skills/, workflows/, and bin/ helpers) happens to exist with unrelated content. This is a thoughtful defensive test.
  • FYI (out of scope for this diff, not flagged inline): workflows/pr-processing.md lines ~996-998, just above the section this PR touches, still hardcode `.agents/workflows/pr-processing.md#cancelling-or-stopping-a-batch` in consumer repos — the same pattern this PR removed from the resume snippet a few lines below. Might be worth a follow-up cleanup for consistency, but it predates this PR.

check_goal_prompt_size.rb (Ruby helper):

  • REPO_ROOT computation via File.expand_path("../../..", __dir__) correctly resolves to the repo root in source checkouts, to the installed target root in copy-mode installs, and to the real source repo in symlink-mode installs (since Ruby's __dir__ resolves symlinks) — verified this against install-agent-workflows's copy/symlink logic.
  • Phrase-based drift checks (CANONICAL_CONTINUATION_SNIPPET_PHRASES, PRESSURE_SCENARIOS) and the exact-match check for CANONICAL_RESUME_SNIPPET are internally consistent with the actual prompt text added in workflows/pr-processing.md.
  • The unexpected_pressure_refs check correctly guards against accidentally introducing non-placeholder PR/issue numbers into the pressure-scenario examples.

Two minor nits posted inline, both low severity:

  1. skills/plan-pr-batch/SKILL.md — the new continuation-prompt reference omits the #generic-pr-batch-continuation-prompt anchor that the other two doc updates use.
  2. workflows/pr-processing.md — the merge_authority: ask field is immediately followed by an explanatory "default" line that could read as a second, contradictory field; consider folding it into one line.

No security, correctness, or shell/Ruby safety issues found. Shell test additions follow existing conventions (quoting, set +e/set -e around capture, no unsanitized interpolation).

@claude

claude Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Summary

Reviewed the full diff (bin/install-agent-workflows-test.bash, bin/validate, docs/agent-runner-restarts.md, docs/pr-batch-skills.md, skills/plan-pr-batch/SKILL.md, skills/plan-pr-batch/scripts/check_goal_prompt_size.rb, skills/pr-batch/SKILL.md, workflows/pr-processing.md) with a focus on code quality, bugs, security, performance, portability of shared skills/workflows, and shell/Ruby helper safety.

Verdict: no blocking issues. This PR has already been through many review rounds (visible in the commit history — "Address ... review feedback", "Tighten ... guards", "Fix installed prompt guard compatibility", "Gate restart docs drift check explicitly", etc.), and the issues raised by earlier automated passes (real-looking PR numbers in pressure scenarios, missing existence guard on workflows/pr-processing.md, docs/agent-runner-restarts.md drift going unchecked, missing anchor in plan-pr-batch's link, ready-gates-clean omitted from terminal states, etc.) are all resolved in the current diff. I independently re-verified each of these against the checked-out state and confirmed the fixes.

Portability (main focus area) — clean:

  • The new "Generic PR-Batch Continuation Prompt" and all routing text in skills/pr-batch/SKILL.md, skills/plan-pr-batch/SKILL.md, and docs/pr-batch-skills.md are generic; placeholders use OWNER/REPO#123 and #101-#105/#201-#205 style refs, not real-looking numbers.
  • check_goal_prompt_size.rb's ALLOWED_PRESSURE_SCENARIO_REFS allowlist actively fails the build if a non-placeholder ref leaks into the pressure scenarios — a good durable guard.
  • The resume snippet edit actually improves portability by dropping the old hardcoded `.agents/workflows/pr-processing.md` in consumer repos aside (nice catch/fix from an earlier round).
  • Confirmed bin/install-agent-workflows only installs skills/, workflows/, and bin/ helpers — never docs/ — so the AGENT_WORKFLOWS_SOURCE_CHECKOUT-gated drift check against docs/agent-runner-restarts.md correctly only runs in the source checkout, and the new test_installed_prompt_guard_ignores_unowned_docs test correctly exercises the installed-copy case where an unrelated local docs/agent-runner-restarts.md must not fail the guard.

Ruby helper safetycheck_goal_prompt_size.rb only reads local repo files (no shell-out, no eval, no network/user-input handling). REPO_ROOT via File.expand_path("../../..", __dir__) correctly resolves in both copy-mode and symlink-mode installs. extract_section/require_phrases are straightforward string operations with clear FAIL: messages on every abort path, including the previously-missing existence guard on workflows/pr-processing.md (now present via read_repo_file).

Shell safety — the new test_installed_prompt_guard_ignores_unowned_docs test in bin/install-agent-workflows-test.bash follows the file's existing conventions (set +e/set -e around the captured command, quoted variables, no unsanitized interpolation).

Minor, non-blocking FYI (pre-existing, out of scope for this diff): check_goal_prompt_size.rb's oversized-fixture generator (unchanged by this PR) still hardcodes https://github.com/shakacode/react_on_rails/issues/... example URLs, which is technically a consumer-repo reference in a shared skill script per AGENTS.md's portability rule. Worth a follow-up to swap for a placeholder org/repo, but it predates this PR and isn't part of the current diff.

No security or performance concerns — this is a docs/prompt-text change plus a local validation script with no new external input handling.

@justin808
justin808 merged commit 13ac6de into main Jul 1, 2026
5 checks passed
@justin808
justin808 deleted the jg-codex/generic-pr-batch-continuation branch July 1, 2026 06:23
justin808 added a commit that referenced this pull request Jul 4, 2026
…h-merge-readiness-route

* origin/main:
  [codex] Make plan-pr-batch goals Codex-pasteable (#50)
  [codex] Add host adapter and Codex plugin metadata
  [codex] Add pause restart prompt skill
  [codex] Add batch titles and audit defaults
  [codex] Fix PR-batch Goal-mode completion contract (#52)
  Add strict trust mode to preflight (#48)
  [codex] Add generic PR-batch continuation prompt (#49)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant