p3c-mysql-database

Enforce Alibaba P3C MySQL standards for schema design and SQL quality.

36|10|Updated Feb 5, 2026
One-click install
npx skills add https://github.com/jie023/trae-setting --skill p3c-mysql-database
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: p3c-mysql-database
Source: https://github.com/jie023/trae-setting/tree/main/skills/p3c-mysql-database
Command: npx skills add https://github.com/jie023/trae-setting --skill p3c-mysql-database

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides standardized MySQL database guidelines aligned with P3C, covering table creation rules, SQL statement standards, indexing strategies, and ORM mapping requirements to improve consistency and quality.

Core Features & Use Cases

  • Enforces mandatory fields and conventions: id as primary key, business_id as unique foreign key, create_time, update_time, delete_state, delete_time; field naming uses lowercase with underscores; all fields include comments.
  • Provides SQL and indexing rules: proper data types, using decimals for numbers, avoiding reserved words, and recommended index strategies for performance.
  • Use Case: An enterprise Java service schema is refactored to align with P3C standards to ensure maintainability and easier code reviews.

Quick Start

Apply the p3c-mysql-database skill to audit a schema.sql or ORM mapping file against the P3C guidelines and generate a compliant schema template.

Frequently Asked Questions about p3c-mysql-database

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce MySQL naming conventions and mandatory fields for database design?

To enforce MySQL naming conventions and mandatory fields, apply P3C database standards requiring lowercase underscore names, mandatory fields like id, business_id, create_time, update_time, delete_state, and delete_time, plus comprehensive field comments for schema consistency.

What are the P3C SQL best practices for indexing and data types in MySQL?

P3C SQL best practices for MySQL indexing and data types mandate using decimals for numbers to avoid precision loss, avoiding reserved words, selecting proper data types, and applying recommended index strategies to optimize query performance.

Can I audit an existing schema.sql file against Alibaba P3C MySQL database standards?

Yes, you can audit an existing schema.sql file against Alibaba P3C MySQL database standards. This process checks table creation rules, ORM mapping requirements, and data lifecycle constraints to generate a fully compliant schema template.

Does P3C database design support ORM mapping requirements for enterprise Java services?

P3C database design supports ORM mapping requirements for enterprise Java services by enforcing standardized table creation rules, unique foreign keys like business_id, and proper data types to ensure maintainability and easier code reviews during schema refactoring.

Why does P3C require specific lifecycle fields like delete_state and delete_time in MySQL tables?

P3C requires specific lifecycle fields like delete_state and delete_time in MySQL tables to enforce soft deletion and track data lifecycle constraints. This ensures consistent audit trails and prevents permanent data loss during enterprise application operations.