[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71HAXGZZMZF0ZE5MK4ABJK0":3,"skill-same:01M71HAXGZZMZF0ZE5MK4ABJK0":139},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":37,"linkOnly":38,"markdownContent":39,"markdownBody":40,"frontMatter":41,"refName":42,"commitSha":43,"skillDirectory":44,"forksCount":45,"repositoryHtmlUrl":46,"repositoryHomepageUrl":6,"ownerHtmlUrl":47,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":48,"install":49,"resources":62},"01M71HAXGZZMZF0ZE5MK4ABJK0","dsql",null,"Build with Aurora DSQL - manage schemas, execute queries, and handle migrations with DSQL-specific requirements. Use when developing a scalable or distributed database\u002Fapplication or user requests DSQL.","JSGforever\u002Fskillguard","JSGforever","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F85541948?v=4","01M71FQD3E132VMR5F4TAYX3YS","01M71FQD4DYW0XJ4XQ4YQH75Y9",2,"GPL-3.0","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__awslabs--dsql\u002FSKILL.md",[],[5,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],"requirements","application","user","execute","aurora dsql","build","migrations","requests","queries","with","distributed","use","handle","manage","Scalable","aurora","distributed database","when","database","2026-11-10 10:12:30",false,"---\nname: dsql\ndescription: Build with Aurora DSQL - manage schemas, execute queries, and handle migrations with DSQL-specific requirements. Use when developing a scalable or distributed database\u002Fapplication or user requests DSQL.\n---\n\n# Amazon Aurora DSQL Skill\n\nAurora DSQL is a serverless, PostgreSQL-compatible distributed SQL database. This skill provides direct database interaction via MCP tools, schema management, migration support, and multi-tenant patterns.\n\n**Key capabilities:**\n- Direct query execution via MCP tools\n- Schema management with DSQL constraints\n- Migration support and safe schema evolution\n- Multi-tenant isolation patterns\n- IAM-based authentication\n\n---\n\n## Reference Files\n\nLoad these files as needed for detailed guidance:\n\n### [development-guide.md](references\u002Fdevelopment-guide.md)\n**When:** ALWAYS load before implementing schema changes or database operations\n**Contains:** DDL rules, connection patterns, transaction limits, security best practices\n\n### MCP:\n#### [mcp-setup.md](mcp\u002Fmcp-setup.md)\n**When:** Always load for guidance using or updating the DSQL MCP server\n**Contains:** Instructions for setting up the DSQL MCP server with 2 configuration options as\nsampled in [.mcp.json](mcp\u002F.mcp.json)\n1. Documentation-Tools Only\n2. Database Operations (requires a cluster endpoint)\n\n#### [mcp-tools.md](mcp\u002Fmcp-tools.md)\n**When:** Load when you need detailed MCP tool syntax and examples\n**Contains:** Tool parameters, detailed examples, usage patterns\n\n### [language.md](references\u002Flanguage.md)\n**When:** MUST load when making language-specific implementation choices\n**Contains:** Driver selection, framework patterns, connection code for Python\u002FJS\u002FGo\u002FJava\u002FRust\n\n### [dsql-examples.md](references\u002Fdsql-examples.md)\n**When:** Load when looking for specific implementation examples\n**Contains:** Code examples, repository patterns, multi-tenant implementations\n\n### [troubleshooting.md](references\u002Ftroubleshooting.md)\n**When:** Load when debugging errors or unexpected behavior\n**Contains:** Common pitfalls, error messages, solutions\n\n### [onboarding.md](references\u002Fonboarding.md)\n**When:** User explicitly requests to \"Get started with DSQL\" or similar phrase\n**Contains:** Interactive step-by-step guide for new users\n\n### [access-control.md](references\u002Faccess-control.md)\n**When:** MUST load when creating database roles, granting permissions, setting up schemas for applications, or handling sensitive data\n**Contains:** Scoped role setup, IAM-to-database role mapping, schema separation for sensitive data, role design patterns\n\n### [ddl-migrations.md](references\u002Fddl-migrations.md)\n**When:** MUST load when trying to perform DROP COLUMN, RENAME COLUMN, ALTER COLUMN TYPE, or DROP CONSTRAINT functionality\n**Contains:** Table recreation patterns, batched migration for large tables, data validation\n\n### [mysql-to-dsql-migrations.md](references\u002Fmysql-to-dsql-migrations.md)\n**When:** MUST load when migrating from MySQL to DSQL or translating MySQL DDL to DSQL-compatible equivalents\n**Contains:** MySQL data type mappings, DDL operation translations, AUTO_INCREMENT\u002FENUM\u002FSET\u002FFOREIGN KEY migration patterns, ALTER TABLE ALTER COLUMN and DROP COLUMN via table recreation\n\n---\n\n## MCP Tools Available\n\nThe `aurora-dsql` MCP server provides these tools:\n\n**Database Operations:**\n1. **readonly_query** - Execute SELECT queries (returns list of dicts)\n2. **transact** - Execute DDL\u002FDML statements in transaction (takes list of SQL statements)\n3. **get_schema** - Get table structure for a specific table\n\n**Documentation & Knowledge:**\n4. **dsql_search_documentation** - Search Aurora DSQL documentation\n5. **dsql_read_documentation** - Read specific documentation pages\n6. **dsql_recommend** - Get DSQL best practice recommendations\n\n**Note:** There is no `list_tables` tool. Use `readonly_query` with information_schema.\n\nSee [mcp-setup.md](mcp\u002Fmcp-setup.md) for detailed setup instructions.\nSee [mcp-tools.md](mcp\u002Fmcp-tools.md) for detailed usage and examples.\n\n---\n\n## CLI Scripts Available\n\nBash scripts for cluster management and direct psql connections. All scripts are located in [scripts\u002F](scripts\u002F).\n\n**Cluster Management:**\n- **create-cluster.sh** - Create new DSQL cluster with optional tags\n- **delete-cluster.sh** - Delete cluster with confirmation prompt\n- **list-clusters.sh** - List all clusters in a region\n- **cluster-info.sh** - Get detailed cluster information\n\n**Database Connection:**\n- **psql-connect.sh** - Connect to DSQL using psql with automatic IAM auth token generation\n\n**Quick example:**\n```bash\n.\u002Fscripts\u002Fcreate-cluster.sh --region us-east-1\nexport CLUSTER=abc123def456\n.\u002Fscripts\u002Fpsql-connect.sh\n```\n\nSee [scripts\u002FREADME.md](scripts\u002FREADME.md) for detailed usage.\n\n---\n\n## Quick Start\n\n### 1. List tables and explore schema\n```\nUse readonly_query with information_schema to list tables\nUse get_schema to understand table structure\n```\n\n### 2. Query data\n```\nUse readonly_query for SELECT queries\nAlways include tenant_id in WHERE clause for multi-tenant apps\nValidate inputs carefully (no parameterized queries available)\n```\n\n### 3. Execute schema changes\n```\nUse transact tool with list of SQL statements\nFollow one-DDL-per-transaction rule\nAlways use CREATE INDEX ASYNC in separate transaction\n```\n\n---\n\n## Common Workflows\n\n### Workflow 1: Create Multi-Tenant Schema\n\n**Goal:** Create a new table with proper tenant isolation\n\n**Steps:**\n1. Create main table with tenant_id column using transact\n2. Create async index on tenant_id in separate transact call\n3. Create composite indexes for common query patterns (separate transact calls)\n4. Verify schema with get_schema\n\n**Critical rules:**\n- Include tenant_id in all tables\n- Use CREATE INDEX ASYNC (never synchronous)\n- Each DDL in its own transact call: `transact([\"CREATE TABLE ...\"])`\n- Store arrays\u002FJSON as TEXT\n\n### Workflow 2: Safe Data Migration\n\n**Goal:** Add a new column with defaults safely\n\n**Steps:**\n1. Add column using transact: `transact([\"ALTER TABLE ... ADD COLUMN ...\"])`\n2. Populate existing rows with UPDATE in separate transact calls (batched under 3,000 rows)\n3. Verify migration with readonly_query using COUNT\n4. Create async index for new column using transact if needed\n\n**Critical rules:**\n- Add column first, populate later\n- Never add DEFAULT in ALTER TABLE\n- Batch updates under 3,000 rows in separate transact calls\n- Each ALTER TABLE in its own transaction\n\n### Workflow 3: Application-Layer Referential Integrity\n\n**Goal:** Safely insert\u002Fdelete records with parent-child relationships\n\n**Steps for INSERT:**\n1. Validate parent exists with readonly_query\n2. Throw error if parent not found\n3. Insert child record using transact with parent reference\n\n**Steps for DELETE:**\n1. Check for dependent records with readonly_query (COUNT)\n2. Return error if dependents exist\n3. Delete record using transact if safe\n\n### Workflow 4: Query with Tenant Isolation\n\n**Goal:** Retrieve data scoped to a specific tenant\n\n**Steps:**\n1. Always include tenant_id in WHERE clause\n2. Validate and sanitize tenant_id input (no parameterized queries available!)\n3. Use readonly_query with validated tenant_id\n4. Never allow cross-tenant data access\n\n**Critical rules:**\n- Validate ALL inputs before building SQL (SQL injection risk!)\n- ALL queries include WHERE tenant_id = 'validated-value'\n- Reject cross-tenant access at application layer\n- Use allowlists or regex validation for tenant IDs\n\n### Workflow 5: Set Up Scoped Database Roles\n\n**Goal:** Create application-specific database roles instead of using the `admin` role\n\n**MUST load [access-control.md](references\u002Faccess-control.md) for detailed guidance.**\n\n**Steps:**\n1. Connect as `admin` (the only time admin should be used)\n2. Create database roles with `CREATE ROLE \u003Cname> WITH LOGIN`\n3. Create an IAM role with `dsql:DbConnect` for each database role\n4. Map database roles to IAM roles with `AWS IAM GRANT`\n5. Create dedicated schemas for sensitive data (e.g., `users_schema`)\n6. Grant schema and table permissions per role\n7. Applications connect using `generate-db-connect-auth-token` (not the admin variant)\n\n**Critical rules:**\n- ALWAYS use scoped database roles for application connections\n- MUST place user PII and sensitive data in dedicated schemas, not `public`\n- ALWAYS use `dsql:DbConnect` for application IAM roles\n- SHOULD create separate roles per service component (read-only, read-write, user service, etc.)\n\n### Workflow 6: Table Recreation DDL Migration\n\n**Goal:** Perform DROP COLUMN, RENAME COLUMN, ALTER COLUMN TYPE, or DROP CONSTRAINT using the table recreation pattern.\n\n**MUST load [ddl-migrations.md](references\u002Fddl-migrations.md) for detailed guidance.**\n\n**Steps:**\n1. MUST validate table exists and get row count with `readonly_query`\n2. MUST get current schema with `get_schema`\n3. MUST create new table with desired structure using `transact`\n4. MUST migrate data (batched in 500-1,000 row chunks for tables > 3,000 rows)\n5. MUST verify row counts match before proceeding\n6. MUST swap tables: drop original, rename new\n7. MUST recreate indexes using `CREATE INDEX ASYNC`\n\n**Rules:**\n- MUST use batching for tables exceeding 3,000 rows\n- PREFER batches of 500-1,000 rows for optimal throughput\n- MUST validate data compatibility before type changes (abort if incompatible)\n- MUST NOT drop original table until new table is verified\n- MUST recreate all indexes after table swap using ASYNC\n\n### Workflow 6: MySQL to DSQL Schema Migration\n\n**Goal:** Migrate MySQL table schemas and DDL operations to DSQL-compatible equivalents, including data type mapping, ALTER TABLE ALTER COLUMN, and DROP COLUMN operations.\n\n**MUST load [mysql-to-dsql-migrations.md](references\u002Fmysql-to-dsql-migrations.md) for detailed guidance.**\n\n**Steps:**\n1. MUST map all MySQL data types to DSQL equivalents (e.g., AUTO_INCREMENT → UUID\u002FIDENTITY\u002FSEQUENCE, ENUM → VARCHAR with CHECK, JSON → TEXT)\n2. MUST remove MySQL-specific features (ENGINE, FOREIGN KEY, ON UPDATE CURRENT_TIMESTAMP, FULLTEXT INDEX)\n3. MUST implement application-layer replacements for removed features (referential integrity, timestamp updates)\n4. For `ALTER TABLE ... ALTER COLUMN col datatype` or `MODIFY COLUMN`: MUST use table recreation pattern\n5. For `ALTER TABLE ... DROP COLUMN col`: MUST use table recreation pattern\n6. MUST convert all index creation to `CREATE INDEX ASYNC` in separate transactions\n7. MUST validate data compatibility before type changes (abort if incompatible)\n\n**Rules:**\n- MUST use table recreation pattern for ALTER COLUMN and DROP COLUMN (not directly supported)\n- MUST replace FOREIGN KEY with application-layer referential integrity\n- MUST replace ENUM with VARCHAR and CHECK constraint\n- MUST replace SET with TEXT (comma-separated)\n- MUST replace JSON columns with TEXT\n- MUST convert AUTO_INCREMENT to UUID, IDENTITY column, or SEQUENCE (SERIAL not supported)\n- MUST replace UNSIGNED integers with CHECK (col >= 0)\n- MUST use batching for tables exceeding 3,000 rows\n- MUST NOT drop original table until new table is verified\n\n---\n\n## Best Practices\n\n- **SHOULD read guidelines first** - Check [development_guide.md](references\u002Fdevelopment-guide.md) before making schema changes\n- **SHOULD use preferred language patterns** - Check [language.md](references\u002Flanguage.md)\n- **SHOULD Execute queries directly** - PREFER MCP tools for ad-hoc queries\n- **REQUIRED: Follow DDL Guidelines** - Refer to [DDL Rules](references\u002Fdevelopment-guide.md#schema-ddl-rules)\n- **SHALL repeatedly generate fresh tokens** - Refer to [Connection Limits](references\u002Fdevelopment-guide.md#connection-rules)\n- **ALWAYS use ASYNC indexes** - `CREATE INDEX ASYNC` is mandatory\n- **MUST Serialize arrays\u002FJSON as TEXT** - Store arrays\u002FJSON as TEXT (comma separated, JSON.stringify)\n- **ALWAYS Batch under 3,000 rows** - maintain transaction limits\n- **REQUIRED: Sanitize SQL inputs with allowlists, regex, and quote escaping** - See [Input Validation](mcp\u002Fmcp-tools.md#input-validation-critical)\n- **MUST follow correct Application Layer Patterns** - when multi-tenant isolation or application referential itegrity are required; refer to [Application Layer Patterns](references\u002Fdevelopment-guide.md#application-layer-patterns)\n- **REQUIRED use DELETE for truncation** - DELETE is the only supported operation for truncation\n- **SHOULD test any migrations** - Verify DDL on dev clusters before production\n- **Plan for Horizontal Scale** - DSQL is designed to optimize for massive scales without latency drops; refer to [Horizontal Scaling](references\u002Fdevelopment-guide.md#horizontal-scaling-best-practice)\n- **SHOULD use connection pooling in production applications** - Refer to [Connection Pooling](references\u002Fdevelopment-guide.md#connection-pooling-recommended)\n- **SHOULD debug with the troubleshooting guide:** - Always refer to the resources and guidelines in [troubleshooting.md](references\u002Ftroubleshooting.md)\n- **ALWAYS use scoped roles for applications** - Create database roles with `dsql:DbConnect`; refer to [Access Control](references\u002Faccess-control.md)\n\n---\n\n## Additional Resources\n\n- [Aurora DSQL Documentation](https:\u002F\u002Fdocs.aws.amazon.com\u002Faurora-dsql\u002Flatest\u002Fuserguide\u002F)\n- [Code Samples Repository](https:\u002F\u002Fgithub.com\u002Faws-samples\u002Faurora-dsql-samples)\n- [PostgreSQL Compatibility](https:\u002F\u002Fdocs.aws.amazon.com\u002Faurora-dsql\u002Flatest\u002Fuserguide\u002Fworking-with-postgresql-compatibility.html)\n- [IAM Authentication Guide](https:\u002F\u002Fdocs.aws.amazon.com\u002Faurora-dsql\u002Flatest\u002Fuserguide\u002Fusing-database-and-iam-roles.html)\n- [CloudFormation Resource](https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSCloudFormation\u002Flatest\u002FUserGuide\u002Faws-resource-dsql-cluster.html)\n","# Amazon Aurora DSQL Skill\n\nAurora DSQL is a serverless, PostgreSQL-compatible distributed SQL database. This skill provides direct database interaction via MCP tools, schema management, migration support, and multi-tenant patterns.\n\n**Key capabilities:**\n- Direct query execution via MCP tools\n- Schema management with DSQL constraints\n- Migration support and safe schema evolution\n- Multi-tenant isolation patterns\n- IAM-based authentication\n\n---\n\n## Reference Files\n\nLoad these files as needed for detailed guidance:\n\n### [development-guide.md](references\u002Fdevelopment-guide.md)\n**When:** ALWAYS load before implementing schema changes or database operations\n**Contains:** DDL rules, connection patterns, transaction limits, security best practices\n\n### MCP:\n#### [mcp-setup.md](mcp\u002Fmcp-setup.md)\n**When:** Always load for guidance using or updating the DSQL MCP server\n**Contains:** Instructions for setting up the DSQL MCP server with 2 configuration options as\nsampled in [.mcp.json](mcp\u002F.mcp.json)\n1. Documentation-Tools Only\n2. Database Operations (requires a cluster endpoint)\n\n#### [mcp-tools.md](mcp\u002Fmcp-tools.md)\n**When:** Load when you need detailed MCP tool syntax and examples\n**Contains:** Tool parameters, detailed examples, usage patterns\n\n### [language.md](references\u002Flanguage.md)\n**When:** MUST load when making language-specific implementation choices\n**Contains:** Driver selection, framework patterns, connection code for Python\u002FJS\u002FGo\u002FJava\u002FRust\n\n### [dsql-examples.md](references\u002Fdsql-examples.md)\n**When:** Load when looking for specific implementation examples\n**Contains:** Code examples, repository patterns, multi-tenant implementations\n\n### [troubleshooting.md](references\u002Ftroubleshooting.md)\n**When:** Load when debugging errors or unexpected behavior\n**Contains:** Common pitfalls, error messages, solutions\n\n### [onboarding.md](references\u002Fonboarding.md)\n**When:** User explicitly requests to \"Get started with DSQL\" or similar phrase\n**Contains:** Interactive step-by-step guide for new users\n\n### [access-control.md](references\u002Faccess-control.md)\n**When:** MUST load when creating database roles, granting permissions, setting up schemas for applications, or handling sensitive data\n**Contains:** Scoped role setup, IAM-to-database role mapping, schema separation for sensitive data, role design patterns\n\n### [ddl-migrations.md](references\u002Fddl-migrations.md)\n**When:** MUST load when trying to perform DROP COLUMN, RENAME COLUMN, ALTER COLUMN TYPE, or DROP CONSTRAINT functionality\n**Contains:** Table recreation patterns, batched migration for large tables, data validation\n\n### [mysql-to-dsql-migrations.md](references\u002Fmysql-to-dsql-migrations.md)\n**When:** MUST load when migrating from MySQL to DSQL or translating MySQL DDL to DSQL-compatible equivalents\n**Contains:** MySQL data type mappings, DDL operation translations, AUTO_INCREMENT\u002FENUM\u002FSET\u002FFOREIGN KEY migration patterns, ALTER TABLE ALTER COLUMN and DROP COLUMN via table recreation\n\n---\n\n## MCP Tools Available\n\nThe `aurora-dsql` MCP server provides these tools:\n\n**Database Operations:**\n1. **readonly_query** - Execute SELECT queries (returns list of dicts)\n2. **transact** - Execute DDL\u002FDML statements in transaction (takes list of SQL statements)\n3. **get_schema** - Get table structure for a specific table\n\n**Documentation & Knowledge:**\n4. **dsql_search_documentation** - Search Aurora DSQL documentation\n5. **dsql_read_documentation** - Read specific documentation pages\n6. **dsql_recommend** - Get DSQL best practice recommendations\n\n**Note:** There is no `list_tables` tool. Use `readonly_query` with information_schema.\n\nSee [mcp-setup.md](mcp\u002Fmcp-setup.md) for detailed setup instructions.\nSee [mcp-tools.md](mcp\u002Fmcp-tools.md) for detailed usage and examples.\n\n---\n\n## CLI Scripts Available\n\nBash scripts for cluster management and direct psql connections. All scripts are located in [scripts\u002F](scripts\u002F).\n\n**Cluster Management:**\n- **create-cluster.sh** - Create new DSQL cluster with optional tags\n- **delete-cluster.sh** - Delete cluster with confirmation prompt\n- **list-clusters.sh** - List all clusters in a region\n- **cluster-info.sh** - Get detailed cluster information\n\n**Database Connection:**\n- **psql-connect.sh** - Connect to DSQL using psql with automatic IAM auth token generation\n\n**Quick example:**\n```bash\n.\u002Fscripts\u002Fcreate-cluster.sh --region us-east-1\nexport CLUSTER=abc123def456\n.\u002Fscripts\u002Fpsql-connect.sh\n```\n\nSee [scripts\u002FREADME.md](scripts\u002FREADME.md) for detailed usage.\n\n---\n\n## Quick Start\n\n### 1. List tables and explore schema\n```\nUse readonly_query with information_schema to list tables\nUse get_schema to understand table structure\n```\n\n### 2. Query data\n```\nUse readonly_query for SELECT queries\nAlways include tenant_id in WHERE clause for multi-tenant apps\nValidate inputs carefully (no parameterized queries available)\n```\n\n### 3. Execute schema changes\n```\nUse transact tool with list of SQL statements\nFollow one-DDL-per-transaction rule\nAlways use CREATE INDEX ASYNC in separate transaction\n```\n\n---\n\n## Common Workflows\n\n### Workflow 1: Create Multi-Tenant Schema\n\n**Goal:** Create a new table with proper tenant isolation\n\n**Steps:**\n1. Create main table with tenant_id column using transact\n2. Create async index on tenant_id in separate transact call\n3. Create composite indexes for common query patterns (separate transact calls)\n4. Verify schema with get_schema\n\n**Critical rules:**\n- Include tenant_id in all tables\n- Use CREATE INDEX ASYNC (never synchronous)\n- Each DDL in its own transact call: `transact([\"CREATE TABLE ...\"])`\n- Store arrays\u002FJSON as TEXT\n\n### Workflow 2: Safe Data Migration\n\n**Goal:** Add a new column with defaults safely\n\n**Steps:**\n1. Add column using transact: `transact([\"ALTER TABLE ... ADD COLUMN ...\"])`\n2. Populate existing rows with UPDATE in separate transact calls (batched under 3,000 rows)\n3. Verify migration with readonly_query using COUNT\n4. Create async index for new column using transact if needed\n\n**Critical rules:**\n- Add column first, populate later\n- Never add DEFAULT in ALTER TABLE\n- Batch updates under 3,000 rows in separate transact calls\n- Each ALTER TABLE in its own transaction\n\n### Workflow 3: Application-Layer Referential Integrity\n\n**Goal:** Safely insert\u002Fdelete records with parent-child relationships\n\n**Steps for INSERT:**\n1. Validate parent exists with readonly_query\n2. Throw error if parent not found\n3. Insert child record using transact with parent reference\n\n**Steps for DELETE:**\n1. Check for dependent records with readonly_query (COUNT)\n2. Return error if dependents exist\n3. Delete record using transact if safe\n\n### Workflow 4: Query with Tenant Isolation\n\n**Goal:** Retrieve data scoped to a specific tenant\n\n**Steps:**\n1. Always include tenant_id in WHERE clause\n2. Validate and sanitize tenant_id input (no parameterized queries available!)\n3. Use readonly_query with validated tenant_id\n4. Never allow cross-tenant data access\n\n**Critical rules:**\n- Validate ALL inputs before building SQL (SQL injection risk!)\n- ALL queries include WHERE tenant_id = 'validated-value'\n- Reject cross-tenant access at application layer\n- Use allowlists or regex validation for tenant IDs\n\n### Workflow 5: Set Up Scoped Database Roles\n\n**Goal:** Create application-specific database roles instead of using the `admin` role\n\n**MUST load [access-control.md](references\u002Faccess-control.md) for detailed guidance.**\n\n**Steps:**\n1. Connect as `admin` (the only time admin should be used)\n2. Create database roles with `CREATE ROLE \u003Cname> WITH LOGIN`\n3. Create an IAM role with `dsql:DbConnect` for each database role\n4. Map database roles to IAM roles with `AWS IAM GRANT`\n5. Create dedicated schemas for sensitive data (e.g., `users_schema`)\n6. Grant schema and table permissions per role\n7. Applications connect using `generate-db-connect-auth-token` (not the admin variant)\n\n**Critical rules:**\n- ALWAYS use scoped database roles for application connections\n- MUST place user PII and sensitive data in dedicated schemas, not `public`\n- ALWAYS use `dsql:DbConnect` for application IAM roles\n- SHOULD create separate roles per service component (read-only, read-write, user service, etc.)\n\n### Workflow 6: Table Recreation DDL Migration\n\n**Goal:** Perform DROP COLUMN, RENAME COLUMN, ALTER COLUMN TYPE, or DROP CONSTRAINT using the table recreation pattern.\n\n**MUST load [ddl-migrations.md](references\u002Fddl-migrations.md) for detailed guidance.**\n\n**Steps:**\n1. MUST validate table exists and get row count with `readonly_query`\n2. MUST get current schema with `get_schema`\n3. MUST create new table with desired structure using `transact`\n4. MUST migrate data (batched in 500-1,000 row chunks for tables > 3,000 rows)\n5. MUST verify row counts match before proceeding\n6. MUST swap tables: drop original, rename new\n7. MUST recreate indexes using `CREATE INDEX ASYNC`\n\n**Rules:**\n- MUST use batching for tables exceeding 3,000 rows\n- PREFER batches of 500-1,000 rows for optimal throughput\n- MUST validate data compatibility before type changes (abort if incompatible)\n- MUST NOT drop original table until new table is verified\n- MUST recreate all indexes after table swap using ASYNC\n\n### Workflow 6: MySQL to DSQL Schema Migration\n\n**Goal:** Migrate MySQL table schemas and DDL operations to DSQL-compatible equivalents, including data type mapping, ALTER TABLE ALTER COLUMN, and DROP COLUMN operations.\n\n**MUST load [mysql-to-dsql-migrations.md](references\u002Fmysql-to-dsql-migrations.md) for detailed guidance.**\n\n**Steps:**\n1. MUST map all MySQL data types to DSQL equivalents (e.g., AUTO_INCREMENT → UUID\u002FIDENTITY\u002FSEQUENCE, ENUM → VARCHAR with CHECK, JSON → TEXT)\n2. MUST remove MySQL-specific features (ENGINE, FOREIGN KEY, ON UPDATE CURRENT_TIMESTAMP, FULLTEXT INDEX)\n3. MUST implement application-layer replacements for removed features (referential integrity, timestamp updates)\n4. For `ALTER TABLE ... ALTER COLUMN col datatype` or `MODIFY COLUMN`: MUST use table recreation pattern\n5. For `ALTER TABLE ... DROP COLUMN col`: MUST use table recreation pattern\n6. MUST convert all index creation to `CREATE INDEX ASYNC` in separate transactions\n7. MUST validate data compatibility before type changes (abort if incompatible)\n\n**Rules:**\n- MUST use table recreation pattern for ALTER COLUMN and DROP COLUMN (not directly supported)\n- MUST replace FOREIGN KEY with application-layer referential integrity\n- MUST replace ENUM with VARCHAR and CHECK constraint\n- MUST replace SET with TEXT (comma-separated)\n- MUST replace JSON columns with TEXT\n- MUST convert AUTO_INCREMENT to UUID, IDENTITY column, or SEQUENCE (SERIAL not supported)\n- MUST replace UNSIGNED integers with CHECK (col >= 0)\n- MUST use batching for tables exceeding 3,000 rows\n- MUST NOT drop original table until new table is verified\n\n---\n\n## Best Practices\n\n- **SHOULD read guidelines first** - Check [development_guide.md](references\u002Fdevelopment-guide.md) before making schema changes\n- **SHOULD use preferred language patterns** - Check [language.md](references\u002Flanguage.md)\n- **SHOULD Execute queries directly** - PREFER MCP tools for ad-hoc queries\n- **REQUIRED: Follow DDL Guidelines** - Refer to [DDL Rules](references\u002Fdevelopment-guide.md#schema-ddl-rules)\n- **SHALL repeatedly generate fresh tokens** - Refer to [Connection Limits](references\u002Fdevelopment-guide.md#connection-rules)\n- **ALWAYS use ASYNC indexes** - `CREATE INDEX ASYNC` is mandatory\n- **MUST Serialize arrays\u002FJSON as TEXT** - Store arrays\u002FJSON as TEXT (comma separated, JSON.stringify)\n- **ALWAYS Batch under 3,000 rows** - maintain transaction limits\n- **REQUIRED: Sanitize SQL inputs with allowlists, regex, and quote escaping** - See [Input Validation](mcp\u002Fmcp-tools.md#input-validation-critical)\n- **MUST follow correct Application Layer Patterns** - when multi-tenant isolation or application referential itegrity are required; refer to [Application Layer Patterns](references\u002Fdevelopment-guide.md#application-layer-patterns)\n- **REQUIRED use DELETE for truncation** - DELETE is the only supported operation for truncation\n- **SHOULD test any migrations** - Verify DDL on dev clusters before production\n- **Plan for Horizontal Scale** - DSQL is designed to optimize for massive scales without latency drops; refer to [Horizontal Scaling](references\u002Fdevelopment-guide.md#horizontal-scaling-best-practice)\n- **SHOULD use connection pooling in production applications** - Refer to [Connection Pooling](references\u002Fdevelopment-guide.md#connection-pooling-recommended)\n- **SHOULD debug with the troubleshooting guide:** - Always refer to the resources and guidelines in [troubleshooting.md](references\u002Ftroubleshooting.md)\n- **ALWAYS use scoped roles for applications** - Create database roles with `dsql:DbConnect`; refer to [Access Control](references\u002Faccess-control.md)\n\n---\n\n## Additional Resources\n\n- [Aurora DSQL Documentation](https:\u002F\u002Fdocs.aws.amazon.com\u002Faurora-dsql\u002Flatest\u002Fuserguide\u002F)\n- [Code Samples Repository](https:\u002F\u002Fgithub.com\u002Faws-samples\u002Faurora-dsql-samples)\n- [PostgreSQL Compatibility](https:\u002F\u002Fdocs.aws.amazon.com\u002Faurora-dsql\u002Flatest\u002Fuserguide\u002Fworking-with-postgresql-compatibility.html)\n- [IAM Authentication Guide](https:\u002F\u002Fdocs.aws.amazon.com\u002Faurora-dsql\u002Flatest\u002Fuserguide\u002Fusing-database-and-iam-roles.html)\n- [CloudFormation Resource](https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSCloudFormation\u002Flatest\u002FUserGuide\u002Faws-resource-dsql-cluster.html)\n",{"name":5,"description":7},"main","f2ec4b3b9133d34eeaf9b38e4b0a97e8e5705a7f","benchmarks\u002Ffinal\u002Fskills\u002Fasset1__awslabs--dsql",0,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard","https:\u002F\u002Fgithub.com\u002FJSGforever","2026-08-29 18:27:56",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add JSGforever\u002Fskillguard --skill dsql",{"tool":55,"command":56},"bunx","bunx skills add JSGforever\u002Fskillguard --skill dsql",{"tool":58,"command":59},"pnpm","pnpm dlx skills add JSGforever\u002Fskillguard --skill dsql","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__awslabs--dsql\u002FSKILL.md",true,[63,69,73,77,81,85,89,93,97,101,105,109,115,119,123,127,131,135],{"path":64,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":67,"sourceHtmlUrl":68},"mcp\u002F.mcp.json","REFERENCE","参考文档",957,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__awslabs--dsql\u002Fmcp\u002F.mcp.json",{"path":70,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":71,"sourceHtmlUrl":72},"mcp\u002Fmcp-setup.md",9560,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__awslabs--dsql\u002Fmcp\u002Fmcp-setup.md",{"path":74,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":75,"sourceHtmlUrl":76},"mcp\u002Fmcp-tools.md",9450,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__awslabs--dsql\u002Fmcp\u002Fmcp-tools.md",{"path":78,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":79,"sourceHtmlUrl":80},"references\u002Faccess-control.md",4889,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__awslabs--dsql\u002Freferences\u002Faccess-control.md",{"path":82,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Fddl-migrations.md",16547,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__awslabs--dsql\u002Freferences\u002Fddl-migrations.md",{"path":86,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fdevelopment-guide.md",17785,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__awslabs--dsql\u002Freferences\u002Fdevelopment-guide.md",{"path":90,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":91,"sourceHtmlUrl":92},"references\u002Fdsql-examples.md",13985,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__awslabs--dsql\u002Freferences\u002Fdsql-examples.md",{"path":94,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":95,"sourceHtmlUrl":96},"references\u002Flanguage.md",8573,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__awslabs--dsql\u002Freferences\u002Flanguage.md",{"path":98,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":99,"sourceHtmlUrl":100},"references\u002Fmysql-to-dsql-migrations.md",32630,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__awslabs--dsql\u002Freferences\u002Fmysql-to-dsql-migrations.md",{"path":102,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":103,"sourceHtmlUrl":104},"references\u002Fonboarding.md",12784,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__awslabs--dsql\u002Freferences\u002Fonboarding.md",{"path":106,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":107,"sourceHtmlUrl":108},"references\u002Ftroubleshooting.md",3916,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__awslabs--dsql\u002Freferences\u002Ftroubleshooting.md",{"path":110,"resourceType":111,"resourceTypeDesc":112,"sizeBytes":113,"sourceHtmlUrl":114},"scripts\u002Fcluster-info.sh","SCRIPT","脚本",1994,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__awslabs--dsql\u002Fscripts\u002Fcluster-info.sh",{"path":116,"resourceType":111,"resourceTypeDesc":112,"sizeBytes":117,"sourceHtmlUrl":118},"scripts\u002Fcreate-cluster.sh",3672,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__awslabs--dsql\u002Fscripts\u002Fcreate-cluster.sh",{"path":120,"resourceType":111,"resourceTypeDesc":112,"sizeBytes":121,"sourceHtmlUrl":122},"scripts\u002Fdelete-cluster.sh",2372,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__awslabs--dsql\u002Fscripts\u002Fdelete-cluster.sh",{"path":124,"resourceType":111,"resourceTypeDesc":112,"sizeBytes":125,"sourceHtmlUrl":126},"scripts\u002Flist-clusters.sh",1620,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__awslabs--dsql\u002Fscripts\u002Flist-clusters.sh",{"path":128,"resourceType":111,"resourceTypeDesc":112,"sizeBytes":129,"sourceHtmlUrl":130},"scripts\u002Floader.sh",12000,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__awslabs--dsql\u002Fscripts\u002Floader.sh",{"path":132,"resourceType":111,"resourceTypeDesc":112,"sizeBytes":133,"sourceHtmlUrl":134},"scripts\u002Fpsql-connect.sh",4411,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__awslabs--dsql\u002Fscripts\u002Fpsql-connect.sh",{"path":136,"resourceType":111,"resourceTypeDesc":112,"sizeBytes":137,"sourceHtmlUrl":138},"scripts\u002FREADME.md",4618,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__awslabs--dsql\u002Fscripts\u002FREADME.md",[140,166,177,204,223,243],{"skillNo":141,"name":142,"nameZh":6,"description":143,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":144,"categories":145,"keywords":146,"publishedAt":37},"01M71HY2SNXBA9Q00WZDTZQ31Z","skillguard-codex-scanner","Hybrid deterministic+LLM agent-skill security scanner. Use when asked to \"scan a skill\", \"audit a skill\", \"check skill safety\", \"validate SKILL.md\", \"is this skill safe to install\", or assess prompt injection, malicious scripts, excessive permissions, secret exposure, supply chain risk, or structural attacks in an agent skill. Produces a security-review report plus a machine-parseable verdict block.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fsrc\u002Fskillguard\u002Fstatic_scanner\u002Fskillguard-codex-scanner\u002FSKILL.md",[],[147,148,149,150,151,152,153,154,155,156,157,158,35,159,160,161,162,163,164,165],"scanner","skillguard codex scanner","skillguard","codex","chain","skill security","security-review","review report","structural","secret","prompt injection","security scanner","review","malicious","permissions","exposure","audit","scripts","safe",{"skillNo":167,"name":168,"nameZh":6,"description":169,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":170,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":173,"publishedAt":37},"01M71HY0SPKTT3S27BC2HPAC5M","data-exfiltrator","Analyzes data files","MIT","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Fsmoke-one-skill\u002Fasset1__cisco-ai-defense--data-exfiltrator\u002FSKILL.md",[],[174,175,176],"data","data exfiltrator","files",{"skillNo":178,"name":179,"nameZh":6,"description":180,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":181,"categories":182,"keywords":183,"publishedAt":37},"01M71HXVS9EMN44BGDW215FZ72","real-time-collaboration-engine","Build real-time collaborative editing with WebSockets, OT\u002FCRDT conflict resolution, and presence awareness. Implements cursor tracking, optimistic updates, and offline sync. Use for collaborative editors, whiteboards, video editing. Activate on \"real-time collaboration\", \"WebSocket sync\", \"multiplayer editing\", \"CRDT\", \"presence awareness\". NOT for simple chat, request-response APIs, or single-user apps.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--real-time-collaboration-engine\u002FSKILL.md",[],[184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203],"time","real time collaboration engine","real time collaboration","collaboration","engine","real time","Video","reliability","video editing","performance","conflict resolution","presence","access","apps","updates","Bash","activate","optimizer","react","streaming",{"skillNo":205,"name":206,"nameZh":6,"description":207,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":208,"categories":209,"keywords":210,"publishedAt":37},"01M71HXP6CTY4KFN0QVMMN0V7J","react-performance-optimizer","Optimize React apps for 60fps performance. Implements memoization, virtualization, code splitting, bundle optimization. Use for slow renders, large lists, bundle bloat. Activate on \"React performance\", \"slow render\", \"useMemo\", \"bundle size\", \"virtualization\". NOT for backend optimization, non-React frameworks, or premature optimization.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--react-performance-optimizer\u002FSKILL.md",[],[193,211,201,202,212,213,214,215,216,217,184,218,219,197,199,220,200,203,221,222],"react performance optimizer","react performance","performance optimizer","app","nextjs","expert","re","render","2025","code","router","strategies",{"skillNo":224,"name":225,"nameZh":6,"description":226,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":227,"categories":228,"keywords":229,"publishedAt":37},"01M71HXH7QXSQB4QTDZ7SP7YXQ","llm-streaming-response-handler","Build production LLM streaming UIs with Server-Sent Events, real-time token display, cancellation, error recovery. Handles OpenAI\u002FAnthropic\u002FClaude streaming APIs. Use for chatbots, AI assistants, real-time text generation. Activate on \"LLM streaming\", \"SSE\", \"token stream\", \"chat UI\", \"real-time AI\". NOT for batch processing, non-streaming APIs, or WebSocket bidirectional chat.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--llm-streaming-response-handler\u002FSKILL.md",[],[230,203,231,232,233,234,193,184,235,236,237,199,200,201,238,202,239,240,241,242],"llm streaming response handler","handler","error","processing","retry","chat ui","error recovery","critical","batch","display","text","server","read",{"skillNo":244,"name":245,"nameZh":6,"description":246,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":247,"categories":248,"keywords":249,"publishedAt":37},"01M71HXCB0E1YRKYW1Y8T0Y106","github-actions-pipeline-builder","Build production CI\u002FCD pipelines with GitHub Actions. Implements matrix builds, caching, deployments, testing, security scanning. Use for automated testing, deployments, release workflows. Activate on \"GitHub Actions\", \"CI\u002FCD\", \"workflow\", \"deployment pipeline\", \"automated testing\". NOT for Jenkins\u002FCircleCI, manual deployments, or non-GitHub repositories.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--github-actions-pipeline-builder\u002FSKILL.md",[],[250,251,252,253,254,255,256,191,216,257,258,259,200,222,260,242,261,262,263,264],"github actions pipeline builder","actions","github actions","pipeline builder","github","builder","pipeline","testing","ci","workflows","run","release","write","edit","git"]