python-app-conventions

Organize Python projects with src/ layout, CLI entry points, and pyproject.toml packaging.

9|1|Updated Jun 16, 2026
One-click install
npx skills add https://github.com/AratKruglik/antigravity-sdlc --skill python-app-conventions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-app-conventions
Source: https://github.com/AratKruglik/antigravity-sdlc/tree/main/plugins/python-plugin/skills/python-app-conventions
Command: npx skills add https://github.com/AratKruglik/antigravity-sdlc --skill python-app-conventions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Application and library conventions for plain Python projects (no web framework): src/ package layout, CLI tooling (argparse/click/typer), configuration management (pydantic-settings), logging setup, module design, entry points, and packaging conventions. Activated automatically by python-plugin/stack.md as a convention skill for the development phase.

Core Features & Use Cases

  • Organise Python application code in a src/ layout with proper package structure.
  • Build CLI tools with argparse, click, or typer and register them as console scripts.
  • Manage configuration from environment variables using pydantic-settings.
  • Set up structured logging for production-grade applications.
  • Package a Python project correctly with pyproject.toml.

Quick Start

Organize a Python project with a src/ layout and expose CLI entry points; configure settings using pydantic-settings and set up logging and packaging according to the conventions.

Frequently Asked Questions about python-app-conventions

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

FAQPage Schema
How do I structure a Python CLI application with a src layout?

A Python CLI application using a src layout places package code under a src/ directory, separates executable scripts via console entry points, and manages dependencies using pyproject.toml to ensure clean imports during development and packaging.

What is the best way to manage configuration in a plain Python app?

Managing configuration in a plain Python app is best handled using pydantic-settings, which loads environment variables into typed Settings objects, validating data and providing structured access to application configurations across different environments.

How do I set up logging for a production Python application?

Production Python application logging is set up by configuring the standard logging module with structured formats, proper log levels, and consistent handlers, ensuring traceable output for CLI tools and background services without requiring external web frameworks.

Does this Python convention skill work with argparse or click for CLI tools?

Yes, this Python convention skill supports building CLI tools with argparse, click, or typer, and registers them as console scripts in pyproject.toml, allowing flexible command-line interface creation depending on your preferred library.

Why use a src layout for Python packaging instead of a flat structure?

Using a src layout for Python packaging prevents accidental imports of the local package during testing, forces installation before running commands, and ensures that the packaged distribution behaves identically to the development environment.

Can I package a Python project using only pyproject.toml?

Yes, you can package a Python project using only pyproject.toml by defining build-system requirements, project metadata, dependencies, and console script entry points, eliminating the need for legacy setup.py or setup.cfg files.