@rashidee/co2 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +25449 -0
- package/drizzle/0000_remarkable_charles_xavier.sql +210 -0
- package/drizzle/0001_wise_wolf_cub.sql +13 -0
- package/drizzle/0002_secret_spyke.sql +16 -0
- package/drizzle/0003_workspace_config_singleton.sql +16 -0
- package/drizzle/0004_terminal_claim_v120.sql +11 -0
- package/drizzle/0005_brainstorm_v124.sql +10 -0
- package/drizzle/0006_project_v140.sql +6 -0
- package/drizzle/0007_prd_wizard_v124.sql +14 -0
- package/drizzle/0008_workflow_artifact_v126.sql +24 -0
- package/drizzle/0009_project_import_v150.sql +7 -0
- package/drizzle/0010_quality_v151.sql +3 -0
- package/drizzle/meta/0000_snapshot.json +1335 -0
- package/drizzle/meta/0001_snapshot.json +1416 -0
- package/drizzle/meta/0002_snapshot.json +1510 -0
- package/drizzle/meta/_journal.json +83 -0
- package/package.json +41 -0
- package/plugin/.claude-plugin/marketplace.json +36 -0
- package/plugin/.claude-plugin/plugin.json +22 -0
- package/plugin/README.md +625 -0
- package/plugin/SKILLS.md +350 -0
- package/plugin/co2.svg +5 -0
- package/plugin/commands/brainstorm-loop.md +129 -0
- package/plugin/skills/conductor-defect/SKILL.md +898 -0
- package/plugin/skills/conductor-feature-develop/SKILL.md +1383 -0
- package/plugin/skills/conductor-feature-develop/references/implementation-domain-template.md +131 -0
- package/plugin/skills/conductor-feature-develop/references/implementation-master-template.md +89 -0
- package/plugin/skills/conductor-feature-develop/references/playwright-setup.md +224 -0
- package/plugin/skills/conductor-feature-prepare/SKILL.md +604 -0
- package/plugin/skills/depgen-k8s/SKILL.md +468 -0
- package/plugin/skills/depgen-k8s/references/dockerfile-laravel.md +197 -0
- package/plugin/skills/depgen-k8s/references/dockerfile-nodejs.md +163 -0
- package/plugin/skills/depgen-k8s/references/dockerfile-spring-boot.md +174 -0
- package/plugin/skills/depgen-k8s/references/k8s-patterns.md +869 -0
- package/plugin/skills/mockgen-shadcn/SKILL.md +1067 -0
- package/plugin/skills/mockgen-shadcn/references/admin-layout-template.md +1467 -0
- package/plugin/skills/mockgen-shadcn/references/mockup-hub-template.md +498 -0
- package/plugin/skills/mockgen-shadcn/references/mockup-index-template.md +216 -0
- package/plugin/skills/mockgen-tailwind/SKILL.md +904 -0
- package/plugin/skills/mockgen-tailwind/references/admin-layout-template.md +720 -0
- package/plugin/skills/mockgen-tailwind/references/mockup-hub-template.md +498 -0
- package/plugin/skills/mockgen-tailwind/references/mockup-index-template.md +190 -0
- package/plugin/skills/modelgen-nosql/SKILL.md +617 -0
- package/plugin/skills/modelgen-nosql/references/model-extraction-methodology.md +497 -0
- package/plugin/skills/modelgen-nosql/references/nosql-design-guide.md +258 -0
- package/plugin/skills/modelgen-relational/SKILL.md +707 -0
- package/plugin/skills/modelgen-relational/references/model-extraction-methodology.md +499 -0
- package/plugin/skills/specgen-flutter-riverpod/SKILL.md +898 -0
- package/plugin/skills/specgen-flutter-riverpod/references/component-patterns.md +971 -0
- package/plugin/skills/specgen-flutter-riverpod/references/notification-patterns.md +457 -0
- package/plugin/skills/specgen-flutter-riverpod/references/routing-patterns.md +362 -0
- package/plugin/skills/specgen-flutter-riverpod/references/security-patterns.md +709 -0
- package/plugin/skills/specgen-flutter-riverpod/references/spec-template.md +1566 -0
- package/plugin/skills/specgen-flutter-riverpod/references/state-patterns.md +518 -0
- package/plugin/skills/specgen-flutter-riverpod/references/storage-patterns.md +370 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/SKILL.md +984 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/batch-patterns.md +359 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/messaging-patterns.md +468 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/modulith-patterns.md +461 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/reporting-patterns.md +803 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/security-patterns.md +501 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/spec-template.md +1268 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/web-patterns.md +301 -0
- package/plugin/skills/specgen-node-cli-web/SKILL.md +561 -0
- package/plugin/skills/specgen-node-cli-web/references/auth-patterns.md +293 -0
- package/plugin/skills/specgen-node-cli-web/references/cli-packaging-patterns.md +250 -0
- package/plugin/skills/specgen-node-cli-web/references/server-patterns.md +247 -0
- package/plugin/skills/specgen-node-cli-web/references/spec-template.md +401 -0
- package/plugin/skills/specgen-node-cli-web/references/testing-patterns.md +174 -0
- package/plugin/skills/specgen-react-mui/SKILL.md +789 -0
- package/plugin/skills/specgen-react-mui/references/component-patterns.md +1077 -0
- package/plugin/skills/specgen-react-mui/references/reporting-patterns.md +1998 -0
- package/plugin/skills/specgen-react-mui/references/routing-patterns.md +461 -0
- package/plugin/skills/specgen-react-mui/references/security-patterns.md +599 -0
- package/plugin/skills/specgen-react-mui/references/spec-template.md +1030 -0
- package/plugin/skills/specgen-react-mui/references/state-patterns.md +327 -0
- package/plugin/skills/specgen-react-tailwind/SKILL.md +859 -0
- package/plugin/skills/specgen-react-tailwind/references/component-patterns.md +1212 -0
- package/plugin/skills/specgen-react-tailwind/references/reporting-patterns.md +1529 -0
- package/plugin/skills/specgen-react-tailwind/references/routing-patterns.md +669 -0
- package/plugin/skills/specgen-react-tailwind/references/security-patterns.md +656 -0
- package/plugin/skills/specgen-react-tailwind/references/spec-template.md +1237 -0
- package/plugin/skills/specgen-react-tailwind/references/state-patterns.md +327 -0
- package/plugin/skills/specgen-sdk-java/SKILL.md +933 -0
- package/plugin/skills/specgen-sdk-java/references/api-extraction-patterns.md +247 -0
- package/plugin/skills/specgen-sdk-java/references/http-client-patterns.md +495 -0
- package/plugin/skills/specgen-sdk-java/references/packaging-patterns.md +366 -0
- package/plugin/skills/specgen-sdk-java/references/spec-template.md +956 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/SKILL.md +1284 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/references/batch-patterns.md +1224 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/references/jasper-patterns.md +1638 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/references/messaging-patterns.md +512 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/references/modulith-patterns.md +354 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/references/security-patterns.md +551 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/references/spec-template.md +2502 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/references/web-patterns.md +503 -0
- package/plugin/skills/specgen-spring-jpa-restapi/SKILL.md +990 -0
- package/plugin/skills/specgen-spring-jpa-restapi/references/batch-patterns.md +1224 -0
- package/plugin/skills/specgen-spring-jpa-restapi/references/messaging-patterns.md +512 -0
- package/plugin/skills/specgen-spring-jpa-restapi/references/modulith-patterns.md +279 -0
- package/plugin/skills/specgen-spring-jpa-restapi/references/reporting-patterns.md +1536 -0
- package/plugin/skills/specgen-spring-jpa-restapi/references/restapi-patterns.md +722 -0
- package/plugin/skills/specgen-spring-jpa-restapi/references/security-patterns.md +351 -0
- package/plugin/skills/specgen-spring-jpa-restapi/references/spec-template.md +553 -0
- package/plugin/skills/specgen-ts-cli/SKILL.md +861 -0
- package/plugin/skills/specgen-ts-cli/references/async-patterns.md +1101 -0
- package/plugin/skills/specgen-ts-cli/references/command-patterns.md +383 -0
- package/plugin/skills/specgen-ts-cli/references/config-patterns.md +430 -0
- package/plugin/skills/specgen-ts-cli/references/database-patterns.md +750 -0
- package/plugin/skills/specgen-ts-cli/references/packaging-patterns.md +426 -0
- package/plugin/skills/specgen-ts-cli/references/spec-template.md +1391 -0
- package/plugin/skills/specgen-ts-cli/references/testing-patterns.md +909 -0
- package/plugin/skills/testgen-functional/SKILL.md +1381 -0
- package/plugin/skills/tracegen-matrix/SKILL.md +243 -0
- package/plugin/skills/util-preparek8senv/SKILL.md +422 -0
- package/plugin/skills/util-projectinit/SKILL.md +307 -0
- package/plugin/skills/util-projectinit/reference/brainstorm-loop.md +129 -0
- package/plugin/skills/util-projectinit/reference/brainstorm-protocol.md +144 -0
- package/plugin/skills/util-projectinit/reference/brainstorm-setup-guide.md +153 -0
- package/plugin/skills/util-projectinit/reference/brainstorm-template-appdev.md +87 -0
- package/plugin/skills/util-projectinit/reference/co2-context-generation-guide.md +761 -0
- package/plugin/skills/util-projectsync/SKILL.md +501 -0
- package/plugin/skills/util-updprd/SKILL.md +324 -0
- package/plugin/skills/util-usanalyzer/SKILL.md +307 -0
- package/plugin/skills/util-ustagger/SKILL.md +154 -0
- package/static/assets/abnfDiagram-VRR7QNED-DvPuwyCV.js +1 -0
- package/static/assets/arc-DRKw7sjs.js +1 -0
- package/static/assets/architectureDiagram-ZJ3FMSHR-CaNcxUbC.js +36 -0
- package/static/assets/blockDiagram-677ZJIJ3-Demd4AOK.js +132 -0
- package/static/assets/c4Diagram-LMCZKHZV-PVKUfc2x.js +10 -0
- package/static/assets/channel-C2nVbuwv.js +1 -0
- package/static/assets/chunk-2Q5K7J3B-CExf8ww_.js +1 -0
- package/static/assets/chunk-32BRIVSS-CFPaoONF.js +1 -0
- package/static/assets/chunk-5VM5RSS4-DE2esM67.js +15 -0
- package/static/assets/chunk-EX3LRPZG-SON_YdDG.js +231 -0
- package/static/assets/chunk-JWPE2WC7-Qxah8LNr.js +1 -0
- package/static/assets/chunk-MOJQB5TN-BcWGQV3j.js +88 -0
- package/static/assets/chunk-RYQCIY6F-DkDj-OR5.js +1 -0
- package/static/assets/chunk-V7JOEXUC-BlI1Mrah.js +206 -0
- package/static/assets/chunk-VR4S4FIN-Agf__duj.js +1 -0
- package/static/assets/chunk-XXDRQBXY-B5CfAh85.js +1 -0
- package/static/assets/classDiagram-OUVF2IWQ-DXJIljsR.js +1 -0
- package/static/assets/classDiagram-v2-EOCWNBFH-DXJIljsR.js +1 -0
- package/static/assets/cose-bilkent-JH36ORCC-DO0cQkcy.js +1 -0
- package/static/assets/cynefin-VYW2F7L2-CfOnsnXc.js +178 -0
- package/static/assets/cynefinDiagram-TSTJHNR4-BJ8tULAv.js +62 -0
- package/static/assets/cytoscape.esm-DTSO7Bv0.js +331 -0
- package/static/assets/dagre-VKFMJZFB-DfjwzHqP.js +4 -0
- package/static/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/static/assets/diagram-FQU43EPY-CndSOIIM.js +3 -0
- package/static/assets/diagram-G47NLZAW-Czf5hN0Z.js +24 -0
- package/static/assets/diagram-NH7WQ7WH-COAyojGh.js +24 -0
- package/static/assets/diagram-OA4YK3LP-H8PoiN2m.js +30 -0
- package/static/assets/diagram-WEI45ONY-DzcaVzjp.js +41 -0
- package/static/assets/ebnfDiagram-CCIWWBDH-DPazGYLJ.js +1 -0
- package/static/assets/erDiagram-Q63AITRT-Bo-fubgF.js +85 -0
- package/static/assets/flowDiagram-23GEKE2U-CSvxUDwh.js +156 -0
- package/static/assets/ganttDiagram-NO4QXBWP-DnBveWX6.js +292 -0
- package/static/assets/gitGraphDiagram-IHSO6WYX-B3rVL8c-.js +106 -0
- package/static/assets/graph-C9eacEi8.js +1 -0
- package/static/assets/index-LZSQkLE2.css +41 -0
- package/static/assets/index-y7XDSgMG.js +495 -0
- package/static/assets/infoDiagram-FWYZ7A6U-CvWV9yy2.js +2 -0
- package/static/assets/init-Gi6I4Gst.js +1 -0
- package/static/assets/ishikawaDiagram-FXEZZL3T-DF28a1N6.js +70 -0
- package/static/assets/journeyDiagram-5HDEW3XC-CB6CugYk.js +139 -0
- package/static/assets/kanban-definition-HUTT4EX6-ResSLF6d.js +89 -0
- package/static/assets/katex-C5jXJg4s.js +257 -0
- package/static/assets/layout-DEXfKzaS.js +1 -0
- package/static/assets/linear-CLO--ryk.js +1 -0
- package/static/assets/map-Czzmt4hB.js +1 -0
- package/static/assets/mindmap-definition-LN4V7U3C-BvW3EbxX.js +96 -0
- package/static/assets/ordinal-Cboi1Yqb.js +1 -0
- package/static/assets/pegDiagram-2B236MQR-BHCgqrrM.js +1 -0
- package/static/assets/pieDiagram-ENE6RG2P-DVmCQ5FA.js +39 -0
- package/static/assets/quadrantDiagram-ABIIQ3AL-B3e5KR52.js +7 -0
- package/static/assets/railroadDiagram-RFXS5EU6-Csv5ysLc.js +1 -0
- package/static/assets/requirementDiagram-TGXJPOKE-DOMVzvnB.js +84 -0
- package/static/assets/sankeyDiagram-HTMAVEWB-B1dcTOvy.js +40 -0
- package/static/assets/sequenceDiagram-DBY2YBRQ-BY414yeO.js +162 -0
- package/static/assets/sizeCapture-X5ZJPWSS-CuJfrfBN.js +1 -0
- package/static/assets/stateDiagram-2N3HPSRC-FX4rJkzV.js +1 -0
- package/static/assets/stateDiagram-v2-6OUMAXLB-BVufbO_H.js +1 -0
- package/static/assets/swimlanes-5IMT3BWC-Sfy58mmv.js +2 -0
- package/static/assets/swimlanesDiagram-G3AALYLV-wDCDw08H.js +8 -0
- package/static/assets/timeline-definition-FHXFAJF6-CmV7by8p.js +120 -0
- package/static/assets/vennDiagram-L72KCM5P-FqIyFZFt.js +34 -0
- package/static/assets/wardleyDiagram-EHGQE667-BZ06O45i.js +78 -0
- package/static/assets/xychartDiagram-FW5EYKEG-BOkffR06.js +7 -0
- package/static/index.html +24 -0
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
# Domain Model Extraction from Agile User Stories
|
|
2
|
+
|
|
3
|
+
> **Version:** 1.1.0
|
|
4
|
+
> **Purpose:** Reusable instruction set for AI coding agents to systematically extract domain models, entities, attributes, and relationships from Agile-format user stories.
|
|
5
|
+
> **Usage:** Reference this document from your PRD. The AI agent will produce a domain model section to be appended to the PRD and a companion Mermaid ERD file sharing the same name as the PRD.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Table of Contents
|
|
10
|
+
|
|
11
|
+
1. [Overview](#1-overview)
|
|
12
|
+
2. [Prerequisites](#2-prerequisites)
|
|
13
|
+
3. [Phase 1: Linguistic Analysis](#3-phase-1-linguistic-analysis)
|
|
14
|
+
4. [Phase 2: Entity Identification and Classification](#4-phase-2-entity-identification-and-classification)
|
|
15
|
+
5. [Phase 3: Attribute Extraction](#5-phase-3-attribute-extraction)
|
|
16
|
+
6. [Phase 4: Relationship Mapping](#6-phase-4-relationship-mapping)
|
|
17
|
+
7. [Phase 5: Cross-Cutting Concern Extraction](#7-phase-5-cross-cutting-concern-extraction)
|
|
18
|
+
8. [Phase 6: Bounded Context Identification](#8-phase-6-bounded-context-identification)
|
|
19
|
+
9. [Phase 7: Output Specification](#9-phase-7-output-specification)
|
|
20
|
+
10. [Phase 8: Validation and Review](#10-phase-8-validation-and-review)
|
|
21
|
+
11. [Appendix A: Verb-to-Relationship Heuristics](#appendix-a-verb-to-relationship-heuristics)
|
|
22
|
+
12. [Appendix B: NFR-to-Model Impact Map](#appendix-b-nfr-to-model-impact-map)
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 1. Overview
|
|
27
|
+
|
|
28
|
+
This document defines a **repeatable, auditable methodology** for extracting domain models from Agile user stories. It is designed to be consumed by an AI coding agent as part of a Product Requirements Document (PRD) pipeline.
|
|
29
|
+
|
|
30
|
+
The methodology follows **Domain-Driven Design (DDD)** principles and produces traceable outputs where every entity, attribute, and relationship maps back to one or more source user stories.
|
|
31
|
+
|
|
32
|
+
### Core Principles
|
|
33
|
+
|
|
34
|
+
- **Traceability** — Every model element MUST reference its originating user story or NFR.
|
|
35
|
+
- **Explicitness over assumption** — When a user story is ambiguous, the agent MUST flag it and state its assumption separately from confirmed facts.
|
|
36
|
+
- **Completeness** — The agent MUST consider user stories, NFRs, module definitions, role definitions, and stakeholder descriptions as input sources.
|
|
37
|
+
- **DDD Alignment** — Output must be organized by Bounded Contexts and Aggregates, not by database tables.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 2. Prerequisites
|
|
42
|
+
|
|
43
|
+
Before executing this methodology, the AI agent must have access to the following inputs from the PRD:
|
|
44
|
+
|
|
45
|
+
| Input Artifact | Description | Required |
|
|
46
|
+
|--------------------------------------|-----------------------------------------------------------------------------------------------|----------|
|
|
47
|
+
| User Stories | Agile-format stories: "As [role], I want to [action] [object] so that [purpose]" | Yes |
|
|
48
|
+
| Module List | High-level feature groupings that serve as bounded context candidates | Yes |
|
|
49
|
+
| Roles and Stakeholders | Actor definitions with role codes | Yes |
|
|
50
|
+
| Non-Functional Requirements (NFRs) | Security, performance, integration, and compliance constraints | Yes |
|
|
51
|
+
| Glossary / Ubiquitous Language | Domain-specific term definitions (if available) | No |
|
|
52
|
+
| Existing Data Model | Current-state model for migration or extension scenarios | No |
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 3. Phase 1: Linguistic Analysis
|
|
57
|
+
|
|
58
|
+
### 3.1 Instruction
|
|
59
|
+
|
|
60
|
+
Agile user stories follow a structured grammar: **"As [role], I want to [action] [object] so that [purpose]."** This structure maps directly onto domain modeling concepts.
|
|
61
|
+
|
|
62
|
+
For **each** user story in the PRD, parse the sentence and map grammar elements to domain concepts:
|
|
63
|
+
|
|
64
|
+
| Grammar Element | Domain Mapping | Extraction Rule |
|
|
65
|
+
|-----------------------------|---------------------------------|--------------------------------------------------------------------------------------------------------------------------|
|
|
66
|
+
| **Subject** (As [ROLE]) | Actor / Role Entity | Extract the role code. This confirms a `Role` or similar authorization entity exists. Record the role as an enum value. |
|
|
67
|
+
| **Verb** (I want to...) | Operation / Command / Event | Identifies the operation type. CRUD verbs imply entity lifecycle. State-change verbs (activate, deactivate, approve, reject) imply a state machine with an enum field. |
|
|
68
|
+
| **Direct Object** | Primary Entity / Aggregate Root | The main noun after the verb is the **candidate entity**. If plural, it suggests a collection relationship. |
|
|
69
|
+
| **Indirect Object** | Related Entity / Association | Nouns connected by prepositions (e.g., "X **to** Y", "X **for** Z") indicate relationships between entities. |
|
|
70
|
+
| **Purpose Clause** (so that...) | Business Rule / Invariant / Domain Event | Reveals the **why** — often defines business rules, access control policies, or domain events. |
|
|
71
|
+
| **Adjectives / Qualifiers** | Attribute, State, or Type | Descriptive words ("active", "pending", "approved") suggest enum values, boolean flags, or validation rules. |
|
|
72
|
+
| **Prepositional Phrases** | Relationship / Bounded Context | Phrases like "access to X", "logs for Y" clarify context boundaries and entity ownership. |
|
|
73
|
+
|
|
74
|
+
### 3.2 Compound Story Handling
|
|
75
|
+
|
|
76
|
+
When a single story contains multiple verbs (e.g., "create, read, update, and delete"), decompose into individual operations and infer the model implications of each:
|
|
77
|
+
|
|
78
|
+
| Operation | Model Implication |
|
|
79
|
+
|------------|--------------------------------------------------------------------------------|
|
|
80
|
+
| CREATE | Entity lifecycle, ID generation, `createdAt`, `createdBy` |
|
|
81
|
+
| READ | Query model, searchable attributes, pagination support |
|
|
82
|
+
| UPDATE | `updatedAt`, `updatedBy`, `version` (optimistic locking) |
|
|
83
|
+
| DELETE | `deletedAt` (soft delete) or cascade rules (hard delete) — determine from context |
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 4. Phase 2: Entity Identification and Classification
|
|
88
|
+
|
|
89
|
+
### 4.1 Classification Rules
|
|
90
|
+
|
|
91
|
+
After extracting all nouns from Phase 1, classify each into one of the following DDD building blocks:
|
|
92
|
+
|
|
93
|
+
| Classification | Criteria |
|
|
94
|
+
|----------------------|------------------------------------------------------------------------------------------------|
|
|
95
|
+
| **Entity** | Has a unique identity, a lifecycle (created, updated, deleted), and is persisted independently |
|
|
96
|
+
| **Value Object** | Immutable, no independent identity, describes a characteristic of an entity |
|
|
97
|
+
| **Aggregate Root** | An entity that serves as the entry point for a cluster of related objects; owns transactional consistency |
|
|
98
|
+
| **Enum / Type** | A finite, closed set of known values derived from qualifiers, states, or role codes |
|
|
99
|
+
| **Domain Event** | An occurrence of significance derived from state transitions or purpose clauses |
|
|
100
|
+
| **Domain Service** | An operation that doesn't naturally belong to any entity, derived from complex verb phrases |
|
|
101
|
+
|
|
102
|
+
### 4.2 Decision Flowchart
|
|
103
|
+
|
|
104
|
+
Apply this decision tree to each extracted noun:
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
Is it a finite, known set of values?
|
|
108
|
+
├── YES → ENUM
|
|
109
|
+
└── NO
|
|
110
|
+
Does it have a unique identity and lifecycle?
|
|
111
|
+
├── YES
|
|
112
|
+
│ Is it the root of a consistency boundary?
|
|
113
|
+
│ ├── YES → AGGREGATE ROOT
|
|
114
|
+
│ └── NO → ENTITY (within an aggregate)
|
|
115
|
+
└── NO
|
|
116
|
+
Is it immutable and describes another entity?
|
|
117
|
+
├── YES → VALUE OBJECT
|
|
118
|
+
└── NO
|
|
119
|
+
Is it a verb/action that happened?
|
|
120
|
+
├── YES → DOMAIN EVENT
|
|
121
|
+
└── NO → DOMAIN SERVICE or requires further analysis
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### 4.3 Naming Conventions
|
|
125
|
+
|
|
126
|
+
| Type | Convention | Example |
|
|
127
|
+
|------------------|---------------------------|--------------------------------------|
|
|
128
|
+
| Entity | PascalCase, singular noun | `User`, `Order`, `Invoice` |
|
|
129
|
+
| Value Object | PascalCase, descriptive | `Address`, `ContactInfo`, `Money` |
|
|
130
|
+
| Enum | PascalCase + contextual suffix | `OrderStatus`, `RoleType` |
|
|
131
|
+
| Domain Event | PascalCase, past tense | `OrderPlaced`, `UserRegistered` |
|
|
132
|
+
| Join Entity | PascalCase, compound noun | `UserRole`, `OrderItem` |
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## 5. Phase 3: Attribute Extraction
|
|
137
|
+
|
|
138
|
+
### 5.1 Attribute Sources
|
|
139
|
+
|
|
140
|
+
Attributes are derived from **four sources**, in order of priority:
|
|
141
|
+
|
|
142
|
+
| Priority | Source | Description |
|
|
143
|
+
|----------|----------------------------|------------------------------------------------------------------------------------------------|
|
|
144
|
+
| 1 | **Explicit Mention** | Attributes directly stated in the user story text |
|
|
145
|
+
| 2 | **Operation Inference** | Attributes implied by the operations performed (see Section 3.2) |
|
|
146
|
+
| 3 | **NFR Requirements** | Attributes required by non-functional requirements (see Appendix B) |
|
|
147
|
+
| 4 | **Domain Convention** | Standard attributes expected by convention (audit fields, soft delete flag, optimistic locking) |
|
|
148
|
+
|
|
149
|
+
### 5.2 Attribute Specification
|
|
150
|
+
|
|
151
|
+
For each attribute, the agent MUST capture:
|
|
152
|
+
|
|
153
|
+
| Field | Description |
|
|
154
|
+
|-----------------|----------------------------------------------------------------------------------------|
|
|
155
|
+
| `name` | camelCase field name |
|
|
156
|
+
| `type` | Data type (String, UUID, Instant, Boolean, Long, custom Enum, or Value Object) |
|
|
157
|
+
| `nullable` | Whether the field can be null |
|
|
158
|
+
| `defaultValue` | Default value if applicable |
|
|
159
|
+
| `constraints` | Validation constraints (not null, unique, max length, pattern, etc.) |
|
|
160
|
+
| `description` | Brief description of the attribute's purpose |
|
|
161
|
+
| `sourceStory` | Traceability reference to the originating user story ID |
|
|
162
|
+
| `sourceType` | One of: `EXPLICIT`, `OPERATION_INFERENCE`, `NFR`, `CONVENTION` |
|
|
163
|
+
|
|
164
|
+
### 5.3 Implicit Attribute Extraction Rules
|
|
165
|
+
|
|
166
|
+
When a user story implies operations but does not explicitly name attributes, apply these inference rules:
|
|
167
|
+
|
|
168
|
+
| Story Pattern | Implied Attributes |
|
|
169
|
+
|------------------------------------------|-----------------------------------------------------------------------------------------|
|
|
170
|
+
| "create X" | `id` (UUID), `createdAt` (Instant), `createdBy` (String) |
|
|
171
|
+
| "update X" | `updatedAt` (Instant), `updatedBy` (String), `version` (Long) |
|
|
172
|
+
| "delete X" | `deletedAt` (Instant), `deletedBy` (String), `deleted` (Boolean) — for soft delete |
|
|
173
|
+
| "deactivate / reactivate X" | `status` (Enum), `statusChangedAt` (Instant), `statusChangedBy` (String) |
|
|
174
|
+
| "assign X to Y" | Join entity with `assignedAt` (Instant), `assignedBy` (String) |
|
|
175
|
+
| "view X logs / activity" | Audit entity with `action`, `timestamp`, `actorId`, `entityType`, `entityId`, `details` |
|
|
176
|
+
| "authenticate / log in" | `lastLoginAt`, `failedLoginAttempts`, `lockedUntil` |
|
|
177
|
+
| "reset password" | `passwordChangedAt`, `passwordResetToken`, `passwordResetExpiry` |
|
|
178
|
+
| "update my profile" | Profile value object or embedded fields (flag as ambiguous — see 5.4) |
|
|
179
|
+
| "approve / reject X" | `approvalStatus` (Enum), `approvedBy`, `approvedAt`, `rejectionReason` |
|
|
180
|
+
| "schedule X" | `scheduledAt`, `startDate`, `endDate` |
|
|
181
|
+
| "search / filter X" | Implies indexed or searchable attributes; note for query model design |
|
|
182
|
+
| "upload / attach X" | `fileName`, `contentType`, `storageKey`, `fileSize` |
|
|
183
|
+
| "notify X about Y" | `Notification` entity with `recipientId`, `type`, `message`, `readAt`, `sentAt` |
|
|
184
|
+
|
|
185
|
+
### 5.4 Ambiguity Handling
|
|
186
|
+
|
|
187
|
+
When a user story contains vague or underspecified terms, the agent MUST:
|
|
188
|
+
|
|
189
|
+
1. **Flag** the ambiguity explicitly in the output.
|
|
190
|
+
2. **Propose** a reasonable default set of attributes based on domain conventions.
|
|
191
|
+
3. **Mark** each proposed attribute with `sourceType: ASSUMPTION`.
|
|
192
|
+
4. **Recommend** clarification questions to ask the product owner.
|
|
193
|
+
|
|
194
|
+
Output format for ambiguities:
|
|
195
|
+
|
|
196
|
+
| Story ID | Ambiguous Term | Issue Description | Proposed Default | Clarification Needed |
|
|
197
|
+
|----------|----------------|-------------------|------------------|----------------------|
|
|
198
|
+
| (ref) | (term) | (what is unclear) | (proposed attrs) | (question to ask PO) |
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## 6. Phase 4: Relationship Mapping
|
|
203
|
+
|
|
204
|
+
> **ARCHITECTURAL CONSTRAINT — `ONE_TO_MANY` is prohibited as an ORM relationship.**
|
|
205
|
+
> Supported relationship types are: `ONE_TO_ONE`, `MANY_TO_ONE`, `MANY_TO_MANY` only.
|
|
206
|
+
> When a domain relationship is logically "parent has many children", model it from the
|
|
207
|
+
> child's perspective as `MANY_TO_ONE` (child entity stores the FK to the parent). The
|
|
208
|
+
> parent entity MUST NOT declare a collection field mapped with `@OneToMany` or equivalent.
|
|
209
|
+
> Retrieval of child records is always handled at the application layer via a dedicated
|
|
210
|
+
> repository query (e.g., `childRepository.findByParentId(parentId)`). This eliminates
|
|
211
|
+
> N+1 query problems, uncontrolled eager/lazy loading, and unbounded in-memory collection growth.
|
|
212
|
+
|
|
213
|
+
### 6.1 Relationship Detection from Linguistic Cues
|
|
214
|
+
|
|
215
|
+
The agent MUST scan for verb and preposition patterns to identify relationships between entities:
|
|
216
|
+
|
|
217
|
+
| Linguistic Pattern | Relationship Type | Cardinality |
|
|
218
|
+
|-------------------------------------|-----------------------|-------------------------------------------------------------------------------------|
|
|
219
|
+
| "assign X to Y" | Association | Many-to-Many |
|
|
220
|
+
| "X belongs to Y" | Composition/Ownership | Many-to-One |
|
|
221
|
+
| "X has Y" / "X contains Y" | Aggregation | **Many-to-One** (Y stores FK to X; parent-to-child collection resolved at application layer) |
|
|
222
|
+
| "X's Y" (possessive) | Composition | One-to-One |
|
|
223
|
+
| "create X for Y" | Ownership | Many-to-One |
|
|
224
|
+
| "view X of Y" / "view X for Y" | Read relationship | **Many-to-One** (Y stores FK to X; collection fetched via repository query) |
|
|
225
|
+
| "X manages Y" | Hierarchical | **Many-to-One** (Y stores FK to X; parent-to-child collection resolved at application layer) |
|
|
226
|
+
| "X is classified by Y" | Categorization | Many-to-One |
|
|
227
|
+
| "X references Y" | Weak association | Many-to-One |
|
|
228
|
+
|
|
229
|
+
### 6.2 Relationship Specification
|
|
230
|
+
|
|
231
|
+
For each identified relationship, the agent MUST capture:
|
|
232
|
+
|
|
233
|
+
| Field | Description |
|
|
234
|
+
|--------------------|------------------------------------------------------------------------------------------|
|
|
235
|
+
| `sourceEntity` | The entity on the owning side |
|
|
236
|
+
| `targetEntity` | The entity on the referenced side |
|
|
237
|
+
| `type` | `ONE_TO_ONE`, `MANY_TO_ONE`, `MANY_TO_MANY` — **`ONE_TO_MANY` is not permitted** |
|
|
238
|
+
| `joinEntity` | Name of join entity (for Many-to-Many relationships only) |
|
|
239
|
+
| `ownerSide` | Which entity owns the foreign key |
|
|
240
|
+
| `cascadeBehavior` | What happens on delete/update of the parent |
|
|
241
|
+
| `sourceStory` | Traceability reference |
|
|
242
|
+
| `businessRule` | Plain-language description of the relationship constraint |
|
|
243
|
+
|
|
244
|
+
### 6.3 Cardinality Decision Matrix
|
|
245
|
+
|
|
246
|
+
| Question | If YES | If NO |
|
|
247
|
+
|-------------------------------------------------------------|-------------------------------------------------------------------------------------|--------------------|
|
|
248
|
+
| Can one instance of A be associated with many B? | B stores Many-to-One FK to A; child collection fetched at application layer | Check reverse |
|
|
249
|
+
| Can one instance of B be associated with many A? | A stores Many-to-One FK to B; child collection fetched at application layer | One-to-One |
|
|
250
|
+
| Can both A and B have many of each other? | Many-to-Many | — |
|
|
251
|
+
| Does A cease to exist without B? | Composition (strong) | Association (weak) |
|
|
252
|
+
| Does the relationship itself carry data (e.g., timestamps)? | Promote to join entity | Use simple FK/join |
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## 7. Phase 5: Cross-Cutting Concern Extraction
|
|
257
|
+
|
|
258
|
+
### 7.1 Instruction
|
|
259
|
+
|
|
260
|
+
The agent MUST scan the **Non-Functional Requirements** section of the PRD and map each requirement to its impact on the domain model. See **Appendix B** for a comprehensive mapping table.
|
|
261
|
+
|
|
262
|
+
### 7.2 Base Entity Pattern
|
|
263
|
+
|
|
264
|
+
If audit fields, soft delete, or optimistic locking are implied by NFRs or user stories, the agent SHOULD define a base entity specification that all domain entities inherit from. At minimum, this base entity should include:
|
|
265
|
+
|
|
266
|
+
| Field | Type | Purpose |
|
|
267
|
+
|---------------|----------|----------------------------------------|
|
|
268
|
+
| `id` | UUID | Primary key |
|
|
269
|
+
| `version` | Long | Optimistic locking |
|
|
270
|
+
| `createdAt` | Instant | Record creation timestamp |
|
|
271
|
+
| `createdBy` | String | Actor who created the record |
|
|
272
|
+
| `updatedAt` | Instant | Last modification timestamp |
|
|
273
|
+
| `updatedBy` | String | Actor who last modified the record |
|
|
274
|
+
| `deleted` | Boolean | Soft delete flag (if applicable) |
|
|
275
|
+
| `deletedAt` | Instant | Soft delete timestamp (if applicable) |
|
|
276
|
+
| `deletedBy` | String | Actor who deleted (if applicable) |
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## 8. Phase 6: Bounded Context Identification
|
|
281
|
+
|
|
282
|
+
### 8.1 Context Boundary Rules
|
|
283
|
+
|
|
284
|
+
Group entities into Bounded Contexts based on these heuristics:
|
|
285
|
+
|
|
286
|
+
| Heuristic | Application |
|
|
287
|
+
|------------------------------------|----------------------------------------------------------------------------------------|
|
|
288
|
+
| **Module headers** | Module names from the PRD are primary candidates for bounded contexts |
|
|
289
|
+
| **Shared actors** | Stories with the same actor role often belong to the same context |
|
|
290
|
+
| **Transactional cohesion** | Entities that MUST be modified together in one transaction belong in the same aggregate |
|
|
291
|
+
| **Independent lifecycle** | Entities that can be created/deleted independently MAY belong in different contexts |
|
|
292
|
+
| **Ubiquitous language boundary** | If the same word means different things in different modules, those are separate contexts |
|
|
293
|
+
|
|
294
|
+
### 8.2 Context Map
|
|
295
|
+
|
|
296
|
+
The agent MUST produce a context map showing each bounded context with its contained aggregates and the relationship type between contexts:
|
|
297
|
+
|
|
298
|
+
| Relationship Type | Description |
|
|
299
|
+
|----------------------------|----------------------------------------------------------------|
|
|
300
|
+
| **Shared Kernel** | Shared model between contexts |
|
|
301
|
+
| **Customer-Supplier** | Upstream/downstream dependency |
|
|
302
|
+
| **Conformist** | Downstream conforms to upstream's model |
|
|
303
|
+
| **Anti-Corruption Layer** | Translation layer between contexts |
|
|
304
|
+
| **Published Language** | Shared API contract |
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## 9. Phase 7: Output Specification
|
|
309
|
+
|
|
310
|
+
The agent MUST produce **two deliverables**:
|
|
311
|
+
|
|
312
|
+
### 9.1 Domain Model Section (appended to the PRD markdown)
|
|
313
|
+
|
|
314
|
+
The following subsections MUST be added to the PRD document:
|
|
315
|
+
|
|
316
|
+
#### 9.1.1 Entity Catalog
|
|
317
|
+
|
|
318
|
+
A markdown table listing all extracted entities:
|
|
319
|
+
|
|
320
|
+
| Column | Description |
|
|
321
|
+
|--------------------|------------------------------------------------------|
|
|
322
|
+
| Entity | Entity name (PascalCase) |
|
|
323
|
+
| DDD Type | Aggregate Root, Entity, Value Object, Enum, or Join Entity |
|
|
324
|
+
| Bounded Context | Which context/module this entity belongs to |
|
|
325
|
+
| Key Attributes | Primary attributes (comma-separated summary) |
|
|
326
|
+
| Relationships | Summary of relationships with cardinality notation |
|
|
327
|
+
| Source Stories | List of user story IDs this entity was derived from |
|
|
328
|
+
|
|
329
|
+
#### 9.1.2 Attribute Detail
|
|
330
|
+
|
|
331
|
+
For each entity in the catalog, a dedicated attribute table containing:
|
|
332
|
+
|
|
333
|
+
| Column | Description |
|
|
334
|
+
|---------------|------------------------------------------------------------------|
|
|
335
|
+
| Attribute | camelCase field name |
|
|
336
|
+
| Type | Data type |
|
|
337
|
+
| Nullable | Yes / No |
|
|
338
|
+
| Constraints | Validation rules |
|
|
339
|
+
| Source | `EXPLICIT`, `OPERATION_INFERENCE`, `NFR`, `CONVENTION`, or `ASSUMPTION` |
|
|
340
|
+
| Source Story | Traceability reference |
|
|
341
|
+
|
|
342
|
+
#### 9.1.3 Relationship Catalog
|
|
343
|
+
|
|
344
|
+
A markdown table listing all relationships:
|
|
345
|
+
|
|
346
|
+
| Column | Description |
|
|
347
|
+
|------------------|-----------------------------------------------------------|
|
|
348
|
+
| Source Entity | Owning-side entity |
|
|
349
|
+
| Target Entity | Referenced entity |
|
|
350
|
+
| Cardinality | `1:1`, `N:1`, `M:N` — `1:N` is not modelled as an ORM relationship; child collection is resolved at the application layer |
|
|
351
|
+
| Join Entity | Name of join entity (M:N only) |
|
|
352
|
+
| Cascade Behavior | What happens on parent delete/update |
|
|
353
|
+
| Business Rule | Plain-language constraint description |
|
|
354
|
+
| Source Story | Traceability reference |
|
|
355
|
+
|
|
356
|
+
#### 9.1.4 Enum Definitions
|
|
357
|
+
|
|
358
|
+
A table for each enum listing its values, descriptions, and source stories.
|
|
359
|
+
|
|
360
|
+
#### 9.1.5 Domain Events
|
|
361
|
+
|
|
362
|
+
| Column | Description |
|
|
363
|
+
|-----------------|---------------------------------------------------------|
|
|
364
|
+
| Event Name | PascalCase, past tense |
|
|
365
|
+
| Trigger Story | User story that implies this event |
|
|
366
|
+
| Aggregate | The aggregate root that emits the event |
|
|
367
|
+
| Payload Fields | Key data carried by the event |
|
|
368
|
+
|
|
369
|
+
#### 9.1.6 Bounded Context Map
|
|
370
|
+
|
|
371
|
+
A summary table showing context names, contained aggregates, and inter-context relationship types.
|
|
372
|
+
|
|
373
|
+
#### 9.1.7 Assumptions and Ambiguities
|
|
374
|
+
|
|
375
|
+
| Column | Description |
|
|
376
|
+
|----------------------|-------------------------------------------------------|
|
|
377
|
+
| Story ID | Reference to the ambiguous user story |
|
|
378
|
+
| Entity / Attribute | The model element affected |
|
|
379
|
+
| Assumption Made | What the agent assumed |
|
|
380
|
+
| Clarification Needed | Question to resolve with the product owner |
|
|
381
|
+
|
|
382
|
+
### 9.2 ERD Mermaid File
|
|
383
|
+
|
|
384
|
+
The agent MUST produce a **Mermaid ER diagram file** with the **same base name as the PRD file** and the `.mermaid` extension.
|
|
385
|
+
|
|
386
|
+
For example, if the PRD is named `my-project-prd.md`, the ERD file MUST be named `my-project-prd.mermaid`.
|
|
387
|
+
|
|
388
|
+
The Mermaid file MUST:
|
|
389
|
+
|
|
390
|
+
- Use the `erDiagram` diagram type.
|
|
391
|
+
- Include all entities from the entity catalog.
|
|
392
|
+
- Show all attributes with their types for each entity.
|
|
393
|
+
- Show all relationships with cardinality notation and relationship labels.
|
|
394
|
+
- Use Mermaid's standard cardinality markers:
|
|
395
|
+
|
|
396
|
+
| Marker | Meaning |
|
|
397
|
+
|----------|------------------|
|
|
398
|
+
| `\|\|` | Exactly one |
|
|
399
|
+
| `o\|` | Zero or one |
|
|
400
|
+
| `\|{` | One or more |
|
|
401
|
+
| `o{` | Zero or more |
|
|
402
|
+
|
|
403
|
+
Example structure (for illustration only — do not copy literally into output):
|
|
404
|
+
|
|
405
|
+
```
|
|
406
|
+
erDiagram
|
|
407
|
+
ENTITY_A {
|
|
408
|
+
uuid id PK
|
|
409
|
+
string name
|
|
410
|
+
string status
|
|
411
|
+
timestamp created_at
|
|
412
|
+
}
|
|
413
|
+
ENTITY_B {
|
|
414
|
+
uuid id PK
|
|
415
|
+
uuid entity_a_id FK
|
|
416
|
+
string description
|
|
417
|
+
}
|
|
418
|
+
ENTITY_A ||--o{ ENTITY_B : "has"
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
---
|
|
422
|
+
|
|
423
|
+
## 10. Phase 8: Validation and Review
|
|
424
|
+
|
|
425
|
+
After generating the model, the agent MUST perform a self-review.
|
|
426
|
+
|
|
427
|
+
### 10.1 Completeness Checklist
|
|
428
|
+
|
|
429
|
+
- [ ] Every user story has at least one corresponding entity.
|
|
430
|
+
- [ ] Every entity has at least one source user story.
|
|
431
|
+
- [ ] Every entity has an `id` field and audit fields.
|
|
432
|
+
- [ ] Every state-change verb has a corresponding enum and transition rules.
|
|
433
|
+
- [ ] Every "assign X to Y" pattern has a join entity or join table.
|
|
434
|
+
- [ ] Every NFR has been analyzed for model impact.
|
|
435
|
+
- [ ] All ambiguities are flagged with proposed defaults.
|
|
436
|
+
|
|
437
|
+
### 10.2 Quality Checklist
|
|
438
|
+
|
|
439
|
+
- [ ] No aggregate contains more than 4–5 entities (split if larger).
|
|
440
|
+
- [ ] No entity has more than 15–20 attributes (decompose into value objects).
|
|
441
|
+
- [ ] All Many-to-Many relationships have clearly defined join entities.
|
|
442
|
+
- [ ] No `ONE_TO_MANY` ORM relationship exists in the model — all parent-to-child collections are resolved at the application layer via repository queries.
|
|
443
|
+
- [ ] Enum values match the role codes and states defined in the PRD.
|
|
444
|
+
- [ ] Naming conventions are consistent across all entities and attributes.
|
|
445
|
+
- [ ] The ERD Mermaid diagram is valid and parseable.
|
|
446
|
+
|
|
447
|
+
### 10.3 Refinement Pass
|
|
448
|
+
|
|
449
|
+
After initial extraction, the agent SHOULD run a second pass reviewing for:
|
|
450
|
+
|
|
451
|
+
1. Any `ONE_TO_MANY` collection field on a parent entity — replace with `MANY_TO_ONE` FK on the child and a repository query at the application layer.
|
|
452
|
+
2. Aggregates that are too large (more than 4 entities).
|
|
453
|
+
3. Attributes that should be Value Objects instead of primitives.
|
|
454
|
+
4. Missing domain events for state transitions.
|
|
455
|
+
5. Naming consistency across the entire model.
|
|
456
|
+
6. Redundant or duplicate entities across bounded contexts.
|
|
457
|
+
|
|
458
|
+
---
|
|
459
|
+
|
|
460
|
+
## Appendix A: Verb-to-Relationship Heuristics
|
|
461
|
+
|
|
462
|
+
| Verb Pattern | Relationship Type | Model Output |
|
|
463
|
+
|-----------------------------------|----------------------------|-------------------------------------------------------------|
|
|
464
|
+
| `assign X to Y` | Many-to-Many | Join entity with audit fields |
|
|
465
|
+
| `create X` | Entity lifecycle | Entity with full CRUD and audit fields |
|
|
466
|
+
| `view X logs` | Many-to-One (on log entity) | Audit/log entity with Many-to-One FK to parent; logs fetched via repository query |
|
|
467
|
+
| `deactivate / reactivate X` | State machine | `status` enum + `statusChangedAt` + transition rules |
|
|
468
|
+
| `reset X` | Command / Domain Event | Event sourcing candidate |
|
|
469
|
+
| `authenticate / log in` | Identity boundary | Credential value object or entity |
|
|
470
|
+
| `approve / reject X` | Workflow / State machine | `approvalStatus` enum + `approvedBy` + `approvedAt` |
|
|
471
|
+
| `search / filter X` | Query model | Consider read model; add indexes |
|
|
472
|
+
| `import / export X` | Batch operation | Batch job entity with status tracking |
|
|
473
|
+
| `configure / set up X` | Configuration entity | Configuration entity with key-value pairs |
|
|
474
|
+
| `classify / categorize X` | Categorization | Classification entity with Many-to-One from subject |
|
|
475
|
+
| `schedule X` | Temporal entity | `scheduledAt`, `startDate`, `endDate` fields |
|
|
476
|
+
| `notify X about Y` | Event-driven | Notification entity + template entity |
|
|
477
|
+
| `upload / attach X` | File association | Stored file entity with metadata |
|
|
478
|
+
| `X manages Y` | Many-to-One (on Y) | Y stores Many-to-One FK to X; children fetched via repository query |
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
482
|
+
## Appendix B: NFR-to-Model Impact Map
|
|
483
|
+
|
|
484
|
+
| NFR Category | Common NFR Statement | Entity / Attribute Impact |
|
|
485
|
+
|----------------------------|-------------------------------------------------|-------------------------------------------------------------------------------|
|
|
486
|
+
| **OAuth2 / OIDC** | Integration with external identity provider | `externalIdpId`, `tokenSubject`, `issuer` on the user entity |
|
|
487
|
+
| **MFA / 2FA** | Multi-factor authentication requirement | MFA configuration value object: `mfaEnabled`, `mfaType`, `mfaSecret` |
|
|
488
|
+
| **Password Policy** | Strong passwords, expiry, history | Password policy entity/VO, `passwordChangedAt`, `passwordHistory` |
|
|
489
|
+
| **Audit Trail** | Audit logging, compliance requirements | Audit log entity, auditable base entity |
|
|
490
|
+
| **Soft Delete** | Data retention, compliance | `deleted`, `deletedAt`, `deletedBy` fields on base entity |
|
|
491
|
+
| **Multi-Tenancy** | Tenant isolation | `tenantId` field, tenant-aware interface, row-level security |
|
|
492
|
+
| **Localization / i18n** | Multi-language support | `locale` field, translated text value object or translation table |
|
|
493
|
+
| **Versioning** | Optimistic locking | `version` field (Long) on base entity |
|
|
494
|
+
| **Rate Limiting** | API throttling | Rate limit policy entity per API key or user |
|
|
495
|
+
| **Data Encryption** | PII encryption at rest | Attribute-level encryption on sensitive fields |
|
|
496
|
+
| **GDPR / Privacy** | Right to erasure, consent tracking | Consent record entity, `anonymized` flag, data retention policy |
|
|
497
|
+
| **File Storage** | Document or image uploads | Stored file entity: `fileName`, `contentType`, `storageKey`, `fileSize` |
|