database-designer — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited database-designer (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Design complete, production-ready database schemas based on user requirements. Generate comprehensive documentation, SQL scripts, and visual ER diagram files compatible with DrawDB.
Before starting any design, always read references/design-principles.md to understand:
Gather information about the database design:
If the user provides minimal information, intelligently infer missing details based on common business scenarios and best practices documented in references/design-examples.md.
Key inference scenarios:
Based on the design requirements, load appropriate references:
references/design-principles.md for core design rulesreferences/drawdb-formats.md for JSON/DBML specificationsreferences/design-examples.md for similar system designsCreate complete table structures following these guidelines:
#### Table Design Checklist
For each table:
id BIGINT AUTO_INCREMENT PRIMARY KEYcreated_at DATETIME DEFAULT CURRENT_TIMESTAMPupdated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMPis_deleted TINYINT(1) DEFAULT 0references/design-principles.md for complete size standards#### Index Design Strategy
For each table, analyze and create indexes for:
xxx_id foreign key fieldsIndex naming conventions:
idx_field_name or idx_field1_field2uk_field_nameIndex limits:
#### Relationship Design
Identify logical relationships between tables:
user_id in order tableuser_id UNIQUE in user_profile tableCreate all required output files:
#### 4.1 Comprehensive Design Document (Markdown)
Create a single, well-structured Markdown file containing:
Structure:
# [Project Name] Database Design Document
## 1. Database Overview
- Database type
- Character set
- Number of core tables
- Main functional modules
## 2. Table Structure Design
### 2.1 [Table Name]
**Table name**: table_name
**Description**: Table description
**Field list**:
| Field Name | Type | Nullable | Default | Description |
|------------|------|----------|---------|-------------|
| id | BIGINT | NO | | Primary key |
| ... | ... | ... | ... | ... |
**Index list**:
| Index Name | Type | Fields |
|------------|------|--------|
| uk_email | UNIQUE | email |
| idx_username | INDEX | username |
### 2.2 [Next Table]
...
## 3. Table Relationships
- table1 → table2 (1:N): Description
- table3 ↔ table4 (N:N): Description via junction table
## 4. Index Strategy
Explain the rationale behind index design decisions#### 4.2 SQL Script
Create executable SQL script with:
-- Database: project_name
-- Generated: YYYY-MM-DD
-- Drop tables if exists (in reverse dependency order)
DROP TABLE IF EXISTS `table3`;
DROP TABLE IF EXISTS `table2`;
DROP TABLE IF EXISTS `table1`;
-- Create tables (in dependency order)
CREATE TABLE `table1` (
`id` BIGINT NOT NULL AUTO_INCREMENT COMMENT 'Comment',
...
PRIMARY KEY (`id`),
UNIQUE KEY `uk_field` (`field`),
KEY `idx_field` (`field`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Table comment';
CREATE TABLE `table2` (
...
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Table comment';#### 4.3 DrawDB JSON Format
Generate DrawDB-compatible JSON file following references/drawdb-formats.md:
Critical Format Requirements:
"_KV5MtPf2m4sI7Inu8pat")"B8rPRTDtOv9oD2Gp4bhWL")"VARCHAR(100)", not separate type and size)["email"] not [1])ID Generation:
import random
import string
def generate_id():
chars = string.ascii_letters + string.digits + '_-'
return ''.join(random.choice(chars) for _ in range(21))Layout Strategy:
x = (index % 3) * 450 + 50, y = floor(index / 3) * 400 + 50["#6360f7", "#bc49c4", "#ffe159", "#89e667", "#ff9159", "#59d9ff", "#ff5959", "#a0a0a0"]Relationship Generation:
xxx_id foreign key fieldsStructure:
{
"tables": [
{
"id": "random_string",
"name": "table_name",
"comment": "Table comment",
"color": "#6360f7",
"fields": [
{
"id": "random_string",
"name": "id",
"type": "BIGINT",
"default": "",
"check": "",
"primary": true,
"unique": true,
"notNull": true,
"increment": true,
"comment": "Primary key ID"
}
],
"indices": [
{
"id": 0,
"fields": ["field_name"],
"name": "idx_field_name",
"unique": false
}
],
"x": 50.0,
"y": 50.0
}
],
"relationships": [
{
"name": "",
"startTableId": "random_string",
"endTableId": "random_string",
"endFieldId": "random_string",
"startFieldId": "random_string",
"id": "random_string",
"updateConstraint": "No action",
"deleteConstraint": "No action",
"cardinality": "many_to_one"
}
],
"notes": [],
"subjectAreas": [],
"database": "generic",
"types": [],
"title": "Project Database"
}#### 4.4 DrawDB DBML Format
Generate DBML file following references/drawdb-formats.md:
Key points:
bigint, varchar(50), datetime[pk, increment, not null, unique, note: 'comment']indexes { } blockRef blocks> (many-to-one), - (one-to-one)Structure:
Table table_name [headercolor: #6360f7] {
id bigint [pk, increment, not null, unique, note: 'Comment']
field varchar(100) [not null, note: 'Comment']
indexes {
field [unique, name: 'uk_field']
}
Note: 'Table comment'
}
Ref fk_name {
table1.field > table2.id [delete: no action, update: no action]
}#### 5.1 Output Directory Convention
Recommended Approach (Following Claude Code Official Standards):
Save all database design files to outputs/<project-name>/database/:
outputs/
└── <project-name>/ # Project name (e.g., e-commerce-system)
└── database/
├── schema-design.md # Comprehensive design document
├── schema.sql # Executable SQL script
├── drawdb-schema.json # DrawDB JSON format
└── drawdb-schema.dbml # DrawDB DBML formatExample:
outputs/
├── e-commerce-system/
│ └── database/
│ ├── schema-design.md
│ ├── schema.sql
│ ├── drawdb-schema.json
│ └── drawdb-schema.dbml
└── task-management-app/
└── database/
├── schema-design.md
└── schema.sqlAlternative Approach (Traditional Project Structure):
If your project has an existing directory structure, you can also use:
project-root/
└── database/
├── schema-design.md
├── schema.sql
├── drawdb-schema.json
└── drawdb-schema.dbml#### 5.2 Output File List
Required Outputs (4 files):
schema-design.md - Comprehensive database design documentschema.sql - Executable SQL scriptdrawdb-schema.json - DrawDB JSON formatdrawdb-schema.dbml - DrawDB DBML formatOptional Outputs:
er-diagram.png - ER diagram visualization (if tools available)index-strategy.md - Index strategy documentation#### 5.3 File Naming Convention
user-authentication-schema.sqlschema-v1.0.sql or schema-2024-12-10.sqle-commerce-database-schema.sql#### 5.4 Delivery Summary
After generating all files, provide a summary with:
Only create minimal structure:
CREATE TABLE `table_name` (
`id` BIGINT NOT NULL AUTO_INCREMENT COMMENT 'Primary key',
/* business fields only */
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Table comment';Adapt SQL syntax accordingly:
PostgreSQL:
SERIAL or BIGSERIAL instead of AUTO_INCREMENTTIMESTAMP instead of DATETIMESQL Server:
IDENTITY(1,1) instead of AUTO_INCREMENTDATETIME2 instead of DATETIMENVARCHAR for Unicode supportOracle:
SEQUENCE for auto-incrementVARCHAR2 instead of VARCHARDATE or TIMESTAMP for time fieldsApply intelligent inference:
references/design-examples.mdBefore finalizing, verify:
User says: "Design a database for an e-commerce system with user, product, and order functionality" → Read design-principles.md and design-examples.md → Design: user_info, product_info, order_info, order_detail tables → Generate all 4 output files
User says: "Design a blog database" → Infer: user, article, comment, tag, article_tag tables → Follow standard design principles → Generate all outputs
User says: "Create a user table for PostgreSQL" → Single table design → Adapt SQL syntax for PostgreSQL → Include in all output formats
references/design-principles.md - Core design rules and standardsreferences/drawdb-formats.md - JSON and DBML format specificationsreferences/design-examples.md - Real-world design examples~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.