domain-decomposition-api-design-advisor
Skill18 starsChanged 9 months agoMITView on GitHub
Decompose business scope into bounded contexts, module or service boundaries, workflows, and API contracts before implementation begins. Use when shaping a new feature, service, or major redesign; when requirements are underspecified; when consistency, idempotency, and integration boundaries must be made explicit; or when ADR-quality tradeoff reasoning is needed for Kotlin plus Spring systems.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- JetBrains/skillsedited, first seen Apr 28, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- JetBrains/skills★ 36096% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository24 other files it gives its agents.
- ci-cd-containerization-advisorSkill
- configuration-properties-profiles-kotlin-safeSkill
- dependency-conflict-resolverSkill
- error-model-validation-architectSkill
- gradle-kotlin-dsl-doctorSkill
- integration-resilience-engineerSkill
- jackson-kotlin-serialization-specialistSkill
- java-kotlin-migration-assistantSkill
- jpa-spring-data-kotlin-mapperSkill
- kotlin-idiomatic-refactorer-spring-awareSkill
- kotlin-spring-proxy-compatibilitySkill
- observability-integratorSkill
- performance-concurrency-advisorSkill
- production-incident-responderSkill
- project-context-ingestionSkill
- schema-migration-plannerSkill
- spring-context-di-reasoningSkill
- spring-kotlin-code-reviewSkill
- spring-mvc-webflux-api-builderSkill
- spring-security-configurator-auditorSkill
- stacktrace-log-triageSkill
- test-suite-builderSkill
- transaction-consistency-designerSkill
- upgrade-breaking-change-navigatorSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 16 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈16
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 39
Prefer a module boundary over a service boundary when independent deployment, ownership, or scaling pressure is weak.
- Distinctive: line 47
Start from consumer use cases, not only internal data shape.
- Distinctive: line 50
Prefer additive evolution and stable machine-readable codes.
- Distinctive: line 55
Use sealed hierarchies for genuinely closed state machines or domain outcomes.
- Distinctive: line 56
Use value classes for domain primitives when they improve clarity and the stack can support them.
- Distinctive: line 57
Keep DTOs as transport shapes.
- Distinctive: line 58
Use nullability to express meaning, not missing analysis.
- Distinctive: line 65
If a feature needs read-your-write guarantees, an eventually consistent split may impose hidden UX or support costs.
- Distinctive: line 80
If two modules change together for every feature, they probably are not separate bounded contexts yet.
- Distinctive: line 81
Prefer boundaries that reduce the number of concepts a team must hold in working memory during a single change.
- Distinctive: line 82
If an API contract must survive multiple client generations, design for behavioral compatibility, not only field-level compatibility.
- Distinctive: line 83
Write the failure story for each boundary.
- Distinctive: line 98
Do not propose microservices where a disciplined module boundary is sufficient.
- Distinctive: line 99
Do not ignore non-functional requirements just because the feature narrative sounds simple.
- Distinctive: line 100
Do not mistake CRUD decomposition for domain decomposition.
- Distinctive: line 101
Do not design APIs before clarifying ownership and invariants.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Domain Decomposition API Design Advisor
Source mapping: Tier 3 specialized skill derived from Kotlin_Spring_Developer_Pipeline.md (SK-25).
Mission
Convert vague product intent into explicit technical boundaries and contracts that can survive implementation and change. Optimize for clear ownership, explicit invariants, and low coupling rather than premature microservice enthusiasm.
Inputs To Gather
- Business goals, user journeys, and success criteria.
- Known constraints: SLA, throughput, latency, audit, privacy, compliance, data retention.
- Existing system boundaries, shared data, and integration points.
- Failure and retry expectations, especially around money, inventory, identity, and messaging.
- Team topology and deployment constraints when they influence boundary choices.
Decomposition Workflow
- Break the feature into use cases and state transitions.
- Identify the core nouns, aggregates, and decision points.
- Identify where consistency must be strong and where eventual consistency is acceptable.
- Separate commands from queries when that improves clarity, not by default.
- Identify external actors and dependencies.
- Decide whether the right boundary is:
- package
- module
- bounded context inside a modular monolith
- separate service
- Design API and event contracts only after the domain boundary is clear.
Boundary Rules
- Prefer a module boundary over a service boundary when independent deployment, ownership, or scaling pressure is weak.
- Shared database tables across service boundaries are usually a warning sign, not a convenience.
- Draw boundaries around invariants and ownership, not around CRUD screens.
- Distinguish reference data sharing from operational write ownership.
- A boundary is only real if dependency direction, data ownership, and failure handling agree.
API Design Rules
- Start from consumer use cases, not only internal data shape.
- Make idempotency, concurrency, versioning, and error semantics explicit.
- Choose synchronous request-response only when latency, consistency, and dependency reliability make it appropriate.
- Prefer additive evolution and stable machine-readable codes.
- Decide whether the API is public, partner-facing, internal synchronous, or asynchronous event-driven. Each has different compatibility expectations.
Kotlin And Modeling Nuances
- Use sealed hierarchies for genuinely closed state machines or domain outcomes.
- Use value classes for domain primitives when they improve clarity and the stack can support them.
- Keep DTOs as transport shapes; do not let them become the entire domain model.
- Use nullability to express meaning, not missing analysis.
Advanced Architecture Traps
- "Microservice by default" often creates distributed transactions, duplicated auth, and fractured observability before it creates value.
- A modular monolith with strong boundaries may be a better target state than several chatty services.
- Event-driven decomposition without clear ownership and replay semantics creates ambiguity, not decoupling.
- If a feature needs read-your-write guarantees, an eventually consistent split may impose hidden UX or support costs.
- Public APIs and internal orchestration APIs should not necessarily look the same.
- ADRs that record only the chosen option are weak. Capture rejected alternatives and why they lost.
Advanced Boundary Nuances
- Reporting boundaries and transactional boundaries are often different. Do not let analytics-driven query convenience dictate write ownership.
- Anti-corruption layers are often cheaper than pretending two bounded contexts share the same ubiquitous language.
- Team ownership, deployment cadence, and support rotation are architecture inputs when boundaries are long-lived. Ignore them only if the code will remain single-team.
- Multi-tenant behavior, data residency, and audit obligations can force a boundary that pure domain language does not reveal immediately.
- Event choreography without a clear owner for recovery and replay becomes shared confusion. If no one owns correction, the boundary is weak.
- Some features deserve process-manager or saga modeling, but only when the business truly spans separate consistency boundaries.
Expert Heuristics
- If two modules change together for every feature, they probably are not separate bounded contexts yet.
- Prefer boundaries that reduce the number of concepts a team must hold in working memory during a single change.
- If an API contract must survive multiple client generations, design for behavioral compatibility, not only field-level compatibility.
- Write the failure story for each boundary. If the team cannot explain how retries, compensation, and partial success work, the design is not finished.
Output Contract
Return these sections:
Problem framing: the use cases, constraints, and unknowns.Proposed boundaries: module or service decomposition and ownership.Consistency map: where transactions, idempotency, and eventual consistency apply.API or event contracts: the principal commands, queries, and error semantics.Tradeoffs: why this boundary shape is better than the main alternatives.ADR outline: decision, options, rationale, and follow-up risks.
Guardrails
- Do not propose microservices where a disciplined module boundary is sufficient.
- Do not ignore non-functional requirements just because the feature narrative sounds simple.
- Do not mistake CRUD decomposition for domain decomposition.
- Do not design APIs before clarifying ownership and invariants.
Quality Bar
A good run of this skill gives the team a boundary model that survives implementation pressure and future change. A bad run produces a plausible architecture diagram with no ownership, no consistency story, and no contract discipline.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

