Token导航 LogoToken导航TokenDH.com
开发执行命令github未标认证来源可访问许可证需确认审计通过

sql-developmentSQL 开发

Agent Skill

用于辅助数据库表结构、查询语句、迁移脚本和数据维护任务。它适合让 Agent 分析 schema、编写 SQL、排查查询问题、整理索引或生成迁移建议。使用时需要明确数据库类型、连接环境和目标表,区分只读分析与写入变更;涉及删除、更新、迁移和批量导入时,应优先 dry-run、备份或事务保护,避免误操作。

总安装

269

周安装

11

GitHub Stars

3

下载量

87
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:sql-development(SQL 开发)
来源仓库:https://github.com/practicalswan/agent-skills
仓库路径:skills/sql-development
安装命令:
npx skills add https://github.com/practicalswan/agent-skills --skill sql-development
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/practicalswan/agent-skills --skill sql-development

简介

用于辅助数据库表结构、查询语句、迁移脚本和数据维护任务。

  • 适合让 Agent 分析 schema、编写 SQL、排查查询问题、整理索引或生成迁移建议。
  • 使用时需要明确数据库类型、连接环境和目标表,区分只读分析与写入变更。
  • 涉及删除、更新、迁移和批量导入时,应优先 dry-run、备份或事务保护,避免误操作。
  • 安装前建议核对仓库维护状态及是否会触发联网、命令执行或文件读写。

SKILL.md

SQL Development

Comprehensive SQL development guidelines combining SQL coding standards, stored procedure generation, and MS SQL Server DBA best practices.

Skill Paths

  • Workspace skills: .github/skills/
  • Global skills: C:/Users/LOQ/.codex/skills/ for Codex or C:/Users/LOQ/.agents/skills/ for the shared mirror

Activation Conditions

  • Writing SQL queries and stored procedures
  • Designing database schemas and table structures
  • Working with MS SQL Server as a DBA
  • Performance tuning and query optimization
  • Database backup, restore, and security configuration
  • SQL Server 2025+ feature adoption and migration

Part 1: Database Schema Design

Table Naming

  • All table names in singular form
  • All column names in singular form

Required Columns

  • All tables must have a primary key column named id
  • All tables must have created_at for creation timestamp
  • All tables must have updated_at for last update timestamp

Constraints

  • All tables must have a primary key constraint
  • All foreign key constraints must have a name
  • All foreign key constraints defined inline
  • All foreign keys must have ON DELETE CASCADE
  • All foreign keys must have ON UPDATE CASCADE
  • All foreign keys must reference the primary key of the parent table

Part 2: SQL Coding Style

Formatting

  • Uppercase for SQL keywords (SELECT, FROM, WHERE)
  • Consistent indentation for nested queries
  • Comments to explain complex logic
  • Break long queries into multiple lines
  • Organize clauses: SELECT, FROM, JOIN, WHERE, GROUP BY, HAVING, ORDER BY

Query Structure

  • Use explicit column names, never SELECT *
  • Qualify column names with table alias when using multiple tables
  • Prefer JOINs over subqueries when possible
  • Include LIMIT/TOP clauses to restrict result sets
  • Use appropriate indexing for frequently queried columns
  • Avoid functions on indexed columns in WHERE clauses

Part 3: Stored Procedure Standards

Naming Conventions

  • Prefix with usp_
  • Use PascalCase: usp_GetCustomerOrders
  • Include plural noun for multiple records: usp_GetProducts
  • Include singular noun for single record: usp_GetProduct

Parameter Handling

  • Prefix parameters with @
  • Use camelCase: @customerId
  • Provide default values for optional parameters
  • Validate parameter values before use
  • Document parameters with comments
  • Required parameters first, optional later

Structure

  • Include header comment block with description, parameters, return values
  • Return standardized error codes/messages
  • Return result sets with consistent column order
  • Use OUTPUT parameters for returning status information
  • Prefix temporary tables with tmp_
  • Include SET NOCOUNT ON for data-modifying procedures

Part 4: Security Best Practices

Query Security

  • Parameterize all queries to prevent SQL injection
  • Use prepared statements for dynamic SQL
  • Avoid embedding credentials in SQL scripts
  • Proper error handling without exposing system details
  • Avoid dynamic SQL in stored procedures

Transaction Management

  • Explicitly begin and commit transactions
  • Use appropriate isolation levels
  • Avoid long-running transactions that lock tables
  • Use batch processing for large data operations

Part 5: MS SQL Server DBA

Tooling

  • Install and enable ms-mssql.mssql VS Code extension for full database management
  • Use official Microsoft documentation for reference and troubleshooting

DBA Responsibilities

  • Database creation and configuration
  • Backup and restore strategies
  • Performance tuning and index optimization
  • Security management and auditing
  • Upgrades and compatibility planning (SQL Server 2025+)

Best Practices

  • Focus on tool-based database inspection over codebase analysis
  • Highlight deprecated/discontinued features in SQL Server 2025+
  • Encourage secure, auditable, performance-oriented solutions
  • Reference official docs for troubleshooting
  • Warn about deprecated features and suggest alternatives

Troubleshooting

IssueSolution
Slow queriesCheck execution plan, add indexes, optimize JOINs
DeadlocksReduce transaction scope, consistent lock ordering
Missing dataVerify CASCADE rules, check transaction isolation
Permission errorsReview GRANT/REVOKE statements, check role membership
Connection issuesVerify firewall rules, connection strings, SQL auth settings

References & Resources

Documentation

  • T-SQL Patterns — MERGE, CTEs, PIVOT, JSON operations, window functions, and error handling
  • Performance Tuning — Execution plans, index tuning, Query Store, and anti-patterns

Scripts

Examples


Cross-Client Portability

This skill is written to stay usable across GitHub Copilot, Claude Code, Codex, and Gemini CLI.

  • GitHub Copilot: keep the folder in a Copilot-visible skill or plugin path, or wrap the workflow as project instructions if the host does not support portable skill folders directly.
  • Claude Code: keep the folder in a local skills directory or a compatible plugin or marketplace source.
  • Codex: install or sync the folder into $CODEX_HOME/skills/<skill-name> and restart Codex after major changes.
  • Gemini CLI: this repository generates a project command named /skills:sql-development from this skill. Rebuild commands with python scripts/export-gemini-skill.py sql-development and then run /commands reload inside Gemini CLI.

MCP Availability And Fallback

No dedicated MCP server is required for the normal workflow in this skill.

  • If the current host lacks an equivalent tool surface, use the bundled scripts, standard shell or editor tooling, and the manual workflow already described in this skill.
  • Treat local verification as the fallback evidence path before closing the task.

Related Skills

SkillRelationship
nestjsTypeORM integration with NestJS
php-developmentPDO/MySQL database access from PHP
mongodb-mongooseAlternative NoSQL database approach
powerbi-modelingSQL sources for Power BI semantic models

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.36%
按下载量换算30

Claude

30.92%
按下载量换算27

Cursor

20.67%
按下载量换算18

Gemini CLI

8.49%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/practicalswan/agent-skills --skill sql-development 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills