core-domain-tenant
Skill0 starsChanged 52 days agoApache-2.0View on GitHub
Placement and layering rules for multi-tenant products that genuinely have a reusable Core, a reusable Domain specialization, and customer-specific Tenant implementations — decides which layer new behaviour belongs in, keeps Core free of customer knowledge, and enforces the Tenant→Domain→Core dependency direction. Use only when the repository already has (or is deliberately building) all three layers, or when behaviour is being duplicated across customers. Do NOT use for single-tenant products, libraries, internal tools, or as a reason to invent Core/Domain/Tenant layers in a repository that does not have them.
In this repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- engineering-qualitySkill
- engineering-reviewSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Use it only if the product genuinely has all three of:
- Very specific: line 23
If the repository has one customer, one problem space, or is a library/tool/service with no tenancy, stop here.
- Distinctive: line 27
Not sure? Ask: *do at least two tenants exist or are two credibly planned, and do they share behaviour that is not universal?* If no, stop.
- Distinctive: line 57
Keep Core intentionally small.
- Very specific: line 78
Never put if customer == "X" inside Core or Domain.
- Distinctive: line 101
Prefer one frontend composed as Core UX + Domain UX/configuration + Tenant branding/configuration over a per-customer frontend fork.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Core / Domain / Tenant
This skill is conditional. Most repositories should not use it.
Applicability gate
Use it only if the product genuinely has all three of:
- a Core that is useful regardless of problem space or customer,
- a Domain specialization reused by multiple customers solving the same kind of problem,
- Tenant implementations for specific customers.
If the repository has one customer, one problem space, or is a library/tool/service with
no tenancy, stop here. Manufacturing these layers is overengineering. Use
engineering-quality instead.
Not sure? Ask: do at least two tenants exist or are two credibly planned, and do they share behaviour that is not universal? If no, stop.
The model
CORE universal capability, no domain or customer knowledge
^
|
DOMAIN reusable specialization for one coherent problem space
^
|
TENANT one customer's implementationDependency rules, non-negotiable:
- Tenant may depend on Domain and Core.
- Domain may depend on Core.
- Core must not depend on Domain or Tenant.
- Domain must not depend on Tenant.
Core
If every current domain and customer disappeared tomorrow, would this still belong in the product?
Yes → Core. Core must not know customer names, tenant workflows, customer prompts, one-off integrations, or domain concepts that are not genuinely universal.
Keep Core intentionally small. Premature generalisation into Core is harder to undo than duplication in Tenant — Core changes affect everyone.
Domain
The reusable specialization for a coherent problem space. A Domain may be an industry, a profession, a business function, or a problem category — do not assume it means industry.
A Domain may own vocabulary, business rules, workflows, prompts, skills, templates, entities, policies, tools, artifact types, and domain UX.
Would multiple customers solving this same kind of problem reuse this behaviour?
Yes → Domain.
Tenant
One customer. Normally mostly configuration, integrations, mappings, branding, customer-specific terminology, enabled capabilities, and bounded extensions.
Never put if customer == "X" inside Core or Domain. When several tenants grow the same
behaviour, promote it into Domain — but only after the second or third repetition shows
the shared shape, not on the first.
Placement test
For any substantial behaviour, in order:
- Needed across fundamentally different problem spaces? → consider Core.
- Reused by multiple customers with the same kind of problem? → consider Domain.
- Unique to one customer? → Tenant.
Apply with judgment, not mechanically. Worked examples and the ambiguous cases:
references/placement.md.
Enforcement
Encode the dependency rules as a check, not a reminder — a layering rule that is only in
prose will be violated. Tooling per ecosystem, promotion and demotion procedures:
references/enforcement.md.
UX across layers
Prefer one frontend composed as Core UX + Domain UX/configuration + Tenant branding/configuration over a per-customer frontend fork. Forks diverge, and every fix then has to be applied N times.
References
| File | Load when |
references/placement.md | deciding where behaviour goes, or a case is ambiguous |
references/enforcement.md | wiring up layer checks, promoting or demoting code |
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.

