[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EA4HJPC6P25XG23SZ3NP7V":3,"skill-same:01M7EA4HJPC6P25XG23SZ3NP7V":98},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":13,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M7EA4HJPC6P25XG23SZ3NP7V","sqlserver",null,"SQL Server and Azure SQL engine rules and T-SQL for .NET services. Use when code or a review touches T-SQL (a .sql script, a stored procedure, FromSql, SqlQuery, ExecuteSql, migrationBuilder.Sql, Dapper, or SqlClient code), column types, keys, indexes, isolation levels, RCSI, optimized locking, lock hints such as NOLOCK or UPDLOCK, deadlocks, MERGE or another upsert, a queue table, AT TIME ZONE, SqlBulkCopy, or SQL Server 2025 features. Not for EF Core mapping, LINQ, or generated EF migrations (dev-stack:efcore), PostgreSQL (dev-stack:postgresql), or server administration (backup, Always On, instance settings).","Charmedme\u002Fmaikelsoft-skills","Charmedme","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F11330182?v=4","01M7E9YWP4Z4JJ1BRXTMWNXAEV","01M7E9YWPS4N3GKRGAYBBDJWNQ",0,"MIT","https:\u002F\u002Fgithub.com\u002FCharmedme\u002Fmaikelsoft-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fdev-stack\u002Fskills\u002Fsqlserver\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: sqlserver\ndescription: SQL Server and Azure SQL engine rules and T-SQL for .NET services. Use when code or a review touches T-SQL (a .sql script, a stored procedure, FromSql, SqlQuery, ExecuteSql, migrationBuilder.Sql, Dapper, or SqlClient code), column types, keys, indexes, isolation levels, RCSI, optimized locking, lock hints such as NOLOCK or UPDLOCK, deadlocks, MERGE or another upsert, a queue table, AT TIME ZONE, SqlBulkCopy, or SQL Server 2025 features. Not for EF Core mapping, LINQ, or generated EF migrations (dev-stack:efcore), PostgreSQL (dev-stack:postgresql), or server administration (backup, Always On, instance settings).\nmetadata:\n  verified: \"2026-10-27\"\n  versions: \"SQL Server 2025 (17.x, CU10), compatibility level 170, Azure SQL Database, Microsoft.Data.SqlClient 6.1.7 and 7.1.1, Dapper 2.1.89, EF Core 10.0.14, .NET 10.0.14\"\n---\n\n# SQL Server\n\nEngine rules and T-SQL for SQL Server and Azure SQL. EF Core mapping, LINQ, and generated migrations are in `dev-stack:efcore`. Its `references\u002Fprovider-sqlserver.md` has the EF options: `UseSqlServer`, `UseCompatibilityLevel`, `rowversion`, and collations in the model. Test containers are in `dev-stack:dotnet-testing`.\n\nWrite all output except code in the rules of `references\u002Flanguage.md`.\n\n## First\n\n1. Read `references\u002Fstack-rules.md`.\n2. Find the engine and the compatibility level: the image tag (`mcr.microsoft.com\u002Fmssql\u002Fserver:2025-CU10-ubuntu-24.04`), `UseCompatibilityLevel(...)` or `UseAzureSql`, or `SELECT @@VERSION, compatibility_level FROM sys.databases WHERE name = DB_NAME();`.\n   - SQL Server 2025 or Azure SQL at level 170: use this file.\n   - Level 160 or lower: no `REGEXP_LIKE` and no regex table functions (rule 17).\n   - SQL Server 2022 or older: no optimized locking, no `json` type, no regex functions.\n3. Find the database settings. Many rules depend on them:\n\n   ```sql\n   SELECT is_read_committed_snapshot_on, is_accelerated_database_recovery_on, is_optimized_locking_on\n   FROM sys.databases WHERE name = DB_NAME();\n   ```\n\n   A new SQL Server database has all three off. Azure SQL Database has all three on.\n4. Find the SqlClient version: 6.1 (with EF Core 10) or 7.1. Both pull a vulnerable `System.Security.Cryptography.Pkcs`. Pin Pkcs 10.0.x (standing rule, stack rule 5). SqlClient 6.1.6 and later also pull `Microsoft.Identity.Client.Broker`. For an app without Entra ID sign-in, Microsoft advises a direct reference to SqlClient `7.1.x` (also with EF Core 10). With Entra ID on SqlClient 7, also add `Microsoft.Data.SqlClient.Extensions.Azure`.\n5. Read the existing data code that the change edits, calls, or copies: raw SQL, reports, upserts, and key generators. These defects give wrong results without an error, and the existing tests pass:\n   - `AT TIME ZONE '\u003Czone>'` on a `datetime2` column without `AT TIME ZONE 'UTC'` first: the report counts UTC days (rule 12).\n   - An interpolated string or `AddWithValue` on a `varchar` column: `nvarchar(4000)`, `CONVERT_IMPLICIT`, and an index scan (rule 10).\n   - `Guid.CreateVersion7()` or `NEWID()` for a clustered key: random order in SQL Server, also when a comment or a decision says otherwise (rule 15).\n   - `MERGE` without `HOLDLOCK`, or a check before an insert (rule 6).\n\n   Fix the defect when the change edits, calls, or copies that code, and list the fix under Changes. Otherwise report it as an open point. Stack rule 3 keeps the style of existing code, not its defects.\n\n   After you fix a defect, search the repository for the same defect. Use `grep` for the table name and the call. Fix each other site on a table that the change uses when the fix changes no result and needs no migration. A typed parameter is an example. List each site under Changes. Report a site that needs a decision, a migration, or a change of behavior as an open point.\n\nDone when you can name the engine, the compatibility level, the RCSI and optimized locking settings, and the SqlClient version. Also name the defects in the existing code that the change touches.\n\n## Defaults for new code\n\nAsk the human before you apply a default that has no accepted decision (stack rule 4). The full entries are in `references\u002Fdecisions.md`.\n\n| Area | Default | ID |\n|------|---------|----|\n| Engine | The engine that the product runs. SQL Server 2025 or Azure SQL when the contract asks for it. | DATA-01 |\n| Isolation | RCSI on for each OLTP database and for the test database. `READ COMMITTED`. No `NOLOCK`. | DATA-26 |\n| Optimized locking | On for a new SQL Server 2025 database, with ADR and RCSI. | DATA-27 |\n| Keys | `uniqueidentifier` from EF (sequential). Writers without EF: `DEFAULT NEWSEQUENTIALID()`, or `bigint IDENTITY`. | DATA-07 |\n| Strings | `nvarchar(n)` for user text, `varchar(n)` for codes, the server default collation. | DATA-28 |\n| Instants | `datetimeoffset`, written as UTC. | DATA-10 |\n| Money | `decimal(19,4)`. Currency as `char(3)`. | DATA-11 |\n| Concurrency | `rowversion` on edited aggregates. | DATA-15 |\n| Bulk insert | `SqlBulkCopy`. | DATA-22 |\n| Procedures | No new procedures in a service. | DATA-29 |\n\nExisting code keeps its style (stack rule 3).\n\n## Rules\n\n### Isolation and locks\n\n1. Turn on RCSI for each OLTP database (DATA-26). Readers then read the last committed version, and readers and writers do not block each other. RCSI is off in a new SQL Server database and on in Azure SQL Database. Turn it on in the test database too, or the tests prove other behavior. In an existing database, first find code that reads a row and then changes it based on that read. Such code needs `UPDLOCK` with RCSI.\n\n```sql\n-- Not in a transaction (error 226). In an EF migration: migrationBuilder.Sql(sql, suppressTransaction: true).\nALTER DATABASE CURRENT SET READ_COMMITTED_SNAPSHOT ON WITH ROLLBACK IMMEDIATE;\n```\n\n2. Do not use `NOLOCK`, `READUNCOMMITTED`, or `READ UNCOMMITTED`. They read uncommitted rows, and a scan can read a row two times or miss it while pages split. RCSI removes the blocking without these errors.\n3. Optimized locking (SQL Server 2025, DATA-27) needs ADR. Its lock after qualification (LAQ) works only with RCSI and `READ COMMITTED`. LAQ checks the `WHERE` clause on the last committed version. So an `UPDATE` can skip a row that a running transaction changes. Code that needs a strict order of transactions uses `REPEATABLE READ` or `SERIALIZABLE`. Lock hints (`UPDLOCK`, `HOLDLOCK`, `XLOCK`) turn LAQ off for their table, so use them only where the logic needs them.\n4. Retry a deadlock (1205) by running the whole transaction again. `EnableRetryOnFailure` does it in EF. Outside EF, retry the whole unit of work 3 times with a short random delay. Repeated deadlocks are a design defect. Read the deadlock graph in the `system_health` session. Add the missing index, and change tables and rows in the same order.\n\nDetail on isolation levels, RCSI, LAQ, deadlocks, and lock waits: `references\u002Fisolation-and-locking.md`.\n\n### Writes under concurrency\n\n5. Change a counter or a stock level in one statement, then check the row count. A read, a check in C#, and a write lose updates under load.\n\n```csharp\nvar reserved = await db.StockLevels\n    .Where(s => s.Sku == sku && s.Available >= quantity)\n    .ExecuteUpdateAsync(s => s.SetProperty(x => x.Available, x => x.Available - quantity), ct);\nif (reserved == 0)\n{\n    \u002F\u002F not enough stock: roll back the transaction and return 409\n}\n```\n\n6. An upsert under concurrency needs a key-range lock. Use `MERGE ... WITH (HOLDLOCK)`. Or use `UPDATE ... WITH (UPDLOCK, HOLDLOCK)`, then `INSERT` when no row changed, in one transaction. Without the lock, two sessions insert the same new key, and one fails (error 2627). A check in C# before the insert has the same problem.\n\n```csharp\nvar skuParameter = new SqlParameter(\"@sku\", SqlDbType.VarChar, 32) { Value = sku };\nawait db.Database.ExecuteSqlAsync($\"\"\"\n    MERGE dbo.StockLevels WITH (HOLDLOCK) AS t\n    USING (VALUES ({skuParameter}, {available})) AS s (Sku, Available)\n        ON t.Sku = s.Sku\n    WHEN MATCHED THEN UPDATE SET Available = s.Available\n    WHEN NOT MATCHED THEN INSERT (Sku, Available) VALUES (s.Sku, s.Available);\n    \"\"\", ct);\n```\n\n7. Take a work item with one statement: `UPDATE TOP (1) ... WITH (UPDLOCK, READPAST, ROWLOCK) ... OUTPUT inserted.Id`. The statement locks the row, and other workers skip it.\n8. Put a unique index on each unique column. Map 2601 and 2627 (unique key) to 409. Map 547 (foreign key or check) to 409 or 422.\n9. In a procedure that opens a transaction, write `SET XACT_ABORT ON; SET NOCOUNT ON;` first. Without `XACT_ABORT`, a client timeout stops the batch, but the transaction stays open with its locks. It stays open until the pool reuses or closes the connection.\n\n### Parameters and dynamic SQL\n\n10. Type each parameter like its column, so that the index can seek:\n    - A .NET string goes as `nvarchar`. EF raw SQL sends an interpolated string as `nvarchar(4000)`. LINQ sends `varchar(32)` from the mapping.\n    - On a `varchar` column with a `SQL_` collation, SQL Server then converts the column (`CONVERT_IMPLICIT`) and scans the index. A `SQL_` collation is the default of a US install.\n    - Use LINQ, a `SqlParameter` with `SqlDbType.VarChar` and a size, or Dapper `DbString { IsAnsi = true, Length = 32 }`. Do not use `AddWithValue`.\n11. Never build SQL by concatenation. Dynamic SQL uses `sp_executesql` with parameters. An identifier (a sort column) comes from an allow list and goes through `QUOTENAME`.\n\n### Types and time\n\n12. `AT TIME ZONE` takes Windows zone names from `sys.time_zone_info` (`'W. Europe Standard Time'`), not IANA names. `'Europe\u002FAmsterdam'` fails with error 9820. Convert a UTC `datetimeoffset`, then cast to `date` for a local day. SQL Server reads a `datetime2` without an offset as a time in the named zone. So convert it from UTC first: `x AT TIME ZONE 'UTC' AT TIME ZONE 'W. Europe Standard Time'`.\n\n```sql\n-- Revenue per day in Amsterdam time. @From and @ToExclusive are dates.\nSELECT CAST(o.PlacedAt AT TIME ZONE 'W. Europe Standard Time' AS date) AS Day,\n       COUNT(DISTINCT o.Id) AS Orders,\n       SUM(l.Quantity * l.UnitPrice) AS Revenue\nFROM dbo.Orders AS o\nJOIN dbo.OrderLines AS l ON l.OrderId = o.Id\nWHERE o.PlacedAt >= (CAST(@From AS datetime2) AT TIME ZONE 'W. Europe Standard Time')\n  AND o.PlacedAt \u003C  (CAST(@ToExclusive AS datetime2) AT TIME ZONE 'W. Europe Standard Time')\nGROUP BY CAST(o.PlacedAt AT TIME ZONE 'W. Europe Standard Time' AS date)\nORDER BY Day;\n```\n\n13. Instants: `datetimeoffset` (or `datetime2` in UTC), not `datetime`. Amounts: `decimal(p,s)`, not `money` or `float`.\n14. Strings (DATA-28): `nvarchar(n)` for text that users type, `varchar(n)` for codes (SKU, ISO codes). Do not filter or index an `nvarchar(max)` column: it cannot be an index key.\n15. Clustered key: narrow, unique, static, and growing. A `uniqueidentifier` key needs sequential values (the EF generator or `NEWSEQUENTIALID()`), never `NEWID()`. `Guid.CreateVersion7()` is not ordered in SQL Server, because SQL Server sorts `uniqueidentifier` bytes in another order.\n\n### Indexes and plans\n\n16. Design an index from the query. Put the equality columns first, then the range or sort column. Add the columns that the query only reads with `INCLUDE`. Index each foreign key column that a join or a delete uses. Use a filtered index for a hot subset (`WHERE Status = 'Placed'`). Prove a plan with the actual execution plan on data like production. A seek is not always the goal. A query that reads much of a big table can need a covering, filtered, or columnstore index. Refer to \"When a seek is not the answer\" in `references\u002Findexes.md`.\n\nDetail and diagnostic queries: `references\u002Findexes.md`.\n\n### SQL Server 2025 features\n\n17. Check the compatibility level before you use a new function. `REGEXP_LIKE` and the regex table functions need level 170. The other regex scalar functions (`REGEXP_REPLACE`, `REGEXP_SUBSTR`) work at each level. SQL Server cannot compare a `json` value with `=` or sort it (error 13636).\n\n### SqlClient, Dapper, and procedures\n\n18. New service code uses LINQ or parameterized SQL in code, not new stored procedures (DATA-29). When the project already has procedures that a DBA owns, call them with `CommandType.StoredProcedure` and typed parameters.\n19. For a large insert, use `SqlBulkCopy` with `EnableStreaming`, a `BatchSize`, and explicit column mappings.\n\nDetail on SqlClient, Dapper, procedures, and bulk copy: `references\u002Fsqlclient-dapper.md`.\n\n## Never write\n\n| Wrong | Correct |\n|-------|---------|\n| `SELECT ... FROM dbo.Orders WITH (NOLOCK)` | RCSI on the database, no hint |\n| `SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED` | RCSI on the database, `READ COMMITTED` |\n| `MERGE dbo.StockLevels AS t USING ...` (concurrent upsert) | `MERGE dbo.StockLevels WITH (HOLDLOCK) AS t USING ...` |\n| `if (await db.StockLevels.FindAsync(sku) is null) db.Add(...)` for an upsert | `MERGE ... WITH (HOLDLOCK)`, or `UPDATE ... WITH (UPDLOCK, HOLDLOCK)` then `INSERT` |\n| `var s = await Get(sku); if (s.Available >= q) { s.Available -= q; Save(); }` | One conditional `UPDATE` or `ExecuteUpdateAsync`, then check the row count |\n| `cmd.Parameters.AddWithValue(\"@sku\", sku)` on a `varchar` column | `cmd.Parameters.Add(\"@sku\", SqlDbType.VarChar, 32).Value = sku;` |\n| `SqlQuery\u003Cint>($\"... WHERE Sku = {sku}\")` on a `varchar` column | LINQ, or `{new SqlParameter(\"@sku\", SqlDbType.VarChar, 32) { Value = sku }}` |\n| `AT TIME ZONE 'Europe\u002FAmsterdam'` | `AT TIME ZONE 'W. Europe Standard Time'` |\n| `Id uniqueidentifier DEFAULT NEWID() PRIMARY KEY CLUSTERED` | `DEFAULT NEWSEQUENTIALID()`, or the EF generator |\n| `BEGIN TRAN` in a procedure without `SET XACT_ABORT ON` | `SET XACT_ABORT ON; SET NOCOUNT ON;` at the start |\n| `EXEC('SELECT ... WHERE Name = ''' + @name + '''')` | `EXEC sp_executesql N'... WHERE Name = @name', N'@name nvarchar(100)', @name = @name;` |\n| `PlacedAt datetime NOT NULL` | `PlacedAt datetimeoffset(7) NOT NULL` |\n| `Amount money` or `Amount float` | `Amount decimal(19,4)` |\n| `ALTER DATABASE ... SET READ_COMMITTED_SNAPSHOT ON` in an EF migration with a transaction | `migrationBuilder.Sql(sql, suppressTransaction: true)`, or a DBA step |\n| `BeginTransactionAsync()` with `EnableRetryOnFailure`, outside a strategy | `CreateExecutionStrategy().ExecuteAsync(...)` (`dev-stack:efcore` rule 20) |\n\n## Check\n\n1. Build with the analyzers as errors:\n\n   ```\n   dotnet build -warnaserror\n   ```\n\n   Pass: `Build succeeded` with 0 warnings. With SqlClient 6.1.7 or 7.1.1, the build fails with NU1902 and NU1903 until the project pins `System.Security.Cryptography.Pkcs` 10.0.x.\n2. Run the tests against `mcr.microsoft.com\u002Fmssql\u002Fserver:2025-CU10-ubuntu-24.04`, with the production settings of the database (RCSI, compatibility level). Pass: all tests green. A test of a counter, a claim, or an upsert runs parallel calls.\n3. Check the database settings in each environment:\n\n   ```sql\n   SELECT is_read_committed_snapshot_on, is_accelerated_database_recovery_on,\n          is_optimized_locking_on, compatibility_level\n   FROM sys.databases WHERE name = DB_NAME();\n   ```\n\n   Pass: the values of DATA-26, DATA-27, and DATA-01.\n4. For a new hot query, read the actual execution plan (`SET STATISTICS XML ON`, or Query Store). Pass: a seek on the hot path, and no `CONVERT_IMPLICIT` on an indexed column.\n5. Run the rules of this skill:\n\n   ```\n   python3 \u003Cskill folder>\u002Fscripts\u002Fstackcheck.py --root \u003Crepo>\n   ```\n\n   Pass: 0 errors. For each warning, fix it or add `\u002F\u002F stackcheck: ignore \u003CRULE-ID> \u003Creason>` (in SQL: `-- stackcheck: ignore \u003CRULE-ID> \u003Creason>`).\n\n## Review checklist\n\nThe full list is in `references\u002Freview-checklist.md`.\n\n1. No `NOLOCK`, `READUNCOMMITTED`, or `READ UNCOMMITTED`. tool (SQL-NOLOCK)\n2. A concurrent upsert uses `MERGE ... WITH (HOLDLOCK)` or `UPDLOCK, HOLDLOCK`. tool (SQL-MERGE-NO-HOLDLOCK), judge\n3. A counter or a stock level changes in one conditional statement with a check of the row count. judge\n4. `AT TIME ZONE` uses a Windows zone name. tool (SQL-IANA-ZONE)\n5. No dynamic SQL by concatenation. `sp_executesql` with parameters, `QUOTENAME` for identifiers. tool (SQL-EXEC-CONCAT), judge\n6. Parameters match the column type. No `AddWithValue`. tool (SQL-ADDWITHVALUE), judge\n7. Procedures with a transaction start with `SET XACT_ABORT ON`. judge\n8. Instants are `datetimeoffset` or UTC `datetime2`, not `datetime`. tool (SQL-DATETIME-TYPE)\n9. Clustered `uniqueidentifier` keys are sequential, not `NEWID()`. judge\n10. RCSI is on, or the report names DATA-26 as an open point. judge\n11. Explicit transactions with retries on run inside the execution strategy. Deadlocks retry the whole unit. judge\n12. Each index serves a query. Foreign keys have an index. No filter on `nvarchar(max)`. judge\n13. New functions of SQL Server 2025 match the compatibility level. judge\n14. Existing code that the change edits, calls, or copies has none of the defects of First, step 5. judge\n15. Each other site of a fixed defect on a table of the change is fixed or reported. judge\n\n## Report\n\nEnd with the report of stack rule 8 (`references\u002Fstack-rules.md`): the same headings in the same order on each run.\n\nThe change can need a database setting: RCSI, optimized locking, or a compatibility level. For each one, state how it is deployed (a migration with `suppressTransaction: true`, or a DBA step) and when it can run.\n\n## References\n\n- `references\u002Fdecisions.md`: read before new code needs DATA-26, DATA-27, DATA-28, DATA-29, or the SQL Server part of DATA-07, DATA-10, DATA-11, DATA-15, or DATA-22.\n- `references\u002Fisolation-and-locking.md`: read when you write a transaction, a queue, an upsert, or a counter. Also read it for blocking, a deadlock (1205), or a lock hint.\n- `references\u002Findexes.md`: read when you add or review an index, or a query is slow.\n- `references\u002Fsqlclient-dapper.md`: read when you write SqlClient or Dapper code, call a procedure, write a procedure, or bulk copy rows.\n- `references\u002Freview-checklist.md`: read for a full review.\n- `references\u002Fsources.md`: the primary sources, the evidence, and the credits.\n- `references\u002Fstack-rules.md` and `references\u002Flanguage.md`: the common rules and the output language.\n- `scripts\u002Fstackcheck.py`: the rule check of this skill.\n","# SQL Server\n\nEngine rules and T-SQL for SQL Server and Azure SQL. EF Core mapping, LINQ, and generated migrations are in `dev-stack:efcore`. Its `references\u002Fprovider-sqlserver.md` has the EF options: `UseSqlServer`, `UseCompatibilityLevel`, `rowversion`, and collations in the model. Test containers are in `dev-stack:dotnet-testing`.\n\nWrite all output except code in the rules of `references\u002Flanguage.md`.\n\n## First\n\n1. Read `references\u002Fstack-rules.md`.\n2. Find the engine and the compatibility level: the image tag (`mcr.microsoft.com\u002Fmssql\u002Fserver:2025-CU10-ubuntu-24.04`), `UseCompatibilityLevel(...)` or `UseAzureSql`, or `SELECT @@VERSION, compatibility_level FROM sys.databases WHERE name = DB_NAME();`.\n   - SQL Server 2025 or Azure SQL at level 170: use this file.\n   - Level 160 or lower: no `REGEXP_LIKE` and no regex table functions (rule 17).\n   - SQL Server 2022 or older: no optimized locking, no `json` type, no regex functions.\n3. Find the database settings. Many rules depend on them:\n\n   ```sql\n   SELECT is_read_committed_snapshot_on, is_accelerated_database_recovery_on, is_optimized_locking_on\n   FROM sys.databases WHERE name = DB_NAME();\n   ```\n\n   A new SQL Server database has all three off. Azure SQL Database has all three on.\n4. Find the SqlClient version: 6.1 (with EF Core 10) or 7.1. Both pull a vulnerable `System.Security.Cryptography.Pkcs`. Pin Pkcs 10.0.x (standing rule, stack rule 5). SqlClient 6.1.6 and later also pull `Microsoft.Identity.Client.Broker`. For an app without Entra ID sign-in, Microsoft advises a direct reference to SqlClient `7.1.x` (also with EF Core 10). With Entra ID on SqlClient 7, also add `Microsoft.Data.SqlClient.Extensions.Azure`.\n5. Read the existing data code that the change edits, calls, or copies: raw SQL, reports, upserts, and key generators. These defects give wrong results without an error, and the existing tests pass:\n   - `AT TIME ZONE '\u003Czone>'` on a `datetime2` column without `AT TIME ZONE 'UTC'` first: the report counts UTC days (rule 12).\n   - An interpolated string or `AddWithValue` on a `varchar` column: `nvarchar(4000)`, `CONVERT_IMPLICIT`, and an index scan (rule 10).\n   - `Guid.CreateVersion7()` or `NEWID()` for a clustered key: random order in SQL Server, also when a comment or a decision says otherwise (rule 15).\n   - `MERGE` without `HOLDLOCK`, or a check before an insert (rule 6).\n\n   Fix the defect when the change edits, calls, or copies that code, and list the fix under Changes. Otherwise report it as an open point. Stack rule 3 keeps the style of existing code, not its defects.\n\n   After you fix a defect, search the repository for the same defect. Use `grep` for the table name and the call. Fix each other site on a table that the change uses when the fix changes no result and needs no migration. A typed parameter is an example. List each site under Changes. Report a site that needs a decision, a migration, or a change of behavior as an open point.\n\nDone when you can name the engine, the compatibility level, the RCSI and optimized locking settings, and the SqlClient version. Also name the defects in the existing code that the change touches.\n\n## Defaults for new code\n\nAsk the human before you apply a default that has no accepted decision (stack rule 4). The full entries are in `references\u002Fdecisions.md`.\n\n| Area | Default | ID |\n|------|---------|----|\n| Engine | The engine that the product runs. SQL Server 2025 or Azure SQL when the contract asks for it. | DATA-01 |\n| Isolation | RCSI on for each OLTP database and for the test database. `READ COMMITTED`. No `NOLOCK`. | DATA-26 |\n| Optimized locking | On for a new SQL Server 2025 database, with ADR and RCSI. | DATA-27 |\n| Keys | `uniqueidentifier` from EF (sequential). Writers without EF: `DEFAULT NEWSEQUENTIALID()`, or `bigint IDENTITY`. | DATA-07 |\n| Strings | `nvarchar(n)` for user text, `varchar(n)` for codes, the server default collation. | DATA-28 |\n| Instants | `datetimeoffset`, written as UTC. | DATA-10 |\n| Money | `decimal(19,4)`. Currency as `char(3)`. | DATA-11 |\n| Concurrency | `rowversion` on edited aggregates. | DATA-15 |\n| Bulk insert | `SqlBulkCopy`. | DATA-22 |\n| Procedures | No new procedures in a service. | DATA-29 |\n\nExisting code keeps its style (stack rule 3).\n\n## Rules\n\n### Isolation and locks\n\n1. Turn on RCSI for each OLTP database (DATA-26). Readers then read the last committed version, and readers and writers do not block each other. RCSI is off in a new SQL Server database and on in Azure SQL Database. Turn it on in the test database too, or the tests prove other behavior. In an existing database, first find code that reads a row and then changes it based on that read. Such code needs `UPDLOCK` with RCSI.\n\n```sql\n-- Not in a transaction (error 226). In an EF migration: migrationBuilder.Sql(sql, suppressTransaction: true).\nALTER DATABASE CURRENT SET READ_COMMITTED_SNAPSHOT ON WITH ROLLBACK IMMEDIATE;\n```\n\n2. Do not use `NOLOCK`, `READUNCOMMITTED`, or `READ UNCOMMITTED`. They read uncommitted rows, and a scan can read a row two times or miss it while pages split. RCSI removes the blocking without these errors.\n3. Optimized locking (SQL Server 2025, DATA-27) needs ADR. Its lock after qualification (LAQ) works only with RCSI and `READ COMMITTED`. LAQ checks the `WHERE` clause on the last committed version. So an `UPDATE` can skip a row that a running transaction changes. Code that needs a strict order of transactions uses `REPEATABLE READ` or `SERIALIZABLE`. Lock hints (`UPDLOCK`, `HOLDLOCK`, `XLOCK`) turn LAQ off for their table, so use them only where the logic needs them.\n4. Retry a deadlock (1205) by running the whole transaction again. `EnableRetryOnFailure` does it in EF. Outside EF, retry the whole unit of work 3 times with a short random delay. Repeated deadlocks are a design defect. Read the deadlock graph in the `system_health` session. Add the missing index, and change tables and rows in the same order.\n\nDetail on isolation levels, RCSI, LAQ, deadlocks, and lock waits: `references\u002Fisolation-and-locking.md`.\n\n### Writes under concurrency\n\n5. Change a counter or a stock level in one statement, then check the row count. A read, a check in C#, and a write lose updates under load.\n\n```csharp\nvar reserved = await db.StockLevels\n    .Where(s => s.Sku == sku && s.Available >= quantity)\n    .ExecuteUpdateAsync(s => s.SetProperty(x => x.Available, x => x.Available - quantity), ct);\nif (reserved == 0)\n{\n    \u002F\u002F not enough stock: roll back the transaction and return 409\n}\n```\n\n6. An upsert under concurrency needs a key-range lock. Use `MERGE ... WITH (HOLDLOCK)`. Or use `UPDATE ... WITH (UPDLOCK, HOLDLOCK)`, then `INSERT` when no row changed, in one transaction. Without the lock, two sessions insert the same new key, and one fails (error 2627). A check in C# before the insert has the same problem.\n\n```csharp\nvar skuParameter = new SqlParameter(\"@sku\", SqlDbType.VarChar, 32) { Value = sku };\nawait db.Database.ExecuteSqlAsync($\"\"\"\n    MERGE dbo.StockLevels WITH (HOLDLOCK) AS t\n    USING (VALUES ({skuParameter}, {available})) AS s (Sku, Available)\n        ON t.Sku = s.Sku\n    WHEN MATCHED THEN UPDATE SET Available = s.Available\n    WHEN NOT MATCHED THEN INSERT (Sku, Available) VALUES (s.Sku, s.Available);\n    \"\"\", ct);\n```\n\n7. Take a work item with one statement: `UPDATE TOP (1) ... WITH (UPDLOCK, READPAST, ROWLOCK) ... OUTPUT inserted.Id`. The statement locks the row, and other workers skip it.\n8. Put a unique index on each unique column. Map 2601 and 2627 (unique key) to 409. Map 547 (foreign key or check) to 409 or 422.\n9. In a procedure that opens a transaction, write `SET XACT_ABORT ON; SET NOCOUNT ON;` first. Without `XACT_ABORT`, a client timeout stops the batch, but the transaction stays open with its locks. It stays open until the pool reuses or closes the connection.\n\n### Parameters and dynamic SQL\n\n10. Type each parameter like its column, so that the index can seek:\n    - A .NET string goes as `nvarchar`. EF raw SQL sends an interpolated string as `nvarchar(4000)`. LINQ sends `varchar(32)` from the mapping.\n    - On a `varchar` column with a `SQL_` collation, SQL Server then converts the column (`CONVERT_IMPLICIT`) and scans the index. A `SQL_` collation is the default of a US install.\n    - Use LINQ, a `SqlParameter` with `SqlDbType.VarChar` and a size, or Dapper `DbString { IsAnsi = true, Length = 32 }`. Do not use `AddWithValue`.\n11. Never build SQL by concatenation. Dynamic SQL uses `sp_executesql` with parameters. An identifier (a sort column) comes from an allow list and goes through `QUOTENAME`.\n\n### Types and time\n\n12. `AT TIME ZONE` takes Windows zone names from `sys.time_zone_info` (`'W. Europe Standard Time'`), not IANA names. `'Europe\u002FAmsterdam'` fails with error 9820. Convert a UTC `datetimeoffset`, then cast to `date` for a local day. SQL Server reads a `datetime2` without an offset as a time in the named zone. So convert it from UTC first: `x AT TIME ZONE 'UTC' AT TIME ZONE 'W. Europe Standard Time'`.\n\n```sql\n-- Revenue per day in Amsterdam time. @From and @ToExclusive are dates.\nSELECT CAST(o.PlacedAt AT TIME ZONE 'W. Europe Standard Time' AS date) AS Day,\n       COUNT(DISTINCT o.Id) AS Orders,\n       SUM(l.Quantity * l.UnitPrice) AS Revenue\nFROM dbo.Orders AS o\nJOIN dbo.OrderLines AS l ON l.OrderId = o.Id\nWHERE o.PlacedAt >= (CAST(@From AS datetime2) AT TIME ZONE 'W. Europe Standard Time')\n  AND o.PlacedAt \u003C  (CAST(@ToExclusive AS datetime2) AT TIME ZONE 'W. Europe Standard Time')\nGROUP BY CAST(o.PlacedAt AT TIME ZONE 'W. Europe Standard Time' AS date)\nORDER BY Day;\n```\n\n13. Instants: `datetimeoffset` (or `datetime2` in UTC), not `datetime`. Amounts: `decimal(p,s)`, not `money` or `float`.\n14. Strings (DATA-28): `nvarchar(n)` for text that users type, `varchar(n)` for codes (SKU, ISO codes). Do not filter or index an `nvarchar(max)` column: it cannot be an index key.\n15. Clustered key: narrow, unique, static, and growing. A `uniqueidentifier` key needs sequential values (the EF generator or `NEWSEQUENTIALID()`), never `NEWID()`. `Guid.CreateVersion7()` is not ordered in SQL Server, because SQL Server sorts `uniqueidentifier` bytes in another order.\n\n### Indexes and plans\n\n16. Design an index from the query. Put the equality columns first, then the range or sort column. Add the columns that the query only reads with `INCLUDE`. Index each foreign key column that a join or a delete uses. Use a filtered index for a hot subset (`WHERE Status = 'Placed'`). Prove a plan with the actual execution plan on data like production. A seek is not always the goal. A query that reads much of a big table can need a covering, filtered, or columnstore index. Refer to \"When a seek is not the answer\" in `references\u002Findexes.md`.\n\nDetail and diagnostic queries: `references\u002Findexes.md`.\n\n### SQL Server 2025 features\n\n17. Check the compatibility level before you use a new function. `REGEXP_LIKE` and the regex table functions need level 170. The other regex scalar functions (`REGEXP_REPLACE`, `REGEXP_SUBSTR`) work at each level. SQL Server cannot compare a `json` value with `=` or sort it (error 13636).\n\n### SqlClient, Dapper, and procedures\n\n18. New service code uses LINQ or parameterized SQL in code, not new stored procedures (DATA-29). When the project already has procedures that a DBA owns, call them with `CommandType.StoredProcedure` and typed parameters.\n19. For a large insert, use `SqlBulkCopy` with `EnableStreaming`, a `BatchSize`, and explicit column mappings.\n\nDetail on SqlClient, Dapper, procedures, and bulk copy: `references\u002Fsqlclient-dapper.md`.\n\n## Never write\n\n| Wrong | Correct |\n|-------|---------|\n| `SELECT ... FROM dbo.Orders WITH (NOLOCK)` | RCSI on the database, no hint |\n| `SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED` | RCSI on the database, `READ COMMITTED` |\n| `MERGE dbo.StockLevels AS t USING ...` (concurrent upsert) | `MERGE dbo.StockLevels WITH (HOLDLOCK) AS t USING ...` |\n| `if (await db.StockLevels.FindAsync(sku) is null) db.Add(...)` for an upsert | `MERGE ... WITH (HOLDLOCK)`, or `UPDATE ... WITH (UPDLOCK, HOLDLOCK)` then `INSERT` |\n| `var s = await Get(sku); if (s.Available >= q) { s.Available -= q; Save(); }` | One conditional `UPDATE` or `ExecuteUpdateAsync`, then check the row count |\n| `cmd.Parameters.AddWithValue(\"@sku\", sku)` on a `varchar` column | `cmd.Parameters.Add(\"@sku\", SqlDbType.VarChar, 32).Value = sku;` |\n| `SqlQuery\u003Cint>($\"... WHERE Sku = {sku}\")` on a `varchar` column | LINQ, or `{new SqlParameter(\"@sku\", SqlDbType.VarChar, 32) { Value = sku }}` |\n| `AT TIME ZONE 'Europe\u002FAmsterdam'` | `AT TIME ZONE 'W. Europe Standard Time'` |\n| `Id uniqueidentifier DEFAULT NEWID() PRIMARY KEY CLUSTERED` | `DEFAULT NEWSEQUENTIALID()`, or the EF generator |\n| `BEGIN TRAN` in a procedure without `SET XACT_ABORT ON` | `SET XACT_ABORT ON; SET NOCOUNT ON;` at the start |\n| `EXEC('SELECT ... WHERE Name = ''' + @name + '''')` | `EXEC sp_executesql N'... WHERE Name = @name', N'@name nvarchar(100)', @name = @name;` |\n| `PlacedAt datetime NOT NULL` | `PlacedAt datetimeoffset(7) NOT NULL` |\n| `Amount money` or `Amount float` | `Amount decimal(19,4)` |\n| `ALTER DATABASE ... SET READ_COMMITTED_SNAPSHOT ON` in an EF migration with a transaction | `migrationBuilder.Sql(sql, suppressTransaction: true)`, or a DBA step |\n| `BeginTransactionAsync()` with `EnableRetryOnFailure`, outside a strategy | `CreateExecutionStrategy().ExecuteAsync(...)` (`dev-stack:efcore` rule 20) |\n\n## Check\n\n1. Build with the analyzers as errors:\n\n   ```\n   dotnet build -warnaserror\n   ```\n\n   Pass: `Build succeeded` with 0 warnings. With SqlClient 6.1.7 or 7.1.1, the build fails with NU1902 and NU1903 until the project pins `System.Security.Cryptography.Pkcs` 10.0.x.\n2. Run the tests against `mcr.microsoft.com\u002Fmssql\u002Fserver:2025-CU10-ubuntu-24.04`, with the production settings of the database (RCSI, compatibility level). Pass: all tests green. A test of a counter, a claim, or an upsert runs parallel calls.\n3. Check the database settings in each environment:\n\n   ```sql\n   SELECT is_read_committed_snapshot_on, is_accelerated_database_recovery_on,\n          is_optimized_locking_on, compatibility_level\n   FROM sys.databases WHERE name = DB_NAME();\n   ```\n\n   Pass: the values of DATA-26, DATA-27, and DATA-01.\n4. For a new hot query, read the actual execution plan (`SET STATISTICS XML ON`, or Query Store). Pass: a seek on the hot path, and no `CONVERT_IMPLICIT` on an indexed column.\n5. Run the rules of this skill:\n\n   ```\n   python3 \u003Cskill folder>\u002Fscripts\u002Fstackcheck.py --root \u003Crepo>\n   ```\n\n   Pass: 0 errors. For each warning, fix it or add `\u002F\u002F stackcheck: ignore \u003CRULE-ID> \u003Creason>` (in SQL: `-- stackcheck: ignore \u003CRULE-ID> \u003Creason>`).\n\n## Review checklist\n\nThe full list is in `references\u002Freview-checklist.md`.\n\n1. No `NOLOCK`, `READUNCOMMITTED`, or `READ UNCOMMITTED`. tool (SQL-NOLOCK)\n2. A concurrent upsert uses `MERGE ... WITH (HOLDLOCK)` or `UPDLOCK, HOLDLOCK`. tool (SQL-MERGE-NO-HOLDLOCK), judge\n3. A counter or a stock level changes in one conditional statement with a check of the row count. judge\n4. `AT TIME ZONE` uses a Windows zone name. tool (SQL-IANA-ZONE)\n5. No dynamic SQL by concatenation. `sp_executesql` with parameters, `QUOTENAME` for identifiers. tool (SQL-EXEC-CONCAT), judge\n6. Parameters match the column type. No `AddWithValue`. tool (SQL-ADDWITHVALUE), judge\n7. Procedures with a transaction start with `SET XACT_ABORT ON`. judge\n8. Instants are `datetimeoffset` or UTC `datetime2`, not `datetime`. tool (SQL-DATETIME-TYPE)\n9. Clustered `uniqueidentifier` keys are sequential, not `NEWID()`. judge\n10. RCSI is on, or the report names DATA-26 as an open point. judge\n11. Explicit transactions with retries on run inside the execution strategy. Deadlocks retry the whole unit. judge\n12. Each index serves a query. Foreign keys have an index. No filter on `nvarchar(max)`. judge\n13. New functions of SQL Server 2025 match the compatibility level. judge\n14. Existing code that the change edits, calls, or copies has none of the defects of First, step 5. judge\n15. Each other site of a fixed defect on a table of the change is fixed or reported. judge\n\n## Report\n\nEnd with the report of stack rule 8 (`references\u002Fstack-rules.md`): the same headings in the same order on each run.\n\nThe change can need a database setting: RCSI, optimized locking, or a compatibility level. For each one, state how it is deployed (a migration with `suppressTransaction: true`, or a DBA step) and when it can run.\n\n## References\n\n- `references\u002Fdecisions.md`: read before new code needs DATA-26, DATA-27, DATA-28, DATA-29, or the SQL Server part of DATA-07, DATA-10, DATA-11, DATA-15, or DATA-22.\n- `references\u002Fisolation-and-locking.md`: read when you write a transaction, a queue, an upsert, or a counter. Also read it for blocking, a deadlock (1205), or a lock hint.\n- `references\u002Findexes.md`: read when you add or review an index, or a query is slow.\n- `references\u002Fsqlclient-dapper.md`: read when you write SqlClient or Dapper code, call a procedure, write a procedure, or bulk copy rows.\n- `references\u002Freview-checklist.md`: read for a full review.\n- `references\u002Fsources.md`: the primary sources, the evidence, and the credits.\n- `references\u002Fstack-rules.md` and `references\u002Flanguage.md`: the common rules and the output language.\n- `scripts\u002Fstackcheck.py`: the rule check of this skill.\n",{"name":5,"metadata":23,"description":7},{"verified":24,"versions":25},"2026-10-27","SQL Server 2025 (17.x, CU10), compatibility level 170, Azure SQL Database, Microsoft.Data.SqlClient 6.1.7 and 7.1.1, Dapper 2.1.89, EF Core 10.0.14, .NET 10.0.14","main","c247fa77bdea99449b9df09f93d92a35fed91874","plugins\u002Fdev-stack\u002Fskills\u002Fsqlserver","https:\u002F\u002Fgithub.com\u002FCharmedme\u002Fmaikelsoft-skills","https:\u002F\u002Fgithub.com\u002FCharmedme","2026-11-13 14:41:21",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add Charmedme\u002Fmaikelsoft-skills --skill sqlserver",{"tool":38,"command":39},"bunx","bunx skills add Charmedme\u002Fmaikelsoft-skills --skill sqlserver",{"tool":41,"command":42},"pnpm","pnpm dlx skills add Charmedme\u002Fmaikelsoft-skills --skill sqlserver","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FCharmedme\u002Fmaikelsoft-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fdev-stack\u002Fskills\u002Fsqlserver\u002FSKILL.md",true,[46,52,56,60,64,68,72,76,80,84,90,94],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Fdecisions.md","REFERENCE","参考文档",9056,"https:\u002F\u002Fgithub.com\u002FCharmedme\u002Fmaikelsoft-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fdev-stack\u002Fskills\u002Fsqlserver\u002Freferences\u002Fdecisions.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Findexes.md",6588,"https:\u002F\u002Fgithub.com\u002FCharmedme\u002Fmaikelsoft-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fdev-stack\u002Fskills\u002Fsqlserver\u002Freferences\u002Findexes.md",{"path":57,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fisolation-and-locking.md",7196,"https:\u002F\u002Fgithub.com\u002FCharmedme\u002Fmaikelsoft-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fdev-stack\u002Fskills\u002Fsqlserver\u002Freferences\u002Fisolation-and-locking.md",{"path":61,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Flanguage.md",4840,"https:\u002F\u002Fgithub.com\u002FCharmedme\u002Fmaikelsoft-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fdev-stack\u002Fskills\u002Fsqlserver\u002Freferences\u002Flanguage.md",{"path":65,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":66,"sourceHtmlUrl":67},"references\u002Freview-checklist.md",5820,"https:\u002F\u002Fgithub.com\u002FCharmedme\u002Fmaikelsoft-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fdev-stack\u002Fskills\u002Fsqlserver\u002Freferences\u002Freview-checklist.md",{"path":69,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Fsources.md",10473,"https:\u002F\u002Fgithub.com\u002FCharmedme\u002Fmaikelsoft-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fdev-stack\u002Fskills\u002Fsqlserver\u002Freferences\u002Fsources.md",{"path":73,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":74,"sourceHtmlUrl":75},"references\u002Fsqlclient-dapper.md",7119,"https:\u002F\u002Fgithub.com\u002FCharmedme\u002Fmaikelsoft-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fdev-stack\u002Fskills\u002Fsqlserver\u002Freferences\u002Fsqlclient-dapper.md",{"path":77,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":78,"sourceHtmlUrl":79},"references\u002Fstack-rules.md",7772,"https:\u002F\u002Fgithub.com\u002FCharmedme\u002Fmaikelsoft-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fdev-stack\u002Fskills\u002Fsqlserver\u002Freferences\u002Fstack-rules.md",{"path":81,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":82,"sourceHtmlUrl":83},"rules.json",5996,"https:\u002F\u002Fgithub.com\u002FCharmedme\u002Fmaikelsoft-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fdev-stack\u002Fskills\u002Fsqlserver\u002Frules.json",{"path":85,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":88,"sourceHtmlUrl":89},"scripts\u002Fconvert.py","SCRIPT","脚本",2928,"https:\u002F\u002Fgithub.com\u002FCharmedme\u002Fmaikelsoft-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fdev-stack\u002Fskills\u002Fsqlserver\u002Fscripts\u002Fconvert.py",{"path":91,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":92,"sourceHtmlUrl":93},"scripts\u002Fdoccheck.py",29463,"https:\u002F\u002Fgithub.com\u002FCharmedme\u002Fmaikelsoft-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fdev-stack\u002Fskills\u002Fsqlserver\u002Fscripts\u002Fdoccheck.py",{"path":95,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":96,"sourceHtmlUrl":97},"scripts\u002Fstackcheck.py",12200,"https:\u002F\u002Fgithub.com\u002FCharmedme\u002Fmaikelsoft-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fdev-stack\u002Fskills\u002Fsqlserver\u002Fscripts\u002Fstackcheck.py",[99,106,113,120,127,134],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":18},"01M7EA9S53810TTZTXYDGBWXHY","web-accessibility","Web accessibility to WCAG 2.2 AA - a checklist for the design, the tool checks (axe-core, the Tab walk, reduced motion), and the manual checks that no tool does (screen reader, zoom, status messages) - with the EAA and EN 301 549 status. Use when a design, mockup, or built feature must be checked for accessibility, when a review must cover keyboard and screen reader use, when the user asks about focus, a focus trap, contrast, or a screen reader on a page, or when the user asks which accessibility rules apply.","https:\u002F\u002Fgithub.com\u002FCharmedme\u002Fmaikelsoft-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fux-design\u002Fskills\u002Fweb-accessibility\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":18},"01M7EA9MGJ7ESKQ7WE2Z96858T","ux-states","State inventory for each screen - default, empty, loading, partial, error, success, disabled, overflow, offline, and the business states (no permission, stale data, locked by another user, waiting on an external system, bulk result with failures, read only) - with what the user sees, can do, and how the user recovers. Use when a screen or flow needs its states designed or checked, or when a design shows only the happy path.","https:\u002F\u002Fgithub.com\u002FCharmedme\u002Fmaikelsoft-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fux-design\u002Fskills\u002Fux-states\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":18},"01M7EA9FHYR0C26BHNQF7AZT4Q","ux-setup","Set up a project for UX work - finds the design tools, the design-system source, the brand files, the languages, and the run command, asks the human one round of questions, and writes the \"## Design\" section of .claude\u002Frules\u002Fdelivery.md that the ux-design commands and the ux-designer agent read. Moves an older \"## Design\" section out of CLAUDE.md. Use when \u002Fsetup, \u002Fux-design, or \u002Fux-review needs the design facts, when the ux-designer agent returns NEEDS_HUMAN because the \"## Design\" section is missing, or when the user wants to set up or change the design tools of a project.","https:\u002F\u002Fgithub.com\u002FCharmedme\u002Fmaikelsoft-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fux-design\u002Fskills\u002Fux-setup\u002FSKILL.md",[],[],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":18},"01M7EA99DQDFVJQBJNYDJQC643","ux-review","UX review of a built feature against its approved design - Playwright walks each flow and state at 390, 820, and 1440 px, axe-core and the tell checks run on each state, and each heuristic gets a verdict - with findings by owner, severity, and origin, and a verdict in ux-review.md in the work folder of the item. Use when a built feature or screen must be checked against its design, mockups, or prototype, in each state or at each screen size, when built screens need findings by severity, when the build of an item with a UX design is done, or when existing screens need a UX audit.","https:\u002F\u002Fgithub.com\u002FCharmedme\u002Fmaikelsoft-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fux-design\u002Fskills\u002Fux-review\u002FSKILL.md",[],[],{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":18},"01M7EA95YPJQQ1YDW5HS0RVAN2","ux-prototype","Clickable prototype of a designed story in the proto-shell standard, with variants for an A\u002FB test, all states in scope, three sizes, and a test plan with tasks. Use when a design or mockups exist and the team must test the flow or compare variants with users before the build.","https:\u002F\u002Fgithub.com\u002FCharmedme\u002Fmaikelsoft-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fux-design\u002Fskills\u002Fux-prototype\u002FSKILL.md",[],[],{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":140,"publishedAt":18},"01M7EA91SKA2RNFGW9VDG9JFW7","ux-practice","The method of the ux-designer agent for the UX design of a story, a feature, or a screen - Double Diamond phases, a design spec with a source for each decision, the UX decision log, evidence tags, severity, and the modes light, full, and new-direction. Preloaded by the ux-designer agent. Use when the ux-designer agent or another UX skill names this method. For the design of an item, a person starts ux-design:ux-design.","https:\u002F\u002Fgithub.com\u002FCharmedme\u002Fmaikelsoft-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fux-design\u002Fskills\u002Fux-practice\u002FSKILL.md",[],[]]