/sqlag-review
Audits SQL Server Always On Availability Group configuration correctness across all layers — prerequisites, replica design, listener architecture, backup strategy, endpoint security, distributed AG topology, Basic and Contained AG constraints, and application integration
$ npx -y skills add vanterx/mssql-performance-skills --skill sqlag-review --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/sqlag-review
Context preview
The summary Claude sees to decide when to auto-load this skill.
Audits SQL Server Always On Availability Group configuration correctness across all layers — prerequisites, replica design, listener architecture, backup strategy, endpoint security, distributed AG topology, Basic and Contained AG constraints, and application integration
SKILL.md
sqlag-review.SKILL.mdname: sqlag-review
description: Audits SQL Server Always On Availability Group configuration correctness across all layers — prerequisites, replica design, listener architecture, backup strategy, endpoint security, distributed AG topology, Basic and Contained AG constraints, and application integration readiness. Use this skill when setting up a new AG, reviewing an existing AG design before a DR test, preparing for a failover, or investigating connection failures, listener misconfigurations, backup failures on secondaries, or endpoint certificate expiry. Applies 37 checks (F1–F37) across 7 categories. Trigger for questions about AG prerequisites, session timeout, failure condition level, read-only routing configuration, MultiSubnetFailover, backup preferred replica, distributed AG setup, Basic AG limits, Contained AG, endpoint encryption, or automatic seeding mode during a manual-restore workflow. Companion to /sqlhadr-review (runtime health) and /sqlclusterlog-review (WSFC events).
triggers:
- /sqlag-review
- /ag-review
- /ag-config-review
- /hadr-config
- /distributed-ag-review
- /ag-setup-review
SQL Server Always On AG Configuration Review Skill
Purpose
Audit the configuration and design of one or more SQL Server Always On Availability Groups. Applies 37 checks (F1–F37) across seven categories:
- **F1–F6** — Prerequisites and instance setup: AlwaysOn feature, database recovery model,
endpoint state, endpoint encryption, failure condition level, version alignment across replicas
- **F7–F13** — Replica configuration design: synchronous replica count, WAN session timeout,
health check timeout, backup priority ties, replica join state, database join completeness, readable secondary availability
- **F14–F18** — Listener and network design: multi-subnet IP completeness, read-only routing URL,
routing list on primary, non-default port documentation, MultiSubnetFailover guidance
- **F19–F23** — Backup strategy: automated backup preference, preferred-replica guard function,
log backup scheduling, compression, and missed offload opportunity
- **F24–F27** — Endpoint security: cross-domain Windows auth, certificate expiry, RC4 algorithm,
firewall port gaps
- **F28–F33** — Distributed AG and advanced features: listener URL requirement for distributed AGs,
Basic AG limits, Contained AG auth, synchronous distributed link, cross-database dependencies
- **F34–F37** — Operational monitoring: Extended Events AG session, listener IP conformance, AG database-count scale ceiling, automatic seeding left active during a manual-restore workflow
**Scope distinction:** This skill audits configuration correctness ("is the AG designed right?"). Use `/sqlhadr-review` (H1–H28) for runtime health ("is the AG healthy right now?") and `/sqlclusterlog-review` (L1–L30) for WSFC cluster log events.
---
Input
Accept any of:
- **File path** — path to a saved text or CSV file containing the catalog view output
- **Inline paste** — query results pasted directly (tab- or pipe-delimited)
- **Natural language description** — description of the AG topology and any known issues
Recommended Capture Queries
Run the following on the **primary replica** to collect the required data.
**Query 1 — Instance and AG overview**
SELECT
SERVERPROPERTY('IsHadrEnabled') AS hadr_enabled,
SERVERPROPERTY('ProductVersion') AS product_version,
SERVERPROPERTY('Edition') AS edition,
ag.name AS ag_name,
ag.failure_condition_level,
ag.health_check_timeout,
ag.automated_backup_preference_desc,
ag.db_failover,
ag.basic_features,
ag.is_contained,
ag.required_synchronized_secondaries_to_commit
FROM sys.availability_groups ag;**Query 2 — Replica configuration**
SELECT
ag.name AS ag_name,
ar.replica_server_name,
ar.availability_mode_desc,
ar.failover_mode_desc,
ar.session_timeout,
ar.primary_role_allow_connections_desc,
ar.secondary_role_allow_connections_desc,
ar.backup_priority,
ar.seeding_mode_desc,
ar.endpoint_url,
ar.read_only_routing_url
FROM sys.availability_groups ag
JOIN sys.availability_replicas ar ON ag.group_id = ar.group_id
ORDER BY ag.name, ar.replica_server_name;**Query 2b — Replica join state** (F11 — from DMV, not catalog view)
SELECT
replica_server_name,
join_state_desc -- NOT_JOINED | JOINED_STANDALONE | JOINED_FCI
FROM sys.dm_hadr_availability_replica_cluster_states
ORDER BY replica_server_name;**Query 3 — Listener and IP configuration**
SELECT
ag.name AS ag_name,
agl.dns_name,
agl.port,
agl.is_conformant, -- F35: 0 = mismatch with cluster resource
aglip.ip_address,
aglip.ip_subnet_mask,
aglip.state_desc AS ip_state -- ONLINE | OFFLINE | ONLINE_PENDING | FAILED
FROM sys.availability_groups ag
JOIN sys.availability_group_listeners agl ON ag.group_id = agl.group_id
JOIN sys.availability_group_listener_ip_addresses aglip ON agl.listener_id = aglip.listener_id;**Query 4 — Mirroring endpoint**
SELECT
name,
state_desc,
role_desc,
connection_auth_desc,
is_encryption_enabled,
encryption_algorithm_desc,
port
FROM sys.database_mirroring_endpoints;**Query 5 — AG database recovery models**
SELECT
adc.ag_database_id,
db.name AS database_name,
db.recovery_model_desc,
db.is_read_committed_snapshot_on,
db.state_desc
FROM sys.availability_databases_cluster adc
JOIN sys.databases db ON adc.database_id = db.database_id
ORDER BY db.name;**Query 6 — Endpoint certificates (certificate auth only)**
SELECT
name,
subject,
expiry_date,
pvt_key_encryption_type_desc,
thumbprint
FROM sys.certificates
WHERE pvt_key_encryption_type_desc IS NOT NULL
ORDER BY expiry_date;---
Thresholds Reference
Read more
name: sqlag-review description: Audits SQL Server Always On Availability Group configuration correctness across all layers — prerequisites, replica design, listener architecture, backup strategy, endpoint security, distributed AG topology, Basic and Contained AG constraints, and application integration readiness. Use this skill when setting up a new AG, reviewing an existing AG design before a DR test, preparing for a failover, or investigating connection failures, listener misconfigurations, backup failures on secondaries, or endpoint certificate expiry. Applies 37 checks (F1–F37) across 7 categories. Trigger for questions about AG prerequisites, session timeout, failure condition level, read-only routing configuration, MultiSubnetFailover, backup preferred replica, distributed AG setup, Basic AG limits, Contained AG, endpoint encryption, or automatic seeding mode during a manual-restore workflow. Companion to /sqlhadr-review (runtime health) and /sqlclusterlog-review (WSFC events). triggers: - /sqlag-review - /ag-review - /ag-config-review - /hadr-config - /distributed-ag-review - /ag-setup-review
SQL Server Always On AG Configuration Review Skill
Purpose
Audit the configuration and design of one or more SQL Server Always On Availability Groups. Applies 37 checks (F1–F37) across seven categories:
- **F1–F6** — Prerequisites and instance setup: AlwaysOn feature, database recovery model,
endpoint state, endpoint encryption, failure condition level, version alignment across replicas
- **F7–F13** — Replica configuration design: synchronous replica count, WAN session timeout,
health check timeout, backup priority ties, replica join state, database join completeness, readable secondary availability
- **F14–F18** — Listener and network design: multi-subnet IP completeness, read-only routing URL,
routing list on primary, non-default port documentation, MultiSubnetFailover guidance
- **F19–F23** — Backup strategy: automated backup preference, preferred-replica guard function,
log backup scheduling, compression, and missed offload opportunity
- **F24–F27** — Endpoint security: cross-domain Windows auth, certificate expiry, RC4 algorithm,
firewall port gaps
- **F28–F33** — Distributed AG and advanced features: listener URL requirement for distributed AGs,
Basic AG limits, Contained AG auth, synchronous distributed link, cross-database dependencies
- **F34–F37** — Operational monitoring: Extended Events AG session, listener IP conformance, AG database-count scale ceiling, automatic seeding left active during a manual-restore workflow
**Scope distinction:** This skill audits configuration correctness ("is the AG designed right?"). Use `/sqlhadr-review` (H1–H28) for runtime health ("is the AG healthy right now?") and `/sqlclusterlog-review` (L1–L30) for WSFC cluster log events.
---
Input
Accept any of:
- **File path** — path to a saved text or CSV file containing the catalog view output
- **Inline paste** — query results pasted directly (tab- or pipe-delimited)
- **Natural language description** — description of the AG topology and any known issues
Recommended Capture Queries
Run the following on the **primary replica** to collect the required data.
**Query 1 — Instance and AG overview**
SELECT
SERVERPROPERTY('IsHadrEnabled') AS hadr_enabled,
SERVERPROPERTY('ProductVersion') AS product_version,
SERVERPROPERTY('Edition') AS edition,
ag.name AS ag_name,
ag.failure_condition_level,
ag.health_check_timeout,
ag.automated_backup_preference_desc,
ag.db_failover,
ag.basic_features,
ag.is_contained,
ag.required_synchronized_secondaries_to_commit
FROM sys.availability_groups ag;**Query 2 — Replica configuration**
SELECT
ag.name AS ag_name,
ar.replica_server_name,
ar.availability_mode_desc,
ar.failover_mode_desc,
ar.session_timeout,
ar.primary_role_allow_connections_desc,
ar.secondary_role_allow_connections_desc,
ar.backup_priority,
ar.seeding_mode_desc,
ar.endpoint_url,
ar.read_only_routing_url
FROM sys.availability_groups ag
JOIN sys.availability_replicas ar ON ag.group_id = ar.group_id
ORDER BY ag.name, ar.replica_server_name;**Query 2b — Replica join state** (F11 — from DMV, not catalog view)
SELECT
replica_server_name,
join_state_desc -- NOT_JOINED | JOINED_STANDALONE | JOINED_FCI
FROM sys.dm_hadr_availability_replica_cluster_states
ORDER BY replica_server_name;**Query 3 — Listener and IP configuration**
SELECT
ag.name AS ag_name,
agl.dns_name,
agl.port,
agl.is_conformant, -- F35: 0 = mismatch with cluster resource
aglip.ip_address,
aglip.ip_subnet_mask,
aglip.state_desc AS ip_state -- ONLINE | OFFLINE | ONLINE_PENDING | FAILED
FROM sys.availability_groups ag
JOIN sys.availability_group_listeners agl ON ag.group_id = agl.group_id
JOIN sys.availability_group_listener_ip_addresses aglip ON agl.listener_id = aglip.listener_id;**Query 4 — Mirroring endpoint**
SELECT
name,
state_desc,
role_desc,
connection_auth_desc,
is_encryption_enabled,
encryption_algorithm_desc,
port
FROM sys.database_mirroring_endpoints;**Query 5 — AG database recovery models**
SELECT
adc.ag_database_id,
db.name AS database_name,
db.recovery_model_desc,
db.is_read_committed_snapshot_on,
db.state_desc
FROM sys.availability_databases_cluster adc
JOIN sys.databases db ON adc.database_id = db.database_id
ORDER BY db.name;**Query 6 — Endpoint certificates (certificate auth only)**
SELECT
name,
subject,
expiry_date,
pvt_key_encryption_type_desc,
thumbprint
FROM sys.certificates
WHERE pvt_key_encryption_type_desc IS NOT NULL
ORDER BY expiry_date;---
Thresholds Reference
Showing the first part of this file.
SQL Server performance tuning skills for LLMs — 829 checks across 26 skills covering T-SQL, execution plans, wait stats, deadlocks, Query Store, indexes, encryption, Always On AG, WSFC, ERRORLOG, SPN, memory, disk I/O, config drift, setup logs, SSRS & migration readiness. Remote MCP server on Cloudflare Workers.
Repo: vanterx/mssql-performance-skills
Other skills on mssql-performance-skills.
- /mssql-performance-review
Agentic offline orchestrator for end-to-end SQL Server performance reviews. Forms hypotheses from artifacts or symptoms, dispatches the specialised review skills (tsql-review, sqlplan-review, sqlwait-review, sqlstats-review, sqltrace-review, sqlquerystore-review,
Open skill - /sqlbootstraplog-review
Analyze SQL Server Setup Bootstrap log files to diagnose failed installations, failed Cumulative Update or Service Pack patching, failed cluster node operations, and risky setup-time configuration. Parses Summary.txt, Detail.txt, MSI/MSP logs, ConfigurationFile.ini, and
Open skill - /sqlclusterlog-review
Analyzes Windows Server Failover Cluster (WSFC) CLUSTER.LOG files for Always On Availability Group root-cause diagnosis. Use this skill when an availability group has gone offline, a failover occurred unexpectedly, or a node was evicted, and you need to identify the WSFC-level
Open skill - /sqldbconfig-review
Analyze SQL Server instance and database configuration drift against proven DBA best practices. Applies 29 checks (B1–B29) across five categories: parallelism tuning (MAXDOP, Cost Threshold for Parallelism, Optimize for Ad Hoc Workloads), memory configuration (Max Server Memory,
Open skill - /sqldeadlock-review
Analyze SQL Server deadlock XML (from system_health XE session, SSMS deadlock graph, or trace) to identify root cause and produce a prioritized remediation plan. Applies 17 known deadlock patterns (P1–P17). Use when a deadlock monitor captures a graph or users report
Open skill - /sqldiskio-review
Analyze SQL Server file-level I/O latency and auto-growth events using sys.dm_io_virtual_file_stats, sys.master_files, and default trace auto-growth records. Applies 15 checks (Z1–Z15) covering data and log file latency thresholds, hot file detection, stall ratio analysis, data
Open skill

