agentleFS
a365ngaya365ngay/CogniRouter/skills/senior-sql-server/SKILL.md

senior-sql-server

Skill2 starsChanged 5 days agoMITView on GitHub

Use when designing, reviewing, tuning, migrating, securing, or troubleshooting Microsoft SQL Server schemas, T-SQL, indexes, stored procedures, transactions, locking, execution plans, backups, or operations.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Prefer declarative constraints, normalized ownership, parameterized T-SQL, and set-based operations.

    line 16
  2. Distinctive:

    Use explicit transactions with the smallest safe scope.

    line 18
  3. Very specific:

    Avoid SELECT *, implicit conversions, non-SARGable predicates, cursor or RBAR patterns, unbounded result sets, dynamic SQL without …

    line 23
  4. Distinctive:

    Use least-privilege database principals and never embed credentials or expose raw database errors to users.

    line 26
  5. Distinctive:

    Treat backups, restore testing, retention, encryption, auditing, and monitoring as production requirements.

    line 27
  6. Distinctive:

    Test semantics, permissions, transactions, concurrent behavior, migration forward/rollback, and representative performance.

    line 31

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Senior SQL Server

Role

Make SQL Server changes correct, secure, reversible, and evidence-driven. Protect data integrity and production availability before pursuing micro-optimizations.

Workflow

  1. Inspect schema, constraints, data volume, query callers, existing indexes, execution plans, SQL Server version, isolation level, and deployment process before changing a query or table.
  2. State the correctness invariant, expected cardinality, access pattern, concurrency behavior, performance target, and rollback method.
  3. Prefer declarative constraints, normalized ownership, parameterized T-SQL, and set-based operations. Use stored procedures or functions only where they fit existing conventions and responsibilities.
  4. Review actual execution plans and measured I/O, CPU, duration, waits, and row estimates before declaring a performance fix. Compare baseline and result on representative data.
  5. Use explicit transactions with the smallest safe scope. Account for deadlocks, blocking, lock escalation, isolation anomalies, retry behavior, and idempotency.
  6. Ship schema changes as forward and rollback scripts; make long-running migrations online, batched, or staged when production size requires it.

Query and Schema Rules

  • Avoid SELECT *, implicit conversions, non-SARGable predicates, cursor or RBAR patterns, unbounded result sets, dynamic SQL without parameterization, and accidental cross joins.
  • Index for the measured predicate, join, sort, and include needs; balance read improvement against write cost and maintenance. Do not add duplicate or speculative indexes.
  • Preserve primary keys, foreign keys, unique constraints, checks, defaults, null semantics, data types, collation, and precision intentionally.
  • Use least-privilege database principals and never embed credentials or expose raw database errors to users.
  • Treat backups, restore testing, retention, encryption, auditing, and monitoring as production requirements; do not alter them without explicit authorization.

Verification

Test semantics, permissions, transactions, concurrent behavior, migration forward/rollback, and representative performance. For a performance change, report plan comparison and measured before/after evidence, plus remaining uncertainty caused by data or workload differences.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.