sqlplan-batch — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited sqlplan-batch (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Analyze multiple .sqlplan files in bulk — applying the full 108-check ruleset (S1–S36, N1–N72) from sqlplan-review to each plan — and produce a single aggregated dashboard that identifies the most expensive queries, most common violations, and consolidated missing index recommendations.
Accept any of:
.sqlplan files: /path/to/plans/.sqlplan file paths.sqlplan files in the inputsqlplan-review)sqlindex-advisorbatch-analysis.md in the same directoryFor each plan, collect:
| Field | Source |
|---|---|
| File name | file system |
| Query text (first 200 chars, for display only; use full StatementText for analysis) | StmtSimple/@StatementText |
| Statement cost | StmtSimple/@StatementSubTreeCost |
| DOP | QueryPlan/@DegreeOfParallelism |
| Memory grant (MB) | MemoryGrantInfo/@GrantedMemory ÷ 1024 |
| Critical issue count | checks fired at Critical severity |
| Warning count | checks fired at Warning severity |
| Spill present | SpillToTempDb/@SpillLevel > 0 |
| Missing index count | <MissingIndexGroup> children count |
| Missing index max impact | max @Impact across all MissingIndexGroups |
| Check IDs fired | list of S/N codes |
Rank by StatementSubTreeCost descending. Report:
| Rank | File | Cost | DOP | Memory (MB) | Criticals | Warnings |
|---|
Rank by Critical issue count descending, break ties by cost.
| Rank | File | Criticals | Warnings | Primary Issue |
|---|
Count how many plans triggered each check ID. Report top 15 most common violations:
| Check | Name | Plans Affected | % of Total |
|---|
Example output:
N21 (Bad Row Estimate) — 31 / 50 plans (62%)
S1 (Serial Plan) — 28 / 50 plans (56%)
N4 (Expensive Scan) — 25 / 50 plans (50%)List all plans with confirmed spills:
| File | Operator | Spill Level | Memory Grant (MB) | Memory Used (MB) |
|---|
| File | Memory Grant (MB) | Grant Used (MB) | Ratio |
|---|
Apply the same merge rules as sqlindex-advisor:
CREATE INDEX statements for top 10 (or all, if ≤ 20 total)If the SQL Server version is known — from the ServerVersion attribute in the plan XML or stated by the user — read VERSION_COMPATIBILITY.md (~/.claude/skills/VERSION_COMPATIBILITY.md if installed, or skills/VERSION_COMPATIBILITY.md from the repo). If unavailable, skip silently. For checks whose minimum version exceeds the instance version: verbose mode → log as SKIP (version: requires SQL 20XX+, instance is SQL 20YY); standard report → omit entirely. Do not suppress NOT ASSESSED rows from missing input — only suppress version-inapplicable checks.
Write batch-analysis.md with the following structure:
# Batch Execution Plan Analysis
**Plans analyzed:** N
**Generated:** [timestamp]
**Checks applied:** 108 (S1–S36, N1–N72)
---
## Executive Summary
- Total Critical issues: X across Y plans
- Total Warnings: A across B plans
- Plans with confirmed spills: C
- Plans with memory grant > 1 GB: D
- Unique tables with missing index suggestions: E
**Systemic issues (> 30% of plans):**
- [Check ID]: [name] — N plans (X%)
- ...
---
## Top 10 Most Expensive Plans
| Rank | File | Cost | DOP | Memory (MB) | Criticals | Warnings |
|------|------|------|-----|-------------|-----------|---------|
| 1 | ... | | | | | |
---
## Top 10 Plans by Critical Issues
[table]
---
## Check Violation Frequency (Top 15)
[table]
---
## Spill Report
| File | Operator | Spill Level | Threads Spilled | Est. Rows | Actual Rows | Note |
|------|---------|------------|----------------|-----------|-------------|------|
| plan.sqlplan | Sort (Node N) | 2 | 8 | 1 | 9,999,999 | [root cause in one phrase] |
[Or: "No spills detected across all plans."]
---
## Memory Grant Summary
| File | Granted MB | Max Used MB | Efficiency | Wait ms |
|------|-----------|-------------|------------|---------|
| plan.sqlplan | 1,024 | 2,048 | 200% overused (grant too small) | 5,000 |
[Efficiency = MaxUsed / Granted × 100. Flags both over-grants (< 10% used) and under-grants (> 100% used). Omit if no plan has a memory grant.]
---
## Cardinality Accuracy Report
| File | NodeId | Operator | Estimated | Actual | Error Factor |
|------|--------|---------|-----------|--------|-------------|
| plan.sqlplan | 5 | Sort | 1 | 9,999,999 | **9,999,999×** |
[Include only operators where actual vs estimated diverges > 100×. Sort by Error Factor descending. This table reveals which plans need statistics work before anything else.]
---
## Consolidated Missing Index Script
### Summary
- Raw suggestions across all plans: N
- After merging: M
- Tables affected: K
### Recommended Indexes
[CREATE INDEX statements in ranked order]
---
## Per-Plan Summary
| File | Cost | DOP | Memory (MB) | Criticals | Warnings | Spill | Check IDs |
|------|------|-----|-------------|-----------|---------|-------|-----------|
| ... | | | | | | | |
## Per-Plan Findings Summary
For each plan with at least one Critical or Warning finding, add a sub-section:
### `plan-name.sqlplan`
| ID | Severity | NodeId | Finding |
|----|----------|--------|---------|
| S3 | Critical | — | Memory grant 1,024 MB — over-budget |
| N21 | Warning | 7 | Row estimate 1 vs actual 9,999,999 |
NodeId column: populate for operator-level findings (N-prefix check IDs) using the `NodeId` attribute from the `<RelOp>` element. Use `—` for statement-level findings (S-prefix) that have no associated operator.
[One sentence at the bottom pointing to the full analysis: "Full analysis: `/sqlplan-review plan-name.sqlplan`"]
[Plans with no findings beyond Info: one line — "Clean plan — no Critical or Warning findings."]
---
*Analyzed by: [state the AI model and version you are running as, e.g. "Claude Sonnet 4.6", "DeepSeek R1", "GPT-4o"] · [current date and time in the user's local timezone, or UTC if timezone is unknown, e.g. "2026-05-16 20:15 NZST"]*sqlplan-review (the parent skill) — do not re-define them here. This skill is an aggregation layer, not a separate ruleset.batch-analysis.md output file should be placed in the same directory as the input plans (or a specified output path) so it stays with the workload capture./sqlindex-advisor on the consolidated missing indexes for a deployment-ready script, or /sqlplan-review on any specific high-cost plan for detailed analysis.`--brief` — Omit the Passed Checks table and attribution footer. Output the Summary, Findings, and Prioritized Fix Sequence sections only. Use when a quick scan of what fired is all that's needed.
`--critical-only` — Suppress Warning and Info findings. Show only Critical findings. The Passed Checks table is also omitted. Use when triaging an incident and only actionable blockers matter.
Both flags can be combined: --brief --critical-only produces the Summary section plus Critical findings only.
When neither flag is present, produce the full report as documented above.
When the user's request includes --verbose, --trace, or the word verbose:
1. Append a `## Check Evaluation Log` section after the Passed Checks table.
Include one row for every check in this skill's ruleset, in check-ID order:
| Check | Evidence | Threshold | Result |
|---|---|---|---|
| [ID — Name] | [key attribute(s) and value found, or "absent"] | [threshold or condition] | PASS / FIRE → [severity] / NOT ASSESSED |
Result conventions:
PASS — attribute present, threshold not met**FIRE → Critical/Warning/Info** — threshold met; bold to distinguish from passesNOT ASSESSED — required attribute absent from input2. Save both files to the current working directory using the Write tool:
output/<skill-name>/<YYYY-MM-DD-HHmmss>-<input-prefix>/analysis.md ← full report output/<skill-name>/<YYYY-MM-DD-HHmmss>-<input-prefix>/trace.md ← Check Evaluation Log
Derive <input-prefix>:
horrible.sqlplan → horrible)runSanitize: alphanumeric + hyphens/underscores only, max 32 chars.
File headers: analysis.md → # Analysis — <skill-name> / # Input: <first 80 chars> / # Generated: <UTC timestamp> trace.md → # Check Evaluation Log — <skill-name> / # Input: <first 80 chars> / # Generated: <UTC timestamp>
Create directories as needed. When --verbose is not present, write nothing to disk.
CREATE INDEX script from the consolidated missing index recommendations in the batch report..sqlplan files, analyze them with this companion skill.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.