test-new-chantal

SKILL开发
开发 未标注权限 许可证不明确
安装这个技能

Design robust, scalable database schemas for SQL and NoSQL databases. Provides normalization guidelines, indexing strategies, migration patterns, constraint design, and performance optimization. Ensures data integrity, query performance, and maintainable data models.

一句话选型结论

按资料字段整理

test-new-chantal是开发类的 Agent Skill,安装方式未标注,权限级别未标注,许可证不明确,有可直接复制的安装命令。技能本质是给模型读的说明书,效果取决于模型与客户端;装完先用一个小任务验证,再放进正式流程。

分类开发 安装方式未标注 权限级别未标注权限 许可证许可证不明确
累计安装 未标注 本周 未标注
GitHub 星标 未标注 仓库 未标注
下载量 未标注 技能市场下载数
权限级别 未标注权限 安装前请确认风险范围
许可证 许可证不明确 未说明

安装

未标注
在支持 Skills 的客户端里执行,装完问一句「你有哪些技能」验证
skillhub install user_f699b15f/test-new-chantal
  1. 1
    确认客户端支持

    确认你的客户端支持 Skills(Claude、Codex、Cursor 等),并升级到较新的版本。

  2. 2
    拿到技能文件

    执行上面的命令安装;也可以把仓库里的 SKILL.md 手动放进客户端的 skills 目录。

  3. 3
    刷新技能列表

    重新打开客户端,或刷新技能列表,让新放进来的技能被加载。

  4. 4
    验证是否生效

    问一句「你有哪些技能」,确认列表里出现它,再拿一个小任务试跑。

技能档案

开发
字段来自技能仓库与公开索引,中文说明由本站标注
作者 / 维护方user_f699b15f仓库 未标注 · 版本 未标注
宿主客户端未标注技能可被这些客户端加载
安装方式未标注安装包 community
权限级别未标注权限安装前请确认风险范围
许可证未说明许可证不明确,商用前请自行确认条款
仓库可用性available技能仓库当前是否可访问
最近核验未标注上游最后核验时间 · 数据更新 1791703714
正文体量17.2 KBSKILL.md 原文大小,越大说明说明书写得越细

典型使用场景

3 类
按分类整理的常见用法,具体以 SKILL.md 为准
写代码与改 bug

按需求补代码、定位并修掉报错。

读仓库与生成改动

让模型读懂项目结构,再给出可落地的改动。

跑测试与排查故障

按现象排查问题,补测试用例并复跑。

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有可直接复制的安装命令,不用自己翻文档找入口。

先想清楚的地方

  • 没有标注权限级别,实际能做什么要装好后确认。
  • 许可证不明确,商用或二次分发前先到仓库确认条款。
  • 没有做站内核验,内容以作者仓库为准。
  • 技能只是说明书,实际效果取决于模型与客户端,装完先用小任务试一遍。

更适合

  • 需要在开发场景里给模型补一套做法的人。
  • 愿意先读一遍 SKILL.md、确认它会让模型做什么的人。

不太适合

  • 对许可证要求很严、必须明确可商用的人。
  • 只想装完就自动变强、不打算看说明书的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
技能权限级别安装方式累计安装宿主客户端安装命令
test-new-chantal当前 未标注权限 未标注 未标注 未标注 有
技能审查员 浏览器控制 ClawHub 市场 877.9 万 OpenClaw 有
Vercel React 最佳实践 浏览器控制 GitHub 仓库 849.1 万 Codex、Claude、Cursor 有
GitHub 代码协作 联网访问 ClawHub 市场 763.3 万 OpenClaw 有
网页设计指南 联网访问 GitHub 仓库 668.6 万 Codex、Claude、Cursor 有
本体论 只读 ClawHub 市场 663.7 万 OpenClaw 有

SKILL.md 全文

17.2 KB
模型实际读到的说明书原文,来自技能仓库

Database Schema Designer

Design production-ready database schemas with best practices built-in.


Quick Start

Just describe your data model:

design a schema for an e-commerce platform with users, products, orders

You'll get a complete SQL schema like:

CREATE TABLE users (
  id BIGINT AUTO_INCREMENT PRIMARY KEY,
  email VARCHAR(255) UNIQUE NOT NULL,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE orders (
  id BIGINT AUTO_INCREMENT PRIMARY KEY,
  user_id BIGINT NOT NULL REFERENCES users(id),
  total DECIMAL(10,2) NOT NULL,
  INDEX idx_orders_user (user_id)
);

What to include in your request:
- Entities (users, products, orders)
- Key relationships (users have orders, orders have items)
- Scale hints (high-traffic, millions of records)
- Database preference (SQL/NoSQL) - defaults to SQL if not specified


Triggers

Trigger Example
design schema "design a schema for user authentication"
database design "database design for multi-tenant SaaS"
create tables "create tables for a blog system"
schema for "schema for inventory management"
model data "model data for real-time analytics"
I need a database "I need a database for tracking orders"
design NoSQL "design NoSQL schema for product catalog"

Key Terms

Term Definition
Normalization Organizing data to reduce redundancy (1NF → 2NF → 3NF)
3NF Third Normal Form - no transitive dependencies between columns
OLTP Online Transaction Processing - write-heavy, needs normalization
OLAP Online Analytical Processing - read-heavy, benefits from denormalization
Foreign Key (FK) Column that references another table's primary key
Index Data structure that speeds up queries (at cost of slower writes)
Access Pattern How your app reads/writes data (queries, joins, filters)
Denormalization Intentionally duplicating data to speed up reads

Quick Reference

Task Approach Key Consideration
New schema Normalize to 3NF first Domain modeling over UI
SQL vs NoSQL Access patterns decide Read/write ratio matters
Primary keys INT or UUID UUID for distributed systems
Foreign keys Always constrain ON DELETE strategy critical
Indexes FKs + WHERE columns Column order matters
Migrations Always reversible Backward compatible first

Process Overview

Your Data Requirements
    |
    v
+-----------------------------------------------------+
| Phase 1: ANALYSIS                                   |
| * Identify entities and relationships               |
| * Determine access patterns (read vs write heavy)   |
| * Choose SQL or NoSQL based on requirements         |
+-----------------------------------------------------+
    |
    v
+-----------------------------------------------------+
| Phase 2: DESIGN                                     |
| * Normalize to 3NF (SQL) or embed/reference (NoSQL) |
| * Define primary keys and foreign keys              |
| * Choose appropriate data types                     |
| * Add constraints (UNIQUE, CHECK, NOT NULL)         |
+-----------------------------------------------------+
    |
    v
+-----------------------------------------------------+
| Phase 3: OPTIMIZE                                   |
| * Plan indexing strategy                            |
| * Consider denormalization for read-heavy queries   |
| * Add timestamps (created_at, updated_at)           |
+-----------------------------------------------------+
    |
    v
+-----------------------------------------------------+
| Phase 4: MIGRATE                                    |
| * Generate migration scripts (up + down)            |
| * Ensure backward compatibility                     |
| * Plan zero-downtime deployment                     |
+-----------------------------------------------------+
    |
    v
Production-Ready Schema

Commands

Command When to Use Action
design schema for {domain} Starting fresh Full schema generation
normalize {table} Fixing existing table Apply normalization rules
add indexes for {table} Performance issues Generate index strategy
migration for {change} Schema evolution Create reversible migration
review schema Code review Audit existing schema

Workflow: Start with design schema → iterate with normalize → optimize with add indexes → evolve with migration


Core Principles

Principle WHY Implementation
Model the Domain UI changes, domain doesn't Entity names reflect business concepts
Data Integrity First Corruption is costly to fix Constraints at database level
Optimize for Access Pattern Can't optimize for both OLTP: normalized, OLAP: denormalized
Plan for Scale Retrofitting is painful Index strategy + partitioning plan

Anti-Patterns

Avoid Why Instead
VARCHAR(255) everywhere Wastes storage, hides intent Size appropriately per field
FLOAT for money Rounding errors DECIMAL(10,2)
Missing FK constraints Orphaned data Always define foreign keys
No indexes on FKs Slow JOINs Index every foreign key
Storing dates as strings Can't compare/sort DATE, TIMESTAMP types
SELECT * in queries Fetches unnecessary data Explicit column lists
Non-reversible migrations Can't rollback Always write DOWN migration
Adding NOT NULL without default Breaks existing rows Add nullable, backfill, then constrain

Verification Checklist

After designing a schema:

  • [ ] Every table has a primary key
  • [ ] All relationships have foreign key constraints
  • [ ] ON DELETE strategy defined for each FK
  • [ ] Indexes exist on all foreign keys
  • [ ] Indexes exist on frequently queried columns
  • [ ] Appropriate data types (DECIMAL for money, etc.)
  • [ ] NOT NULL on required fields
  • [ ] UNIQUE constraints where needed
  • [ ] CHECK constraints for validation
  • [ ] created_at and updated_at timestamps
  • [ ] Migration scripts are reversible
  • [ ] Tested on staging with production data

<details>
<summary><strong>Deep Dive: Normalization (SQL)</strong></summary>

Normal Forms

Form Rule Violation Example
1NF Atomic values, no repeating groups product_ids = &#x27;1,2,3&#x27;
2NF 1NF + no partial dependencies customer_name in order_items
3NF 2NF + no transitive dependencies country derived from postal_code

1st Normal Form (1NF)

-- BAD: Multiple values in column
CREATE TABLE orders (
  id INT PRIMARY KEY,
  product_ids VARCHAR(255)  -- &#x27;101,102,103&#x27;
);

-- GOOD: Separate table for items
CREATE TABLE orders (
  id INT PRIMARY KEY,
  customer_id INT
);

CREATE TABLE order_items (
  id INT PRIMARY KEY,
  order_id INT REFERENCES orders(id),
  product_id INT
);

2nd Normal Form (2NF)

-- BAD: customer_name depends only on customer_id
CREATE TABLE order_items (
  order_id INT,
  product_id INT,
  customer_name VARCHAR(100),  -- Partial dependency!
  PRIMARY KEY (order_id, product_id)
);

-- GOOD: Customer data in separate table
CREATE TABLE customers (
  id INT PRIMARY KEY,
  name VARCHAR(100)
);

3rd Normal Form (3NF)

-- BAD: country depends on postal_code
CREATE TABLE customers (
  id INT PRIMARY KEY,
  postal_code VARCHAR(10),
  country VARCHAR(50)  -- Transitive dependency!
);

-- GOOD: Separate postal_codes table
CREATE TABLE postal_codes (
  code VARCHAR(10) PRIMARY KEY,
  country VARCHAR(50)
);

When to Denormalize

Scenario Denormalization Strategy
Read-heavy reporting Pre-calculated aggregates
Expensive JOINs Cached derived columns
Analytics dashboards Materialized views
-- Denormalized for performance
CREATE TABLE orders (
  id INT PRIMARY KEY,
  customer_id INT,
  total_amount DECIMAL(10,2),  -- Calculated
  item_count INT               -- Calculated
);

</details>

<details>
<summary><strong>Deep Dive: Data Types</strong></summary>

String Types

Type Use Case Example
CHAR(n) Fixed length State codes, ISO dates
VARCHAR(n) Variable length Names, emails
TEXT Long content Articles, descriptions
-- Good sizing
email VARCHAR(255)
phone VARCHAR(20)
country_code CHAR(2)

Numeric Types

Type Range Use Case
TINYINT -128 to 127 Age, status codes
SMALLINT -32K to 32K Quantities
INT -2.1B to 2.1B IDs, counts
BIGINT Very large Large IDs, timestamps
DECIMAL(p,s) Exact precision Money
FLOAT/DOUBLE Approximate Scientific data
-- ALWAYS use DECIMAL for money
price DECIMAL(10, 2)  -- $99,999,999.99

-- NEVER use FLOAT for money
price FLOAT  -- Rounding errors!

Date/Time Types

DATE        -- 2025-10-31
TIME        -- 14:30:00
DATETIME    -- 2025-10-31 14:30:00
TIMESTAMP   -- Auto timezone conversion

-- Always store in UTC
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

Boolean

-- PostgreSQL
is_active BOOLEAN DEFAULT TRUE

-- MySQL
is_active TINYINT(1) DEFAULT 1

</details>

<details>
<summary><strong>Deep Dive: Indexing Strategy</strong></summary>

When to Create Indexes

Always Index Reason
Foreign keys Speed up JOINs
WHERE clause columns Speed up filtering
ORDER BY columns Speed up sorting
Unique constraints Enforced uniqueness
-- Foreign key index
CREATE INDEX idx_orders_customer ON orders(customer_id);

-- Query pattern index
CREATE INDEX idx_orders_status_date ON orders(status, created_at);

Index Types

Type Best For Example
B-Tree Ranges, equality price &gt; 100
Hash Exact matches only email = &#x27;x@y.com&#x27;
Full-text Text search MATCH AGAINST
Partial Subset of rows WHERE is_active = true

Composite Index Order

CREATE INDEX idx_customer_status ON orders(customer_id, status);

-- Uses index (customer_id first)
SELECT * FROM orders WHERE customer_id = 123;
SELECT * FROM orders WHERE customer_id = 123 AND status = &#x27;pending&#x27;;

-- Does NOT use index (status alone)
SELECT * FROM orders WHERE status = &#x27;pending&#x27;;

Rule: Most selective column first, or column most queried alone.

Index Pitfalls

Pitfall Problem Solution
Over-indexing Slow writes Only index what's queried
Wrong column order Unused index Match query patterns
Missing FK indexes Slow JOINs Always index FKs

</details>

<details>
<summary><strong>Deep Dive: Constraints</strong></summary>

Primary Keys

-- Auto-increment (simple)
id INT AUTO_INCREMENT PRIMARY KEY

-- UUID (distributed systems)
id CHAR(36) PRIMARY KEY DEFAULT (UUID())

-- Composite (junction tables)
PRIMARY KEY (student_id, course_id)

Foreign Keys

FOREIGN KEY (customer_id) REFERENCES customers(id)
  ON DELETE CASCADE     -- Delete children with parent
  ON DELETE RESTRICT    -- Prevent deletion if referenced
  ON DELETE SET NULL    -- Set to NULL when parent deleted
  ON UPDATE CASCADE     -- Update children when parent changes
Strategy Use When
CASCADE Dependent data (order_items)
RESTRICT Important references (prevent accidents)
SET NULL Optional relationships

Other Constraints

-- Unique
email VARCHAR(255) UNIQUE NOT NULL

-- Composite unique
UNIQUE (student_id, course_id)

-- Check
price DECIMAL(10,2) CHECK (price &gt;= 0)
discount INT CHECK (discount BETWEEN 0 AND 100)

-- Not null
name VARCHAR(100) NOT NULL

</details>

<details>
<summary><strong>Deep Dive: Relationship Patterns</strong></summary>

One-to-Many

CREATE TABLE orders (
  id INT PRIMARY KEY,
  customer_id INT NOT NULL REFERENCES customers(id)
);

CREATE TABLE order_items (
  id INT PRIMARY KEY,
  order_id INT NOT NULL REFERENCES orders(id) ON DELETE CASCADE,
  product_id INT NOT NULL,
  quantity INT NOT NULL
);

Many-to-Many

-- Junction table
CREATE TABLE enrollments (
  student_id INT REFERENCES students(id) ON DELETE CASCADE,
  course_id INT REFERENCES courses(id) ON DELETE CASCADE,
  enrolled_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (student_id, course_id)
);

Self-Referencing

CREATE TABLE employees (
  id INT PRIMARY KEY,
  name VARCHAR(100) NOT NULL,
  manager_id INT REFERENCES employees(id)
);

Polymorphic

-- Approach 1: Separate FKs (stronger integrity)
CREATE TABLE comments (
  id INT PRIMARY KEY,
  content TEXT NOT NULL,
  post_id INT REFERENCES posts(id),
  photo_id INT REFERENCES photos(id),
  CHECK (
    (post_id IS NOT NULL AND photo_id IS NULL) OR
    (post_id IS NULL AND photo_id IS NOT NULL)
  )
);

-- Approach 2: Type + ID (flexible, weaker integrity)
CREATE TABLE comments (
  id INT PRIMARY KEY,
  content TEXT NOT NULL,
  commentable_type VARCHAR(50) NOT NULL,
  commentable_id INT NOT NULL
);

</details>

<details>
<summary><strong>Deep Dive: NoSQL Design (MongoDB)</strong></summary>

Embedding vs Referencing

Factor Embed Reference
Access pattern Read together Read separately
Relationship 1:few 1:many
Document size Small Approaching 16MB
Update frequency Rarely Frequently

Embedded Document

{
  &quot;_id&quot;: &quot;order_123&quot;,
  &quot;customer&quot;: {
    &quot;id&quot;: &quot;cust_456&quot;,
    &quot;name&quot;: &quot;Jane Smith&quot;,
    &quot;email&quot;: &quot;jane@example.com&quot;
  },
  &quot;items&quot;: [
    { &quot;product_id&quot;: &quot;prod_789&quot;, &quot;quantity&quot;: 2, &quot;price&quot;: 29.99 }
  ],
  &quot;total&quot;: 109.97
}

Referenced Document

{
  &quot;_id&quot;: &quot;order_123&quot;,
  &quot;customer_id&quot;: &quot;cust_456&quot;,
  &quot;item_ids&quot;: [&quot;item_1&quot;, &quot;item_2&quot;],
  &quot;total&quot;: 109.97
}

MongoDB Indexes

// Single field
db.users.createIndex({ email: 1 }, { unique: true });

// Composite
db.orders.createIndex({ customer_id: 1, created_at: -1 });

// Text search
db.articles.createIndex({ title: &quot;text&quot;, content: &quot;text&quot; });

// Geospatial
db.stores.createIndex({ location: &quot;2dsphere&quot; });

</details>

<details>
<summary><strong>Deep Dive: Migrations</strong></summary>

Migration Best Practices

Practice WHY
Always reversible Need to rollback
Backward compatible Zero-downtime deploys
Schema before data Separate concerns
Test on staging Catch issues early

Adding a Column (Zero-Downtime)

-- Step 1: Add nullable column
ALTER TABLE users ADD COLUMN phone VARCHAR(20);

-- Step 2: Deploy code that writes to new column

-- Step 3: Backfill existing rows
UPDATE users SET phone = &#x27;&#x27; WHERE phone IS NULL;

-- Step 4: Make required (if needed)
ALTER TABLE users MODIFY phone VARCHAR(20) NOT NULL;

Renaming a Column (Zero-Downtime)

-- Step 1: Add new column
ALTER TABLE users ADD COLUMN email_address VARCHAR(255);

-- Step 2: Copy data
UPDATE users SET email_address = email;

-- Step 3: Deploy code reading from new column
-- Step 4: Deploy code writing to new column

-- Step 5: Drop old column
ALTER TABLE users DROP COLUMN email;

Migration Template

-- Migration: YYYYMMDDHHMMSS_description.sql

-- UP
BEGIN;
ALTER TABLE users ADD COLUMN phone VARCHAR(20);
CREATE INDEX idx_users_phone ON users(phone);
COMMIT;

-- DOWN
BEGIN;
DROP INDEX idx_users_phone ON users;
ALTER TABLE users DROP COLUMN phone;
COMMIT;

</details>

<details>
<summary><strong>Deep Dive: Performance Optimization</strong></summary>

Query Analysis

EXPLAIN SELECT * FROM orders
WHERE customer_id = 123 AND status = &#x27;pending&#x27;;
Look For Meaning
type: ALL Full table scan (bad)
type: ref Index used (good)
key: NULL No index used
rows: high Many rows scanned

N+1 Query Problem

# BAD: N+1 queries
orders = db.query(&quot;SELECT * FROM orders&quot;)
for order in orders:
    customer = db.query(f&quot;SELECT * FROM customers WHERE id = {order.customer_id}&quot;)

# GOOD: Single JOIN
results = db.query(&quot;&quot;&quot;
    SELECT orders.*, customers.name
    FROM orders
    JOIN customers ON orders.customer_id = customers.id
&quot;&quot;&quot;)

Optimization Techniques

Technique When to Use
Add indexes Slow WHERE/ORDER BY
Denormalize Expensive JOINs
Pagination Large result sets
Caching Repeated queries
Read replicas Read-heavy load
Partitioning Very large tables

</details>


Extension Points

  1. Database-Specific Patterns: Add MySQL vs PostgreSQL vs SQLite variations
  2. Advanced Patterns: Time-series, event sourcing, CQRS, multi-tenancy
  3. ORM Integration: TypeORM, Prisma, SQLAlchemy patterns
  4. Monitoring: Query performance tracking, slow query alerts

常见问题

5 问
答案由本站依据条目字段整理
test-new-chantal怎么安装?

在支持 Skills 的客户端里执行:skillhub install user_f699b15f/test-new-chantal。安装方式为未标注。装完刷新技能列表或重开客户端。

test-new-chantal支持哪些客户端?

资料没有标注宿主客户端,但只要客户端支持 Skills(Claude、Codex、Cursor 等),一般都能加载。

test-new-chantal权限高吗,安全吗?

权限级别为未标注权限。安装前先看它会读取或写入哪些内容。

test-new-chantal收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于技能本身和所用的模型或客户端,正式使用前按作者说明确认。

test-new-chantal用什么许可证?

许可证标注为 未说明(许可证不明确)。商用或二次分发前请到仓库确认条款原文。

热门专题

按场景挑技能
全部专题 →

技能内容以作者仓库为准;分类、权限级别与许可证状态的中文说明为中文整理,最近核验 未标注。