-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Is your feature request related to a problem? Please describe.
The current PR Review Tone Assistant is a Chrome extension that empowers individual developers to improve their communication style before they post a comment. This is highly effective for users who install it.
However, it doesn't solve the problem at a team or organizational level. Team leads cannot enforce a consistent standard of communication, as adoption relies on individual developers. Harsh or unconstructive comments can still be posted by users who don't have the extension or choose to ignore its suggestions, negatively impacting team culture.
Describe the solution you'd like
I propose also looking into creating a GitHub Action that acts as a repository-level "Tone Moderator." This action would be triggered whenever a comment is posted on a Pull Request.
Proposed Workflow:
- Trigger: The action would run on
pull_request_review_commentandissue_commentevents within a PR. - Analysis: The content of the new comment (
github.event.comment.body) is sent to the backend analysis service. - Conditional Action:
- If the comment's tone is determined to be harsh or unconstructive, the Action will automatically post a reply comment.
- This reply, posted by a bot, would gently tag the original commenter and provide a more constructive phrasing, serving as a public and educational corrective measure.
Example Bot Reply:
Hi @, that's a valid technical point. To foster a more constructive review culture, could we rephrase it like this?
Suggested Tone:
"I see some areas that could be improved. Here are some suggestions to make this code more robust..."
This is an automated suggestion from the PR Review Tone Assistant. Please edit your original comment if you agree.
Describe alternatives you've considered
The primary alternative is the existing Chrome Extension.
- Chrome Extension (Author-Side Tool): Proactively helps the author write better comments. It is user-centric but relies on individual adoption.
- GitHub Action (Repo-Side Tool): Reactively moderates comments for an entire team. It ensures a consistent standard but acts after the initial comment is posted.
These two approaches are not mutually exclusive; they are complementary. The extension is a personal assistant, while the action is a team-wide safety net and moderation tool.
Additional Context
Benefits of a GitHub Action:
- Team-Wide Enforcement: Ensures all PR comments in a repository meet a certain standard of quality and tone.
- Zero-Effort Adoption for Devs: No individual installation is required. It works for everyone contributing to the repository out-of-the-box.
- Centralized Configuration: Team leads can install and configure it once at the repository level.
- Improved Security: The
OPENROUTER_API_KEYcan be stored securely as a GitHub repository secret, rather than being managed by individual users.
Initial Implementation Plan:
- Create a new workflow file (e.g.,
.github/workflows/tone-check.yml). - Define the trigger:
on: issue_comment: types: [created, edited] pull_request_review_comment: types: [created, edited]
- Add a job that performs a
curlrequest to the remote LLM server (eliminating the need of setting up a backend on your local). - Use a conditional step to trigger a subsequent action, such as
peter-evans/create-or-update-comment, to post the bot's suggestion.