← スキル一覧に戻る

data-modeling
by simple-platform
Simple Platform Tools
⭐ 1🍴 1📅 2026年1月25日
SKILL.md
name: data-modeling description: Expert guide to defining enterprise-grade data models in Simple Configuration Language (SCL).
Data Modeling Skill
1. Introduction
The Data Layer is the foundation. You define your schema in apps/<app>/tables.scl.
Golden Rules:
- NO SQL: You never write
CREATE TABLE. - No Arrays: Use lists
"a", "b"NOT["a", "b"]. - No UUID Type: Use
:stringwithid_prefix.
2. Table Definition
table user, users {
default :id, :timestamps, :userstamps
id_prefix "USR"
display_field full_name
required email, :string {
length 1..100
unique true
}
}
3. Field Types & Constraints (Exhaustive)
Derived from scl-grammar.txt.
Textual
:stringlength: 100(Max) or2..100(Range)hash: true(Store as hash, e.g. passwords)secret: true(Encrypted at rest)multiline: true(Text area UI)unique: true
:char- Same constraints as
:string.
- Same constraints as
:enumvalues "Draft", "Active"(NO SPACES in values)
Numeric
:integer(4-byte),:smallint(2-byte),:bigint(8-byte)default 0,min 0,max 100
:float(Real):decimal(Currency/Precision)digits 10(Total precision)decimals 2(Scale)
Boolean
:boolean(true/false)default true
Temporal
:date(Date only):time(Time only):datetime(Timestamptz)
Structured
:json,:jsonb(Arbitrary JSON):document(File Attachments)multiple: trueallowed_types: "pdf", "jpg", "image/png"max_size: "10MB"
:version(Semver string)
4. Relationships
In-App
# Parent
has :many, orders {
table order
}
# Child
belongs :to, user {
required true
}
Cross-App (Advanced)
Referencing tables in other installed applications.
1. The belongs :to (in tables.scl)
belongs :to, job_site {
# Fully qualified table name
table com_bnv_administration.job_site
required true
}
2. The has :many (in records/30_links.scl)
Since you cannot edit the external app's tables.scl, you must use a Relationship Record.
set dev_simple_system.table_relationship, link_site_to_jobs {
name "jobs"
kind has
cardinality many
# Source = External Table
source_table_id `$var('meta') |> $jq(...)`
# Target = My Table
target_table_id `$var('meta') |> $jq(...)`
}
5. Indexes
index email { unique true }
index status, created_at { }
スコア
総合スコア
60/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です