python-project-structure

Installation
Summary

Clear module boundaries, explicit public interfaces, and maintainable directory layouts for Python projects.

  • Define public APIs with __all__ in every module; unlisted members remain internal implementation details
  • Prefer flat directory structures with minimal nesting; add sub-packages only for genuine sub-domains
  • Organize by architectural layers (API, services, repositories, models) or business domains depending on project complexity
  • Keep files focused on a single concept; consider splitting when files exceed 300–500 lines or handle unrelated responsibilities
  • Use absolute imports and consistent snake_case naming; match file names to their primary class or concept
SKILL.md

Python Project Structure & Module Architecture

Design well-organized Python projects with clear module boundaries, explicit public interfaces, and maintainable directory structures. Good organization makes code discoverable and changes predictable.

When to Use This Skill

  • Starting a new Python project from scratch
  • Reorganizing an existing codebase for clarity
  • Defining module public APIs with __all__
  • Deciding between flat and nested directory structures
  • Determining test file placement strategies
  • Creating reusable library packages

Core Concepts

1. Module Cohesion

Group related code that changes together. A module should have a single, clear purpose.

Related skills

More from wshobson/agents

Installs
7.3K
Repository
wshobson/agents
GitHub Stars
35.3K
First Seen
Jan 30, 2026