refactor-backend-06-dependency-guard

Installation
SKILL.md

Layered Dependency Guard — refactor-chain · backend lane · step 06/09

Bundle: refactor-chain (self-diagnosing, self-healing fix-it pipeline). Phase: do-the-work · Prerequisite: refactor-backend-05-controller · Next: refactor-backend-07-api-naming. Adaptivity / conditional: repo-agnostic — works on any layered backend project in any registry-detected stack. Module-name conventions (e.g. <module>-controller, <module>-service, <module>-model) are detected from the build files, never assumed.

Purpose

Enforce the Controller → Service interface → DAO direction of a layered backend service. The skill scans controller-layer injections and imports, labels violations with a six-rule deterministic table (first match wins), reports them, and — on request — repairs them: removing controller-to-controller coupling, synthesizing a delegate-service intermediary where a controller talks to a DAO directly, and switching concrete-implementation injections to interfaces. It runs after steps 03–05 on purpose: by then every service interface the repairs need already exists, so a fix can never stall for want of an interface. Structure changes only; business logic never changes.

When to use

  • After the controller step (05) and before API naming (07).
  • You say things like: "dependency check", "dependency fix", "layered dependency check", "architecture dependency fix", "why does this controller import a mapper".
  • A controller injects another controller, imports from a dao/mapper package, injects FooServiceImpl, returns entity types, or references a sibling module's classes directly.
Installs
5
GitHub Stars
3
First Seen
Jul 6, 2026
refactor-backend-06-dependency-guard — ahmedbenaw/refactor-chain