---
title: "Point dependencies inward · Agent Wranglers"
url: https://agentwranglers.se/playbook/architecture/structure/layers-point-inward
updated: 2026-10-20
licence: "All rights reserved"
---

# Point dependencies inward

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Required
- Chapter: [Structure](https://agentwranglers.se/playbook/architecture/structure)
- Rule: Business rules never import the web framework, the database or other outside services. Outer layers depend on inner ones, never the reverse.
- How: Keep three rings in their own folders, such as `domain/`, `application/` and `adapters/`. The domain holds rules and types. The application holds use cases. The outer ring holds controllers, database code and adapters for outside services. The outer ring implements interfaces the inner rings define.
- Check: A dependency rule fails the build when an inner folder imports an outer one. Examples are dependency-cruiser, Deptrac, import-linter and ArchUnit.

Example:

```yaml
# deptrac.yaml: the domain may depend on nothing else
deptrac:
  paths: [./src]
  layers:
    - { name: Domain, collectors: [{ type: directory, value: src/Domain/.* }] }
    - { name: Application, collectors: [{ type: directory, value: src/Application/.* }] }
    - { name: Infrastructure, collectors: [{ type: directory, value: src/Infrastructure/.* }] }
  ruleset:
    Domain: ~
    Application: [Domain]
    Infrastructure: [Domain, Application]
```

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers architecture playbook: https://agentwranglers.se/playbook/architecture/structure/layers-point-inward`.

- Next: [Allow no dependency cycles](https://agentwranglers.se/playbook/architecture/structure/no-dependency-cycles)
- [Structure](https://agentwranglers.se/playbook/architecture/structure)
