Arckit data model

From tractorjuice/arckit-codex · View interactive version

Arckit data model is an AI agent skill from the GitHub repository tractorjuice/arckit-codex. Create comprehensive data model with entity relationships, GDPR compliance, and data governance

How to use this skill

Skill file

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.

  1. Read existing artifacts from the project context:

MANDATORY (warn if missing):

RECOMMENDED (read if available, note if missing):

OPTIONAL (read if available, skip silently if missing):

  1. Identify the target project:

1. Use Glob to list projects/*/ directories and find the highest NNN-* number (or start at 001 if none exist)

2. Calculate the next number (zero-padded to 3 digits, e.g., 002)

3. Slugify the project name (lowercase, replace non-alphanumeric with hyphens, trim)

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 automatically

5. Also create projects/{NNN}-{slug}/external/README.md with a note to place external reference documents here

6. Set PROJECT_ID = the 3-digit number, PROJECT_PATH = the new directory path

  1. Read external documents and policies:
  1. Read the template (with user override support):

> Tip: Users can customize templates with $arckit-customize data-model

  1. Extract data requirements:
  1. Load Mermaid Syntax Reference:

Mermaid ERD Rules (apply to every erDiagram block you write):

  1. Generate comprehensive data model:

A. Executive Summary:

B. Visual Entity-Relationship Diagram (ERD):

C. Entity Catalog (E-001, E-002, etc.):

```text

| 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 |

```

D. Data Governance Matrix:

E. CRUD Matrix (Create, Read, Update, Delete):

```text

| Entity | Payment API | Admin Portal | Reporting Service | CRM Integration |

|--------|-------------|--------------|-------------------|-----------------|

| E-001: Customer | CR-- | CRUD | -R-- | -R-- |

| E-002: Transaction | CR-- | -R-- | -R-- | ---- |

```

F. Data Integration Mapping:

G. Privacy & Compliance:

H. Data Quality Framework:

I. Requirements Traceability:

```text

| 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 |

```

J. Implementation Guidance:

  1. UK Government Compliance (if applicable):

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.

  1. Write the output:

IMPORTANT - Auto-Populate Document Information Fields:

Before completing the document, populate document information fields:

Auto-populated fields

User-provided fields

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]
  1. Summarize what you created:

Example Usage

User: $arckit-data-model Create data model for payment gateway project

You should:

Important Notes

Integration with Other Commands

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-v{VERSION}.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-v{VERSION}.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-v{VERSION}.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.

Suggested Next Steps

After completing this command, consider running:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.