---
title: "Allow no dependency cycles · Agent Wranglers"
url: https://agentwranglers.se/playbook/architecture/structure/no-dependency-cycles
updated: 2026-10-20
licence: "All rights reserved"
---

# Allow no dependency cycles

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

- Level: Required
- Chapter: [Structure](https://agentwranglers.se/playbook/architecture/structure)
- Rule: No module may depend on itself through a chain of imports. Cycles make code impossible to test, load or change on its own.
- How: When two modules need each other, move the shared part into a third module, or turn one direction into an interface or an event.
- Check: A tool fails the build on any cycle. Examples are ESLint `import/no-cycle`, dependency-cruiser `no-circular` and the import-linter `acyclic_siblings` contract.

**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/no-dependency-cycles`.

- Previous: [Point dependencies inward](https://agentwranglers.se/playbook/architecture/structure/layers-point-inward)
- Next: [Group code by feature](https://agentwranglers.se/playbook/architecture/structure/group-by-feature)
- [Structure](https://agentwranglers.se/playbook/architecture/structure)
