agentleFS
RidhuanDEVRidhuanDEV/claude-skills/shadow-domain/SKILL.md

shadow-domain

Skill1 starsChanged yesterdayMITView on GitHub

Domain-Driven Design & Business Invariant Modeling. Use when modeling complex state machines, approval/cancellation policies, bounded contexts, aggregate consistency boundaries, domain events, or anti-corruption layers. Do NOT use for simple CRUD screens (keep lightweight), stakeholder PRD interviews (shadow-discovery), physical DB tuning (shadow-db), or system topology/C4 (shadow-architect).

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    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. Distinctive:

    Anti-Overengineering Rule: Never introduce heavy DDD ceremony (aggregates, event sourcing, value-object wrappers) for simple CRUD tables …

    line 12
  2. Distinctive:

    Ambiguity Escalation Rule: If two domain policies conflict (e.g., whether an already-settled invoice can be cancelled), STOP and escalate …

    line 13
  3. Very specific:

    Read methodologies/DDD-BOUNDED-CONTEXTS-AND-AGGREGATES.md and playbooks/INVARIANT-CATALOG-AND-STATE-SPEC.md:

    line 16
  4. Distinctive:

    Delineate Bounded Contexts & Anti-Corruption Layers (ACL): Keep core domain logic isolated from legacy external ERP/vendor schemas.

    line 20

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

/shadow-domain — Domain-Driven Design & Business Invariant Modeling

  • Owner: Bounded contexts, ubiquitous language, aggregate consistency boundaries, state transitions, and executable invariants.
  • Boundaries: Stakeholder PRD elicitation (shadow-discovery), physical SQL indexing (shadow-db), system topology/containers (shadow-architect).

1. Preconditions, DDD Applicability Limits & Escalation

  • Anti-Overengineering Rule: Never introduce heavy DDD ceremony (aggregates, event sourcing, value-object wrappers) for simple CRUD tables without stateful invariants.
  • Ambiguity Escalation Rule: If two domain policies conflict (e.g., whether an already-settled invoice can be cancelled), STOP and escalate the conflict instead of inventing an unstated policy.

2. 6-Step Domain Modeling Playbook

Read methodologies/DDD-BOUNDED-CONTEXTS-AND-AGGREGATES.md and playbooks/INVARIANT-CATALOG-AND-STATE-SPEC.md:

  1. Gather Real Business Scenarios: Walk through happy, concurrent, and cancellation/reversal edge scenarios.
  2. Build Ubiquitous Glossary & Conflict Register: Resolve overlapping terms (Order vs Invoice vs Shipment) across teams.
  3. Define State Diagrams & Invariants: List illegal transitions (COMPLETED -> CANCELLED), concurrency rules (optimistic lock on aggregate root), and cross-tenant isolation.
  4. Delineate Bounded Contexts & Anti-Corruption Layers (ACL): Keep core domain logic isolated from legacy external ERP/vendor schemas.
  5. Distinguish Domain Events vs Integration Events: Internal aggregate facts vs versioned cross-context public contracts.
  6. Express Executable Acceptance Tests: Enforce identical invariants across API validation, domain entity, and persistence layers.

3. Examples & Deterministic Verifier

  • Happy Path: Approval workflow validates PENDING -> APPROVED with maker != checker invariant and optimistic version check.
  • Ambiguous / Must-Reject: Ambiguous cancellation rule resolved by guessing silently instead of escalating, or applying full DDD aggregates to a 3-column lookup table -> BLOCKED by domain_invariant_verifier.py.
python "shadow-domain/scripts/domain_invariant_verifier.py" --self-test
python "shadow-domain/scripts/domain_invariant_verifier.py" --verify-model path/to/domain_model.json

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.