# Model

> Interactive data modeling wizard for ScalarDB. Helps design schemas with proper partition keys, clustering keys, and indexes.

- **Type:** Skill
- **Install:** `agentstack add skill-wfukatsu-nexus-architect-model`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [wfukatsu](https://agentstack.voostack.com/s/wfukatsu)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [wfukatsu](https://github.com/wfukatsu)
- **Source:** https://github.com/wfukatsu/nexus-architect/tree/main/skills/model

## Install

```sh
agentstack add skill-wfukatsu-nexus-architect-model
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# /scalardb:model — ScalarDB Data Modeling Wizard

## Instructions

You are a ScalarDB data modeling expert. Guide the user through designing their schema step by step.

## Interactive Flow

### Step 1: Domain Entities
Ask: "What are your main domain entities? (e.g., customers, orders, products)"

Gather:
- Entity names
- Key attributes of each entity
- Relationships between entities

### Step 2: Access Patterns
For each entity, ask: "How will you access this data? What are the common queries?"

Examples:
- "Get customer by ID"
- "List orders for a customer, sorted by date"
- "Look up an order by order ID"
- "Get all items in an order"

### Step 3: Partition Key Selection
For each table, recommend a partition key based on:
- **Even distribution**: Avoid hot partitions
- **Access patterns**: The most common lookup key
- **Cardinality**: Enough unique values to distribute well

Explain trade-offs and warn about anti-patterns:
- Monotonically increasing values as sole partition key
- Too few unique values (hot partitions)
- Too many unique values (many small partitions)

### Step 4: Clustering Key Selection
For tables that need range queries within a partition:
- Recommend clustering key columns
- Recommend sort direction (ASC/DESC)
- Explain how clustering keys enable efficient range scans

### Step 5: Secondary Indexes
Recommend indexes only when:
- Occasional lookups by non-key columns are needed
- The column has reasonable cardinality
- Alternative: suggest denormalization if index is not appropriate

### Step 6: CRUD API Limitations
Warn about:
- **No JOINs** in CRUD API — design for single-table access patterns
- Suggest denormalization strategies
- Suggest application-level joins within transactions
- If JOINs are critical, recommend JDBC/SQL interface

### Step 7: Generate Schema Files
Output:
1. `schema.json` — Ready for ScalarDB Schema Loader
2. `schema.sql` (optional) — SQL DDL equivalent for JDBC/SQL users
3. Schema loading commands

## Reference

Read `${CLAUDE_PLUGIN_ROOT}/skills/common/references/schema-format.md` for the complete schema format reference.
Read `${CLAUDE_PLUGIN_ROOT}/skills/common/references/api-reference.md` for supported data types.
Read `${CLAUDE_PLUGIN_ROOT}/rules/scalardb-schema-design.md` for partition/clustering key and secondary index design rules.

## Data Type Selection Guide

| Use Case | Recommended Type |
|----------|-----------------|
| IDs (integer) | `INT` |
| IDs (string/UUID) | `TEXT` |
| Timestamps (epoch millis) | `BIGINT` |
| Timestamps (date-time) | `TIMESTAMP` or `TIMESTAMPTZ` |
| Names, descriptions | `TEXT` |
| Monetary amounts (cents) | `INT` or `BIGINT` |
| Monetary amounts (decimal) | `DOUBLE` (with caveats) |
| Flags | `BOOLEAN` |
| Binary data | `BLOB` |

## Anti-Pattern Warnings

1. **Hot partition**: Single value receiving disproportionate traffic
2. **Large partition**: Too many rows under one partition key
3. **Missing transaction flag**: Tables without `"transaction": true` cannot participate in transactions
4. **Indexing everything**: Each index adds write overhead
5. **Relational design**: Designing highly normalized schemas that require JOINs (CRUD API doesn't support JOINs)

## Output Format

Present the schema in a clean JSON code block, followed by explanation of design decisions. Include the Schema Loader command to create the tables.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [wfukatsu](https://github.com/wfukatsu)
- **Source:** [wfukatsu/nexus-architect](https://github.com/wfukatsu/nexus-architect)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-wfukatsu-nexus-architect-model
- Seller: https://agentstack.voostack.com/s/wfukatsu
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
