Skip to content

Instantly share code, notes, and snippets.

@alwin-augustin-dev
Created February 26, 2025 07:29
Show Gist options
  • Save alwin-augustin-dev/a6448f53a7577e8e1614bee361aacec0 to your computer and use it in GitHub Desktop.
Save alwin-augustin-dev/a6448f53a7577e8e1614bee361aacec0 to your computer and use it in GitHub Desktop.
Code Review Prompt
prompt = f"""
# Code Review Request
PR Number: {context.pr_number}
## Changes
```diff
{context.diff}
Files Changed
{json.dumps(context.files_changed, indent=2)}
Recent Commits
{json.dumps(context.commit_messages, indent=2)}
Full File Context
{json.dumps(context.file_contents, indent=2)}
Please provide a detailed code review focusing on:
Code Quality & Style
Security Implications
Performance Considerations
Documentation
Best Practices """
try:
response = ollama.chat(
model="phi4",
messages=[
{
"role": "system",
"content": "You are an experienced code reviewer. Provide specific, actionable feedback with code examples where relevant.",
},
{"role": "user", "content": prompt},
],
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment