database

Designs and governs MySQL schemas, SQL, indexes, migrations, and data access contracts.

Updated Sep 20, 2026
One-click install
npx skills add https://github.com/aascer39/codeagent --skill database-aascer39
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: database
Source: https://github.com/aascer39/codeagent/tree/main/.agents/skills/database
Command: npx skills add https://github.com/aascer39/codeagent --skill database-aascer39

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents uncontrolled or destructive database changes by enforcing a single set of rules for MySQL schema design, SQL writing, migrations, and data access in the CodeAgent project, keeping Entity, Mapper, and Service layers consistent with the actual database structure. ## Core Features & Use Cases - Schema Design Standards: Enforces snake_case naming, BIGINT auto-increment primary keys, DATETIME(3) time columns, meaningful NULL/default semantics, and business-driven unique constraints and indexes. - Safe Change Management: Routes all structural changes through the single migration carrier sql/schema.sql with idempotent DDL, and forbids destructive operations (DROP, TRUNCATE, mass DELETE) without human confirmation. - Data Access Discipline: Defines the Controller → Service → Mapper layering, parameterized SQL, transaction boundaries, pagination, batch operations, and N+1 avoidance. - Use Case: When adding a cancel-order feature, use this Skill to check the existing schema, design new columns or tables, write the idempotent SQL in sql/schema.sql, and update the Mapper and Entity consistently. ## Quick Start Ask the AI to design a new MySQL table or modify an existing one for your feature, following the database skill's schema and migration rules.

Frequently Asked Questions about database

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

FAQPage Schema
How do I add a new table to a MySQL database safely?▼

First inspect the existing schema, Entities, Mappers, and Services to reuse existing structures. Define the table's purpose, primary key, unique constraints, indexes, and field comments, then add an idempotent CREATE TABLE IF NOT EXISTS statement to sql/schema.sql.

How should database schema migrations be managed without Flyway?▼

Use a single sql/schema.sql file as the only migration carrier. It must create the full database from scratch and be re-runnable on existing databases, using CREATE TABLE IF NOT EXISTS and information_schema checks before ALTER statements.

Should I use database foreign keys in a Spring Boot MySQL project?▼

This project deliberately avoids database-level foreign keys per ADR-0010, because memory writes are best-effort side links that must not block the main Agent flow. Relationships use indexed columns like project_id and run_id, with consistency enforced at the application layer.

Why is SELECT * discouraged in MyBatis Mapper queries?▼

SELECT * causes unstable results, excessive network transfer, and fragile DTO mapping, especially with JOINs, large tables, and pagination. Queries should explicitly list required columns and include a deterministic ORDER BY key for paginated results.

When should soft delete columns be added to a table?▼

Add a deleted_at DATETIME(3) column only to entities that can be deleted and rebuilt, such as project or knowledge_document. Audit and execution records like agent_execution or tool_execution keep full history and should not have soft delete columns.

What are the limits of storing JSON in MySQL columns?▼

MySQL JSON suits only extension data that is not frequently filtered, such as tool arguments or user profile attributes. Fields that are queried, sorted, joined, or structurally stable must be designed as independent relational columns instead.