sqlhadr-review

sqlhadr-review is a skill for Claude Code from vanterx/mssql-performance-skills. It costs 152 tokens per session (8,254 once invoked), scanned A, original, MIT.

A diagnostic review for SQL Server Always On Availability Groups using database management-view output. These groups keep copies of a database on multiple servers for availability and failover.

In plain words
What is it for?
Checking replica roles, synchronization, secondary delay, redo and log-send queues, failover settings, listeners, routing, and other availability-group conditions.
Why use it?
It reveals disconnected replicas, synchronization problems, data-loss risk, lag, queue buildup, and configuration gaps.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths.

Part of the mssql-performance-skills plugin — 26 skills, 3 hooks, 1 MCP server shipped together

Good fit Checking replica roles, synchronization, secondary delay, redo and log-send queues, failover settings, listeners, routing, and other availability-group conditions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vanterx/mssql-performance-skills/sqlhadr-review
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add vanterx/mssql-performance-skills --skill sqlhadr-review
Clone the repo
git clone --depth 1 https://github.com/vanterx/mssql-performance-skills

Made for: Claude Code.

Or install mssql-performance-skills, the plugin that ships this one along with the rest of its 26 skills, 3 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sqlhadr-review

README.md
[![agentmods](https://agentmods.dev/badge/skills/vanterx/mssql-performance-skills/sqlhadr-review/github.svg)](https://agentmods.dev/skills/vanterx/mssql-performance-skills/sqlhadr-review)
Your own site
<a href="https://agentmods.dev/skills/vanterx/mssql-performance-skills/sqlhadr-review"><img src="https://agentmods.dev/badge/skills/vanterx/mssql-performance-skills/sqlhadr-review/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sqlhadr-review

Your own site · 80×15
<a href="https://agentmods.dev/skills/vanterx/mssql-performance-skills/sqlhadr-review"><img src="https://agentmods.dev/badge/skills/vanterx/mssql-performance-skills/sqlhadr-review.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 152 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 8,254 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00152 $0.08254
Opus 5 $0.00076 $0.04127
Sonnet 5 $0.00030 $0.01651
Haiku 4.5 $0.00015 $0.00825

Measured 8d ago against content hash f0f40b6aa0b3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

sqlhadr-review scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/sqlhadr-review/SKILL.md · 539 lines

How it starts

The opening of the file, as written. The whole thing — 539 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SQL Server Always On AG Health Review Skill

Purpose

Analyze output from the sys.dm_hadr_* DMV family to assess the health of one or more Always On Availability Groups. Applies 27 checks (H1–H28, with H21 retired and merged into sqlag-review F15 — see Category 4) across six categories:

  • H1–H6 — Replica connectivity and role: detect disconnected replicas, resolving state, unhealthy synchronization health, replicas not synchronizing, last-connect errors, and failover mode mismatches
  • H7–H11 — Data loss and recovery time: flag estimated data loss, excessive recovery time, secondary lag, redo queue buildup, and log send queue buildup
  • H12–H16 — Throughput and performance: detect stalled redo rate, stalled log send rate, rate mismatch causing queue accumulation, multiple databases lagging on the same replica, and commit latency signals on sync-commit replicas
  • H17–H22 — Configuration: async replica in unexpected position, no automatic failover replica, single-replica AG, missing listener, and automatic seeding in progress (H21 is retired — read-only routing absence is covered by sqlag-review F15)
  • H23–H27 — Modern AG features: Contained AG DML misrouting, Cloud Witness inaccessible, Parallel Redo saturation, Read-Scale secondary missing RCSI, AG without database-level health detection (SQL 2012–2022+)
  • H28 — Seeding and initialization integrity: database stuck in INITIALIZING synchronization state, particularly after a failover

Input

Accept any of:

  • File path — path to a saved text/CSV file containing the DMV query output
  • Inline paste — DMV result grid pasted directly into chat (tab- or pipe-delimited)
  • Natural language description — description of AG symptoms ("secondary is 90 seconds behind", "replica shows NOT_HEALTHY")

Capture Query

Run the following on the primary replica to collect the required columns:

SELECT
    ag.name                              AS ag_name,
    ar.replica_server_name,
    ar.availability_mode_desc,
    ar.failover_mode_desc,
    ars.role_desc,
    ars.connected_state_desc,
    ars.synchronization_health_desc,
    ars.last_connect_error_number,
    ars.last_connect_error_description,
    drs.database_name,
    drs.synchronization_state_desc,
    drs.synchronization_health_desc      AS db_sync_health,
    drs.log_send_queue_size,
    drs.log_send_rate,
    drs.redo_queue_size,
    drs.redo_rate,
    drs.secondary_lag_seconds,          /* SQL Server 2016+ only; NULL on 2014 and earlier */
    drs.estimated_data_loss_seconds,
    drs.estimated_recovery_time_seconds
FROM sys.availability_groups ag
JOIN sys.availability_replicas ar
    ON ag.group_id = ar.group_id
JOIN sys.dm_hadr_availability_replica_states ars
    ON ar.replica_id = ars.replica_id
JOIN sys.dm_hadr_database_replica_states drs
    ON ar.replica_id = drs.replica_id
ORDER BY ar.replica_server_name, drs.database_name;

Read the full file on GitHub · 539 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 539 lines · 152 tokens per session scan A f0f40b6aa0b3

Subscribe to this mod's changes

sqlhadr-review is a skill published in the GitHub repository vanterx/mssql-performance-skills (5 stars, last pushed yesterday), licensed MIT. It adds 152 tokens to every session and 8,254 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

triage-issues

Triage GitHub issues in the googleapis/mcp-toolbox repo: propose the correct labels (type / priority / product / status), check for duplicates, verify a bug has enough info to act on, and draft a triage comment. Use whenever a maintainer asks you to triage, label, categorize, prioritize, or "look at" an issue (or a…

googleapis/mcp-toolbox · 164 tokens

postgresql-indexing

PostgreSQL indexing best practices for Prowler: index design, partial indexes, partitioned table indexing, EXPLAIN ANALYZE validation, concurrent operations, monitoring, and maintenance. Trigger: When creating or modifying PostgreSQL indexes, analyzing query performance with EXPLAIN, debugging slow queries, reviewing…

prowler-cloud/prowler · 108 tokens

graphjin-eval

Create, extend, run, baseline, and diagnose GraphJin agent evaluations through the graphjin eval CLI.

dosco/graphjin · 27 tokens

axiom-audit-grdb-performance

Use when the user mentions GRDB performance review, slow GRDB queries, app-group database setup audit, a ValueObservation that stopped updating, or pre-release GRDB scan.

CharlesWiltgen/Axiom · 43 tokens

django-perf-review

Django performance code review. Use when asked to "review Django performance", "find N+1 queries", "optimize Django", "check queryset performance", "database performance", "Django ORM issues", or audit Django code for performance problems.

getsentry/skills · 55 tokens

byted-bytehouse-slow-query

A ByteHouse tool for finding slow database queries, examining how they run, and suggesting ways to improve them.

bytedance/agentkit-samples · 74 tokens