Commit f48cdad
authored
Keep plan-pr-batch goal prompts under 4000 chars (#4025)
Fixes #4024
## Summary
- Keep the ready `$pr-batch` goal prompt under 4000 characters by moving
bulky detail into the Batch Plan.
- Require a measured goal prompt character count in `$plan-pr-batch`
output.
- Add a split fallback and self-check coverage for template size,
oversized detail handling, and prompt self-containment.
## Validation
- `ruby .agents/skills/plan-pr-batch/scripts/check_goal_prompt_size.rb`
-> `goal_prompt_template_chars=2040`, `oversized_candidate_chars=15677`,
`split_fallback_goal_prompt_chars=1939`
- `ruby -cw
.agents/skills/plan-pr-batch/scripts/check_goal_prompt_size.rb` ->
`Syntax OK`
- `git diff origin/main --check` -> passed
- `script/ci-changes-detector origin/main` -> documentation-only;
recommended CI jobs: none
- `(cd react_on_rails && BUNDLE_GEMFILE=../Gemfile bundle exec rubocop)`
-> 218 files inspected, no offenses
- `codex review --base origin/main` -> accepted one P2 about
self-contained prompts, fixed it, rerun clean
## CI / Labels
Labels: none. This is process tooling/docs only and the detector
recommends no CI expansion.
Confidence note:
- Validated: command list above, plus pre-commit hooks on the amended
commit.
- Evidence: local command output and clean branch review.
- UNKNOWN: none.
- Residual risk: low; limited to the prompt-size workflow contract.
Decision points: 0
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Documentation and agent-skill tooling only; no runtime product code,
auth, or data paths.
>
> **Overview**
> Tightens **`$plan-pr-batch`** so handoff prompts stay under **4000
characters** (not bytes): planners must measure only the fenced body,
print `Goal prompt character count: N characters`, move bulky audit text
into the Batch Plan, and if still over budget emit **only the first
ready goal** with omitted items listed in the plan.
>
> The **Goal Prompt** template is slimmed (e.g. `Scope summary`,
one-line item fields) and long **Execution rules** are compressed while
keeping merge authorization, coordination, and UNKNOWN reporting. Batch
Plan format adds a **Prompt sizing** line.
>
> Adds **`check_goal_prompt_size.rb`**, which extracts the template from
`SKILL.md`, pins required phrases, asserts template and split-fallback
prompts stay under the limit, and simulates an oversized batch. A
**Self-Check** section documents running it after skill edits.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
acea61e. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Documentation**
* Tightened goal-prompt sizing rules: character counts now measure only
the fenced prompt body (excluding fence lines) and require `Goal prompt
character count: N characters` after the fence.
* If too large, shrink via batch planning; if still oversized, split
into smaller goals and emit only the first ready goal while listing
omitted ready items in the batch plan.
* Updated execution/coordination instructions and the batch plan
formatting, and added a “Self-Check” section.
* **New Features**
* Added a Ruby validation script to verify the fenced goal-prompt
template and split-fallback variants stay within a 4,000-character limit
and output character-count diagnostics.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Agent Merge Confidence
Mode: accelerated-rc
Current head SHA: acea61e
Score: 9/10
Auto-merge recommendation: yes
Affected areas: agent workflow/process tooling; no runtime product code
CI detector: `script/ci-changes-detector origin/main` ->
documentation-only changes; recommended CI jobs: none
Checks: `gh pr checks 4025` -> 22 pass, 20 skipped, 0 pending, 0
failing. Skips are explained by the CI selector/detector for
docs/process-only changes.
Validation run:
- `ruby .agents/skills/plan-pr-batch/scripts/check_goal_prompt_size.rb`
-> `goal_prompt_template_chars=2040`, `oversized_candidate_chars=15677`,
`split_fallback_goal_prompt_chars=1939`
- `ruby -cw
.agents/skills/plan-pr-batch/scripts/check_goal_prompt_size.rb` ->
`Syntax OK`
- `git diff origin/main --check` -> passed
- `(cd react_on_rails && BUNDLE_GEMFILE=../Gemfile bundle exec rubocop)`
-> 218 files inspected, no offenses
- `codex review --base origin/main` -> accepted one P2 about
self-contained prompts, fixed it, rerun clean
Review/check gate:
- GitHub checks: complete for
`acea61e07b28b43adf3bcdb48a627f62e1cf7165`; no failed or pending checks
- Review threads: live GraphQL unresolved count is 0
- Feedback triage: stale CodeRabbit/Claude/Codex/Cursor findings were
either fixed or resolved; no current unresolved non-trivial concern
remains
- Current-head reviewer verdicts:
- `claude-review` check: success for
`acea61e07b28b43adf3bcdb48a627f62e1cf7165`
([run](https://github.com/shakacode/react_on_rails/actions/runs/27516264076),
[job](https://github.com/shakacode/react_on_rails/actions/runs/27516264076/job/81325409388))
- Cursor Bugbot: pass for current head
- CodeRabbit: pass for current head
- Stale reviewer verdicts, advisory only:
- CodeRabbit requested changes on
`805e618b0eaa079f45fc2c7a1be2dc7137ad55fd`, then later approved an older
intermediate head; not cited as a merge gate
Labels: none. Process tooling/docs change; CI detector recommends no CI
expansion.
Known residual risk: low; limited to future agent prompt-sizing
behavior, covered by the added validator and local checks.
Merge recommendation: merge now by squash.
Finalized by: `claude-review` GitHub check, Claude Code Review run
`27516264076` / job `81325409388`, completed successfully for current
head `acea61e07b28b43adf3bcdb48a627f62e1cf7165`.1 parent 5abe360 commit f48cdad
2 files changed
Lines changed: 158 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
175 | 176 | | |
176 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
177 | 187 | | |
178 | | - | |
| 188 | + | |
179 | 189 | | |
180 | 190 | | |
181 | 191 | | |
| |||
202 | 212 | | |
203 | 213 | | |
204 | 214 | | |
| 215 | + | |
| 216 | + | |
205 | 217 | | |
206 | 218 | | |
207 | 219 | | |
208 | 220 | | |
209 | | - | |
| 221 | + | |
| 222 | + | |
210 | 223 | | |
211 | 224 | | |
212 | 225 | | |
| |||
215 | 228 | | |
216 | 229 | | |
217 | 230 | | |
| 231 | + | |
218 | 232 | | |
219 | 233 | | |
220 | 234 | | |
| |||
224 | 238 | | |
225 | 239 | | |
226 | 240 | | |
227 | | - | |
228 | | - | |
229 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
230 | 244 | | |
231 | | - | |
232 | | - | |
233 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
234 | 248 | | |
235 | 249 | | |
236 | 250 | | |
237 | | - | |
| 251 | + | |
238 | 252 | | |
239 | 253 | | |
240 | 254 | | |
| |||
243 | 257 | | |
244 | 258 | | |
245 | 259 | | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
Lines changed: 123 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
0 commit comments