/db-sqlserver:sqlserver-codingfrom db-sqlserver
Use when writing or reviewing SQL Server T-SQL code — enforces T-SQL naming conventions, stored procedure patterns, error handling with TRY/CATCH, transaction management, indexing strategies, and security best practices
Ships in db-sqlserver. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
| Element | Convention | Example |
|---|---|---|
| Table | PascalCase, no prefix | Orders, OrderItems |
| View | vw_ prefix, PascalCase | vw_ActiveCustomers |
| Stored Procedure | usp_ prefix, PascalCase | usp_GetOrderById |
| Function | fn_ prefix, PascalCase | fn_CalculateTotal |
| Column | PascalCase | FirstName, CreatedAt |
| Index | IX_<Table>_<Column(s)> | IX_Orders_CustomerId |
| Primary Key | PK_<Table> | PK_Orders |
| Foreign Key | FK_<Child>_<Parent> | FK_OrderItems_Orders |
| Default | DF_<Table>_<Column> | DF_Orders_CreatedAt |
| Check | CK_<Table>_<Column> | CK_Orders_Total |
CREATE OR ALTER PROCEDURE [dbo].[usp_GetOrderById]
@OrderId INT
AS
BEGIN
SET NOCOUNT ON;
SET XACT_ABORT ON;
BEGIN TRY
SELECT
o.Id,
o.CustomerName,
o.Total,
o.CreatedAt
FROM dbo.Orders o
WHERE o.Id = @OrderId;
END TRY
BEGIN CATCH
THROW;
END CATCH
END;
BEGIN TRY
BEGIN TRANSACTION;
-- operations here
COMMIT TRANSACTION;
END TRY
BEGIN CATCH
IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION;
-- Optionally log error
INSERT INTO dbo.ErrorLog (ErrorMessage, ErrorProcedure, ErrorLine)
VALUES (ERROR_MESSAGE(), ERROR_PROCEDURE(), ERROR_LINE());
THROW;
END CATCH;
IF NOT EXISTS (SELECT 1 FROM sys.tables WHERE name = 'Orders' AND schema_id = SCHEMA_ID('dbo'))
BEGIN
CREATE TABLE [dbo].[Orders] (
[Id] INT IDENTITY(1,1) NOT NULL,
[CustomerName] NVARCHAR(200) NOT NULL,
[Total] DECIMAL(18,2) NOT NULL DEFAULT 0,
[Status] NVARCHAR(50) NOT NULL DEFAULT 'Pending',
[CreatedAt] DATETIME2(7) NOT NULL DEFAULT SYSUTCDATETIME(),
[CreatedBy] NVARCHAR(100) NOT NULL,
[ModifiedAt] DATETIME2(7) NULL,
[ModifiedBy] NVARCHAR(100) NULL,
CONSTRAINT [PK_Orders] PRIMARY KEY CLUSTERED ([Id]),
CONSTRAINT [CK_Orders_Total] CHECK ([Total] >= 0)
);
END;
CREATE NONCLUSTERED INDEX [IX_Orders_CustomerId]
ON [dbo].[Orders] ([CustomerId])
INCLUDE ([CustomerName], [Total])
WHERE [Status] != 'Deleted';
CREATE OR ALTER VIEW [dbo].[vw_ActiveCustomers]
AS
SELECT
c.Id,
c.Name,
c.Email,
COUNT(o.Id) AS OrderCount
FROM dbo.Customers c
LEFT JOIN dbo.Orders o ON c.Id = o.CustomerId AND o.Status != 'Cancelled'
GROUP BY c.Id, c.Name, c.Email;
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub gagandeepp/software-agent-teams --plugin db-sqlserverOther plugins' skills for the same job
6 skills in this plugin
/sqlserver-er-knowledgebaseUse when reading ER diagrams committed in the project repo and building a structured knowledge base of entities, relationships, columns, keys, and constraints to inform code generation and review/sqlserver-frameworksUse when implementing SQL Server database code with frameworks — enforces patterns for EF Core (Code First, migrations, DbContext), Dapper (query patterns, multi-mapping), DbUp (script naming, runners), and Flyway (versioned migrations)/sqlserver-live-knowledgebaseFallback for sqlserver-er-knowledgebase — connects to a live SQL Server instance using the connection string from .env, introspects every database object (schemas, tables, columns, keys, indexes, views, stored procedures, functions, triggers, constraints, synonyms, sequences), builds a knowledge base, and writes or updates the project CLAUDE.md. Asks for HITL when ambiguous.