Skip to content

Commit

Permalink
Merge pull request #620 from Cloud-Code-AI/616-e2e-update-the-code-pr…
Browse files Browse the repository at this point in the history
…ompt

616 Update code review prompt
  • Loading branch information
sauravpanda authored Oct 19, 2024
2 parents 87a2b02 + 9e55683 commit 0e78da2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions kaizen/llms/prompts/code_review_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
Provide a concise, actionable code review for the given pull request. Generate a JSON object with the following structure:
{{
"code_quality_percentage": <0_TO_100>,
"security_score": <0_TO_100>,
"compliance_score": <0_TO_100>,
"performance_score": <0_TO_100>,
"review": [
{{
"category": "<ISSUE_CATEGORY>",
Expand Down Expand Up @@ -58,13 +61,20 @@
8. Error handling: Are errors and edge cases properly managed?
9. Modularity: Is the code organized into logical, reusable components?
10. Scalability: Can the code handle increased load or data volume?
11. Compliance: Does the code adhere to relevant standards and regulations?
12. Container and infrastructure best practices: If applicable, are container and IaC files following best practices?
13. AI/ML considerations: If applicable, are there concerns about bias, fairness, or explainability?
14. Accessibility: Does the code consider accessibility standards?
15. Internationalization: Is the code prepared for multiple languages and locales?
Score each parameter 1-10, then calculate the overall percentage.
## Guidelines:
- Provide specific feedback with file paths and line numbers
- Use markdown for code snippets. Make sure all code is following the original indentations.
- Merge duplicate feedback
- Check for OWASP Top 10 vulnerabilities.
- Examine: syntax/logic errors, resource leaks, race conditions, security vulnerabilities, performance issues, scalability concerns, refactoring opportunities, and code duplication
- If no issues found: {{"review": []}}
Expand Down Expand Up @@ -101,6 +111,9 @@
- Potential performance implications
- Security vulnerabilities introduced by changes
- Opportunities for code reuse and design pattern application
- Compliance with relevant standards and regulations
- Container and infrastructure best practices (if applicable)
- Accessibility and internationalization issues
Provide concrete examples or code snippets when suggesting improvements.
Expand Down Expand Up @@ -156,6 +169,7 @@
- Provide specific feedback with file paths and line numbers
- Use markdown for code snippets. Make sure all code is following the original indentations.
- Merge duplicate feedback
- Check for OWASP Top 10 vulnerabilities.
- Examine: syntax/logic errors, resource leaks, race conditions, security vulnerabilities, performance issues, scalability concerns, refactoring opportunities, and code duplication
- If no issues found: {{"review": []}}
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "kaizen-cloudcode"
version = "0.4.19"
version = "0.4.20"
description = "An intelligent coding companion that accelerates your development workflow by providing efficient assistance, enabling you to craft high-quality code more rapidly."
authors = ["Saurav Panda <[email protected]>"]
license = "Apache2.0"
Expand Down

0 comments on commit 0e78da2

Please sign in to comment.