Skip to content

Chore: update AI review prompt#4632

Closed
katspaugh wants to merge 1 commit intodevfrom
prompt
Closed

Chore: update AI review prompt#4632
katspaugh wants to merge 1 commit intodevfrom
prompt

Conversation

@katspaugh
Copy link
Copy Markdown
Member

The robot talks too much.

@github-actions
Copy link
Copy Markdown
Contributor

Branch preview

⏳ Deploying a preview site...

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review by ChatGPT

6. Stay Brief: If no clear issues are identified or the concerns are minor, keep feedback minimal or state that no significant issues were found.

Output should be focused, practical, and devoid of redundant commentary. Stick to 260 characters per comment.
I'm not happy with my code. As a Senior AI Sofrware Architecht, how would you refactor it?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Certainly! To improve the code and make it more effective, consider the following refactoring suggestions:

  1. Event Types:

    • If the decision to monitor only the opened event is confirmed, clearly document the reasoning. If additional events (reopened, synchronize) might be relevant, consider keeping them to ensure comprehensive monitoring of PR changes.
  2. Prompt Refinement:

    • The provided prompt is too vague for an AI model to give specific feedback. Maintain the detailed guidelines you initially had, as they provide clear instructions for the AI's task. Here’s an improved version that incorporates the initial structure with clarity:
permissions:

on:
  pull_request:
    types: [opened, reopened, synchronize]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: AI Code Review
        env:
          MODEL: gpt-4o
          PROMPT: |
            As a Senior AI Software Architect, review the code changes in this pull request with these guidelines:
            1. **Focus on Issues**: Identify logical errors, best practice violations, or improvement opportunities; limit feedback on unchanged code unless impacted by the pull request changes.
            2. **Actionable Suggestions**: Offer specific, applicable recommendations for refactoring or fixes, emphasizing DRY and SOLID principles.
            3. **Conciseness**: Deliver feedback succinctly, avoiding unnecessary commentary, with a limit of 260 characters per comment.
            4. **Avoid Praise**: Provide constructive criticism without commendation unless contextually necessary for understanding.
            5. **Enabling Simplicity**: Suggest simplifications to code structure and logic to avoid complexity in components and functions.
  1. Modularization & Best Practices:

    • Break down large functions into smaller, more manageable ones, applying the Single Responsibility Principle. This makes the code easier to test and maintain.
    • Review variable and function names to ensure they are descriptive and convey intent clearly.
  2. Documentation:

    • Enhance inline documentation to improve readability and maintainability of the code for future developers who might work on it.
  3. Testing & Validation:

    • Ensure that any changes include updated tests if applicable. Adding unit tests or integrating to existing test frameworks could increase reliability.

These recommendations aim to enhance code clarity, maintainability, and alignment with software architecture principles.

@katspaugh katspaugh closed this Dec 10, 2024
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 10, 2024
@katspaugh katspaugh deleted the prompt branch February 7, 2025 08:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant