4b-ports-contract-repair

Repair port/contract issues in Python projects with AST checks and deterministic fixes.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill automates the mechanical fixes required to repair port/contract structures in a Python project, reducing manual edits and rework during audits.

Core Features & Use Cases

  • Create missing gateway contracts directory structure at src/interface_adapters/gateways when absent.
  • Ensure init.py exists in the gateways package to enable proper imports.
  • Re-audit the repository and populate docs/todo.md with the resulting post-fix state.
  • Limit repairs to mechanical, deterministic changes with minimal risk, suitable for maintenance cycles.

Quick Start

Run the repair workflow to audit the repository and apply deterministic fixes for port contracts.

Frequently Asked Questions about 4b-ports-contract-repair

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

FAQPage Schema
How do I fix missing gateway directories in a Python ports and gateways architecture?

To fix missing gateway directories in a Python ports and gateways architecture, this Skill creates the required src/interface_adapters/gateways folder structure and ensures __init__.py exists for proper imports. It applies deterministic, mechanical repairs to enforce port-contract discipline.

How do I repair Python port contracts automatically during a maintenance cycle?

You can repair Python port contracts automatically by running this Skill's workflow, which limits changes to mechanical, deterministic fixes with minimal risk. This makes it suitable for automated maintenance cycles and reduces manual edits during audits.

Can I use static analysis to enforce port-contract discipline in Python projects?

Yes, you can use static analysis to enforce port-contract discipline in Python projects. This Skill uses AST checks to validate class naming and import constraints, ensuring your layered architecture remains compliant after applying mechanical repairs.

What is the best way to update documentation after fixing port contracts in Python?

The best way to update documentation after fixing port contracts in Python is to re-audit the repository and populate docs/todo.md with the resulting post-fix state. This Skill automatically updates documentation to reflect the current port-contract compliance.

What are the limitations of mechanical port contract repairs in Python?

The limitation of mechanical port contract repairs in Python is that they are restricted to deterministic, low-risk changes like creating missing gateway folders and fixing imports. Complex architectural refactoring beyond these mechanical fixes is not supported.