db-naming
Audits database schema naming conventions to ensure consistency and prevent engine-specific bugs.
Install
mkdir -p .claude/skills/db-naming && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16436" && unzip -o skill.zip -d .claude/skills/db-naming && rm skill.zipInstalls to .claude/skills/db-naming
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Audit naming conventions — inconsistent table/column casing and pluralization, ambiguous or reserved-word identifiers, untyped/opaque columns, inconsistent FK and boolean naming, and identifiers that fight the engine's case-folding rules. Module M7. Feeds the Design & Integrity score (Naming category, low weight).Key capabilities
- →Audit table and column casing consistency
- →Audit table and column pluralization consistency
- →Detect SQL reserved words in identifiers
- →Identify case-folding traps in identifiers
- →Check FK column naming against `<referenced>_id` pattern
- →Flag boolean columns without `is_`/`has_`/`can_` prefixes
How it works
The skill performs a static check by parsing DDL/snapshot to tally identifier casing, pluralization, and reserved words, then verifies live identifier inventory with a query.
Inputs & outputs
When to use db-naming
- →Auditing schema consistency
- →Identifying reserved word conflicts
- →Checking casing standardization
- →Validating FK naming patterns
About this skill
db-naming (M7)
Naming is the schema's documentation: consistent, predictable identifiers make joins obvious and reduce the quoting/casing bugs that creep in across ORMs and engines. It is low-weight (Naming category, design axis) — real but never the headline. This module is design-axis and never caps.
What it checks
- Casing / pluralization consistency: a mix of
snake_caseandcamelCase, or singular and plural table names (user,orders,OrderItem) in one schema — pick one and hold it. - Reserved words & case-folding traps: identifiers that are SQL reserved words (
user,order,group,select) or that rely on case ("User"quoted) — Postgres folds unquoted to lowercase, MySQL is filesystem/case-config dependent; mixed quoting causes "relation does not exist" bugs. - FK naming: FK columns not following a predictable
<referenced>_idpattern, so joins aren't self-evident. - Boolean naming: booleans not prefixed
is_/has_/can_, or negative names (not_active) that invert logic. - Opaque / ambiguous names:
data,info,value,flag,temp,col1, abbreviations without a glossary, or timestamps not suffixed_at.
Axis & severity
- Axis: design; magnitude almost always low, banded honestly.
- Reserved-word unquoted identifier that breaks across engines: severity 2–3,
warn. - Schema-wide casing/pluralization inconsistency: severity 2,
warn,fixable: proposed(rename is high-blast-radius — neverauto). - Opaque column name / missing
_atsuffix: severity 1,warn. - M7 never caps any score; it is the smallest-weight design category.
Tier-0 static check
Parse DDL/snapshot via scripts/parse-schema.mjs: tally identifier casing styles and table pluralization; match identifiers against a reserved-word list per engine; check FK columns against the <table>_id pattern; flag boolean columns without is_/has_/can_ and opaque names. This is fully static and directional.
Tier-1 verification query
Confirm live identifier inventory and quoting:
-- $DATABASE_URL, read-only
SELECT table_name, column_name FROM information_schema.columns
WHERE table_schema NOT IN ('pg_catalog','information_schema')
ORDER BY table_name; -- inspect casing/plurality/reserved words across the real catalog
Findings
Emit per schema/finding.schema.json. Examples:
M7.schema.mixed_casing— schema mixessnake_caseandcamelCaseidentifiers (severity 2,warn, axisdesign,fixable: proposed).M7.user.reserved_word_table— table nameduserrequires quoting and breaks unquoted refs (severity 2,warn, axisdesign).M7.accounts.active_boolean_unprefixed— booleanactivenot namedis_active(severity 1,warn). Each finding:evidence.observedquotes the identifier(s) verbatim;verification.reproduceis the runnable query above (method: ddl_parse/schema_introspect);expected_impactis banded (typicallylow) + confidencedirectionalwith rationale.
Honesty
- Naming findings are advisory polish — never let them dominate the report or imply a functional defect.
- Renames are destructive and break app code/migrations; recommendations are
proposed/advisory, neverauto. - Reserved-word and case-folding behaviour is engine-specific; scope each finding to the detected engine rather than asserting a universal rule.
When not to use it
- →When functional defects are the primary concern
- →When destructive renames are acceptable without explicit approval
- →When asserting universal rules for engine-specific behaviors
Limitations
- →Naming findings are advisory polish, not functional defects.
- →Renames are destructive and break app code/migrations.
- →Reserved-word and case-folding behavior is engine-specific.
How it compares
This workflow systematically audits database naming conventions for consistency and potential issues, providing structured findings, unlike a manual, ad-hoc review.
Compared to similar skills
db-naming side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| db-naming (this skill) | 0 | 2mo | No flags | Intermediate |
| analyzing-query-performance | 1 | 1mo | Review | Intermediate |
| sql-optimization-patterns | 64 | 2mo | No flags | Advanced |
| drizzle-orm | 32 | 2mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by Hainrixz
View all by Hainrixz →You might also like
analyzing-query-performance
jeremylongshore
Execute use when you need to work with query optimization. This skill provides query performance analysis with comprehensive guidance and automation. Trigger with phrases like "optimize queries", "analyze performance", or "improve query speed".
sql-optimization-patterns
wshobson
Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries. Use when debugging slow queries, designing database schemas, or optimizing application performance.
drizzle-orm
EpicenterHQ
Drizzle ORM patterns for type branding and custom types. Use when working with Drizzle column definitions, branded types, or custom type conversions.
postgres-patterns
affaan-m
PostgreSQL database patterns for query optimization, schema design, indexing, and security. Based on Supabase best practices.
postgresql-table-design
wshobson
Design a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features
hybrid-search-implementation
wshobson
Combine vector and keyword search for improved retrieval. Use when implementing RAG systems, building search engines, or when neither approach alone provides sufficient recall.