/starlake-skills:starflow-schema-designfrom starlake-skills
Design Starlake-compatible table schemas with types, constraints, privacy, and expectations. Use when the user says "design schema" or "create table definition".
Ships in starlake-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Guides the design of Starlake-compatible table schemas including attribute definitions, custom types with regex validation, privacy annotations, and data quality expectations. Outputs ready-to-use .sl.yml configuration files for Starlake load operations.
Role Guidance: Act as a Data Architect with deep knowledge of Starlake's schema definition format and data typing system.
Design Rationale: Schemas are the contract between data producers and consumers. Starlake enforces schemas at load time, rejecting records that don't conform. Well-designed schemas prevent bad data from entering the pipeline.
{planning_artifacts}/source-analysis-*.md if available.{planning_artifacts}/data-architecture-*.md if available.Define project-specific types in metadata/types/custom.sl.yml:
version: 1
types:
- name: "email"
pattern: "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"
primitiveType: "string"
- name: "phone"
pattern: "^\\+?[0-9\\s\\-\\.\\(\\)]{7,20}$"
primitiveType: "string"
- name: "sku"
pattern: "^[A-Z]{2,4}-[0-9]{4,8}$"
primitiveType: "string"
For each table, create the .sl.yml file with:
Example structure:
version: 1
table:
name: "customers"
pattern: "customers.*\\.csv"
writeStrategy:
type: "UPSERT_BY_KEY_AND_TIMESTAMP"
key: ["customer_id"]
timestamp: "updated_at"
attributes:
- name: "customer_id"
type: "long"
required: true
- name: "email"
type: "email"
required: true
privacy: "SHA256"
- name: "name"
type: "string"
required: true
- name: "created_at"
type: "timestamp"
required: true
- name: "updated_at"
type: "timestamp"
required: true
Define data quality expectations as Jinja2 macros:
{# Reusable macro for non-null check #}
{% macro not_null(column) %}
SELECT COUNT(*) = 0 FROM SL_THIS WHERE {{ column }} IS NULL
{% endmacro %}
{# Domain-specific check #}
{% macro valid_email(column) %}
SELECT COUNT(*) = 0 FROM SL_THIS
WHERE {{ column }} NOT LIKE '%@%.%'
{% endmacro %}
Create the domain _config.sl.yml:
version: 1
load:
metadata:
directory: "{incoming_dir}/{domain_name}"
multiline: false
encoding: "UTF-8"
withHeader: true
separator: ","
quote: "\""
Generate:
{planning_artifacts}/schema-design-{{domain_name}}.md.sl.yml files to {implementation_artifacts}/schemas/config skill for the complete attribute types catalog (string, int, long, date, timestamp, etc.)load skill for write strategy reference (APPEND, OVERWRITE, SCD2, UPSERT, etc.)infer-schema skill to auto-infer schemas from existing data filesexpectations skill for Jinja2 macro syntax when defining quality checksComplete Starlake-compatible schema definitions with custom types, privacy annotations, and expectations: ready to be placed in the metadata/load/ directory.
What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (starlake-ai/starlake-skills) — no native marketplace selected
npx claudepluginhub p/starlake-ai-starlake-skills75 skills in this plugin
/acl-dependenciesVisualize access control with `starlake acl-dependencies` — graph which users and groups can access which tables, from the ACL and RLS (row-level security) definitions in your YAML, output as SVG, PNG, or JSON/autoloadInfer schemas from files in the incoming directory and load them into the warehouse in one step with `starlake autoload`. Use for quick starts or new data files with no YAML table definitions yet; generates the table configs automatically./bootstrapCreate a new Starlake project with `starlake bootstrap` — scaffold the standard metadata/load/transform directory structure and starter config from a template (quickstart, simple). Use when initializing or setting up a new project.