Create comprehensive data model with entity relationships, GDPR compliance, and data governance
Generates comprehensive data models with ER diagrams, GDPR compliance, and governance frameworks from project requirements.
npx claudepluginhub tractorjuice/arc-kit<project ID or domain, e.g. '001', 'patient records'>You are helping an enterprise architect create a comprehensive data model for a project that will guide database design, API specifications, and compliance requirements.
$ARGUMENTS
Note: The ArcKit Project Context hook has already detected all projects, artifacts, external documents, and global policies. Use that context below — no need to scan directories manually.
Read existing artifacts from the project context:
MANDATORY (warn if missing):
/arckit:requirements first — data model MUST be based on DR-xxx requirementsRECOMMENDED (read if available, note if missing):
OPTIONAL (read if available, skip silently if missing):
Identify the target project:
projects/*/ directories and find the highest NNN-* number (or start at 001 if none exist)002)projects/{NNN}-{slug}/README.md with the project name, ID, and date — the Write tool will create all parent directories automaticallyprojects/{NNN}-{slug}/external/README.md with a note to place external reference documents herePROJECT_ID = the 3-digit number, PROJECT_PATH = the new directory pathRead external documents and policies:
external/ files) — extract entity definitions, relationships, data types, constraints, existing schemas, migration requirementsprojects/000-global/external/ — extract enterprise data dictionaries, master data management standards, cross-project data architecture patternsprojects/{project-dir}/external/ and re-run, or skip."Read the template (with user override support):
.arckit/templates/data-model-template.md exists in the project root${CLAUDE_PLUGIN_ROOT}/templates/data-model-template.md (default)Tip: Users can customize templates with
/arckit:customize data-model
Extract data requirements:
ARC-*-REQ-*.md)Load Mermaid Syntax Reference:
${CLAUDE_PLUGIN_ROOT}/skills/mermaid-syntax/references/entityRelationshipDiagram.md for official Mermaid ER diagram syntax — entity definitions, relationship types, cardinality notation, and attribute syntax.Generate comprehensive data model:
A. Executive Summary:
B. Visual Entity-Relationship Diagram (ERD):
C. Entity Catalog (E-001, E-002, etc.):
Entity ID: E-001, E-002, etc.
Entity Name: Customer, Transaction, Product, etc.
Description: What this entity represents
Source Requirement: Which DR-xxx requirement(s) drive this entity
Business Owner: From stakeholder RACI matrix
Technical Owner: Data steward or database team
Data Classification: Public/Internal/Confidential/Restricted
Estimated Volume: Initial records + growth rate
Retention Period: How long data is kept (GDPR requirement)
Attributes Table:
| Attribute | Type | Required | PII | Description | Validation | Source Req |
|-----------|------|----------|-----|-------------|------------|------------|
| customer_id | UUID | Yes | No | Unique identifier | UUID v4 | DR-001 |
| email | String(255) | Yes | Yes | Contact email | RFC 5322, unique | DR-002 |
Relationships: What other entities this connects to
Indexes: Primary key, foreign keys, performance indexes
Privacy Notes: GDPR considerations, data subject rights
D. Data Governance Matrix:
E. CRUD Matrix (Create, Read, Update, Delete):
Map which components/systems can perform which operations on each entity
Example:
| Entity | Payment API | Admin Portal | Reporting Service | CRM Integration |
|--------|-------------|--------------|-------------------|-----------------|
| E-001: Customer | CR-- | CRUD | -R-- | -R-- |
| E-002: Transaction | CR-- | -R-- | -R-- | ---- |
Helps identify unauthorized access patterns and data flows
F. Data Integration Mapping:
G. Privacy & Compliance:
H. Data Quality Framework:
I. Requirements Traceability:
Create traceability table:
| Requirement | Entity | Attributes | Rationale |
|-------------|--------|------------|-----------|
| DR-001 | E-001: Customer | customer_id, email, name | Store customer identity |
| DR-002 | E-002: Transaction | transaction_id, amount, status | Track payments |
| NFR-SEC-003 | E-001: Customer | password_hash (encrypted) | Secure authentication |
Show how every DR-xxx requirement maps to entities/attributes
Flag any DR-xxx requirements NOT yet modeled (gaps)
J. Implementation Guidance:
UK Government Compliance (if applicable):
Before writing the file, read ${CLAUDE_PLUGIN_ROOT}/references/quality-checklist.md and verify all Common Checks plus the DATA per-type checks pass. Fix any failures before proceeding.
projects/{project-dir}/ARC-{PROJECT_ID}-DATA-v1.0.mddata-model-template.mdIMPORTANT - Auto-Populate Document Information Fields:
Before completing the document, populate document information fields:
[PROJECT_ID] → Extract from project path (e.g., "001")[VERSION] → Start with "1.0" for new documents[DATE] / [YYYY-MM-DD] → Current date in YYYY-MM-DD format[DOCUMENT_TYPE_NAME] → Document purposeARC-[PROJECT_ID]-DATA-v[VERSION] → Generated document ID[STATUS] → "DRAFT" for new documents[CLASSIFICATION] → Default to "OFFICIAL" (UK Gov) or "PUBLIC"[PROJECT_NAME] → Full project name[OWNER_NAME_AND_ROLE] → Document owner| 1.0 | {DATE} | ArcKit AI | Initial creation from `/arckit:data-model` command |
**Generated by**: ArcKit `/arckit:data-model` command
**Generated on**: {DATE}
**ArcKit Version**: {ARCKIT_VERSION}
**Project**: {PROJECT_NAME} (Project {PROJECT_ID})
**AI Model**: [Actual model name]
/arckit:hld-review to validate database technology choices")User: /arckit:data-model Create data model for payment gateway project
You should:
projects/001-payment-gateway-modernization/)projects/001-payment-gateway-modernization/ARC-001-DATA-v1.0.md
Data model drives database schema, API contracts, and data governance policies
GDPR compliance is MANDATORY for any PII - identify and protect it
Every entity MUST trace back to at least one DR-xxx requirement
Data ownership is critical - assign business owners from stakeholder RACI matrix
PII requires special handling: encryption at rest, encryption in transit, access controls, audit logging, retention limits
Use Mermaid ERD syntax for GitHub-renderable diagrams (not PlantUML or other formats)
Data quality metrics should be measurable (not "high quality", use "99% accuracy")
Consider data lifecycle: creation, updates, archival, deletion (GDPR "right to erasure")
Reference architecture principles from any ARC-000-PRIN-*.md file in projects/000-global/ if they exist
Flag any DR-xxx requirements that cannot be modeled (gaps for requirements clarification)
UK Government data projects: The data model supports National Data Strategy alignment — Data Foundations pillar (metadata, standards, quality) and Availability pillar (data access, sharing). The Data Quality Framework section maps to the Government Data Quality Framework 6 dimensions. See docs/guides/national-data-strategy.md and docs/guides/data-quality-framework.md for full mappings.
Markdown escaping: When writing less-than or greater-than comparisons, always include a space after < or > (e.g., < 3 seconds, > 99.9% uptime) to prevent markdown renderers from interpreting them as HTML tags or emoji
ARC-*-REQ-*.md) for DR-xxx requirementsARC-*-STKE-*.md) for data ownership RACI matrixARC-*-SOBC-*.md) for data-related costs and benefits/arckit:hld-review (validates database technology choices)/arckit:dld-review (validates schema design, indexes, query patterns)/arckit:sow (RFP includes data migration, data governance requirements)/arckit:traceability (DR-xxx → Entity → Attribute → HLD Component)CRITICAL - Token Efficiency:
Create the comprehensive data model following the template structure with all sections.
Use the Write tool to create projects/[PROJECT]/ARC-{PROJECT_ID}-DATA-v1.0.md with the complete data model.
DO NOT output the full document in your response. This would exceed token limits.
After writing the file, show ONLY a concise summary:
## Data Model Complete ✅
**Project**: [Project Name]
**File Created**: `projects/[PROJECT]/ARC-{PROJECT_ID}-DATA-v1.0.md`
### Data Model Summary
**Entities**: [Number] entities modeled
- Core Entities: [List main entities, e.g., Customer, Order, Payment]
- Supporting Entities: [List supporting entities]
- Lookup/Reference Data: [List reference tables]
**Relationships**: [Number] relationships defined
- One-to-Many: [Number]
- Many-to-Many: [Number]
- One-to-One: [Number]
**Attributes**: [Number] total attributes across all entities
- PII Attributes: [Number] (GDPR-sensitive)
- Encrypted Attributes: [Number]
- Indexed Attributes: [Number] (for performance)
**GDPR Compliance**:
- PII Entities: [List entities containing PII]
- Legal Basis: [e.g., Consent, Contract, Legitimate Interest]
- DPIA Required: [Yes/No]
- Retention Periods: [Range, e.g., 6 months to 7 years]
**Data Governance**:
- Data Owners: [Number] stakeholders assigned as data owners
- CRUD Matrix: [Number] roles/systems defined
- Access Controls: [Summary of who can access what]
**Compliance Requirements**:
- [List: GDPR, PCI-DSS, HIPAA, SOX, etc. as applicable]
**Requirements Traceability**:
- Data Requirements Mapped: [Number] DR-xxx requirements
- Unmapped Requirements: [Number] (need clarification)
### What's in the Document
- Entity Relationship Diagram (Mermaid ERD)
- Detailed Entity Catalog (all attributes, data types, constraints)
- GDPR Compliance Matrix (PII identification and protection)
- Data Governance Framework (ownership, CRUD matrix)
- Data Quality Metrics (accuracy, completeness, timeliness targets)
- Data Retention Policy (by entity)
- Encryption and Security Requirements
- Requirements Traceability Matrix (DR-xxx → Entity mapping)
### Next Steps
- Review `ARC-{PROJECT_ID}-DATA-v1.0.md` for full ERD and entity details
- Validate with data owners and stakeholders
- Run `/arckit:research` to research database technologies
- Run `/arckit:hld-review` after HLD is created
Statistics to Include:
Generate the data model now, write to file using Write tool, and show only the summary above.