python-project-structure

Organize Python projects with module boundaries and explicit __all__ interfaces.

6|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/archibate/archibate-skills --skill python-project-structure-archibate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-project-structure
Source: https://github.com/archibate/archibate-skills/tree/main/old-skills/minor-skills/python-project-structure
Command: npx skills add https://github.com/archibate/archibate-skills --skill python-project-structure-archibate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a blueprint for organizing Python projects, emphasizing clear module boundaries, cohesive design, and explicit public interfaces defined via all.

Core Features & Use Cases

  • Module cohesion and single-responsibility patterns
  • Explicit public APIs with all and clean packaging
  • Flat, scalable directory structures suitable for libraries and applications
  • Use Case: Start a new Python package or refactor an existing codebase to improve discoverability and maintainability

Quick Start

Draft a minimal blueprint that places the package under src/, includes init.py files, and adds a tests/ directory.

Frequently Asked Questions about python-project-structure

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

FAQPage Schema
How do I structure a Python project to make the public API explicit?

You can make your Python project's public API explicit by defining the `__all__` variable in your modules. This ensures clear module boundaries and cohesive design, improving discoverability and maintainability for libraries and applications.

What is the best way to organize a scalable directory structure for a Python package?

The best way to organize a scalable directory structure for a Python package is to place the package under `src/`, include `__init__.py` files, and add a `tests/` directory. This flat structure supports cohesive module architecture.

When do I need to use __all__ in my Python module architecture?

You need to use `__all__` in your Python module architecture when defining a public API for a library. It establishes explicit public interfaces, ensuring module cohesion and clear boundaries for users importing your package.

Can I use this approach to refactor an existing Python codebase for better maintainability?

Yes, you can apply these project structure and API design principles to refactor an existing Python codebase. By enforcing single-responsibility patterns and explicit public interfaces, you improve discoverability and maintainability.

Does a flat Python project structure work for both applications and libraries?

Yes, a flat, scalable directory structure works for both applications and libraries. By placing the package under `src/` and maintaining clear module boundaries, you ensure consistent packaging and testing practices across different project types.