Token导航 LogoToken导航TokenDH.com
开发只读clawhub未标认证来源可访问clear审计通过

mysql8-crm-schema-expertmysql8 CRM schema expert 开发

Agent Skill

用于辅助数据库表结构、查询语句、迁移脚本和数据维护任务。它适合让 Agent 分析 schema、编写 SQL、排查查询问题、整理索引或生成迁移建议。使用时需要明确数据库类型、连接环境和目标表,区分只读分析与写入变更;涉及删除、更新、迁移和批量导入时,应优先 dry-run、备份或事务保护,避免误操作。

总安装

2,775

周安装

118

GitHub Stars

公开资料未说明

下载量

972
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:mysql8-crm-schema-expert(mysql8 CRM schema expert 开发)
来源仓库:https://github.com/encryptshawn/mysql8-crm-schema-expert
安装命令:
openclaw skills install mysql8-crm-schema-expert
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install mysql8-crm-schema-expert

简介

mysql8-crm-schema-expert 专注于 CRM 系统的 MySQL 8 数据库设计。

  • 提供表结构设计、索引优化与模式审查服务。
  • 适用于客户管理系统开发与性能调优需求。mysql8-crm-schema-expert 属于开发类 Skill,可作为该场景下的辅助能力补充。
  • 输出结果应结合具体业务实体与查询模式定制。
  • 避免通用模板,需根据实际数据量与并发要求评估方案。

SKILL.md

name
mysql8-design-crm
version
1.0.0
description
>

MySQL 8 CRM Database Design Skill

A comprehensive guide for designing production-quality MySQL 8 database schemas for CRM (Customer Relationship Management) systems. This skill covers everything from core entity design to advanced patterns like EAV custom fields, polymorphic activities, audit trails, and multi-tenant architectures.

How to Use This Skill

This skill is organized into a main guide (this file) and detailed reference documents. Read the relevant reference file before generating any SQL or making design decisions.

Reference Files

Read these from references/ as needed:

FileWhen to Read
core-entities.mdDesigning the foundational CRM tables (accounts, contacts, leads, opportunities, etc.)
relationships-and-normalization.mdEstablishing foreign keys, junction tables, and achieving proper normal forms
indexing-and-performance.mdCreating indexes, query optimization, partitioning, and performance tuning
custom-fields-and-flexibility.mdImplementing EAV patterns, JSON columns, or hybrid approaches for user-defined fields
audit-and-soft-deletes.mdChange tracking, audit trails, soft delete patterns, and compliance logging
activities-and-timeline.mdPolymorphic activity feeds, notes, tasks, emails, calls, and event tracking
security-and-multitenancy.mdRow-level security, role-based access, tenant isolation, and data privacy
migrations-and-seeding.mdSchema versioning, migration scripts, and realistic test data generation
reference-schemas.mdComplete example schemas you can use as starting points

Core Design Principles

When designing a CRM database on MySQL 8, always follow these principles:

  1. Relational integrity first. Define FOREIGN KEY constraints at the database level. Never rely on application code alone to maintain referential integrity.
  1. Normalize to 3NF, then denormalize deliberately. Start at Third Normal Form. Only denormalize when you have measured performance evidence, and document the reason.
  1. Consistent naming conventions. Use snake_case for all identifiers. Table names are plural (contacts, accounts). Foreign keys follow the pattern {singular_referenced_table}_id (e.g., account_id). Timestamps are created_at, updated_at, deleted_at.
  1. Every table gets an audit baseline. At minimum: id (BIGINT UNSIGNED AUTO_INCREMENT), created_at, updated_at. Most CRM tables also need created_by and updated_by.
  1. Soft deletes over hard deletes. CRM data has legal, compliance, and historical reporting value. Use deleted_at (TIMESTAMP NULL) rather than DELETE statements.
  1. Use BIGINT UNSIGNED for primary keys. INT runs out at ~2.1 billion. CRM tables like activities and audit logs grow fast. BIGINT UNSIGNED gives you headroom through 18.4 quintillion.
  1. UTF8MB4 everywhere. Always CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci. Customer names, notes, and communications contain international characters and emoji.
  1. InnoDB only. All tables use InnoDB for transaction support, row-level locking, foreign key enforcement, and crash recovery.
  1. Timestamps use DATETIME(3) or TIMESTAMP. For CRM, prefer DATETIME(3) for event times (timezone-independent, millisecond precision). Use TIMESTAMP for created_at/updated_at with DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP.
  1. Design for integration. CRM systems connect to email, marketing, billing, and support tools. Include external_id or external_source columns on entities that sync with third-party systems.

Standard Table Template

Every CRM table should follow this baseline structure:

CREATE TABLE `table_name` (
    `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,

    -- entity-specific columns here --

    `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `deleted_at` TIMESTAMP NULL DEFAULT NULL,
    `created_by` BIGINT UNSIGNED NULL DEFAULT NULL,
    `updated_by` BIGINT UNSIGNED NULL DEFAULT NULL,

    PRIMARY KEY (`id`),
    INDEX `idx_table_name_deleted_at` (`deleted_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Workflow for Designing a CRM Schema

Follow this sequence when the user asks you to design a CRM database:

  1. Clarify scope. Determine which CRM modules are needed: contacts/accounts, sales pipeline, marketing/campaigns, support/tickets, or all of the above.
  1. Read the relevant reference files. Always start with core-entities.md. Add others based on the modules identified.
  1. Design entities first, relationships second. List the tables and their columns, then define the foreign keys and junction tables.
  1. Apply indexing strategy. Read indexing-and-performance.md and add indexes for every foreign key, every column used in WHERE/JOIN/ORDER BY, and composite indexes for common query patterns.
  1. Add flexibility layer. If the user needs custom fields, read custom-fields-and-flexibility.md and choose between EAV, JSON columns, or a hybrid approach.
  1. Add audit and compliance. Read audit-and-soft-deletes.md and implement the appropriate level of change tracking.
  1. Generate migration scripts. Read migrations-and-seeding.md and output versioned, idempotent migration SQL.
  1. Review and validate. Walk through the schema checking for: missing indexes on FKs, missing NOT NULL constraints, missing default values, orphan risk, and query patterns that would cause full table scans.

MySQL 8 Features to Leverage

These MySQL 8 specific features are particularly valuable for CRM schemas:

  • JSON columns for semi-structured data (custom fields, metadata, integration payloads). See custom-fields-and-flexibility.md.
  • Generated columns (VIRTUAL or STORED) to extract and index JSON values.
  • Functional indexes (8.0.13+) to index expressions without explicit generated columns.
  • Multi-valued indexes (8.0.17+) to index JSON arrays efficiently.
  • Common Table Expressions (CTEs) for recursive queries on hierarchical data (org charts, account hierarchies, nested categories).
  • Window functions for pipeline analytics (running totals, rank, lead/lag).
  • CHECK constraints for data validation at the database level.
  • DEFAULT expressions for computed defaults.
  • Invisible indexes for safe testing of index removal.
  • Descending indexes for optimizing ORDER BY ... DESC queries.

Quick Decision Guide

SituationAction
User needs a full CRM from scratchRead core-entities.md + reference-schemas.md, design all modules
User needs just contacts + accountsRead core-entities.md, design the contact/account module only
User asks about custom fieldsRead custom-fields-and-flexibility.md
User has performance concernsRead indexing-and-performance.md
User needs GDPR/compliance supportRead audit-and-soft-deletes.md + security-and-multitenancy.md
User is building multi-tenant SaaS CRMRead security-and-multitenancy.md
User wants to track all user activityRead activities-and-timeline.md
User needs migration scriptsRead migrations-and-seeding.md
User wants a ready-to-use schemaRead reference-schemas.md

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

98.37%
按下载量换算956

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills