Onion layers for codexloop (domain, application, infrastructure, cli), import-linter, and where new code belongs. Use before adding a module under src/codexloop/.
Install
npx skillscat add the-vibey-project/vibey/codexloop-architecture Install via the SkillsCat registry.
SKILL.md
codexloop architecture
Dependencies point inward. import-linter enforces this in CI.
src/codexloop/
├── domain/ # PURE. stdlib only. No I/O, no async, no third-party.
├── application/ # Protocol ports + use cases. Imports domain + stdlib.
├── infrastructure/ # Adapters. ONLY layer that may import openai.
├── cli/ # Typer. Calls application via bootstrap.
└── bootstrap.py # Composition root — the ONE module that sees every layer.Where does new code go?
- Touches FS, network, clock, or an SDK? →
infrastructure/, behind aProtocolinapplication/interfaces/. Neverimport openai
elsewhere. - Pure decision, zero I/O? →
domain/. Examples:classify.py,waiting.py,completion.py,capacity.py. - Orchestration (port → domain → port)? →
application/. - Argument parsing / terminal formatting? →
cli/.
When in doubt, push logic inward. lint-imports names the broken contract.
See ADR 0001.