agentleFS
Hive-AcademyHive-Academy/PtahCode/.claude/skills/ddd-architecture/SKILL.md

ddd-architecture

Skill34 starsChanged 10 days agoMITView on GitHub

Domain-Driven Design for complex business domains. Use when deciding whether DDD is warranted, defining bounded contexts, aggregates, entities and value objects, applying CQRS or domain events, or organizing a domain layer. .NET project and solution layout is dotnet-solution-architect.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If this skill is invoked from saas-workspace-initializer Step a2, the Round 1 discovery answers (jobs-to-be-done, candidate domains, MVP …

    line 14
  2. Distinctive:

    Do entities have complex lifecycles?

    line 22
  3. Distinctive:

    Do different parts of the system use different terminology?

    line 24

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Domain-Driven Design Architecture

Decide whether DDD is warranted, then load the one reference that owns the pattern. Do not implement a base class or a library layout from this file.

When to Engage User

DDD is highly context-dependent. ALWAYS discuss with user before implementing.

If this skill is invoked from saas-workspace-initializer Step a2, the Round 1 discovery answers (jobs-to-be-done, candidate domains, MVP scope) are already available — use them and do not re-ask the equivalent questions. Ask only what those answers leave open.

Load references/discovery.md only when domain discovery is still open.

Warrant

Score with the user before writing pattern code. Count the yeses:

  • Do entities have complex lifecycles? (draft → approved → fulfilled)
  • Are there business rules that span multiple entities?
  • Do different parts of the system use different terminology?
  • Is there a need for audit trails or event sourcing?
  • Will multiple teams work on different parts?
YesesDo
0-1Simple services. Stop.
2-3Tactical patterns only (entities, value objects).
4-5Strategic DDD: bounded contexts, then the tactical patterns.

Situations the score alone does not route:

SituationDo
Simple CRUDSame as 0-1. Skip DDD.
Multiple teamsBounded contexts, even when the rest of the score is low.
High consistency needsAggregates + domain events. Load entities-aggregates.md and domain-events.md.

Rules that break silently

  1. Copy Entity, EntityId, and ValueObject from the references below. Do not hand-roll a base class.
  2. One aggregate per transaction; refer to other aggregates by id. Home: references/entities-aggregates.md.

References

LoadWhen
references/discovery.mdDomain discovery is still open.
references/entities-aggregates.mdWriting an entity, an identity type, or an aggregate.
references/value-objects.mdWriting a value object.
references/cqrs-pattern.mdSeparating commands from queries, or a read path dominates.
references/domain-events.mdRecording what happened, eventual consistency, or an audit trail.
references/repository-pattern.mdPersisting an aggregate.
references/layer-layout.mdOrganizing a domain library into folders.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.