Ddd logo

Ddd

Organization
swamp-club
ddd

Domain Driven Design guidance for TypeScript/Deno codebases. Apply when writing or modifying code to choose appropriate DDD building blocks (entities, value objects, aggregates, domain services, repositories) and maintain ubiquitous language. Triggers on all code changes to ensure domain model consistency.

Overview

Publisherswamp-club
Repositoryswamp
Skill nameddd
Stars
647
Forks
46
Bundled files
2
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by swamp-club on GitHub. Read the source before you install it.

Installation

Install the Ddd AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/swamp-club/swamp/tree/main/.claude/skills/ddd
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/swamp-club/swamp.git /tmp/swamp
mkdir -p .claude/skills
cp -r /tmp/swamp/.claude/skills/ddd .claude/skills/ddd
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Ddd in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Ddd on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Ddd is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Domain Driven Design

Apply these patterns when implementing domain logic in TypeScript/Deno.

Building Block Selection

Choose the appropriate type based on these criteria:

TypeIdentityMutabilityWhen to Use
Value ObjectNone (equality by value)ImmutableMeasurements, descriptions, identifiers, money, dates, addresses
EntityHas unique IDMutableThings with lifecycle, tracked over time, referenced by ID
AggregateRoot entity + childrenRoot controls mutationsConsistency boundary, transactional unit, enforce invariants
Domain ServiceNoneStatelessOperations spanning multiple aggregates, external integrations
RepositoryNoneStatelessPersistence abstraction for aggregates only
Application ServiceNoneStatelessOrchestrate domain objects for a use case; own the transaction boundary; return results or emit progress events; live in the application/libswamp layer, not the domain

Quick Decision Flow

Does it have a unique identity that matters?
├─ No → Value Object
└─ Yes → Does it enforce invariants over child objects?
         ├─ Yes → Aggregate Root
         └─ No → Entity (likely part of an aggregate)

Does it orchestrate multiple domain objects for a use case?
└─ Yes → Application Service (lives in the application/libswamp layer)

TypeScript Patterns

See references/patterns.md for implementation examples.

Ubiquitous Language

Update the project's ubiquitous language glossary when:

  • New domain concept introduced (add term + definition)
  • Meaning clarified through discussion (refine definition)
  • Naming conflicts discovered (resolve and document)
  • Bounded context boundary identified (note context for term)

Location: Document terms in code via types/interfaces. Add non-obvious terms to project documentation.

Naming Rules

  • Use domain expert terminology, not technical jargon
  • Prefer nouns for entities/value objects: Order, Money, Address
  • Prefer verbs for domain services: PricingService, ShippingCalculator
  • Name aggregates by their root: Order (not OrderAggregate)

Testing by Building Block

When you create or modify a building block, include the test types below alongside the unit test. See references/testing.md for templates.

Building BlockRequired Beyond Unit Tests
Value ObjectProperty test: round-trip serialization, equality symmetry, create() rejects invalid inputs across random inputs
EntityProperty test: state-transition invariants hold across random mutation sequences
AggregateProperty test: aggregate invariants hold after random command sequences. Integration test when it wires multiple repositories
Domain ServiceProperty test when it transforms or computes across value objects. Integration test when it orchestrates multiple aggregates
RepositoryConformance suite in packages/testing/ when it defines a new provider interface that extensions implement
Application ServiceIntegration test wiring real dependencies (temp filesystem, event bus, port-0 mock servers)

When to skip

A property test adds no value when the function under test is a trivial delegation (e.g. a repository method that calls a single store method). Use judgement — the goal is to cover invariants that unit tests can't exhaust, not to hit a ratio.

Anti-Patterns to Avoid

  • Anemic domain model: Entities with only getters/setters, logic in services
  • God aggregate: Too many entities under one root (split by invariant boundary)
  • Repository per entity: Only aggregate roots get repositories
  • Leaking persistence: Domain objects should not know about storage

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Ddd AI skill do?

Domain Driven Design guidance for TypeScript/Deno codebases. Apply when writing or modifying code to choose appropriate DDD building blocks (entities, value objects, aggregates, domain services, repositories) and maintain ubiquitous language. Triggers on all code changes to ensure domain model consistency.

Why use Ddd on TypingMind?

Because you install it once and use it with any model. Ddd is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Ddd in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/swamp-club/swamp/tree/main/.claude/skills/ddd. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Ddd?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Ddd?

As many as you like. As long as a model supports skills, you can use Ddd with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Ddd AI skill free?

It is published on GitHub by swamp-club. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇