askill
analyzing-domains

analyzing-domainsSafety 90Repository

Use when entering unfamiliar domains, modeling complex business logic, or when terms/concepts are unclear. Triggers: "what are the domain concepts", "define the entities", "model this domain", "DDD", "ubiquitous language", "bounded context", or when implementing-features Phase 1.2 detects unfamiliar domain.

2 stars
1.2k downloads
Updated 2/4/2026

Package Files

Loading files...
SKILL.md

Domain Analysis

Reasoning Schema

Before analysis: domain being explored, stakeholder terminology, existing system context, integration boundaries.

After analysis: ubiquitous language captured, entity boundaries defined, aggregate roots identified, context map complete, agent recommendations justified.

Invariant Principles

  1. Language Is the Model: Ubiquitous language IS the domain model. Misaligned terminology → misaligned code.
  2. Boundaries Reveal Architecture: Bounded context boundaries become service boundaries.
  3. Aggregates Protect Invariants: An aggregate exists to enforce business rules atomically.
  4. Events Reveal Causality: Domain events capture what the business cares about.
  5. Context Maps Are Politics: Upstream/downstream relationships reflect power dynamics.
  6. Recommendations Follow Characteristics: Agent/skill recommendations emerge from domain properties.

Inputs / Outputs

InputRequiredDescription
problem_descriptionYesNatural language description of the problem space
stakeholder_vocabularyNoTerms already used by domain experts
OutputTypeDescription
domain_glossaryInlineUbiquitous language definitions
context_mapMermaidBounded contexts and relationships
entity_sketchMermaidEntities, value objects, aggregates
agent_recommendationsTableRecommended skills with justification

Domain Analysis Framework

Phase 1: Language Mining

Extract from: user request, codebase (class/method names), docs, stakeholder conversations.

Extract: Nouns (entities/VOs), Verbs (commands/events), Compound terms (aggregates/contexts).

Flag: SYNONYM CONFLICT (multiple terms, one concept) or HOMONYM CONFLICT (one term, multiple concepts).

Phase 2: Ubiquitous Language

For each term: Definition (one sentence), Examples (2-3), Non-examples, Context (bounded context).

Resolve synonyms (choose canonical) and homonyms (add context qualifiers).

Phase 3: Entity vs Value Object

QuestionEntityValue Object
Has lifecycle?YesNo (immutable)
Identity matters?YesNo (only attributes)

Phase 4: Aggregate Boundary Detection

Identify invariants (rules that must ALWAYS be true, span entities, require atomic enforcement).

Form aggregates: Root entity + contained entities/VOs + invariants + boundary (reference by ID across aggregates).

Phase 5: Domain Event Identification

For each state change: What happened? (past tense), Who cares? (handlers), What data?

Phase 6: Bounded Context Mapping

Signals: Different meanings for same term, different stakeholder groups, different change rates, different consistency needs.

Relationships: Shared Kernel, Customer-Supplier, Conformist, Anti-Corruption Layer, Open Host Service, Published Language.

Phase 7: Agent Recommendations

CharacteristicSignalRecommended Skill
Complex state machinesMultiple status fieldsdesigning-workflows
Multiple bounded contextsDifferent vocabulariesbrainstorming
Security-sensitivePII, authgathering-requirements (Hermit)
Complex aggregatesMany invariantstest-driven-development

Example

  1. Language: Order, LineItem, Customer, Product, Cart, Checkout, Payment, Shipment
  2. Synonyms: Customer = User = Buyer → canonical: "Customer"
  3. Entities: Order (tracked by ID), Customer (tracked by ID)
  4. Value Objects: Money, Address, LineItem (immutable snapshot)
  5. Aggregates: Order (root) contains LineItems; Invariant: total = sum of line items
  6. Events: OrderPlaced, OrderShipped, PaymentReceived
  7. Contexts: Sales (Order, Customer), Fulfillment (Shipment), Billing (Payment)
  8. Recommendation: Medium complexity → design doc first, implementing-features Phase 1-4

Quality Gates

GateCriteria
Language completeAll terms defined
Conflicts resolvedNo unresolved synonyms/homonyms
Entities classifiedEvery noun categorized
Aggregates boundedEvery entity in one aggregate
Events identifiedState changes have events
Context map completeAll contexts with relationships


Self-Check

  • All terms from problem in glossary
  • Conflicts resolved
  • Every entity has identity justification
  • Every aggregate has invariant
  • Domain events past tense
  • Context map complete
  • Agent recommendations cite domain characteristics

If ANY unchecked: revise before completing.


<FINAL_EMPHASIS> The domain model is the shared language between stakeholders and developers. Get the language right and code follows. Get boundaries right and architecture emerges. Domain analysis IS implementation at the conceptual level. </FINAL_EMPHASIS>

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

95/100Analyzed 2/11/2026

An exceptional skill document for Domain-Driven Design analysis. It provides a highly structured, phased framework with clear triggers, quality gates, and forbidden patterns, making it both a great reference and a practical guide for an agent.

90
96
98
98
94

Metadata

Licenseunknown
Version-
Updated2/4/2026
Publisheraxiomantic

Tags

securitytesting