3a-ports-contract-audit

Audit Python port and contract classes for layer boundary compliance.

Updated Mar 22, 2026
One-click install
npx skills add https://github.com/AgustinMadygraf/skills --skill 3a-ports-contract-audit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: 3a-ports-contract-audit
Source: https://github.com/AgustinMadygraf/skills/tree/main/3a-ports-contract-audit
Command: npx skills add https://github.com/AgustinMadygraf/skills --skill 3a-ports-contract-audit

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Audit contracts and ports between layers to ensure proper interface boundaries and prevent integration issues in clean-architecture projects.

Core Features & Use Cases

  • Detects port and contract naming and alignment across gateways and use cases.
  • Validates imports and inter-layer dependencies to enforce modularity and correct boundaries.
  • Use Case: In a multi-layer Python project, run this to confirm that gateway contracts match use-case expectations and surface misalignments before refactors.

Quick Start

Run a ports-contract audit to identify and fix contract inconsistencies.

Frequently Asked Questions about 3a-ports-contract-audit

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

FAQPage Schema
How do I audit contracts and ports for clean architecture in Python?

To audit contracts and ports in Python, you can run a static analysis script that parses source files to verify interface boundaries. This process detects naming alignment across gateways and use cases to enforce proper modularity.

What is static analysis for ports and gateways in layered architecture?

Static analysis for ports and gateways is an automated review mechanism that validates interface compliance without running the application. It checks if contract classes named with suffixes like Port or Gateway maintain correct layer boundaries.

How do I check inter-layer dependencies and imports in a Python project?

You can check inter-layer dependencies by parsing Python source files to validate imports and verify that use cases interact through defined interfaces. This surfaces misalignments between layers before refactoring.

Does this contract audit work with Python projects using Protocol or Interface suffixes?

Yes, the contract audit works with Python projects using Protocol or Interface suffixes. It parses source files to detect contract classes with these specific naming patterns and validates their alignment across the architecture.

When do I need to run a ports contract audit on my codebase?

You need to run a ports contract audit when managing a multi-layer Python project to confirm that gateway contracts match use-case expectations. It is highly recommended to execute this before major refactors to prevent integration issues.

What is the best way to enforce clean architecture boundaries in Python?

The best way to enforce clean architecture boundaries in Python is through automated static analysis that detects port and contract naming alignments. This validates inter-layer dependencies and reports findings to surface misalignments early.