deptrac-fixer

Refactor code to fix Deptrac architectural violations without editing deptrac.yaml.

5|Updated May 30, 2023
One-click install
npx skills add https://github.com/VilnaCRM-Org/core-service --skill deptrac-fixer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: deptrac-fixer
Source: https://github.com/VilnaCRM-Org/core-service/tree/main/.claude/skills/deptrac-fixer
Command: npx skills add https://github.com/VilnaCRM-Org/core-service --skill deptrac-fixer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Diagnose and fix Deptrac architectural violations by refactoring code to respect hexagonal architecture boundaries.

Core Features & Use Cases

  • Automatically identify and repair cross-layer dependency violations reported by Deptrac.
  • Apply pragmatic fix patterns that align code with domain boundaries (Domain → Symfony Validator, Domain → Doctrine mapping, Domain → API Platform, Infrastructure → Handler).
  • Guarantee Deptrac rules are satisfied without modifying deptrac.yaml.

Quick Start

Run the fixer by executing make deptrac to detect violations, then let automated corrections align the codebase with the architecture.

Frequently Asked Questions about deptrac-fixer

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

FAQPage Schema
How do I fix Deptrac architectural violations in a PHP project?

Deptrac architectural violations are fixed by refactoring code to respect hexagonal boundaries. This involves applying documented patterns like Command Bus and factories to correct cross-layer dependencies, such as domain importing frameworks or infrastructure calling application handlers.

Why does my domain layer violate Deptrac rules when importing Symfony components?

Domain layer Deptrac violations occur when domain code imports external frameworks. These forbidden dependencies are resolved by applying pragmatic refactoring patterns that align code with domain boundaries without modifying the deptrac.yaml configuration file.

Can I resolve forbidden dependencies reported by Deptrac without editing deptrac.yaml?

Yes, forbidden dependencies can be resolved without editing deptrac.yaml. The code is automatically refactored to satisfy Deptrac rules by applying structural patterns that respect hexagonal architecture boundaries between domain, application, and infrastructure layers.

What is the best way to align a codebase with hexagonal architecture after running Deptrac?

Aligning a codebase with hexagonal architecture involves applying specific fix patterns to the violations reported by Deptrac. The automated correction process maps dependencies correctly, ensuring infrastructure does not directly call application handlers and domain remains isolated.

How do I get started with automated Deptrac violation refactoring?

Start by running make deptrac to detect architectural violations. Once cross-layer dependency violations are reported, apply automated corrections that refactor the codebase to align with documented hexagonal architecture fix patterns.

What patterns are applied when fixing cross-layer dependency violations in PHP?

Fixing cross-layer dependency violations applies patterns like Command Bus and factories. These pragmatic refactoring approaches align code with domain boundaries for issues such as Domain to Doctrine mapping or Infrastructure to Handler dependencies.