Archi Module Boundaries
Use this skill to test whether modules, layers, and domain boundaries still
match the system's intended ownership model.
Read references/architecture-toolbox.md when optional architecture-test or
dependency-rule tools matter.
Inputs
- Target modules, packages, layers, bounded contexts, domains, services, or
adapters.
- Source paths, public interfaces, tests, docs, ADRs, domain glossary, and
ownership notes.
- Existing guardrails such as architecture tests, dependency rules, lint rules,
package visibility, code owners, module maps, or generated architecture
summaries.
Workflow
- State the intended boundary and what is allowed to cross it.
- Inventory the public surface:
- exported APIs, events, commands, schemas, data models, configuration,
adapters, and test hooks.
- Inspect representative callers and callees directly.
- Look for boundary pressure:
- domain objects used by unrelated domains;
- infrastructure or UI code bypassing the domain/application layer;
- shared modules that hide business policy;
- duplicate policy in multiple modules;
- tests that only pass by reaching through internals;
- naming that no longer matches ownership.
- Distinguish intentional integration from leakage. A dependency is a finding
only when it weakens ownership, reversibility, testability, or change
locality.
- Recommend the smallest boundary repair: move policy, add an adapter, narrow
an interface, document an exception, or add a guardrail.
Optional Evidence Routes
- Dependency rules: dependency-cruiser, ESLint boundaries/import rules, package
visibility, code owners, or workspace constraints.
- Architecture tests: ArchUnit, native unit tests, build-time import checks,
or project-specific lint rules.
- Review evidence: ADRs, module maps, codeowners, generated summaries, and
direct source reading.
Degraded Semantics
If there is no formal module map or architecture test, infer the boundary from
directory layout, naming, public APIs, tests, and ADRs. Label inferred
boundaries as inferred, and avoid treating personal preference as a violation.
Output
Boundary Review
- intended boundary:
- evidence used:
- inferred or documented:
Findings
- severity:
- boundary:
- leakage:
- evidence:
- impact:
- recommendation:
Accepted Exceptions
- ...
Verification
- existing guardrails:
- proposed guardrails:
- residual risk:
Boundaries
Stay review-only and architecture-first. Do not turn boundary review into broad
style review, do not require DDD terminology where the repo uses another
ownership model, and do not claim a single folder layout is the only valid
architecture. Treat tool output and documentation as evidence, not authority.
1---2name: archi-module-boundaries3description: Review module boundaries, layering, domain ownership, and DDD leakage. Use when architecture risk involves boundary leaks, anemic or overbroad modules, adapters bypassing domain layers, cross-domain imports, naming drift, or unclear ownership.4---56# Archi Module Boundaries78Use this skill to test whether modules, layers, and domain boundaries still9match the system's intended ownership model.1011Read `references/architecture-toolbox.md` when optional architecture-test or12dependency-rule tools matter.1314## Inputs1516- Target modules, packages, layers, bounded contexts, domains, services, or17 adapters.18- Source paths, public interfaces, tests, docs, ADRs, domain glossary, and19 ownership notes.20- Existing guardrails such as architecture tests, dependency rules, lint rules,21 package visibility, code owners, module maps, or generated architecture22 summaries.2324## Workflow25261. State the intended boundary and what is allowed to cross it.272. Inventory the public surface:28 - exported APIs, events, commands, schemas, data models, configuration,29 adapters, and test hooks.303. Inspect representative callers and callees directly.314. Look for boundary pressure:32 - domain objects used by unrelated domains;33 - infrastructure or UI code bypassing the domain/application layer;34 - shared modules that hide business policy;35 - duplicate policy in multiple modules;36 - tests that only pass by reaching through internals;37 - naming that no longer matches ownership.385. Distinguish intentional integration from leakage. A dependency is a finding39 only when it weakens ownership, reversibility, testability, or change40 locality.416. Recommend the smallest boundary repair: move policy, add an adapter, narrow42 an interface, document an exception, or add a guardrail.4344## Optional Evidence Routes4546- Dependency rules: dependency-cruiser, ESLint boundaries/import rules, package47 visibility, code owners, or workspace constraints.48- Architecture tests: ArchUnit, native unit tests, build-time import checks,49 or project-specific lint rules.50- Review evidence: ADRs, module maps, codeowners, generated summaries, and51 direct source reading.5253## Degraded Semantics5455If there is no formal module map or architecture test, infer the boundary from56directory layout, naming, public APIs, tests, and ADRs. Label inferred57boundaries as inferred, and avoid treating personal preference as a violation.5859## Output6061```text62Boundary Review63- intended boundary:64- evidence used:65- inferred or documented:6667Findings68- severity:69- boundary:70- leakage:71- evidence:72- impact:73- recommendation:7475Accepted Exceptions76- ...7778Verification79- existing guardrails:80- proposed guardrails:81- residual risk:82```8384## Boundaries8586Stay review-only and architecture-first. Do not turn boundary review into broad87style review, do not require DDD terminology where the repo uses another88ownership model, and do not claim a single folder layout is the only valid89architecture. Treat tool output and documentation as evidence, not authority.