Skip to content

improve(create-pr): optimize token efficiency and fix bugs via autoresearch#608

Merged
baleen37 merged 30 commits intomainfrom
autoresearch/create-pr-optimize-20260402
Apr 2, 2026
Merged

improve(create-pr): optimize token efficiency and fix bugs via autoresearch#608
baleen37 merged 30 commits intomainfrom
autoresearch/create-pr-optimize-20260402

Conversation

@baleen37
Copy link
Copy Markdown
Owner

@baleen37 baleen37 commented Apr 2, 2026

Summary

Optimize the create-pr skill for token efficiency (SKILL.md -59%) and fix 5 bugs found through
subagent testing (4 real PRs created and merged as validation).

Changes

Structural (file reduction: 6→3 files)

  • Remove unused verify-pr-status.sh (not referenced by any skill)
  • Merge sync-with-base.sh into preflight-check.sh (auto-sync when behind)
  • Inline lib.sh into preflight-check.sh (single consumer)

SKILL.md optimization (1,898→776 bytes, -59%)

  • Remove redundant sections (Overview, When to Use, Stop Conditions)
  • Extract S= path variable for script paths
  • Add "scripts MUST be run" directive (agents were reimplementing logic)
  • Add auto-merge re-enable instruction after CI fix push

Bug fixes (found via 4 subagent PR tests)

  • preflight-check.sh: use git push -u for new branches without upstream
  • wait-for-merge.sh: remove --delete-branch from fallback merge (inconsistent with SKILL.md)
  • SKILL.md: add auto-merge re-enable after CI fix (was silently failing)
  • SKILL.md: add "scripts MUST be run" (agents were skipping scripts)
  • Fix stale tests referencing deleted scripts (63/63 pass)

Tests

Test User added 30 commits April 2, 2026 20:51
…dundant comments

Result: {"status":"keep","total_bytes":6268,"line_count":183,"word_count":917}
…tighten prose

Result: {"status":"keep","total_bytes":5836,"line_count":169,"word_count":844}
Not referenced by any skill or hook. Was retained for pr-pass per spec
but pr-pass doesn't actually use it.

Result: {"status":"keep","total_bytes":4534,"line_count":141,"word_count":666}
…ync when behind)

Result: {"status":"keep","total_bytes":4019,"line_count":122,"word_count":601}
Only preflight-check.sh used lib.sh. Inlining saves a file and overhead.

Result: {"status":"keep","total_bytes":3558,"line_count":107,"word_count":541}
… inline notes

Result: {"status":"keep","total_bytes":3202,"line_count":85,"word_count":490}
Result: {"status":"keep","total_bytes":3103,"line_count":82,"word_count":471}
Result: {"status":"keep","total_bytes":2884,"line_count":68,"word_count":448}
Scripts don't load into LLM context — only SKILL.md token cost matters.

Result: {"status":"keep","skill_bytes":1081,"skill_lines":27,"skill_words":151}
…edundant sections

Remove stop conditions (obvious), trim CI failure instructions,
shorten description field.

Result: {"status":"keep","skill_bytes":802,"skill_lines":23,"skill_words":110}
Result: {"status":"keep","skill_bytes":732,"skill_lines":19,"skill_words":100}
Result: {"status":"keep","skill_bytes":675,"skill_lines":18,"skill_words":93}
Result: {"status":"keep","skill_bytes":635,"skill_lines":18,"skill_words":82}
Result: {"status":"keep","skill_bytes":605,"skill_lines":17,"skill_words":82}
… preflight

Test found: auto-merge is disabled after force-push, must re-enable.
Also: preflight sync push needs -u for new branches.

Result: {"status":"keep","skill_bytes":665,"skill_lines":17,"skill_words":92}
Test showed agent skipping preflight-check.sh and doing manual logic instead.
Added "Execute each line literally" + "scripts MUST be run" directive.

Result: {"status":"keep","skill_bytes":794,"skill_lines":20,"skill_words":109}
- Remove tests for deleted scripts (lib.sh, verify-pr-status.sh, sync-with-base.sh)
- Update preflight BEHIND test to expect auto-sync behavior
- Fix skill content test to accept code-block-only skills

Result: {"status":"keep","skill_bytes":794}
…erge

Aligns with SKILL.md's gh pr merge --auto --squash (no delete-branch).
Prevents unexpected branch deletion on fallback merge path.

Result: {"status":"keep","skill_bytes":794,"script_bytes":1802}
…heck

Branch created from main is always up-to-date with base — re-run is unnecessary.
Move main/master check before preflight for logical ordering.

Result: {"status":"keep","skill_bytes":776,"skill_lines":20,"skill_words":107}
Result: {"status":"keep","skill_bytes":776}
…r-optimize-20260402

# Conflicts:
#	.autoresearch/autoresearch.jsonl
#	.autoresearch/autoresearch.md
#	.autoresearch/dashboard.md
#	.autoresearch/worklog.md
#	plugins/me/skills/create-pr/SKILL.md
#	plugins/me/skills/create-pr/scripts/wait-for-merge.sh
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 2, 2026

Warning

Rate limit exceeded

@baleen37 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 16 minutes and 58 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 16 minutes and 58 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 774cf71b-c8ae-437a-afe8-9a078ebd6360

📥 Commits

Reviewing files that changed from the base of the PR and between d8570e6 and 2197ece.

📒 Files selected for processing (11)
  • .autoresearch/autoresearch.jsonl
  • .autoresearch/autoresearch.md
  • .autoresearch/dashboard.md
  • .autoresearch/worklog.md
  • plugins/me/skills/create-pr/SKILL.md
  • plugins/me/skills/create-pr/scripts/wait-for-merge.sh
  • test-create-pr-validation.md
  • test-edge1.md
  • test-final.md
  • test-pr-v3.md
  • test-pr-validation.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch autoresearch/create-pr-optimize-20260402

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 and usage tips.

@baleen37 baleen37 enabled auto-merge (squash) April 2, 2026 12:47
@baleen37 baleen37 merged commit fe3b97a into main Apr 2, 2026
5 checks passed
@baleen37 baleen37 deleted the autoresearch/create-pr-optimize-20260402 branch April 2, 2026 12:48
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