python-best-practices

Guide modern Python development with uv, ruff, mypy, and pytest.

Updated Feb 12, 2026
One-click install
npx skills add https://github.com/kobogithub/knowledge --skill python-best-practices-kobogithub
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-best-practices
Source: https://github.com/kobogithub/knowledge/tree/main/skills/python-best-practices
Command: npx skills add https://github.com/kobogithub/knowledge --skill python-best-practices-kobogithub

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the challenges of maintaining high-quality, efficient, and modern Python codebases by providing comprehensive guidance on best practices, project structure, and tooling.

Core Features & Use Cases

  • Project Structure: Implements the recommended src layout for better organization and import management.
  • Package Management: Leverages uv for fast, reproducible dependency management and locking.
  • Modern Tooling: Integrates ruff for linting and formatting, and mypy for strict type checking.
  • Type Hinting: Enforces modern type hinting practices for improved code clarity and safety.
  • API Development: Demonstrates patterns for building robust APIs with FastAPI and Pydantic.
  • Testing: Guides on effective testing strategies using pytest, including async tests and mocking.
  • Security: Highlights essential security practices to prevent common vulnerabilities.

Quick Start

Follow the guidance in this skill to set up a new Python project using uv, ruff, and mypy.

Frequently Asked Questions about python-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the recommended project structure for modern Python development?

Modern Python development best practices recommend using a src layout for better organization and import management. This structure ensures robust and maintainable codebases by cleanly separating source code from tests and configuration files.

How do I set up a Python project using uv and ruff?

Set up a Python project using uv for fast, reproducible dependency management and locking, while integrating ruff for linting and formatting. This modern tooling combination establishes robust codebases and enforces best practices.

Does FastAPI work well with strict type checking and Pydantic?

FastAPI works seamlessly with strict type checking using mypy and Pydantic for data validation. Enforcing modern type hinting practices improves code clarity and safety when building robust APIs with FastAPI.

What's the best way to test asynchronous Python code with pytest?

The best way to test asynchronous Python code is using pytest with dedicated async tests and mocking strategies. Effective testing with pytest ensures maintainable and reliable modern Python codebases.

Why should I use uv for Python dependency management?

You should use uv for Python dependency management to achieve fast and reproducible environment locking. It solves challenges of maintaining high-quality codebases by ensuring consistent dependency resolution across different environments.

What security considerations should I follow when building Python APIs?

Building Python APIs requires highlighting essential security practices to prevent common vulnerabilities. Modern Python development best practices integrate these security considerations directly into the workflow alongside linting and strict type checking.