一键导入
judo-domain-docs
Domain model documentation guide. Covers domain overview, entity reference, and diagram generation for model-driven applications.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Domain model documentation guide. Covers domain overview, entity reference, and diagram generation for model-driven applications.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
ESM-to-UI mapping reference for JUDO React frontends. Covers widget mappings, table and navigation element mappings, and the ESM→UI transformation model.
Frontend development guide for JUDO React applications. Covers hooks, theming, i18n, and Pandino DI customization patterns.
ESM metamodel reference for JUDO. Covers namespace, type, structure, operation, accesspoint, UI, UI-behaviour, and UI-visual-styleguide packages with element-level attribute and constraint definitions.
Model documentation for JUDO applications. Covers ESM metamodel, cardinality, CRUD flags, and advanced modeling patterns.
Backend development guide for JUDO applications. Covers custom operations, interceptors, validators, data access, and error handling.
Deployment and build documentation for JUDO applications. Covers judo.sh commands, Docker setup, Karaf configuration, and production deployment.
| name | judo-domain-docs |
| description | Domain model documentation guide. Covers domain overview, entity reference, and diagram generation for model-driven applications. |
| disable-model-invocation | false |
| user-invocable | false |
| agent | general-purpose |
This guide provides a comprehensive overview of the application's domain model, organized by layer and bounded context.
The northwind is a model-driven application that serves a specific business purpose. This document outlines the core entities, relationships, and business rules that make up the domain model.
| Document | Purpose | Update Frequency |
|---|---|---|
| domain-overview.md | Provides a high-level overview of the business context, architecture, and ER diagrams. | When major model restructuring occurs. |
| entity-reference.md | Contains detailed specifications for each entity, including attributes and relationships. | When entities, attributes, or relationships change. |
The entire application is generated from a single Editor Specific Model (ESM) defined in:
/model/northwind.model
This model is the single source of truth for:
All entities at the entity layer are configured with createable="false", updateable="false", and deleteable="false". This enforces that all mutations occur through the service layer using command/input DTOs, following CQRS principles.
The domain is organized into distinct bounded contexts, each representing a specific area of the business domain.
graph TB
subgraph Context A
EntityA1 --> EntityA2
end
subgraph Context B
EntityB1 --> EntityB2
EntityA2 -.-> EntityB1
end
| Context | Entities |
|---|---|
| Context A | EntityA1, EntityA2 |
| Context B | EntityB1, EntityB2 |
| Enumeration | Values | Purpose |
|---|---|---|
| Status | ACTIVE, INACTIVE | Represents the status of an entity. |
| Pattern | Example | Description |
|---|---|---|
| Hierarchy | Parent -> Child | Represents a hierarchical relationship. |
| Association | EntityA <-> EntityB | Represents a many-to-many association. |
The model makes heavy use of calculated/derived fields to avoid data duplication and ensure consistency.
EntityA.derivedField = EntityA.field1 + " " + EntityA.field2
Events are used to capture all changes to the application state as a sequence of immutable events.
DEFAULT)
For each entity, the service layer provides:
Address)CreateAddressInput)This separation supports CQRS (Command Query Responsibility Segregation).
ESM (northwind.model)
↓
PSM (Platform Specific Model)
↓
ASM (Architecture Specific Model)
↓
┌─────────┬──────────┬───────────┐
│ Backend │ Frontend │ Database │
│ Java │ React │ Schema │
└─────────┴──────────┴───────────┘
See @AGENTS.md for a detailed explanation of the transformation pipeline.
Update the domain documentation when:
Option 1: Manual Update (for small changes)
git diff application/model/src/main/resources/*.model).entity-reference.md with the new or modified entity information.domain-overview.md with any changes to ER diagrams or bounded contexts.Option 2: Semi-Automated Update (using the template)
cd application/model && mvn clean install).domain-documentation-template.md to get entity and schema information./model/northwind.model as the single source of truth.[!IMPORTANT] Do NOT edit the model file directly!
Model changes must be made using the Judo Designer modeling tool. When proposing model changes:
- Describe the entities, relationships, operations, and attributes to be added, modified, or removed in detail.
- Note that the model file will be updated using the Judo Designer.
- After the model changes are applied, run
./judo.sh buildto regenerate the code.
judo-model-docs skill): For information on editing the ESM model with the Judo Designer.judo-backend-docs skill): For backend development guides.judo-frontend-docs skill): For frontend development guides./tests/test_model_interrogator.py/tests/README.md/tests/QUICK_START.md/tests/example_usage.py/tests/TEST_SUMMARY.mdFor each entity, the service layer provides:
Address)CreateAddressInput)This separation supports CQRS (Command Query Responsibility Segregation).
ESM (northwind.model)
↓
PSM (Platform Specific Model)
↓
ASM (Architecture Specific Model)
↓
┌─────────┬──────────┬───────────┐
│ Backend │ Frontend │ Database │
│ Java │ React │ Schema │
└─────────┴──────────┴───────────┘
See @AGENTS.md for detailed transformation pipeline documentation.
Update domain documentation when:
Option 1: Manual Update (for small changes)
# 1. Identify what changed in the model
git diff application/model/src/main/resources/*.model
# 2. Update entity-reference.md
# - Add/update entity sections
# - Update attribute tables
# - Update relationship tables
# 3. Update domain-overview.md if needed
# - Update ER diagram if relationships changed
# - Update bounded context diagrams if structure changed
Option 2: Semi-Automated Update (using template)
# 1. Build model to generate Liquibase changelog
cd application/model && mvn clean install
# 2. Use extraction patterns from domain_documentation_template.md
# - Extract entities from ESM model file
# - Extract database schema from Liquibase changelog
# - Generate entity tables and ER diagrams
# 3. See domain_documentation_template.md for:
# - Python/Bash script examples
# - XPath extraction patterns
# - Mermaid diagram generation algorithms
Option 3: Fully Automated (create custom script)
# Create a script based on the Python example in domain_documentation_template.md
python scripts/generate_domain_docs.py
# This script can:
# 1. Parse ESM model XML
# 2. Extract entity metadata
# 3. Parse Liquibase changelog
# 4. Generate Mermaid diagrams
# 5. Update entity-reference.md
The domain_documentation_template.md can be used to:
Quick Start for New Project:
# 1. Copy template to your project
cp agent-docs/domain/domain_documentation_template.md ~/my-project/agent-docs/domain/
# 2. Follow the extraction patterns to generate docs
# See "Automation Script Template" section in the template
# 3. Customize with business context
# Add manual descriptions, business rules, and context explanations
/model/northwind.model as the source of truthWhen making model changes:
domain_documentation_template.md for extraction patterns⚠️ CRITICAL: Do NOT edit the model file directly!
Model changes must be made using the Judo Designer modeling tool. When proposing model changes:
./judo.sh build to regenerate code/application/app/judo-backend-docs skill)src/custom/judo-frontend-docs skill)Java-based CLI tool for querying and mutating ESM model files. Load the judo-model-cli skill for detailed commands and patterns.
The diagram_generator.py script in this directory can be used to generate visual diagrams of the ESM model.
Functionality:
.aird (diagram definitions) and .model (ESM structure) files.PlantUML (default) and Mermaid diagram formats.How to Use:
Navigate to the root directory of the [project-name] project.
Run the script with the following command:
python agent-docs/domain/diagram_generator.py \
representations.aird \
application/model/target/generated-resources/model/kopogtato-esm.model \
agent-docs/domain/generated-diagrams.md
To specify the output format, use the --format flag:
# To generate Mermaid diagrams
python agent-docs/domain/diagram_generator.py \
representations.aird \
application/model/target/generated-resources/model/kopogtato-esm.model \
agent-docs/domain/generated-diagrams.md \
--format mermaid
The generated file, generated-diagrams.md, will be placed in this directory.
Quick Test:
./tests/run_tests.sh
$MODEL_VERSION_PLACEHOLDER$)Next Steps: Explore the detailed documentation for each domain context to understand entity structures, relationships, and usage patterns.