Skip to content

Creative Apps : copilot-code-reviewer #51

@Pawan1979

Description

@Pawan1979

Track

Creative Apps (GitHub Copilot)

Project Name

copilot-code-reviewer

GitHub Username

Pawan1979

Repository URL

https://github.com/Pawan1979/copilot-code-reviewer

Project Description

CodeReview Agent is an AI-powered chatbot assistant that reviews your code in real time using GitHub Copilot Chat. It detects bugs, security vulnerabilities, and code smells — and suggests clean, refactored alternatives along with ready-to-use unit test stubs.

Designed for developers who want instant, actionable code feedback without waiting for a PR review.

Demo Video or Screenshots

Image

Primary Programming Language

Python

Key Technologies Used

-Visual Studio Code
-Visual Studio code Github Copilot Chat
-Open AI LLM

Submission Type

Individual

Team Members

No response

Submission Requirements

  • My project meets the track-specific challenge requirements
  • My repository includes a comprehensive README.md with setup instructions
  • My code does not contain hardcoded API keys or secrets
  • I have included demo materials (video or screenshots)
  • My project is my own work with proper attribution for any third-party code
  • I agree to the Code of Conduct
  • I have read and agree to the Disclaimer
  • My submission does NOT contain any confidential, proprietary, or sensitive information
  • I confirm I have the rights to submit this content and grant the necessary licenses

Quick Setup Summary

  1. Clone the repo
    git clone https://github.com/pawan1979/codereview-agent.git
    cd codereview-agent
  2. Install dependencies
    pip install -r requirements.txt
  3. Set your Open AI Key
    cp .env.example .env

Edit .env and add your OPENAI_API_KEY

  1. Run the agent

Interactive chat mode

python agent.py

Review a specific file

python agent.py --file path/to/your/code.py

Review an inline snippet

python agent.py --code "def divide(a,b): return a/b"

Save review to JSON (great for CI pipelines)

python agent.py --file app.py --output review.json

Technical Highlights

CodeReview Agent is an AI-powered chatbot assistant that reviews your code in real time using GitHub Copilot Chat. It detects bugs, security vulnerabilities, and code smells — and suggests clean, refactored alternatives along with ready-to-use unit test stubs.

Designed for developers who want instant, actionable code feedback without waiting for a PR review.


✨ Features

Feature | Description -- | -- 🐛 Bug Detection | Identifies logic errors, null pointer risks, edge cases 🔒 Security Scanning | Flags SQL injection, hardcoded secrets, unsafe I/O 💡 Refactoring Tips | Suggests cleaner, more idiomatic rewrites 🧪 Test Stubs | Generates pytest/unittest stubs automatically 📂 File Review | Review any local file directly from the CLI 💬 Chat Mode | Conversational REPL — ask follow-up questions 🔁 CI Integration | Single-shot mode for use in GitHub Actions pipelines


🏗️ Architecture

copilot-code-reviewer/
└── agent.py # Core agent: CodeReviewAgent class + CLI
└── test_agent.py # pytest test suite (10+ tests)
├── instructions.md # GitHub Copilot repo instructions
└── ci.yml # CI pipeline (Python 3.10/3.11/3.12)
├── .env.example # Credential template
├── requirements.txt
└── README.md

How it uses GitHub Copilot

The agent connects to GitHub's Models Inference endpoint (https://models.inference.ai.azure.com) using your GITHUB_TOKEN. This is the production GitHub Copilot Chat API — the same one powering Copilot in VS Code and the CLI.

User Input


CodeReviewAgent (Python)
│ Builds structured prompt with SYSTEM_PROMPT + conversation history

GitHub Copilot Chat API ──► gpt-4o (or gpt-4o-mini)


Structured Review Output
📋 Summary | 🐛 Issues | 💡 Suggestions | ✅ Refactor | 🧪 Tests

Challenges & Learnings

Learned how Github Copilot can help to write a complex application from vibe coding.

Contact Information

www.linkedin.com/in/ pawankumarshukla Vanity URL name

Country/Region

India

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions