Code Review Comment Drafter
Free to download on every platform. Comes pre-installed on BotFone, BotPad and BotFlip — with extra free apps included.
About this app
WHAT IT DOES
AI-powered code review comment drafter that creates constructive, clear comments for code reviews and pull requests. The script reads code or pull request context from the current page—code snippets, diff, PR description, comments, and file paths—and generates a draft code review comment. The AI produces a helpful comment that can be a suggestion, a question, a requested change, or an approval based on the context. You can customize the comment type (suggestion/question/change_required/approval), tone (constructive/technical/friendly), length, and toggle inclusion of code examples and explanations. The user reviews the output before copying or using it.
WHERE IT RUNS
Works on all code review and pull request pages (match pattern *://*/*), including GitHub PRs, GitLab merge requests, Bitbucket PRs, Gerrit reviews, and any page containing code review or pull request content.
HOW TO USE
Install the script and navigate to any code review or pull request page. The Code Review Comment Drafter appears in the panel. Configure your comment type, tone, length, and toggle inclusion of code examples and explanations using the settings controls. Click "Draft Comment" to analyze the current page. The AI extracts code and PR context and generates a constructive review comment. Review the output in the panel. Click "Copy to Clipboard" to copy the comment for use in the review thread. Adjust the settings and regenerate if you want a different type or tone.
REAL MECHANISM: DOM CONTENT EXTRACTION WITH AI REVIEW COMMENT DRAFTING AND REVIEW GATE
This script uses a hybrid extraction approach that prioritizes structured content when available. First, it checks for WebMCP (navigator.modelContext), a W3C proposal that exposes structured tools on the page. If available, it calls getContent() to obtain structured review data. If WebMCP is not present—the common case today—it falls back to DOM scraping using targeted selectors for code review sections (pr-description, pull-request-description, diff-content, code-diff, file-changes, comment-thread, review-comment, code-comment, file-header, code-block, and line-comment). It also extracts code blocks from pre code, .highlight, and .code elements. The extracted text is sent to an AI backend via GM_xmlhttpRequest, which processes it with a system prompt that includes the user's comment type, tone preference, length, and inclusion preferences. The AI returns a draft comment (80-200 words depending on the selected length) that is constructive, clear, and matches the selected purpose. The response is displayed in a bordered container for review before copying. Copy-to-clipboard uses GM_setClipboard. All settings (commentType, tone, length, includeCodeExample, includeExplanation) are persisted via GM_setValue. The script enforces a review-before-use pattern: the user must read and approve the AI output before copying it.
THE PANEL
Drag the panel anywhere on screen by clicking and holding the header. It snaps to screen edges when released. Collapse it to a small bubble by clicking the minimize button, and expand it back by clicking the bubble. Resize the panel from any corner. Press Escape to close the configuration panel. Your position and size preferences are saved automatically per site.
PLEASE NOTE
This script requires the free BotGentz browser extension and an active AI subscription for the drafting service. AI-generated comments should be reviewed for accuracy and appropriateness before posting—the AI may misinterpret code context or suggest changes that don't apply. The script reads the current page content and sends it to the AI backend for processing; no data is stored or logged. Websites change frequently; if the script stops detecting code review content, check for updates to the extraction selectors.