cg-database-conventions

Audits and refactors repository databases against PascalCase, SQLite split-db, and ORM conventions.

Updated May 16, 2026
One-click install
npx skills add https://github.com/alimtvnetwork/img-pdf-v2 --skill cg-database-conventions-alimtvnetwork
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cg-database-conventions
Source: https://github.com/alimtvnetwork/img-pdf-v2/tree/main/.agents/skills/cg-database-conventions
Command: npx skills add https://github.com/alimtvnetwork/img-pdf-v2 --skill cg-database-conventions-alimtvnetwork

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Database schemas drift over time: inconsistent table naming, mismatched foreign keys, raw SQL creeping into code, and unclear boolean conventions. This Skill autonomously audits, refactors, and validates an entire repository against a defined set of database conventions so the schema stays consistent. ## Core Features & Use Cases - Convention Auditing: Scans the repository for violations of PascalCase singular table names, PascalCase columns, and {TableName}Id primary key patterns. - Automated Refactoring: Renames tables, columns, and foreign keys to match the standard, including enforcing positive Is/Has boolean prefixes. - Architecture Validation: Verifies SQLite split-database architecture is used and that all data access goes through an ORM instead of raw SQL. - Use Case: After merging several feature branches, run the audit to detect a Users table with a raw SQL query and refactor it to a singular User table accessed only through the ORM. ## Quick Start Audit this repository for database convention violations and refactor any tables, columns, or queries that break the PascalCase, split-db, and ORM rules.

Frequently Asked Questions about cg-database-conventions

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

FAQPage Schema
How do I enforce consistent database naming conventions across a repository?

Run an automated audit that checks every table and column against defined rules, then refactor violations in place. This Skill enforces PascalCase singular table names, PascalCase columns, and {TableName}Id primary keys across the whole repository.

What naming convention should database tables and columns use?

This convention set requires singular PascalCase table names like User or Project, PascalCase columns like UserId and CreatedAt, and primary keys named {TableName}Id as INTEGER PRIMARY KEY AUTOINCREMENT. Foreign keys must exactly match the referenced table's primary key name.

Should I use raw SQL or an ORM in my application code?

Under these conventions, raw SQL is prohibited and all data access must go through an ORM. This keeps queries consistent, makes refactors safer, and allows automated validation of schema usage across the repository.

How should boolean columns be named in a database schema?

Boolean columns must use positive Is or Has prefixes, such as IsActive or HasAccess. Negative or ambiguous names are flagged during the audit and refactored to the positive form.

What is a split-database architecture with SQLite?

Split-database architecture uses SQLite as the default engine with data separated into multiple database files by concern rather than one monolithic database. The Skill validates that the repository follows this pattern as part of its convention checks.