Use when writing or reviewing MSSQL/T-SQL, creating stored procedures, designing table schemas, writing views, building migrations, defining custom types, or architecting a SQL Server application database. Also use when writing RAISERROR patterns, CHECK constraints with scalar functions, base/subtype table hierarchies, composite key designs, role-scoped views with row-level security, or idempotent DDL scripts. If you are touching MSSQL for an application database, use this skill. Not for PostgreSQL, MySQL, Oracle, or SQLite — patterns are SQL Server-specific.
95
94%
Does it follow best practices?
Impact
98%
1.81xAverage score across 5 eval scenarios
Passed
No known issues
{
"context": "Tests whether the agent follows the custom type system instructions: using named type aliases instead of bare built-in types, organizing types in a central manifest, applying NOT NULL defaults, using correct type naming conventions, seeding reference tables inline, and naming constraints as business predicates.",
"type": "weighted_checklist",
"checklist": [
{
"name": "No bare built-in types",
"description": "No column definition uses bare VARCHAR, INT, DATETIME, BIT, or DECIMAL directly — all columns use named custom types",
"max_score": 12
},
{
"name": "Types YAML manifest exists",
"description": "A types.yaml file exists that documents the custom types with at least their underlying base type",
"max_score": 8
},
{
"name": "Generic primitive underscore prefix",
"description": "Generic primitive types are prefixed with underscore (e.g., _Bool, _Timestamp, _Int, _Money) while domain-specific types are not (e.g., Email, MemberNo, BookNo)",
"max_score": 8
},
{
"name": "Custom types defined as NOT NULL",
"description": "Custom type definitions use NOT NULL (e.g., CREATE TYPE Email FROM VARCHAR(100) NOT NULL)",
"max_score": 8
},
{
"name": "Default constraints documented",
"description": "Types manifest or SQL includes documented default values for applicable types (e.g., _Timestamp uses SYSDATETIME(), _Bool uses 0)",
"max_score": 7
},
{
"name": "Reference tables seeded inline",
"description": "The BookState and MemberTier (or equivalent) reference tables are immediately followed by INSERT statements seeding all known values in the same script",
"max_score": 10
},
{
"name": "Constraint predicate naming",
"description": "Foreign key constraints are named as Subject_Relationship_Object predicates (e.g., Loan_IsBorrowedBy_Member, Book_IsClassifiedBy_BookState) — NOT using FK_Table_Column patterns",
"max_score": 12
},
{
"name": "No structural FK prefixes",
"description": "No constraint name begins with FK_, CK_, UQ_, or similar structural prefixes",
"max_score": 8
},
{
"name": "PascalCase identifiers",
"description": "All table names, column names, type names, and constraint names use PascalCase (no snake_case, no all-caps, no camelCase)",
"max_score": 7
},
{
"name": "No suffix for Number columns",
"description": "Primary key columns for internally generated sequential identifiers use the No suffix (e.g., MemberNo, BookNo, LoanNo) rather than Id or ID",
"max_score": 8
},
{
"name": "Associative table naming",
"description": "The many-to-many join table between Book and Author uses Entity_Entity naming (e.g., Book_Author) with a composite PK of both parent keys and no surrogate IDENTITY column",
"max_score": 12
}
]
}