# Senior Python Code Reviewer & Debugger

> Reviews, debugs, and refactors Python code like a senior engineer: root-cause diagnosis, the smallest safe fix, tests, security checks, and a clear handoff.

Senior Python Code Reviewer & Debugger is a free AI agent skill on Agensi by Qasim Khan, in Code Quality & Review. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Qasim Khan](https://www.agensi.io/creators/qasim-khan)
- Category: [Code Quality & Review](https://www.agensi.io/skills/code-quality-review)
- Version: 1.0
- Last updated: 2026-12-05
- Security: scan passed (2026-12-05); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/senior-python-code-reviewer-debugger
- Tags: coding, python, code-review

## What it does

- Diagnoses the root cause of a bug, not just the symptom
- Proposes the smallest safe fix instead of a full rewrite
- Adds typing, tests, and error handling only where they actually help
- Reviews code for security issues (injection, unsafe deserialization, secrets in logs)
- Writes a regression test for every bug it fixes
- Delivers a severity-ranked review or a clean patch, your choice

## Who it's for

- **Developers stuck on a bug:** Get the root cause and a minimal fix with a regression test. Try: "Here's a traceback — find the bug and fix it."
- **Teams doing code review:** Get a severity-ranked review, not a nitpick list. Try: "Review this pull request for correctness and security."
- **Engineers refactoring legacy code:** Get the smallest safe change, not a rewrite. Try: "Refactor this function for readability without changing behavior."

## About this skill

The problem it solves

Generic code help tends to either rewrite far more than asked or miss the actual root cause behind a bug. This skill operates as a pragmatic senior engineer: understand the contract first, diagnose from evidence, then make the smallest safe change — preserving intended behavior unless a change is explicitly requested.

How it works

Understands the contract (inputs, outputs, Python version, constraints), inspects existing code and tests before changing anything, diagnoses from evidence (distinguishing confirmed cause from hypothesis), proposes the smallest safe fix, adds typing and error handling where they clarify the contract, writes tests for the actual behavior/bug, assesses security, measures performance by benchmarking, and delivers a handoff summary with risks and follow-ups.

Frameworks & tools

pytest-first for testing; standard-library solutions preferred over frameworks when sufficient; idiomatic practices include pathlib, context managers, no mutable default arguments, parameterized SQL, no hardcoded credentials.

Why this beats prompting it yourself

Has five distinct output modes (Explain / Patch / Review / Design / Debug), each with its own deliverable shape — code reviews are severity-ranked with location, impact, fix, and a regression test per finding, and it never claims to have run code or tests unless it actually did.

Use cases

- Debugging a traceback down to the root cause
- Code review before merging a pull request
- Refactoring legacy code without changing behavior
- Security review of code handling user input, subprocess calls, or SQL

Known limitations

Can't execute code itself unless the host agent provides a code-execution tool — without one, it gives you commands to run rather than claiming results it didn't verify.

## Requires

- Python
- Optional: Code execution / sandbox tool (to run pytest and linters)

Without a code-execution tool, it won't claim to have run tests — it gives you the exact commands to run yourself.

## Technical details

Pure SKILL.md package (no dependencies itself). Ships references/review-checklist.md, references/project-layouts.md, templates/code-review.md and templates/bug-report.md (required deliverables), examples/example-review.md, and tests/quality-tests.md. Works on any supplied Python code — no required runtime. If a terminal/code-execution tool is connected, runs pytest and linters directly and reports real results; otherwise supplies exact commands to run. Supports Python 3.8+ idioms by default.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Senior Python Code Reviewer & Debugger skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What does Senior Python Code Reviewer & Debugger do?

Reviews, debugs, and refactors Python code like a senior engineer: root-cause diagnosis, the smallest safe fix, tests, security checks, and a clear handoff.

### Which AI agents support Senior Python Code Reviewer & Debugger?

This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

### How do I use Senior Python Code Reviewer & Debugger?

Connect your AI agent to Agensi through MCP, then ask it to use Senior Python Code Reviewer & Debugger on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
