Domain architecture guidance
Skill xfoundries/domain-architecture-skills/skills/domain-architecture-guidance
Source-aware architecture guidance for business-domain systems using Domain-Driven Design, Layered Architecture, Onion Architecture, Hexagonal Architecture / Ports and Adapters, and CQRS.
npx -y skills add xfoundries/domain-architecture-skills --skill domain-architecture-guidanceAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Authoritative architecture guidance for business-domain systems using Domain-Driven Design, Layered Architecture, Onion Architecture, Hexagonal Architecture / Ports and Adapters, and CQRS. Use when designing, reviewing, refactoring, documenting, or implementing domain-heavy systems with package/project boundaries, repositories, aggregates, application services, ports/adapters, CQRS, jMolecules-style annotations, or architecture tests.
SKILL.md
6.9 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it
Domain Architecture Guidance
Purpose
Use this skill to guide AI agents and developers in correctly applying Domain-Driven Design, Layered Architecture, Onion Architecture, Hexagonal Architecture / Ports and Adapters, and CQRS in backend business-domain systems. It can also guide client applications when they own substantial business rules, offline workflows, synchronization conflicts, or local persistence boundaries. It does not provide platform-specific mobile or frontend implementation templates. Treat jMolecules as a strong Java reference for expressing and validating DDD and architecture concepts in code, not as a universal framework that every language must copy.
Do not present DDD, Layered, Onion, Hexagonal, CQRS, or Event Sourcing as one canonical combined architecture. Distinguish foundational patterns from opinionated compositions.
DDD is a domain modeling methodology and language for business concepts, boundaries, and invariants. Layered, Onion, Hexagonal / Ports and Adapters, and CQRS are architecture styles or patterns that can host or support DDD in domain-heavy systems, but they are not owned by DDD and should not be reduced to DDD. When a project explicitly chooses one of those architectures, enforce its dependency, boundary, and responsibility rules consistently.
Workflow
- Identify the task type: architecture explanation, code review, implementation, refactoring, package/project layout, jMolecules annotation usage, architecture test, or documentation.
- Determine the stack and runtime role: Java/Kotlin, C#/.NET, Go, Python, or another ecosystem. For a client application, confirm that it owns substantial domain behavior before applying backend-style patterns. Prefer host-ecosystem idioms over imported templates.
- Identify the chosen architecture, if any: Layered, Onion, Hexagonal / Ports and Adapters, CQRS, mixed, or none. If one is chosen, apply its structural constraints before suggesting simplification.
- Classify the domain complexity. Use rich DDD, aggregate modeling, CQRS, or strict ports/adapters only when the business rules and change pressure justify the ceremony.
- Apply source hierarchy from
references/source-policy.mdbefore citing or enforcing a rule. - Apply architecture constraints from
references/architecture-constraints.mdbefore changing boundaries or dependency direction. - Apply backend implementation guidance from
references/backend-guidance.mdwhen changing code or recommending structure. - State uncertainty explicitly when a rule is context-dependent.
- For architecture decisions, reviews, and boundary-affecting implementation recommendations, produce an
Architecture Guidance Resultfromreferences/architecture-result.mdwith rule sources, constraints, evidence, open questions, and readiness for the recommended next step. Simple conceptual explanations and documentation answers may remain concise unless the user asks for a structured result.
Core Rules
- Prefer original and broadly recognized sources over blog-style synthesis.
- When a project chooses DDD, enforce its core modeling discipline: ubiquitous language, explicit bounded-context meaning, invariant-protecting aggregates, identity/value distinction, and behavior placed where it best protects rules. Do not treat DDD as optional decoration after that choice is made.
- Do not weaken explicit architecture constraints. Apply only the constraints supplied by the selected style or an explicit project policy. For example, strict Layered and Hexagonal projects usually route controllers through application/use-case boundaries, while foundational Onion Architecture requires inward dependencies but does not itself require every controller call to pass through an application service. If the project has chosen CQRS, enforce command/query responsibility separation, query non-mutation, and read/write model boundaries without importing unrelated layer rules.
- Do not upgrade implementation preferences into universal DDD rules. Repository naming, read-port suffixes, CQRS, Event Sourcing, package layout, jMolecules annotations, and ArchUnit tests become strict only when selected by the architecture, framework, or project policy.
- Use jMolecules primarily for Java/Kotlin code annotation, architecture expression, validation, and documentation.
- For C#/.NET, Go, and Python, translate concepts into idiomatic modules, packages, namespaces, protocols/interfaces, tests, and dependency rules.
- Apply this skill to client applications only when they own substantial business behavior, offline workflows, synchronization conflicts, or local persistence boundaries. Do not imply platform-specific mobile or frontend implementation guidance.
- Keep the domain model free of framework persistence concerns when the domain is behavior-rich; allow simpler transaction script or CRUD designs for low-complexity areas.
- Treat CQRS as a targeted pattern for asymmetric read/write needs, complex queries, scalability differences, or task-based write models. Do not make every use case CQRS by default.
- Treat Event Sourcing as separate from CQRS. Do not introduce it unless auditability, temporal reconstruction, or event replay is a real requirement.
- Avoid saying "must" unless the rule follows from the chosen architecture and project context. Prefer "usually", "in this architecture", or "for this bounded context".
Reference Routing
Read only the references required by the task.
- For an architecture decision, review, or boundary-affecting recommendation, read
references/architecture-result.mdbefore returning the result andreferences/architecture-constraints.mdbefore judging a dependency or call path. - Read
references/source-policy.mdwhen making a normative claim, choosing a source, or handling Explicit Architecture or Clean Architecture terminology. - Read
references/hexagonal-architecture.mdonly for selected or proposed Hexagonal / Ports and Adapters work, including port roles, adapter direction, or application-service naming. - For implementation or code review, read
references/backend-guidance.md. Retrieve current upstream documentation before using exact framework or library APIs. - Read
references/architecture-testing.mdonly when selecting, implementing, or reviewing architecture validation. - For Java projects that use jfoundry, route confirmed architecture decisions to
using-jfoundryfor framework-specific landing rather than treating the Java example as a jfoundry template.
What ships with it: 7 files
47.7 KB alongside SKILL.md
agents/
- openai.yaml342 B
references/
- architecture-constraints.md14.4 KB
- architecture-result.md4.0 KB
- architecture-testing.md4.5 KB
- backend-guidance.md7.3 KB
- hexagonal-architecture.md9.5 KB
- source-policy.md7.6 KB