project-structure

Guide Python project structure with src/ layout and canonical directories.

28|3|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/oborchers/fractional-cto --skill project-structure-oborchers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: project-structure
Source: https://github.com/oborchers/fractional-cto/tree/main/python-package/skills/project-structure
Command: npx skills add https://github.com/oborchers/fractional-cto --skill project-structure-oborchers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the common pitfalls and complexities in structuring Python projects, ensuring better maintainability, testability, and packaging.

Core Features & Use Cases

  • Src Layout: Guides users to adopt the recommended src/ layout for safer packaging and testing.
  • Directory Organization: Provides a canonical structure for packages, tests, and documentation.
  • Naming Conventions: Enforces consistent naming for repositories, packages, and imports.
  • __init__.py Design: Details best practices for defining public APIs and versioning.
  • py.typed Marker: Ensures type checkers recognize typed packages.
  • Root-Level Files: Lists essential files for a well-maintained project.
  • Monorepo Patterns: Discusses strategies for managing multiple related packages.

Quick Start

Adopt the canonical directory structure for a new Python package.

Frequently Asked Questions about project-structure

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

FAQPage Schema
What is the src layout in Python and why should I use it for my project structure?

The Python src layout places your package code inside a src/ directory, preventing accidental imports of local unbuilt files during testing and ensuring you evaluate the actual installed package for safer packaging.

How do I organize a Python package directory to follow community best practices?

To organize a Python package directory, separate source code into a src/ folder, maintain canonical directories for tests and documentation, enforce consistent naming conventions, and include essential root-level files like pyproject.toml to ensure maintainability and adherence to community standards.

What is the best way to structure a Python monorepo for multiple related packages?

The best way to structure a Python monorepo involves adopting established monorepo patterns that isolate individual packages using the src/ layout, ensuring each sub-package maintains its own canonical directory organization, naming conventions, and py.typed marker for independent testability and packaging.

How do I design __init__.py files to define a robust public API in Python?

To design __init__.py files for a robust public API, define explicit imports and versioning within the file, exposing only the necessary public classes and functions while keeping internal modules hidden, ensuring a maintainable and clear interface for your Python package.

Do I need a py.typed marker for my Python package?

You need a py.typed marker in your Python package if you use type hints and want type checkers to recognize your package as typed, which is a community best practice that ensures better maintainability and IDE support for downstream users.