Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify prompt and remove redundancy #48

Closed
kmesiab opened this issue Jan 4, 2024 · 0 comments
Closed

Simplify prompt and remove redundancy #48

kmesiab opened this issue Jan 4, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@kmesiab
Copy link
Owner

kmesiab commented Jan 4, 2024

Repetition of You will... on each line of the prompt is superflous. The prompt should be optimized for both token spend and instruction quality.

prompt := `
You are a helpful software developer.
Attached below is a diff of a pull request.
You will review the diff for bugs and common mistakes.
You will review the diff for best practices according to its language.
You will review the diff for security vulnerabilities.
You will review the diff for performance issues.
You will review the diff for readability.
You will review the diff for maintainability.
You will review the diff for testability.
You will review the diff for scalability.
You will review the diff for extensibility.
You will review the diff for reusability.
You will review the diff for modularity.
You will review the diff for simplicity.
You will produce a concise code review and output it in markdown.
Break all lines before 60 characters.

ChatGPT 3.5 suggests this change:

 Please review the pull request's diff for the following aspects:

Bugs and common mistakes
Best practices specific to the language used
Security vulnerabilities
Performance issues
Readability
Maintainability
Testability
Scalability
Extensibility
Reusability
Modularity
Simplicity
Once you've completed the review, provide a concise code review summary in markdown format. Remember to break lines before 60 characters.

ChatGPT 4 suggests:

Please review the attached pull request diff with the following considerations in mind:

Bug Detection: Identify any bugs or common mistakes.
Best Practices: Evaluate adherence to language-specific best practices.
Security: Check for potential security vulnerabilities.
Performance: Assess any performance issues.
Readability: Ensure the code is easily understandable.
Maintainability: Consider long-term maintainability.
Testability: Evaluate ease of testing.
Scalability: Assess scalability potential.
Extensibility: Check for extensibility features.
Reusability: Determine code reusability.
Modularity: Evaluate the modularity of the code.
Simplicity: Ensure the code is not overly complex.
Provide a comprehensive code review in markdown format, ensuring line breaks before 60 characters for readability.

A better prompt altogether:

## Code Review Request

**Pull Request Overview**:
- Brief description of changes:
- Purpose and scope of the PR:

**Specific Concerns**:
- Highlight areas needing detailed review:
- Any complex logic or new implementations:

**Security Aspects**:
- Security-sensitive sections of the code:

**Performance Considerations**:
- Performance-critical sections:

**Readability and Maintainability**:
- Feedback on naming conventions, structure, and comments:

**Testing**:
- Description of testing done:
- Suggestions for additional tests:

**Dependencies**:
- New or changed dependencies:

**Compliance with Best Practices**:
- Review of compliance with language/framework best practices:

**Documentation**:
- Review of updated/added documentation:

**Questions for Reviewers**:
- Any specific questions or areas where feedback is sought:

%s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant