Draft Punks keeps sprawling CodeRabbit reviews manageable. It collects every review comment into a Markdown worksheet, guides you through accepting or rejecting each note, and blocks pushes until every decision is documented.
- Harvest CodeRabbit review threads into a local worksheet with
{response}placeholders. - Fill each placeholder with an Accepted or Rejected response (plus rationale).
- A pre-push hook refuses to let you push until the worksheet is complete.
- The Apply Feedback workflow pushes your decisions back to GitHub once you commit the worksheet.
CodeRabbit can outpace any reviewer—its comments arrive so quickly that GitHub’s UI becomes noisy and easy to ignore. Draft Punks enforces a rhythm: every comment must be heard, answered, and resolved before code merges. Instead of skimming threads, you work from a single Markdown score where each instrument (comment) gets a clear response.
- Seed workflow copies CodeRabbit comments from a pull request into
docs/code-reviews/PR*/<comment>.mdworksheets. - You review the worksheet locally, marking every comment’s
{response}block as Accepted or Rejected and adding rationale. - Pre-push hook (
tools/hooks/pre-push-draft-punks.sh) scans staged worksheets. Empty{response}placeholders or missing decisions trigger a failed push. - Apply workflow (
tools/review/apply_feedback_to_github.py) reads the completed worksheets and updates the original GitHub review threads with your decisions.
- GitHub repository with CodeRabbit enabled on pull requests.
- Ability to run GitHub Actions workflows.
- Local git hooks enabled (Draft Punks ships one) and Python 3.9+ for the tool scripts.
- Add the workflows. Copy the two workflow files below into
.github/workflows/on your repository’s default branch. - Commit the Draft Punks toolkit. Include the
docs/code-reviews/directory and thetools/scripts from this repository. - Open a pull request. CodeRabbit leaves feedback as usual.
- Run the seed workflow. On
opened,reopened, orsynchronizeevents the action builds worksheets indocs/code-reviews/PR<id>/. - Pull the branch locally and open each worksheet. Replace every
{response}placeholder with an Accepted or Rejected block (examples below). - Stage changes and push. The pre-push hook blocks incomplete worksheets; fix any flagged sections and try again.
- Watch the Apply workflow. On pushes that touch
docs/code-reviews/**.md, the GitHub Action posts your responses back to the corresponding review threads.
Add these GitHub Actions to your repository. Update uses: versions as Draft Punks releases new tags.
# .github/workflows/draft-punks-seed.yml
name: Seed Review Worksheet
on:
pull_request_target:
types: [opened, reopened, synchronize]
jobs:
seed:
uses: flyingrobots/draft-punks/.github/workflows/seed-review.yml@v1.0.0
secrets: inherit# .github/workflows/draft-punks-apply.yml
name: Apply Feedback
on:
push:
paths: ['docs/code-reviews/**.md']
jobs:
apply:
uses: flyingrobots/draft-punks/.github/workflows/apply-feedback.yml@v1.0.0
secrets: inherit- Copy
tools/hooks/pre-push-draft-punks.shinto.git/hooks/pre-push(or source it from your hook manager). - Ensure
tools/review/apply_feedback_to_github.pyis executable (chmod +x). - Export
GITHUB_TOKENwhen running local scripts that access the API. - Keep the
docs/code-reviews/directory in version control; the workflows read and write to these files.
Every worksheet entry mirrors a CodeRabbit thread. Replace each {response} with one of the templated blocks below.
> [!info]- **Accepted**
> **What changed:** Fixed indentation in commit def5678
> **Lesson learned:** Consistent spacing improves readability
> **Prevention:** Added pre-commit hook for formatting> [!warning]- **Rejected**
> **Rationale:** Performance cost outweighs marginal benefit
> **Trade-offs:** Maintainability over micro-optimization
> **Future consideration:** Revisit if profiling shows bottleneckTips:
- Keep explanations concise; reviewers should learn why you accepted or declined a change.
- When rejecting, reference data (benchmarks, specs) whenever possible.
- Commit the worksheet alongside any code changes that address the feedback.
The pre-push script inspects staged Markdown files in docs/code-reviews/. You will see output like:
❌ Review worksheet issues detected:
- docs/code-reviews/PR123/abc1234.md: contains unfilled placeholder '{response}'
- docs/code-reviews/PR123/abc1234.md: section missing Accepted/Rejected decisionSet HOOKS_BYPASS=1 git push to bypass in emergencies, but consider that a last resort—the gate is the only thing preventing unresolved feedback from slipping through.
- Script path:
tools/review/apply_feedback_to_github.py - Expects
GITHUB_TOKENwith permission to update pull request comments. - Filters for
docs/code-reviews/**.mdfiles whose names contain"docs/code-reviews/PR". - On success, the workflow replays each worksheet entry to the matching GitHub review thread and marks it resolved when appropriate.
If the workflow exits with a non-zero status, check the action logs for:
- Missing or malformed worksheet sections.
- Authentication failures (token not set or insufficient scopes).
- API rate limiting.
- No worksheets appear. Confirm the seed workflow ran on your PR and that GitHub Actions has access to CodeRabbit’s comment API.
- Pre-push hook never runs. Verify the hook file is executable and located at
.git/hooks/pre-push(or configured in your hook manager). - Script crashes locally. Ensure Python 3.9+ is on your PATH and that files use ASCII quotes (see
READMEfix history!). - Apply workflow posts duplicates. Make sure you commit updated worksheets only once; avoid rewriting history without rerunning the seed workflow.