一键导入
db-schema
Design database schemas — tables, columns, types, constraints, indexes, and
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Design database schemas — tables, columns, types, constraints, indexes, and
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Consult and write the ARAYA postoffice — the operational-directive channel. Advisory, never a gate: read it at cycle start, append your entry at cycle end, consider its directives, never be blocked by it. Governance acts never travel the postoffice.
Audit and enforce brand compliance across all projects and platforms — logo,
Design REST and GraphQL APIs following OpenAPI 3.1 standards. Produce complete
Connect frontend to backend — type-safe API clients, request/response handling,
Implement authentication and authorization middleware — JWT validation, role-based
Design scalable component architectures — design systems, component libraries,
| name | db-schema |
| description | Design database schemas — tables, columns, types, constraints, indexes, and |
| governance | Constitution ENG-004: Engineering Excellence & Software Craftsmanship Standard |
Design database schemas — tables, columns, types, constraints, indexes, and migrations — following best practices for the target database engine.
Poorly designed schemas lead to data corruption, query performance issues, and expensive migrations. This skill produces normalized schemas with proper types, constraints, indexes, and migration scripts that evolve safely.
When creating new tables, modifying existing schemas, designing a new database, or reviewing an existing schema for normalization and performance.
Data model requirements, entity relationships, query patterns, expected data volumes.
erDiagram
users ||--o{ orders : places
users {
uuid id PK
string name
string email UK
string password_hash
string role
timestamp created_at
timestamp updated_at
}
orders {
uuid id PK
uuid user_id FK
string status
decimal total
timestamp created_at
}
-- 001_create_users.up.sql
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE users (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
name VARCHAR(100) NOT NULL,
email VARCHAR(255) NOT NULL UNIQUE,
password_hash VARCHAR(255) NOT NULL,
role VARCHAR(20) NOT NULL DEFAULT 'user'
CHECK (role IN ('user', 'admin')),
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX idx_users_email ON users(email);
CREATE INDEX idx_users_role ON users(role);
-- Trigger for updated_at
CREATE OR REPLACE FUNCTION update_timestamp()
RETURNS TRIGGER AS $$
BEGIN
NEW.updated_at = NOW();
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER users_updated_at
BEFORE UPDATE ON users
FOR EACH ROW EXECUTE FUNCTION update_timestamp();
created_at, updated_at on every tablecreated_at and updated_at columns with auto-update trigger