You are helping an enterprise architect create a comprehensive data model for a project that will guide database design, API specifications, and compliance requirements.
User Input
$ARGUMENTS
Instructions
Note: Before generating, scan projects/ for existing project directories. For each project, list all ARC-*.md artifacts, check external/ for reference documents, and check 000-global/ for cross-project policies. If no external docs exist but they would improve output, ask the user.
Read existing artifacts from the project context:
MANDATORY (warn if missing):
- REQ (Requirements)
- Extract: All DR (data requirements), NFR-SEC (security/privacy), INT (integration/data exchange), BR (data-related business requirements)
- If missing: STOP and warn user to run
$arckit-requirements first — data model MUST be based on DR-xxx requirements
RECOMMENDED (read if available, note if missing):
- STKE (Stakeholder Analysis)
- Extract: Data owners from RACI matrix, governance stakeholders, data stewardship responsibilities
- PRIN (Architecture Principles, in 000-global)
- Extract: Data governance standards, privacy by design principles, data sovereignty requirements
OPTIONAL (read if available, skip silently if missing):
- SOBC (Business Case)
- Extract: Data-related benefits and costs
- RSCH (Research Findings)
- Extract: Database technology recommendations, data platform choices
Identify the target project:
- Use the ArcKit Project Context (above) to find the project matching the user's input (by name or number)
- If no match, create a new project:
- Use Glob to list
projects/*/ directories and find the highest NNN-* number (or start at 001 if none exist)
- Calculate the next number (zero-padded to 3 digits, e.g.,
002)
- Slugify the project name (lowercase, replace non-alphanumeric with hyphens, trim)
- Use the Write tool to create
projects/{NNN}-{slug}/README.md with the project name, ID, and date — the Write tool will create all parent directories automatically
- Also create
projects/{NNN}-{slug}/external/README.md with a note to place external reference documents here
- Set
PROJECT_ID = the 3-digit number, PROJECT_PATH = the new directory path
Read external documents and policies:
- Read any external documents listed in the project context (
external/ files) — extract entity definitions, relationships, data types, constraints, existing schemas, migration requirements
- Read any enterprise standards in
projects/000-global/external/ — extract enterprise data dictionaries, master data management standards, cross-project data architecture patterns
- If no external docs exist but they would improve the data model, ask: "Do you have any existing database schemas, ERD diagrams, or data dictionaries? I can read PDFs, images, and SQL files directly. Place them in
projects/{project-dir}/external/ and re-run, or skip."
- Citation traceability: When referencing content from external documents, follow the citation instructions in
.arckit/references/citation-instructions.md. Place inline citation markers (e.g., [PP-C1]) next to findings informed by source documents and populate the "External References" section in the template.
Read the template (with user override support):
- First, check if
.arckit/templates-custom/data-model-template.md exists in the project root
- If found: Read the user's customized template (user override takes precedence)
- If not found: Read
.arckit/templates/data-model-template.md (default)
- Then read
.arckit/templates/_partials/RENDERING.md and resolve the <!-- DOC-CONTROL-HEADER --> marker in the template before writing. Do not hand-write the Document Control table: the partial RENDERING.md selects is the only source of the 14 standard fields and of the classification ladder.
Tip: Users can customize templates with $arckit-customize data-model
Extract data requirements:
- Read the project's requirements document (
ARC-*-REQ-*.md)
- Extract ALL Data Requirements (DR-xxx)
- Also look for privacy/GDPR requirements in NFR section
- Identify integration requirements (INT-xxx) that involve data exchange
- Note any data-related business requirements (BR-xxx)
Load Mermaid Syntax Reference:
- Read
.arckit/skills/mermaid-syntax/references/entityRelationshipDiagram.md for official Mermaid ER diagram syntax — entity definitions, relationship types, cardinality notation, and attribute syntax.
Mermaid ERD Rules (apply to every erDiagram block you write):
- Valid key types:
PK, FK, UK only. To put more than one key on an attribute, comma-separate them: uuid tenant_id FK, UK "One assignment per tenant". Space-separating (FK UK) and concatenating (PK_FK) are both parse errors — Mermaid reports Expecting 'BLOCK_STOP', 'ATTRIBUTE_WORD', ',', 'COMMENT' and the whole block silently fails to render (#435).
- Attribute comments are double-quoted and go last on the line. A comment cannot itself contain a
", and an unclosed quote breaks the block.
- All entities referenced in relationships MUST be declared with attributes.
Generate comprehensive data model:
A. Executive Summary:
- Total number of entities identified
- Data classification summary (Public, Internal, Confidential, Restricted)
- PII/sensitive data identified (Yes/No)
- GDPR/DPA 2018 compliance status
- Key data governance stakeholders
B. Visual Entity-Relationship Diagram (ERD):
- Create Mermaid ERD syntax showing:
- All entities (E-001, E-002, etc.)
- Relationships (one-to-one, one-to-many, many-to-many)
- Cardinality notation
- Organise by logical domain/bounded context if possible
- Use descriptive entity and relationship names
C. Entity Catalog (E-001, E-002, etc.):
- For each entity, document:
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:
- For each entity, identify:
- Data Owner: Business stakeholder responsible (from RACI matrix)
- Data Steward: Person responsible for quality and compliance
- Data Custodian: Technical team managing storage/backups
- Access Control: Who can view/modify (roles/permissions)
- Sensitivity: Public, Internal, Confidential, Restricted
- Compliance: GDPR, PCI-DSS, HIPAA, etc.
- Quality SLA: Accuracy, completeness, timeliness targets
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:
- Upstream Systems: Where data comes from
- System name, entity mapping, update frequency, data quality SLA
- Downstream Systems: Where data goes to
- System name, entity mapping, sync method (API, batch, event), latency SLA
- Master Data Management: Which system is "source of truth" for each entity
G. Privacy & Compliance:
- GDPR/DPA 2018 Compliance:
- List all PII attributes across all entities
- Document legal basis for processing (consent, contract, legitimate interest, etc.)
- Data subject rights implementation (access, rectification, erasure, portability)
- Data retention schedules per entity
- Cross-border data transfer considerations (UK-EU adequacy)
- Data Protection Impact Assessment (DPIA):
- Is DPIA required? (Yes if high-risk processing of PII)
- Key privacy risks identified
- Mitigation measures
- ICO notification requirements
- Sector-Specific Compliance:
- PCI-DSS: If payment card data (special handling requirements)
- HIPAA: If healthcare data (US projects)
- FCA regulations: If financial services (UK)
- Government Security Classifications: If public sector (OFFICIAL, SECRET)
H. Data Quality Framework:
- Quality Dimensions:
- Accuracy: How correct is the data? (validation rules, reference data)
- Completeness: Required fields populated? (% target)
- Consistency: Same data across systems? (reconciliation rules)
- Timeliness: How current is the data? (update frequency, staleness tolerance)
- Uniqueness: No duplicates? (deduplication rules)
- Validity: Conforms to format? (regex patterns, enums, ranges)
- Data Quality Metrics:
- Define measurable targets per entity (e.g., "Customer email accuracy >99%")
- Data quality monitoring approach
- Data quality issue resolution process
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:
- Database Technology Recommendation:
- Relational (PostgreSQL, MySQL) for transactional data
- Document (MongoDB, DynamoDB) for flexible schemas
- Graph (Neo4j) for highly connected data
- Time-series (InfluxDB, TimescaleDB) for metrics/events
- Schema Migration Strategy: How to evolve schema (Flyway, Liquibase, Alembic)
- Backup and Recovery: RPO/RTO targets, backup frequency
- Data Archival: When to move data from hot to cold storage
- Testing Data: Anonymization/pseudonymization for test environments
UK Government Compliance (if applicable):
- Government Security Classifications: OFFICIAL, SECRET, TOP SECRET
- Data Standards: Use GDS Data Standards Catalogue where applicable
- Open Standards: Preference for open data formats (JSON, CSV, OData)
- ICO Data Protection: Reference ICO guidance for public sector
- National Cyber Security Centre (NCSC): Data security patterns
Before writing the file, read .arckit/references/quality-checklist.md and verify all Common Checks plus the DATA per-type checks pass. Fix any failures before proceeding.
- Write the output:
- Write to
projects/{project-dir}/ARC-{PROJECT_ID}-DATA-v1.0.md
- Use the exact template structure from
data-model-template.md
- Include Mermaid ERD at the top for quick visualization
- Include all sections even if some are TBD
- Create comprehensive entity catalog with ALL attributes
IMPORTANT - Auto-Populate Document Information Fields:
Before completing the document, populate document information fields:
Auto-populated 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 purpose
ARC-[PROJECT_ID]-DATA-v[VERSION] → Generated document ID
[STATUS] → "DRAFT" for new documents
- Classification → comes from the resolved Document Control header, not from a placeholder.
_partials/RENDERING.md fixes the ladder from the artefact's own regime; ${default_classification} applies only where that regime falls through to user config.
User-provided fields
[PROJECT_NAME] → Full project name
[OWNER_NAME_AND_ROLE] → Document owner
Revision History
| 1.0 | {DATE} | ArcKit AI | Initial creation from `$arckit-data-model` command |
Generation Metadata Footer
**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]
- Summarize what you created:
- How many entities defined (E-001, E-002, etc.)
- How many total attributes across all entities
- How many entities contain PII (privacy-sensitive)
- Data classification breakdown (Public/Internal/Confidential/Restricted)
- GDPR compliance status (compliant / needs DPIA / gaps identified)
- Key data governance stakeholders identified
- Requirements coverage (% of DR-xxx requirements modeled)
- Suggested next steps (e.g., "Review data model with data protection officer before proceeding to HLD" or "Run
$arckit-hld-review to validate database technology choices")
Example Usage
User: $arckit-data-model Create data model for payment gateway project
You should:
- Check prerequisites (requirements document exists, stakeholder analysis recommended)
- Find project directory (e.g.,
projects/001-payment-gateway-modernization/)
- Extract DR-xxx requirements from the requirements document
- Generate comprehensive data model:
- Mermaid ERD showing Customer, Transaction, PaymentMethod, RefundRequest entities
- Detailed entity catalog with attributes, PII flags, retention periods
- GDPR compliance: PII identified, legal basis documented, DPIA required
- Data governance: CFO owns financial data, DPO owns PII, IT owns storage
- CRUD matrix: Payment API can create transactions, Admin can read all, Reporting read-only
- PCI-DSS compliance: Payment card data encrypted, tokenized, not stored long-term
- Requirements traceability: All DR-001 through DR-008 mapped to entities
- CRITICAL - Token Efficiency: Use the Write tool to create
projects/001-payment-gateway-modernization/ARC-001-DATA-v1.0.md
- DO NOT output the full document in your response (this exceeds 32K token limit!)
- Show summary only (see Output Instructions below)
Important Notes
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
Integration with Other Commands
- Input: Requires requirements document (
ARC-*-REQ-*.md) for DR-xxx requirements
- Input: Uses stakeholder analysis (
ARC-*-STKE-*.md) for data ownership RACI matrix
- Input: References SOBC (
ARC-*-SOBC-*.md) for data-related costs and benefits
- Output: Feeds into
$arckit-hld-review (validates database technology choices)
- Output: Feeds into
$arckit-dld-review (validates schema design, indexes, query patterns)
- Output: Feeds into
$arckit-sow (RFP includes data migration, data governance requirements)
- Output: Supports
$arckit-traceability (DR-xxx → Entity → Attribute → HLD Component)
Output Instructions
CRITICAL - Token Efficiency:
1. Generate Data Model
Create the comprehensive data model following the template structure with all sections.
2. Write Directly to File
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.
3. Show Summary Only
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:
- Number of entities
- Number of relationships
- Number of PII attributes
- Number of data requirements mapped
- Number of data owners assigned
- DPIA required (yes/no)
- Compliance frameworks applicable
Generate the data model now, write to file using Write tool, and show only the summary above.
Suggested Next Steps
After completing this command, consider running:
$arckit-hld-review -- Validate database technology choices
$arckit-dld-review -- Validate schema design and query patterns
$arckit-sow -- Include data migration and governance in RFP
$arckit-traceability -- Map DR-xxx to entities and attributes
1---2name: arckit-data-model3description: Create comprehensive data model with entity relationships, GDPR compliance, and data governance4---56You are helping an enterprise architect create a comprehensive data model for a project that will guide database design, API specifications, and compliance requirements.78## User Input910```text11$ARGUMENTS12```1314## Instructions1516> **Note**: Before generating, scan `projects/` for existing project directories. For each project, list all `ARC-*.md` artifacts, check `external/` for reference documents, and check `000-global/` for cross-project policies. If no external docs exist but they would improve output, ask the user.17181. **Read existing artifacts from the project context:**1920 **MANDATORY** (warn if missing):21 - **REQ** (Requirements)22 - Extract: All DR (data requirements), NFR-SEC (security/privacy), INT (integration/data exchange), BR (data-related business requirements)23 - If missing: STOP and warn user to run `$arckit-requirements` first — data model MUST be based on DR-xxx requirements2425 **RECOMMENDED** (read if available, note if missing):26 - **STKE** (Stakeholder Analysis)27 - Extract: Data owners from RACI matrix, governance stakeholders, data stewardship responsibilities28 - **PRIN** (Architecture Principles, in 000-global)29 - Extract: Data governance standards, privacy by design principles, data sovereignty requirements3031 **OPTIONAL** (read if available, skip silently if missing):32 - **SOBC** (Business Case)33 - Extract: Data-related benefits and costs34 - **RSCH** (Research Findings)35 - Extract: Database technology recommendations, data platform choices36372. **Identify the target project**:38 - Use the **ArcKit Project Context** (above) to find the project matching the user's input (by name or number)39 - If no match, create a new project:40 1. Use Glob to list `projects/*/` directories and find the highest `NNN-*` number (or start at `001` if none exist)41 2. Calculate the next number (zero-padded to 3 digits, e.g., `002`)42 3. Slugify the project name (lowercase, replace non-alphanumeric with hyphens, trim)43 4. Use the Write tool to create `projects/{NNN}-{slug}/README.md` with the project name, ID, and date — the Write tool will create all parent directories automatically44 5. Also create `projects/{NNN}-{slug}/external/README.md` with a note to place external reference documents here45 6. Set `PROJECT_ID` = the 3-digit number, `PROJECT_PATH` = the new directory path46473. **Read external documents and policies**:48 - Read any **external documents** listed in the project context (`external/` files) — extract entity definitions, relationships, data types, constraints, existing schemas, migration requirements49 - Read any **enterprise standards** in `projects/000-global/external/` — extract enterprise data dictionaries, master data management standards, cross-project data architecture patterns50 - If no external docs exist but they would improve the data model, ask: "Do you have any existing database schemas, ERD diagrams, or data dictionaries? I can read PDFs, images, and SQL files directly. Place them in `projects/{project-dir}/external/` and re-run, or skip."51 - **Citation traceability**: When referencing content from external documents, follow the citation instructions in `.arckit/references/citation-instructions.md`. Place inline citation markers (e.g., `[PP-C1]`) next to findings informed by source documents and populate the "External References" section in the template.52534. **Read the template** (with user override support):54 - **First**, check if `.arckit/templates-custom/data-model-template.md` exists in the project root55 - **If found**: Read the user's customized template (user override takes precedence)56 - **If not found**: Read `.arckit/templates/data-model-template.md` (default)57 - **Then read** `.arckit/templates/_partials/RENDERING.md` and resolve the `<!-- DOC-CONTROL-HEADER -->` marker in the template before writing. Do not hand-write the Document Control table: the partial `RENDERING.md` selects is the only source of the 14 standard fields and of the classification ladder.5859 > **Tip**: Users can customize templates with `$arckit-customize data-model`60615. **Extract data requirements**:62 - Read the project's requirements document (`ARC-*-REQ-*.md`)63 - Extract ALL Data Requirements (DR-xxx)64 - Also look for privacy/GDPR requirements in NFR section65 - Identify integration requirements (INT-xxx) that involve data exchange66 - Note any data-related business requirements (BR-xxx)67686. **Load Mermaid Syntax Reference**:69 - Read `.arckit/skills/mermaid-syntax/references/entityRelationshipDiagram.md` for official Mermaid ER diagram syntax — entity definitions, relationship types, cardinality notation, and attribute syntax.7071 **Mermaid ERD Rules** (apply to every `erDiagram` block you write):7273 - Valid key types: `PK`, `FK`, `UK` only. To put more than one key on an attribute, **comma-separate** them: `uuid tenant_id FK, UK "One assignment per tenant"`. Space-separating (`FK UK`) and concatenating (`PK_FK`) are both parse errors — Mermaid reports `Expecting 'BLOCK_STOP', 'ATTRIBUTE_WORD', ',', 'COMMENT'` and the whole block silently fails to render (#435).74 - Attribute comments are double-quoted and go last on the line. A comment cannot itself contain a `"`, and an unclosed quote breaks the block.75 - All entities referenced in relationships MUST be declared with attributes.76777. **Generate comprehensive data model**:7879 **A. Executive Summary**:80 - Total number of entities identified81 - Data classification summary (Public, Internal, Confidential, Restricted)82 - PII/sensitive data identified (Yes/No)83 - GDPR/DPA 2018 compliance status84 - Key data governance stakeholders8586 **B. Visual Entity-Relationship Diagram (ERD)**:87 - Create Mermaid ERD syntax showing:88 - All entities (E-001, E-002, etc.)89 - Relationships (one-to-one, one-to-many, many-to-many)90 - Cardinality notation91 - Organise by logical domain/bounded context if possible92 - Use descriptive entity and relationship names9394 **C. Entity Catalog** (E-001, E-002, etc.):95 - For each entity, document:96 - **Entity ID**: E-001, E-002, etc.97 - **Entity Name**: Customer, Transaction, Product, etc.98 - **Description**: What this entity represents99 - **Source Requirement**: Which DR-xxx requirement(s) drive this entity100 - **Business Owner**: From stakeholder RACI matrix101 - **Technical Owner**: Data steward or database team102 - **Data Classification**: Public/Internal/Confidential/Restricted103 - **Estimated Volume**: Initial records + growth rate104 - **Retention Period**: How long data is kept (GDPR requirement)105 - **Attributes Table**:106107 ```text108 | Attribute | Type | Required | PII | Description | Validation | Source Req |109 |-----------|------|----------|-----|-------------|------------|------------|110 | customer_id | UUID | Yes | No | Unique identifier | UUID v4 | DR-001 |111 | email | String(255) | Yes | Yes | Contact email | RFC 5322, unique | DR-002 |112 ```113114 - **Relationships**: What other entities this connects to115 - **Indexes**: Primary key, foreign keys, performance indexes116 - **Privacy Notes**: GDPR considerations, data subject rights117118 **D. Data Governance Matrix**:119 - For each entity, identify:120 - **Data Owner**: Business stakeholder responsible (from RACI matrix)121 - **Data Steward**: Person responsible for quality and compliance122 - **Data Custodian**: Technical team managing storage/backups123 - **Access Control**: Who can view/modify (roles/permissions)124 - **Sensitivity**: Public, Internal, Confidential, Restricted125 - **Compliance**: GDPR, PCI-DSS, HIPAA, etc.126 - **Quality SLA**: Accuracy, completeness, timeliness targets127128 **E. CRUD Matrix** (Create, Read, Update, Delete):129 - Map which components/systems can perform which operations on each entity130 - Example:131132 ```text133 | Entity | Payment API | Admin Portal | Reporting Service | CRM Integration |134 |--------|-------------|--------------|-------------------|-----------------|135 | E-001: Customer | CR-- | CRUD | -R-- | -R-- |136 | E-002: Transaction | CR-- | -R-- | -R-- | ---- |137 ```138139 - Helps identify unauthorized access patterns and data flows140141 **F. Data Integration Mapping**:142 - **Upstream Systems**: Where data comes from143 - System name, entity mapping, update frequency, data quality SLA144 - **Downstream Systems**: Where data goes to145 - System name, entity mapping, sync method (API, batch, event), latency SLA146 - **Master Data Management**: Which system is "source of truth" for each entity147148 **G. Privacy & Compliance**:149 - **GDPR/DPA 2018 Compliance**:150 - List all PII attributes across all entities151 - Document legal basis for processing (consent, contract, legitimate interest, etc.)152 - Data subject rights implementation (access, rectification, erasure, portability)153 - Data retention schedules per entity154 - Cross-border data transfer considerations (UK-EU adequacy)155 - **Data Protection Impact Assessment (DPIA)**:156 - Is DPIA required? (Yes if high-risk processing of PII)157 - Key privacy risks identified158 - Mitigation measures159 - ICO notification requirements160 - **Sector-Specific Compliance**:161 - PCI-DSS: If payment card data (special handling requirements)162 - HIPAA: If healthcare data (US projects)163 - FCA regulations: If financial services (UK)164 - Government Security Classifications: If public sector (OFFICIAL, SECRET)165166 **H. Data Quality Framework**:167 - **Quality Dimensions**:168 - **Accuracy**: How correct is the data? (validation rules, reference data)169 - **Completeness**: Required fields populated? (% target)170 - **Consistency**: Same data across systems? (reconciliation rules)171 - **Timeliness**: How current is the data? (update frequency, staleness tolerance)172 - **Uniqueness**: No duplicates? (deduplication rules)173 - **Validity**: Conforms to format? (regex patterns, enums, ranges)174 - **Data Quality Metrics**:175 - Define measurable targets per entity (e.g., "Customer email accuracy >99%")176 - Data quality monitoring approach177 - Data quality issue resolution process178179 **I. Requirements Traceability**:180 - Create traceability table:181182 ```text183 | Requirement | Entity | Attributes | Rationale |184 |-------------|--------|------------|-----------|185 | DR-001 | E-001: Customer | customer_id, email, name | Store customer identity |186 | DR-002 | E-002: Transaction | transaction_id, amount, status | Track payments |187 | NFR-SEC-003 | E-001: Customer | password_hash (encrypted) | Secure authentication |188 ```189190 - Show how every DR-xxx requirement maps to entities/attributes191 - Flag any DR-xxx requirements NOT yet modeled (gaps)192193 **J. Implementation Guidance**:194 - **Database Technology Recommendation**:195 - Relational (PostgreSQL, MySQL) for transactional data196 - Document (MongoDB, DynamoDB) for flexible schemas197 - Graph (Neo4j) for highly connected data198 - Time-series (InfluxDB, TimescaleDB) for metrics/events199 - **Schema Migration Strategy**: How to evolve schema (Flyway, Liquibase, Alembic)200 - **Backup and Recovery**: RPO/RTO targets, backup frequency201 - **Data Archival**: When to move data from hot to cold storage202 - **Testing Data**: Anonymization/pseudonymization for test environments2032048. **UK Government Compliance** (if applicable):205 - **Government Security Classifications**: OFFICIAL, SECRET, TOP SECRET206 - **Data Standards**: Use GDS Data Standards Catalogue where applicable207 - **Open Standards**: Preference for open data formats (JSON, CSV, OData)208 - **ICO Data Protection**: Reference ICO guidance for public sector209 - **National Cyber Security Centre (NCSC)**: Data security patterns210211Before writing the file, read `.arckit/references/quality-checklist.md` and verify all **Common Checks** plus the **DATA** per-type checks pass. Fix any failures before proceeding.2122139. **Write the output**:214 - Write to `projects/{project-dir}/ARC-{PROJECT_ID}-DATA-v1.0.md`215 - Use the exact template structure from `data-model-template.md`216 - Include Mermaid ERD at the top for quick visualization217 - Include all sections even if some are TBD218 - Create comprehensive entity catalog with ALL attributes219220**IMPORTANT - Auto-Populate Document Information Fields**:221222Before completing the document, populate document information fields:223224### Auto-populated fields225226- `[PROJECT_ID]` → Extract from project path (e.g., "001")227- `[VERSION]` → Start with "1.0" for new documents228- `[DATE]` / `[YYYY-MM-DD]` → Current date in YYYY-MM-DD format229- `[DOCUMENT_TYPE_NAME]` → Document purpose230- `ARC-[PROJECT_ID]-DATA-v[VERSION]` → Generated document ID231- `[STATUS]` → "DRAFT" for new documents232- **Classification** → comes from the resolved Document Control header, not from a placeholder. `_partials/RENDERING.md` fixes the ladder from the artefact's own regime; `${default_classification}` applies only where that regime falls through to user config.233234### User-provided fields235236- `[PROJECT_NAME]` → Full project name237- `[OWNER_NAME_AND_ROLE]` → Document owner238239### Revision History240241```markdown242| 1.0 | {DATE} | ArcKit AI | Initial creation from `$arckit-data-model` command |243```244245### Generation Metadata Footer246247```markdown248**Generated by**: ArcKit `$arckit-data-model` command249**Generated on**: {DATE}250**ArcKit Version**: {ARCKIT_VERSION}251**Project**: {PROJECT_NAME} (Project {PROJECT_ID})252**AI Model**: [Actual model name]253```25425510. **Summarize what you created**:256257- How many entities defined (E-001, E-002, etc.)258- How many total attributes across all entities259- How many entities contain PII (privacy-sensitive)260- Data classification breakdown (Public/Internal/Confidential/Restricted)261- GDPR compliance status (compliant / needs DPIA / gaps identified)262- Key data governance stakeholders identified263- Requirements coverage (% of DR-xxx requirements modeled)264- Suggested next steps (e.g., "Review data model with data protection officer before proceeding to HLD" or "Run `$arckit-hld-review` to validate database technology choices")265266## Example Usage267268User: `$arckit-data-model Create data model for payment gateway project`269270You should:271272- Check prerequisites (requirements document exists, stakeholder analysis recommended)273- Find project directory (e.g., `projects/001-payment-gateway-modernization/`)274- Extract DR-xxx requirements from the requirements document275- Generate comprehensive data model:276 - Mermaid ERD showing Customer, Transaction, PaymentMethod, RefundRequest entities277 - Detailed entity catalog with attributes, PII flags, retention periods278 - GDPR compliance: PII identified, legal basis documented, DPIA required279 - Data governance: CFO owns financial data, DPO owns PII, IT owns storage280 - CRUD matrix: Payment API can create transactions, Admin can read all, Reporting read-only281 - PCI-DSS compliance: Payment card data encrypted, tokenized, not stored long-term282 - Requirements traceability: All DR-001 through DR-008 mapped to entities283- **CRITICAL - Token Efficiency**: Use the **Write tool** to create `projects/001-payment-gateway-modernization/ARC-001-DATA-v1.0.md`284 - **DO NOT** output the full document in your response (this exceeds 32K token limit!)285- Show summary only (see Output Instructions below)286287## Important Notes288289- **Data model drives database schema, API contracts, and data governance policies**290- **GDPR compliance is MANDATORY for any PII - identify and protect it**291- **Every entity MUST trace back to at least one DR-xxx requirement**292- **Data ownership is critical - assign business owners from stakeholder RACI matrix**293- **PII requires special handling**: encryption at rest, encryption in transit, access controls, audit logging, retention limits294- **Use Mermaid ERD syntax** for GitHub-renderable diagrams (not PlantUML or other formats)295- **Data quality metrics should be measurable** (not "high quality", use "99% accuracy")296- **Consider data lifecycle**: creation, updates, archival, deletion (GDPR "right to erasure")297- **Reference architecture principles** from any `ARC-000-PRIN-*.md` file in `projects/000-global/` if they exist298- **Flag any DR-xxx requirements that cannot be modeled** (gaps for requirements clarification)299- **UK Government data projects**: The data model supports [National Data Strategy](https://www.gov.uk/government/publications/uk-national-data-strategy/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](https://www.gov.uk/government/publications/the-government-data-quality-framework/the-government-data-quality-framework) 6 dimensions. See `docs/guides/national-data-strategy.md` and `docs/guides/data-quality-framework.md` for full mappings.300301- **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 emoji302303## Integration with Other Commands304305- **Input**: Requires requirements document (`ARC-*-REQ-*.md`) for DR-xxx requirements306- **Input**: Uses stakeholder analysis (`ARC-*-STKE-*.md`) for data ownership RACI matrix307- **Input**: References SOBC (`ARC-*-SOBC-*.md`) for data-related costs and benefits308- **Output**: Feeds into `$arckit-hld-review` (validates database technology choices)309- **Output**: Feeds into `$arckit-dld-review` (validates schema design, indexes, query patterns)310- **Output**: Feeds into `$arckit-sow` (RFP includes data migration, data governance requirements)311- **Output**: Supports `$arckit-traceability` (DR-xxx → Entity → Attribute → HLD Component)312313## Output Instructions314315**CRITICAL - Token Efficiency**:316317### 1. Generate Data Model318319Create the comprehensive data model following the template structure with all sections.320321### 2. Write Directly to File322323**Use the Write tool** to create `projects/[PROJECT]/ARC-{PROJECT_ID}-DATA-v1.0.md` with the complete data model.324325**DO NOT** output the full document in your response. This would exceed token limits.326327### 3. Show Summary Only328329After writing the file, show ONLY a concise summary:330331```markdown332## Data Model Complete ✅333334**Project**: [Project Name]335**File Created**: `projects/[PROJECT]/ARC-{PROJECT_ID}-DATA-v1.0.md`336337### Data Model Summary338339**Entities**: [Number] entities modeled340- Core Entities: [List main entities, e.g., Customer, Order, Payment]341- Supporting Entities: [List supporting entities]342- Lookup/Reference Data: [List reference tables]343344**Relationships**: [Number] relationships defined345- One-to-Many: [Number]346- Many-to-Many: [Number]347- One-to-One: [Number]348349**Attributes**: [Number] total attributes across all entities350- PII Attributes: [Number] (GDPR-sensitive)351- Encrypted Attributes: [Number]352- Indexed Attributes: [Number] (for performance)353354**GDPR Compliance**:355- PII Entities: [List entities containing PII]356- Legal Basis: [e.g., Consent, Contract, Legitimate Interest]357- DPIA Required: [Yes/No]358- Retention Periods: [Range, e.g., 6 months to 7 years]359360**Data Governance**:361- Data Owners: [Number] stakeholders assigned as data owners362- CRUD Matrix: [Number] roles/systems defined363- Access Controls: [Summary of who can access what]364365**Compliance Requirements**:366- [List: GDPR, PCI-DSS, HIPAA, SOX, etc. as applicable]367368**Requirements Traceability**:369- Data Requirements Mapped: [Number] DR-xxx requirements370- Unmapped Requirements: [Number] (need clarification)371372### What's in the Document373374- Entity Relationship Diagram (Mermaid ERD)375- Detailed Entity Catalog (all attributes, data types, constraints)376- GDPR Compliance Matrix (PII identification and protection)377- Data Governance Framework (ownership, CRUD matrix)378- Data Quality Metrics (accuracy, completeness, timeliness targets)379- Data Retention Policy (by entity)380- Encryption and Security Requirements381- Requirements Traceability Matrix (DR-xxx → Entity mapping)382383### Next Steps384385- Review `ARC-{PROJECT_ID}-DATA-v1.0.md` for full ERD and entity details386- Validate with data owners and stakeholders387- Run `$arckit-research` to research database technologies388- Run `$arckit-hld-review` after HLD is created389```390391**Statistics to Include**:392393- Number of entities394- Number of relationships395- Number of PII attributes396- Number of data requirements mapped397- Number of data owners assigned398- DPIA required (yes/no)399- Compliance frameworks applicable400401Generate the data model now, write to file using Write tool, and show only the summary above.402403## Suggested Next Steps404405After completing this command, consider running:406407- `$arckit-hld-review` -- Validate database technology choices408- `$arckit-dld-review` -- Validate schema design and query patterns409- `$arckit-sow` -- Include data migration and governance in RFP410- `$arckit-traceability` -- Map DR-xxx to entities and attributes