python-architecture

Guide Python module architecture in the APM CLI project using BaseIntegrator, CommandLogger, and AuthResolver patterns.

3.5k|319|Updated Sep 18, 2025
One-click install
npx skills add https://github.com/microsoft/apm --skill python-architecture-microsoft
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-architecture
Source: https://github.com/microsoft/apm/tree/main/.apm/skills/python-architecture
Command: npx skills add https://github.com/microsoft/apm --skill python-architecture-microsoft

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Activate when creating new Python modules, refactoring class hierarchies, introducing design patterns, or making changes spanning 3+ files in the APM CLI codebase.

Core Features & Use Cases

  • Guidance on when to apply architecture guidelines during module creation or refactoring
  • Encourages reuse of patterns like BaseIntegrator, CommandLogger, AuthResolver
  • Use Case: ensure changes touching 3+ files follow consistent patterns and design
  • Cross-cutting concerns (logging, error handling)

Quick Start

Create or refactor Python modules in src/apm_cli/ following the described patterns to ensure consistent architecture.

Frequently Asked Questions about python-architecture

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

FAQPage Schema
How do I refactor Python class hierarchies to use composition over inheritance?

To refactor Python class hierarchies using composition over inheritance, move shared logic into base classes like BaseIntegrator, CommandLogger, and AuthResolver to ensure consistent module architecture and reduce code duplication.

What design patterns should I apply when creating new Python modules?

When creating new Python modules, apply established design patterns like BaseIntegrator, CommandLogger, and AuthResolver to enforce consistent architecture, handle cross-cutting concerns, and promote code reuse across the codebase.

When do I need to follow Python architecture guidelines for multi-file changes?

Python architecture guidelines should be followed when changes span 3 or more files, or when creating new modules under src/apm_cli/, to ensure consistent design patterns and modularity across the codebase.

How do I handle cross-cutting concerns like logging and error handling in Python modules?

Handle cross-cutting concerns like logging and error handling in Python modules by reusing established patterns such as CommandLogger, ensuring consistent architecture and centralized logic across multiple files.

Can I use these Python architecture guidelines for projects outside the APM CLI?

These Python architecture guidelines are specifically tailored for the APM CLI codebase, enforcing patterns like BaseIntegrator and AuthResolver under src/apm_cli/, and may not directly apply to other projects without adaptation.

What is the best way to ensure consistent Python module architecture during refactoring?

The best way to ensure consistent Python module architecture during refactoring is to apply identified design patterns, recommend composition over inheritance, and move shared logic into base classes to maintain code quality and modularity.