Agent skill

Python Backend Reviewer

by Qredence in Qredence/agentic-fleet

Expert Python backend code reviewer that identifies over-complexity, duplicates, bad optimizations, and violations of best practices.

MITAuto-check passedDevelopment

Install Python Backend Reviewer

skills CLI
$ npx skills add Qredence/agentic-fleet --skill python-backend-reviewer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Qredence/agentic-fleet python-backend-reviewer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Qredence/agentic-fleet.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/python-backend-reviewer .claude/skills/python-backend-reviewer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
python-backend-reviewer
GitHub stars
111
Token cost
~3.3k tokens
SKILL.md length
1,150 words
Files
8 (incl. scripts, references)
Skills in repo
10
Repo updated
First seen
Licence
MIT

At a glance

Expert Python backend code reviewer that identifies over-complexity, duplicates, bad optimizations, and violations of best practices.

  • Works in 3 steps: Run Automated Analysis → Review Analysis Results → Apply Fixes
  • Asked to review Python code quality
  • SKILL.md covers Overview, ⚠️ Architecture-Aware…, Pragmatic Thresholds and Quick Start, plus 6 more sections
  • Runs Python scripts from its folder; calls uv and python

What it does

Python Backend Reviewer is an agent skill from Qredence/agentic-fleet. Expert Python backend code reviewer that identifies over-complexity, duplicates, bad optimizations, and violations of best practices. Use when asked to review Python code quality, check for duplicate code, analyze module complexity, optimize backend code, identify anti-patterns, or ensure adherence to best practices. Ideal for preventing AI-generated code from creating unnecessary files instead of imports, finding repeated validation logic, and catching over-engineered solutions.

Its SKILL.md is about 3.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files, including scripts and reference files (for example `references/best_practices.md`, `references/python_antipatterns.md` and `references/refactoring_patterns.md`).

It sits in Development, covering Code review and Code quality. It works with Python. The repository describes itself as: Adaptive Agentic AI Reasoning using Microsoft Agent Framework -- Join the Discord for suggestion or support ! https://discord.gg/ebgy7gtZHK. The licence is MIT.

When your agent uses it

  • Asked to review Python code quality
  • Check for duplicate code
  • Analyze module complexity
  • Optimize backend code

Example prompts

  • “/python-backend-reviewer”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Run Automated Analysis
  2. Review Analysis Results
  3. Apply Fixes

What it can do on your machine

Read from SKILL.md and the folder at commit 46a254b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 4 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • uv
    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Python Backend Reviewer loads about 3.3k tokens when it runs, and up to ~11k if it reads all its reference files. Until then it costs about 127 tokens; SKILL.md has 1,150 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~127
When it runs · the whole SKILL.md, loaded when a task matches
~3.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~11k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from Qredence/agentic-fleet at commit 46a254b, republished under its MIT licence (© Qredence). 1,150 words, ~3,336 tokens.

Download SKILL.mdSave it as .claude/skills/python-backend-reviewer/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
python-backend-reviewer
description
Expert Python backend code reviewer that identifies over-complexity, duplicates, bad optimizations, and violations of best practices. Use when asked to review Python code quality, check for duplicate code, analyze module complexity, optimize backend code, identify anti-patterns, or ensure adherence to best practices. Ideal for preventing AI-generated code from creating unnecessary files instead of imports, finding repeated validation logic, and catching over-engineered solutions.

Python Backend Code Reviewer

Expert analysis and refactoring of Python backend code to eliminate duplication, reduce complexity, and enforce best practices.

Overview

This skill helps identify and fix common issues in Python backend code, particularly problems introduced by AI code generation:

  • Duplicate code across multiple files
  • Recreated utilities instead of imports
  • Over-engineered solutions
  • High complexity functions and classes
  • Anti-patterns and code smells
  • Concurrency issues in async code (shared state mutation)

The skill provides automated analysis tools and comprehensive refactoring guidance.

⚠️ Architecture-Aware Prioritization

Static analysis finds issues, but architectural context determines priority.

Before prioritizing fixes, identify:

  1. Critical paths: Which code runs on every request?

    • WebSocket/HTTP handlers
    • Main workflow orchestration
    • Shared services/middleware
  2. Secondary paths: Less critical code

    • CLI tools
    • Scripts
    • Dev-only utilities
    • One-time migrations
  3. Concurrency model: How is state shared?

    • Are handlers concurrent?
    • Are instances shared across requests?
    • Is there mutable singleton state?

Prioritization rule: Correctness in critical paths > Complexity in secondary paths

FindingCritical PathSecondary Path
Shared state mutation🔴 Fix immediately🟡 Review
High complexity (>25)🟡 Refactor carefully🟢 Backlog
Duplicates🟡 Extract if >3 occurrences🟢 Nice to have
God class🟡 Migrate to façade🟢 Low priority

Pragmatic Thresholds

For orchestration/workflow code, use realistic thresholds:

MetricStrict ThresholdPragmatic ThresholdNotes
Cyclomatic complexity1025Orchestrators naturally have decision points
Function length50 lines150 linesAsync flows can be longer
Nesting depth45Guard clauses help more than extracting
God class methods20N/AOK if it's a façade that delegates

Hard limits (always fix):

  • No functions > 300 lines
  • No nesting > 7 levels
  • No shared-state mutation without synchronization guard

Quick Start

1. Run Automated Analysis

Start with automated tools to identify issues:

bash
# Detect duplicate code blocks
uv run python scripts/detect_duplicates.py <path>

# Analyze imports and utility reimplementation
uv run python scripts/analyze_imports.py <path>

# Check code complexity
uv run python scripts/complexity_analyzer.py <path>

# Check for concurrency issues (shared state mutation)
uv run python scripts/concurrency_analyzer.py <path>
2. Review Analysis Results

Each tool outputs:

  • Severity levels: Warnings (must fix) vs Info (should review)
  • File locations: Exact line numbers for each issue
  • Specific recommendations: What to change and why
3. Apply Fixes

Use the reference guides to refactor issues:

Main Workflows

Review a Python File

When a user asks to review a specific file:

  1. Run all analysis tools on the file:

    bash
    python scripts/detect_duplicates.py path/to/file.py
    python scripts/analyze_imports.py path/to/file.py
    python scripts/complexity_analyzer.py path/to/file.py
  2. Analyze results and categorize issues:

    • Critical: Duplicates, high complexity, security issues
    • Important: Utility reimplementation, deep nesting
    • Minor: Style issues, minor inefficiencies
  3. Provide specific fixes:

    • Quote exact code locations with line numbers
    • Show before/after examples
    • Explain why the change improves the code
  4. Offer to implement fixes if requested

Check Backend for Duplicates

When a user asks to check a project/module for duplicates:

  1. Run duplicate detection on the entire directory:

    bash
    python scripts/detect_duplicates.py src/
  2. Group duplicates by severity:

    • High: 10+ lines duplicated, 3+ occurrences
    • Medium: 5-10 lines, 2+ occurrences
    • Low: Helper functions that could be extracted
  3. Recommend consolidation strategy:

    • Extract to shared utilities for cross-cutting concerns
    • Create base classes for inherited behavior
    • Use decorators for repeated patterns
Analyze Module Over-Engineering

When code appears over-engineered:

  1. Run complexity analysis:

    bash
    python scripts/complexity_analyzer.py --max-complexity 10 --max-length 50 path/
  2. Identify over-engineering patterns:

    • Premature abstractions (base classes with one implementation)
    • Excessive configuration options
    • God classes (20+ methods)
    • Deep inheritance hierarchies
  3. Suggest simplifications:

    • Replace abstractions with simple functions
    • Remove unused configuration
    • Split god classes by responsibility
    • Flatten inheritance
  4. Reference specific patterns from python_antipatterns.md

Optimize Following Best Practices

When asked to optimize code or ensure best practices:

  1. Run all analysis tools to get baseline metrics

  2. Check against best practices:

    • DRY principle violations
    • SOLID principle violations
    • Type hint coverage
    • Error handling patterns
    • Async/await consistency
  3. Prioritize optimizations:

    • First: Correctness (bugs, security)
    • Second: Maintainability (duplicates, complexity)
    • Third: Performance (N+1 queries, inefficiencies)
    • Fourth: Style (naming, imports)
  4. Reference best_practices.md for specific guidelines

Analyze Concurrency Safety

When reviewing async code that handles concurrent requests:

  1. Run concurrency analysis:

    bash
    uv run python scripts/concurrency_analyzer.py services/ workflows/
  2. Prioritize by severity:

    • Critical: Fix before production deployment
    • Warning: Review for actual sharing patterns
    • Info: Consider but often acceptable
  3. Common fixes for shared state mutation:

    python
    # ❌ Before: Mutating shared instance state
    class Workflow:
        async def run(self, task):
            self.current_task = task  # Race condition!
    
    # ✅ After: Request-scoped state
    class Workflow:
        async def run(self, task):
            execution = ExecutionContext(task=task)
            return await self._execute(execution)
  4. Alternative patterns:

    • Pass state through parameters (preferred)
    • Use contextvars for request-scoped data
    • Use asyncio.Lock for truly shared state
    • Create new instances per request

Analysis Tools

Show full SKILL.md (490 more words)Show less
detect_duplicates.py

Finds duplicate code blocks using AST analysis.

Usage:

bash
uv run python scripts/detect_duplicates.py <path>
uv run python scripts/detect_duplicates.py --min-lines 10 <path>

Detects:

  • Duplicate functions (identical implementations)
  • Duplicate classes
  • Repeated code blocks

Options:

  • --min-lines N: Minimum lines for a block to be considered (default: 5)
analyze_imports.py

Analyzes import organization and detects recreated utilities.

Usage:

bash
uv run python scripts/analyze_imports.py <path>

Detects:

  • Wildcard imports (from module import *)
  • Relative imports in non-package contexts
  • Functions that look like reimplemented utilities
  • Common patterns that should use libraries

Common utilities flagged:

  • JSON serialization → use json or orjson
  • Retry logic → use tenacity or backoff
  • Validation → use pydantic
  • HTTP clients → use requests or httpx
complexity_analyzer.py

Measures cyclomatic complexity, function length, and nesting depth.

Usage:

bash
uv run python scripts/complexity_analyzer.py <path>
uv run python scripts/complexity_analyzer.py --max-complexity 10 --max-length 50 <path>

Metrics:

  • Cyclomatic complexity: Number of decision points (default threshold: 10)
  • Function length: Lines in function (default threshold: 50)
  • Nesting depth: Maximum levels of nested control structures (threshold: 4)
  • God classes: Classes with 20+ methods

Options:

  • --max-complexity N: Cyclomatic complexity threshold (default: 10)
  • --max-length N: Function length threshold (default: 50)
concurrency_analyzer.py

Detects concurrency issues in async Python code.

Usage:

bash
uv run python scripts/concurrency_analyzer.py <path>

Detects:

  • Shared state mutation in async methods (self.x = y in async def)
  • Module-level mutable state (shared across requests)
  • Missing synchronization patterns
  • Potentially unsafe singleton patterns

Severity levels:

  • Critical: Mutation of shared state like client, session, agent, config
  • Warning: Any self.attr mutation in async context
  • Info: Module-level mutable objects

When to use: Run on services, handlers, and workflow code that handles concurrent requests.

Reference Documentation

python_antipatterns.md

Comprehensive catalog of anti-patterns with examples:

  • Code duplication patterns
  • Over-engineering examples
  • God objects
  • Complexity issues
  • Import problems
  • Error handling mistakes
  • Performance anti-patterns

Use when: You identify an issue but need to see the anti-pattern and solution

refactoring_patterns.md

Step-by-step refactoring techniques:

  • Extract function/variable
  • Consolidate duplicates
  • Simplify conditionals
  • Break up god classes
  • Reduce complexity
  • Improve imports

Use when: You know what's wrong and need concrete refactoring steps

best_practices.md

Python backend best practices and principles:

  • Core principles (DRY, SOLID)
  • Code organization
  • Type hints
  • Error handling
  • Async patterns
  • Database practices
  • API design
  • Security guidelines

Use when: Establishing coding standards or need authoritative guidance

Example Reviews

Example 1: Duplicate Validation Logic

User request: "Review this code for quality issues"

Analysis:

bash
uv run python scripts/detect_duplicates.py api/

Finding: Email validation duplicated in 5 files

Recommendation:

python
# Extract to utils/validation.py
def validate_email(email: str) -> None:
    if not email or "@" not in email:
        raise ValueError("Invalid email")

# Import everywhere
from utils.validation import validate_email
Example 2: Recreated Retry Logic

User request: "Check if we're recreating utility functions"

Analysis:

bash
uv run python scripts/analyze_imports.py services/

Finding: Custom retry logic in 3 services

Recommendation:

python
# Replace with tenacity
from tenacity import retry, stop_after_attempt, wait_exponential

@retry(stop=stop_after_attempt(3), wait=wait_exponential())
async def fetch_data(url: str):
    return await client.get(url)
Example 3: Complex Function

User request: "This function is hard to understand"

Analysis:

bash
uv run python scripts/complexity_analyzer.py utils/processor.py

Finding: Complexity 23, nesting depth 6

Recommendation: Extract nested logic into helper functions (see refactoring_patterns.md)

When NOT to Refactor

⚠️ Avoid refactoring when:

  • No tests exist and can't be added
  • Close to deadline
  • Code won't be modified again
  • Would break public APIs without migration path

Output Format

When reviewing code, structure feedback as:

  1. Summary: Brief overview of findings
  2. Critical Issues: Must-fix problems (duplicates, security)
  3. Important Issues: Should-fix problems (complexity, utilities)
  4. Suggestions: Nice-to-have improvements
  5. Code Examples: Specific before/after for each issue
  6. Next Steps: Recommended action plan

Always include:

  • Exact file paths and line numbers
  • Severity level for each issue
  • Concrete code examples
  • References to patterns/practices when applicable

© Qredence, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (scripts, references) in .claude/skills/python-backend-reviewer of Qredence/agentic-fleet.

  • SKILL.md
  • references/best_practices.md
  • references/python_antipatterns.md
  • references/refactoring_patterns.md
  • scripts/analyze_imports.py
  • scripts/complexity_analyzer.py
  • scripts/concurrency_analyzer.py
  • scripts/detect_duplicates.py

Open the folder on GitHubat commit 46a254b

Compare with similar skills

Python Backend Reviewer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Python Backend Reviewer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Python Backend Reviewer this skillQredence/agentic-fleet111—~3.3kAutomated safety check: PassMIT
Dignified Python Standardsdocling-project/docling69k—~1.5kAutomated safety check: PassApache-2.0
Code Review Skillawesome-skills/code-review-skill2.1k—~2.8kAutomated safety check: NotesMIT
Code Reviewerjewbetcha/opentrace1162 repos~1.1kAutomated safety check: NotesMIT
Code Review Specialistluongnv89/claude-howto42k—~764Automated safety check: PassMIT
Cross-Language Coding Standardszereight/gitlab-mcp2k1 repos~1.4kAutomated safety check: PassMIT

Similar skills

  • Dignified Python Standards

    docling-project/docling

    Applies opinionated production Python conventions chosen by the project's Python version: modern type syntax, pathlib, explicit checks and interface guidance.

    69k GitHub stars~1.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Code Review Skill

    awesome-skills/code-review-skill

    Provides comprehensive code review guidance for React 19, Vue 3, Angular 17+, Svelte 5, Rust, TypeScript, Java, Java 8, PHP, Ruby, Rails, Python, Django, FastAPI, Go, C/.NET, Kotlin, Swift, Dart…

    2.1k GitHub stars~2.8k tokensUpdated 1 mo ago
    DevelopmentAuto-check: notes
  • Code Reviewer

    jewbetcha/opentrace

    Comprehensive code review skill for TypeScript, JavaScript, Python, Swift, Kotlin, Go.

    116 GitHub starsUsed in 2 repos~1.1k tokens
    DevelopmentAuto-check: notes
  • Code Review Specialist

    luongnv89/claude-howto

    Reviews code for security, performance, quality and maintainability, using a checklist, a finding template and two metrics scripts.

    42k GitHub stars~764 tokensUpdated 8 days ago
    DevelopmentAuto-check passed
  • Shared reference for naming, function size, complexity and error handling rules that reviewer agents apply across TypeScript, Python, Go, Rust, Java, C# and Swift.

    2k GitHub starsUsed in 1 repo~1.4k tokens
    DevelopmentAuto-check passed
  • Code Review Skill

    Rain-kl/OpenFlare

    Provides comprehensive code review guidance for React 19, Vue 3, Angular 17+, Svelte 5, Rust, TypeScript, Java, PHP, Python, Django, Go, C/.NET, Kotlin, Swift, NestJS, C/C++, and more.

    288 GitHub stars~2.3k tokensUpdated today
    DevelopmentAuto-check: notes

More from Qredence/agentic-fleet

All 10 skills in this repo
  • Changelog Generator

    Qredence/agentic-fleet

    Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes.

    111 GitHub starsUsed in 20 repos~772 tokens
    Auto-check passed
  • Memory System

    Qredence/agentic-fleet

    Complete guide to the AgenticFleet memory system. An agent skill from Qredence/agentic-fleet.

    111 GitHub stars~1.2k tokensUpdated 5 mo ago
    Auto-check passed
  • Recall

    Qredence/agentic-fleet

    Semantic search for memory. An agent skill from Qredence/agentic-fleet.

    111 GitHub stars~445 tokensUpdated 5 mo ago
    Auto-check passed
  • Dspy Agent Framework Quick Ref

    Qredence/agentic-fleet

    Quick reference card for DSPy + Agent Framework integration patterns: typed signatures, assertions, routing cache, and agent handoffs.

    111 GitHub stars~1k tokensUpdated 5 mo ago
    Auto-check passed
  • Fleet Agent

    Qredence/agentic-fleet

    Context-aware development assistant for AgenticFleet with auto-learning and dual memory (NeonDB + ChromaDB).

    111 GitHub stars~994 tokensUpdated 5 mo ago
    Auto-check passed
  • Initiate Memory

    Qredence/agentic-fleet

    Comprehensive guide for initializing or reorganizing agent memory and project context.

    111 GitHub stars~2k tokensUpdated 5 mo ago
    Auto-check passed

Works with

Categories

Questions about Python Backend Reviewer

What does Python Backend Reviewer do?

Expert Python backend code reviewer that identifies over-complexity, duplicates, bad optimizations, and violations of best practices. Python Backend Reviewer is an agent skill from Qredence/agentic-fleet. Expert Python backend code reviewer that identifies over-complexity, duplicates, bad optimizations, and violations of best practices.

When should I use Python Backend Reviewer?

Python Backend Reviewer fits situations like: asked to review Python code quality; check for duplicate code; analyze module complexity; optimize backend code.

How do I install Python Backend Reviewer in Claude Code?

Run `npx skills add Qredence/agentic-fleet --skill python-backend-reviewer -a claude-code`. Or copy the skill folder (.claude/skills/python-backend-reviewer in Qredence/agentic-fleet) into .claude/skills/python-backend-reviewer in your project. Claude Code loads it when a task matches its description.

How do I install Python Backend Reviewer in Codex?

Run `npx skills add Qredence/agentic-fleet --skill python-backend-reviewer -a codex`. Or copy the skill folder (.claude/skills/python-backend-reviewer in Qredence/agentic-fleet) into .agents/skills/python-backend-reviewer in your project. Codex loads it when a task matches its description.

Can I use Python Backend Reviewer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Qredence/agentic-fleet --skill python-backend-reviewer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/python-backend-reviewer, .gemini/skills/python-backend-reviewer, .github/skills/python-backend-reviewer and .opencode/skills/python-backend-reviewer in your project.

What does Python Backend Reviewer need to run?

Going by SKILL.md and its folder, Python Backend Reviewer needs Python for the scripts in its folder and the command-line tools its instructions call (uv and python). Our summary lists: Python 3.

Does Python Backend Reviewer access the network?

SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Python Backend Reviewer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Python Backend Reviewer use?

Python Backend Reviewer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Python Backend Reviewer use?

About 3.3k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 8k tokens, read only when the agent opens those files.

What are the alternatives to Python Backend Reviewer?

Skills that share tags, products or a category with Python Backend Reviewer: Dignified Python Standards (docling-project/docling, 69k stars), Code Review Skill (awesome-skills/code-review-skill, 2.1k stars), Code Reviewer (jewbetcha/opentrace, 116 stars) and Code Review Specialist (luongnv89/claude-howto, 42k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Python Backend Reviewer?

Qredence (a GitHub organization) maintains it in Qredence/agentic-fleet, which has 111 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on April 13, 2026.

Source: Qredence/agentic-fleet on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.