Skip to content

feat(dsql): add dsql_lint tool integration for SQL compatibility validation#157

Merged
amaksimo merged 12 commits into
mainfrom
feature/dsql-lint-skill
May 8, 2026
Merged

feat(dsql): add dsql_lint tool integration for SQL compatibility validation#157
amaksimo merged 12 commits into
mainfrom
feature/dsql-lint-skill

Conversation

@amaksimo
Copy link
Copy Markdown
Contributor

@amaksimo amaksimo commented May 4, 2026

Summary

Integrates dsql-lint as a deterministic SQL validation tool into the DSQL skill. The agent invokes dsql_lint before executing externally-sourced SQL to catch DSQL compatibility issues and auto-fix them where possible.

Changes

  • references/dsql-lint.md (new) — Tool API reference with accurate fix_result.status enum (fixed | fixed_with_warning | unfixable), schema notes (1M-char limit, 30s timeout, statement_preview field), workflow steps with user-confirmation gates, ORM integration guidance, unfixable error resolution, and error handling for MCP unavailability, parse errors, and timeouts.
  • SKILL.md — Add dsql_lint to MCP Tools section, update Workflows 2/6/7 with lint validation steps, rename Workflow 7 to "Validate and Migrate to DSQL" (covers PostgreSQL, MySQL fallback with silent-pass cross-check, ORM sources), add dsql_lint unavailable entry to Error Scenarios, MUST-load gate for references/dsql-lint.md, update frontmatter description (add "SQL compatibility validation") and add orm tag.

What this enables

The dsql_lint MCP tool (merged in awslabs/mcp#3350) validates SQL and optionally auto-fixes issues. The skill teaches the agent when and how to use it:

  • Workflow 2 (Safe Data Migration): Lint DDL before executing — applies to both ADD COLUMN and async index.
  • Workflow 6 (Table Recreation): Validate every generated DDL (CREATE new, INSERT ... SELECT, DROP old, RENAME) before execution.
  • Workflow 7 (Validate and Migrate to DSQL): General migration from PostgreSQL-compatible sources; for MySQL-origin SQL, cross-checks against mysql-migrations/type-mapping.md even on clean lint (ENGINE=, SET() pass silently through the PostgreSQL parser).

Validation

  • validate-references.py: 0 broken links, 0 new orphans
  • validate-size.py: 298 lines (under 300 limit)
  • mise run build: all checks pass

Eval Results

Behavioral with-skill vs baseline comparison (full results in tools/evals/databases-on-aws/dsql/dsql_lint_eval_results.md):

Eval With Skill Baseline Key Delta
100 (pg_dump) PASS FAIL (3 errors) Baseline gets JSON→JSONB wrong, misses ASYNC, no tx split
101 (Django) PASS FAIL (3 errors) Same baseline failures + incomplete transaction guidance
102 (clean SQL) PASS N/A Tool correctly reports no issues
103 (MySQL syntax) PASS N/A Tool returns parse_error; agent falls back to mysql-migrations

Mirror PR

The dsql_lint tool itself shipped in awslabs/mcp#3350 (merged). The skill-side mirror to awslabs/mcp will follow after this PR merges (per multi-target sync workflow).

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.

Copy link
Copy Markdown
Member

@anwesham-lab anwesham-lab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there no eval harness? We should definitely add functional evals? Also this change seems like it is intrinsically blocked on the MCP server changes propagating first, no?

Comment thread plugins/databases-on-aws/skills/dsql/SKILL.md
Comment thread plugins/databases-on-aws/skills/dsql/SKILL.md Outdated
Comment thread plugins/databases-on-aws/skills/dsql/SKILL.md Outdated
Comment thread plugins/databases-on-aws/skills/dsql/SKILL.md Outdated
Comment thread plugins/databases-on-aws/skills/dsql/references/dsql-lint.md Outdated
Comment thread plugins/databases-on-aws/skills/dsql/references/dsql-lint.md Outdated
Comment thread plugins/databases-on-aws/skills/dsql/SKILL.md Outdated
@amaksimo
Copy link
Copy Markdown
Contributor Author

amaksimo commented May 5, 2026

Addressed both points:

Eval harness: Added tools/evals/databases-on-aws/dsql/dsql_lint_evals.json with 4 functional evals:

  1. pg_dump migration → validates agent calls dsql_lint with fix=true
  2. Django ORM migration → validates agent handles multi-DDL + foreign key warnings
  3. Clean SQL validation → validates agent reports no issues and does NOT execute
  4. MySQL with unfixable issues → validates agent distinguishes fixable vs unfixable

MCP server dependency:

Yea it should be a joint PR in the MCP repo. The skill-author workflow says:

  1. Author in agent-plugins (canonical source) ← this PR
  2. Mirror to mcp/src/aurora-dsql-mcp-server/skills/dsql-skill/ + kiro_power/
  3. The MCP server code change (server.py + pyproject.toml) ships in the same MCP repo PR as the skill/power mirror

I was confused as your previous comment asked to make the changes here, so I thought you wanted to see the scope of the steering prior to making further changes.

So the delivery to awslabs/mcp will be ONE PR containing both the dsql_lint tool implementation and the skill content that references it.

This agent-plugins PR is step 1 — iterate on the skill content with better tooling. Once this merges, the MCP repo PR bundles everything together.

@amaksimo
Copy link
Copy Markdown
Contributor Author

amaksimo commented May 6, 2026

Updated Eval Results — Behavioral With-Skill vs Baseline

Replaced the previous tool-only validation with proper behavioral evals. Spawned subagents with and without the skill, compared outputs.

Summary

Eval With Skill Baseline Key Delta
100 (pg_dump) PASS — correct on all points FAIL — 3 errors JSON→JSONB wrong, missed ASYNC, no transaction split
101 (Django) PASS — correct on all points FAIL — 3 errors Same failures + incomplete transaction guidance

Baseline Failures (consistent across both evals)

  1. JSON → JSONB (wrong) — baseline recommends JSONB as column type. DSQL rejects this at DDL time. The skill-guided agent correctly uses TEXT.
  2. Index "is fine" (wrong) — baseline misses the ASYNC requirement entirely. Would fail at execution.
  3. No transaction splitting — baseline doesn't mention one-DDL-per-transaction rule.

The iron law holds

The agent fails without this skill change — it hallucinates incorrect DSQL constraints from training data. The skill eliminates this by routing through dsql_lint for deterministic validation.

Full results: tools/evals/databases-on-aws/dsql/dsql_lint_eval_results.md

amaksimo added 9 commits May 7, 2026 12:57
…dation

Add dsql-lint as a deterministic validation tool the agent invokes before
executing externally-sourced SQL. Enables migration support for customers
coming from PostgreSQL, MySQL, or ORMs (Django, Rails, Prisma, TypeORM).

Changes:
- Add references/dsql-lint.md: tool API, fix statuses, usage patterns,
  ORM integration, unfixable error resolution
- Update SKILL.md: add dsql_lint to MCP Tools section, update Workflows
  2/6/7 with lint validation steps, add Workflow 9 (Validate & Migrate
  SQL to DSQL)
- Update frontmatter: add lint/ORM trigger phrases and tags

The dsql_lint MCP tool (shipping separately in awslabs/mcp) validates SQL
and optionally auto-fixes issues, returning structured diagnostics the
agent acts on. The skill teaches the agent when and how to use it.
- MD029: Restart ordered list numbering after section breaks
- MD032: Add blank lines before lists after bold headings
Move AWS Knowledge limits table reference to development-guide.md (already
documented there). Condense Quick Start to 3 lines. Trim workflow
descriptions to routing-only — detail lives in reference files.

validate-size.py: 276 lines, status 'good'
validate-references.py: 0 broken links, 0 new orphans
- Restore destructive workflow warning in Workflow 6
- Re-introduce RFC language (MUST, MAY) in Quick Start
- Use active voice: 'Use get_schema', 'Use transact', 'Use readonly_query'
- Restore 'one DDL per transaction, multiple DML may share' framing
- Remove 'lint' from tags (not sufficient alone to trigger skill)
- Remove TOC from dsql-lint.md (file is short, TOC adds no value)
Run dprint fmt to align table columns per repo formatting rules.
- Add tools/evals/databases-on-aws/dsql/dsql_lint_evals.json with 4
  functional evals covering: pg_dump migration, Django ORM migration,
  clean SQL validation, and MySQL with unfixable issues
- Add availability note to dsql-lint.md: fall back to manual validation
  using existing DDL rules when the MCP tool is not yet available

The evals test that the agent calls dsql_lint before executing SQL,
presents warnings to the user, and handles unfixable errors correctly.
The dsql_lint tool and the skill that references it will ship together
in the same MCP repo PR. There is no availability gap — the fallback
note was based on a wrong assumption about PR splitting.
Run dsql_lint_evals.json against local MCP server with dsql_lint tool.
All 4 evals pass — tool correctly identifies compatibility issues,
produces fixed SQL, and reports unfixable errors for manual resolution.

Key findings:
- Eval 103 (MySQL syntax): dsql-lint uses a PostgreSQL parser, so
  MySQL-specific syntax (SET, ENGINE, PARTITION BY) triggers a parse
  error rather than individual rules. Agent falls back to
  mysql-migrations reference for these cases.
…seline comparison

Run evals as subagent behavioral tests: one agent with the skill loaded
(uses dsql_lint), one baseline without (relies on model knowledge).

Key findings:
- Baseline hallucinates JSON→JSONB (DSQL rejects JSONB as column type)
- Baseline misses CREATE INDEX ASYNC requirement
- Baseline doesn't split multi-DDL transactions
- Skill-guided agent uses dsql_lint for deterministic validation,
  produces correct output on all three failure points

The iron law holds: the agent fails without this skill change.
@anwesham-lab anwesham-lab force-pushed the feature/dsql-lint-skill branch from 843e540 to 588c8f1 Compare May 7, 2026 19:57
Comment thread plugins/databases-on-aws/skills/dsql/SKILL.md
Comment thread plugins/databases-on-aws/skills/dsql/SKILL.md Outdated
Comment thread plugins/databases-on-aws/skills/dsql/SKILL.md Outdated
Comment thread plugins/databases-on-aws/skills/dsql/SKILL.md Outdated
- Restore hardcoded limits table (critical for performance, not all
  are in dev guide, link to DSQL docs prevents stale numbers)
- Merge Workflow 9 into Workflow 7 as 'Validate and Migrate to DSQL'
  (reduces line count, single entry point for all migration sources)
- Trim redundant triggers from description (lint SQL covers dsql-lint,
  migrate to DSQL covers ORM migration DSQL)

290 lines, mise run build passes.
@amaksimo amaksimo enabled auto-merge May 7, 2026 23:21
@anwesham-lab
Copy link
Copy Markdown
Member

Code review

Reviewed via 14 parallel subagents (CLAUDE.md-adherence, shallow-bug, git-history, past-PR-comments, comments-compliance, silent-failure-hunter, comment-analyzer, code-simplifier, pr-test-analyzer, type-design-analyzer, code-reviewer, commit/PR-description audit, simplify, security-review). Each finding was independently scored 0-100 for confidence; listing only items at 60+. The PR body and the 0.1.3 dsql_lint results are otherwise solid, and the with-skill vs. baseline comparison for evals 100-101 is high-quality evidence.

Tracker (18 findings, confidence >= 60)

# Confidence Area Finding
1 95 PR body "Paired PR" section contradicts commit 4bd3833 (ship together, no gap).
2 90 PR body Cites "352 lines (under 500 cap)" — actual SKILL.md is 290 and reviewer-cited limit is 300.
3 90 Correctness Quick Start step 3 loosens one-DDL-per-tx invariant and drops the 3k-row cap.
4 85 Docs drift PR body advertises "Workflow 9"; diff only renames Workflow 7.
5 85 Evals Results file reports only evals 100/101; commit c92c4b3 claims "all 4 pass".
6 80 Correctness Workflow 7 claims MySQL/ORM support though dsql_lint is a PostgreSQL-grammar parser.
7 75 Docs rails db:schema:dump emits Ruby DSL, not SQL, by default.
8 75 Docs Bare prisma migrate diff requires mandatory --from-*/--to-* flags.
9 75 Metadata Results file: "Claude Opus 4.6" — current family is 4.7.
10 75 Contradiction ORM pattern says auto-accept fixed_with_warning; Critical rules say MUST present.
11 75 Eval bug Eval 103 references category_id without declaring the column.
12 75 Silent failure unfixable is silently rewritten (e.g., TRUNCATE -> DELETE) without user disclosure.
13 70 Availability dsql_lint listed under aurora-dsql MCP server; tool lives in aurora-dsql-tools.
14 70 Eval gap No negative test for the MUST-lint-before-execute iron law.
15 65 Docs drift Frontmatter still advertises "MySQL-to-DSQL migration"; Workflow 7 dropped mysql-migrations refs except type-mapping.md.
16 65 Error handling No guidance for dsql_lint tool-level failures (MCP unavailable, parse error).
17 65 Unresolved Frontmatter trim ("fair enough") not pushed — dsql-lint still in description, lint SQL for DSQL still in triggers.
18 60 Eval gap 11 unfixable rules documented; no per-rule eval coverage.

Findings

1. PR body "Paired PR" section says the tool ships in a separate awslabs/mcp PR; commit 4bd3833 explicitly reverses this: "ship together in the same MCP repo PR. There is no availability gap."

2. PR body line-count claim is stale. Actual file is 290 lines:

- [Code Samples Repository](https://github.com/aws-samples/aurora-dsql-samples)
- [PostgreSQL Compatibility](https://docs.aws.amazon.com/aurora-dsql/latest/userguide/working-with-postgresql-compatibility.html)
- [CloudFormation Resource](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dsql-cluster.html)

3. Quick Start step 3 says "multiple DML statements MAY share a transaction" and omits the 3,000-row cap, loosening invariants asserted elsewhere in the skill (development-guide.md "REQUIRED: at most one DDL statement per operation / ALWAYS separate schema (DDL) and data (DML) changes") and Workflow 2's 3,000-row batching rule:

2. **Query:** Use `readonly_query` for SELECT queries. **MUST** include `tenant_id` in WHERE for multi-tenant apps. **MUST** build SQL with `safe_query.build()`.
3. **Schema changes:** Use `transact` with one DDL per transaction; multiple DML statements **MAY** share a transaction. **MUST** use `CREATE INDEX ASYNC` in a separate call. Use `dsql_lint` to validate first.

4. PR body advertises "Workflow 9 (new): General migration from any source", but the diff only renames Workflow 7 to "Validate and Migrate to DSQL". references/dsql-lint.md heading is also unnumbered ("Workflow: Validate & Migrate SQL to DSQL").

### Workflow 7: Validate and Migrate to DSQL
Run `dsql_lint(sql=source_sql, fix=true)` to validate and auto-convert SQL from any source (PostgreSQL, MySQL, ORM-generated). MUST load [dsql-lint.md](references/dsql-lint.md) for the full workflow, ORM-specific guidance, and unfixable error resolution. MUST load [mysql-migrations/type-mapping.md](references/mysql-migrations/type-mapping.md) for MySQL-specific types not covered by auto-fix.

5. Eval results file documents only evals 100-101; evals 102 and 103 are declared in dsql_lint_evals.json but have no pass/fail entry or behavioral comparison. Commit c92c4b3 still says "All 4 evals pass":

| Eval | Scenario | With Skill | Baseline | Delta |
| ---- | ------------------------- | ---------- | --------------- | --------------------------------------------------------------- |
| 100 | pg_dump PostgreSQL schema | **PASS** | FAIL (3 errors) | Skill corrects JSON, index, transaction handling |
| 101 | Django ORM migration | **PASS** | FAIL (3 errors) | Skill corrects JSON, index, provides actionable Django guidance |

6. Workflow 7 advertises "any source (PostgreSQL, MySQL, ORM-generated)" but dsql_lint uses a PostgreSQL parser (commit c92c4b3 acknowledges this). For MySQL input, the tool can return a parse error or no diagnostics; the skill does not warn that "no diagnostics" != "validated" for MySQL SQL, which is exactly eval 103's scenario.

Run `dsql_lint(sql=source_sql, fix=true)` to validate and auto-convert SQL from any source (PostgreSQL, MySQL, ORM-generated). MUST load [dsql-lint.md](references/dsql-lint.md) for the full workflow, ORM-specific guidance, and unfixable error resolution. MUST load [mysql-migrations/type-mapping.md](references/mysql-migrations/type-mapping.md) for MySQL-specific types not covered by auto-fix.

7. rails db:schema:dump produces db/schema.rb (Ruby) by default. SQL output requires config.active_record.schema_format = :sql; the parenthetical "(SQL format)" hides this precondition:

- **Django:** Run `python manage.py sqlmigrate <app> <migration>` to get raw SQL, then lint
- **Rails:** Export with `rails db:schema:dump` (SQL format), then lint
- **Prisma:** Use `prisma migrate diff` to get SQL, then lint

8. prisma migrate diff requires --from-*/--to-* flags; the bare command errors out:

- **Rails:** Export with `rails db:schema:dump` (SQL format), then lint
- **Prisma:** Use `prisma migrate diff` to get SQL, then lint
- **TypeORM/Sequelize:** Generate migration SQL, then lint

9. Model metadata is stale — current Opus family is 4.7, not 4.6:

**dsql-lint version:** 0.1.3
**Model:** Claude Opus 4.6 (subagent execution)

10. ORM migration usage pattern collapses fixed and fixed_with_warning into "accept the fix", contradicting the Critical rule at L66 ("MUST present fixed_with_warning items to user before proceeding"):

3. For each diagnostic:
- fixed/fixed_with_warning → accept the fix
- unfixable → rewrite using skill knowledge (Table Recreation, app-layer patterns)

11. Eval 103 prompt declares only id, name, tags, details columns but the FK clause references category_id, producing invalid MySQL and muddling what the eval actually measures:

"id": 103,
"prompt": "I need to migrate this MySQL table to DSQL:\n\nCREATE TABLE products (\n id INT AUTO_INCREMENT PRIMARY KEY,\n name VARCHAR(100),\n tags SET('electronics','clothing','food'),\n details JSON,\n FOREIGN KEY (category_id) REFERENCES categories(id)\n) ENGINE=InnoDB PARTITION BY HASH(id) PARTITIONS 4;",
"expected_output": "Calls dsql_lint with fix=true, identifies multiple issues including unfixable ones (PARTITION BY), presents what can be auto-fixed vs what needs manual rewrite",

12. Workflow step 3 and the ORM pattern instruct the agent to silently substitute alternative implementations for unfixable rules (e.g., TRUNCATE -> DELETE FROM table_name) without disclosing the substitution to the user. TRUNCATE->DELETE changes sequences, trigger behavior, and transaction size:

- `fixed_with_warning`: Present to user — explain application-layer implications
- `unfixable`: Rewrite manually using skill knowledge (Table Recreation for `unsupported_alter_table_op`, DELETE for `truncate`, omit for `partition_by`)
4. Take `fixed_sql` from the response

13. dsql_lint is listed under "The aurora-dsql MCP server provides these tools" but references/dsql-lint.md L149 points to awslabs/aurora-dsql-tools — a separate project. If the tool is not yet wired into the configured aurora-dsql MCP server when the skill ships, agents will fail to call it:

The `aurora-dsql` MCP server provides these tools:
**Database Operations:**
1. **readonly_query** - Execute SELECT queries (returns list of dicts)
2. **transact** - Execute DDL/DML statements in transaction (takes list of SQL statements)
3. **get_schema** - Get table structure for a specific table
**SQL Validation:**
1. **dsql_lint** - Validate SQL for DSQL compatibility and optionally auto-fix issues. Use before executing externally-sourced SQL.

14. No eval frames the prompt as "execute this SQL" and asserts that the agent lints first. Evals 100-101 ask for compatibility checks; eval 102 explicitly says "do not execute yet" (user-gated). The iron-law MUST rule ("MUST run dsql_lint before executing any externally-sourced SQL") has no regression test.

15. Frontmatter description still advertises "MySQL-to-DSQL migration", yet Workflow 7 (the only remaining MySQL path) drops all references to mysql-migrations/ddl-operations.md and full-example.md, keeping only type-mapping.md:

name: dsql
description: "Build with Aurora DSQL — manage schemas, execute queries, handle migrations, diagnose query plans, and develop applications with a serverless, distributed SQL database. Covers IAM auth, multi-tenant patterns, MySQL-to-DSQL migration, DDL operations, query plan explainability, and SQL compatibility validation via dsql-lint. Triggers on phrases like: DSQL, Aurora DSQL, create DSQL table, DSQL schema, migrate to DSQL, distributed SQL database, serverless PostgreSQL-compatible database, DSQL query plan, DSQL EXPLAIN ANALYZE, why is my DSQL query slow, lint SQL for DSQL."
license: Apache-2.0

16. SKILL.md carries an explicit fallback for awsknowledge unavailability, but dsql-lint.md has no guidance for dsql_lint tool failure (MCP unavailable, timeout, SQL parse error). On failure, the agent reverts to training-data reasoning — the exact baseline failure mode documented in dsql_lint_eval_results.md:

**Critical rules:**
- **MUST** run `dsql_lint` before executing any externally-sourced SQL
- **MUST** present `fixed_with_warning` items to user before proceeding
- **MUST** resolve all `unfixable` errors before execution (use skill knowledge or ask user)
- **MUST** issue each DDL in its own `transact` call

17. Unresolved review thread (3204355704): reviewer asked to drop dsql-lint from description and lint SQL for DSQL from triggers; author replied "fair enough" but head commit c07d2a6 predates the ack and still contains both:

name: dsql
description: "Build with Aurora DSQL — manage schemas, execute queries, handle migrations, diagnose query plans, and develop applications with a serverless, distributed SQL database. Covers IAM auth, multi-tenant patterns, MySQL-to-DSQL migration, DDL operations, query plan explainability, and SQL compatibility validation via dsql-lint. Triggers on phrases like: DSQL, Aurora DSQL, create DSQL table, DSQL schema, migrate to DSQL, distributed SQL database, serverless PostgreSQL-compatible database, DSQL query plan, DSQL EXPLAIN ANALYZE, why is my DSQL query slow, lint SQL for DSQL."
license: Apache-2.0
metadata:
tags: aws, aurora, dsql, distributed-sql, distributed, distributed-database, database, serverless, serverless-database, postgresql, postgres, sql, schema, migration, multi-tenant, iam-auth, aurora-dsql, mcp, orm

18. The Handling Unfixable Errors table enumerates 11 distinct rules; only eval 103 gestures at one (partition_by) without asserting rule ID or correct resolution:

When `dsql_lint` reports unfixable errors, use skill knowledge to resolve:
| Rule | Resolution |
| ---------------------------- | ---------------------------------------------------------------- |
| `temp_table` | Use a regular table with a session/request identifier column |
| `partition_by` | Omit — DSQL manages distribution automatically |
| `inherits` | Flatten into a single table or use application-layer inheritance |
| `create_table_as` | CREATE TABLE with explicit columns, then INSERT ... SELECT |
| `truncate` | Use `DELETE FROM table_name` (batch if > 3,000 rows) |
| `unsupported_alter_table_op` | Use Table Recreation Pattern (Workflow 6) |
| `add_column_constraint` | Split: ADD COLUMN (name + type only) → UPDATE → ALTER COLUMN |
| `index_using` | Use default B-tree index (DSQL's only supported method) |
| `index_expression` | Create a computed column, then index that column |
| `index_partial` | Create a full index; filter at query time |
| `transaction_isolation` | Omit — DSQL uses Repeatable Read (fixed) |

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

Comment thread plugins/databases-on-aws/skills/dsql/SKILL.md Outdated
Comment thread plugins/databases-on-aws/skills/dsql/SKILL.md Outdated
Per review: 'SQL compatibility validation' is sufficient without
naming the tool. Remove 'via dsql-lint' and 'lint SQL for DSQL'
trigger — 'migrate to DSQL' already covers the use case.
@amaksimo amaksimo force-pushed the feature/dsql-lint-skill branch 2 times, most recently from 5bf1a0e to 6fed1df Compare May 8, 2026 19:24
Correctness:
- #3: Restore 3k-row cap in Quick Start step 3
- #6: Add PostgreSQL parser caveat to Workflow 7 (MySQL syntax → parse error → fallback)
- #10: Fix ORM pattern to present fixed_with_warning to user (not auto-accept)
- #12: Unfixable rewrites MUST present to user before substituting

Docs accuracy:
- #7: Rails: use db:schema:dump with schema_format = :sql (6.1+)
- #8: Prisma: add required --from-empty --to-schema-datamodel flags
- SQLAlchemy: use CreateTable(table).compile(engine) instead of metadata.create_all(echo=True) which executes DDL

Error handling:
- #16: Add Error Handling section for dsql_lint failures (MCP unavailable, parse error, timeout) with user-confirmation gates
- Add dsql_lint-unavailable entry to SKILL.md Error Scenarios

Evals:
- #5: Add evals 102/103 to results MD with detail sections
- #9: Fix model metadata (remove specific version; clarify manual grading)
- #11: Add missing category_id column to eval 103 prompt
- Tighten eval expectations to reference concrete tool outputs (rule names, summary fields)
- Replace emoji markers with PASS/FAIL/PARTIAL to fix dprint table alignment
- Bump recorded dsql-lint version to 0.1.4

Self-review fixes (17 sub-agent review rounds):
- Document accurate fix_result.status enum: fixed | fixed_with_warning | unfixable
  (tool emits status='unfixable' explicitly; earlier doc incorrectly implied absence)
- Scope Unfixable Errors table to truly-unfixable rules only (set_transaction, truncate,
  create_table_as, add_column_constraint, index_expression, index_partial,
  unsupported_alter_table_op); note that temp_table, inherits, index_using,
  transaction_isolation are fixed/fixed_with_warning
- Fix transaction_isolation vs set_transaction rule-id confusion
- Promote reference-load gate from SHOULD to MUST with tightened trigger
- Workflow 2: explicit lint gate for async index DDL (step 5)
- Workflow 6: lint every generated DDL in Table Recreation Pattern
- Workflow 7: cross-check MySQL source against type-mapping.md even on clean lint
  (ENGINE=, SET() pass silently through PostgreSQL parser)
- Document 1M-char SQL limit and 30s server timeout
- Require user confirmation before destructive DDL (DROP/RENAME/TRUNCATE), MCP-unavailable
  fallback, parse_error manual rewrite, and timeout split-retry paths
- Forbid executing fixed_sql while any unfixable diagnostic remains (re-lint until clean)
- Add user override semantics for "just run it" requests
- Remove redundant Usage Patterns, Exit Codes, and Additional Resources sections

Already fixed in previous commit:
- #17: dsql-lint removed from description (93e9c7b)

PR body items (1, 2, 4) will be updated separately.
@amaksimo amaksimo force-pushed the feature/dsql-lint-skill branch from 6fed1df to cf4fe70 Compare May 8, 2026 19:25
@amaksimo amaksimo added this pull request to the merge queue May 8, 2026
Merged via the queue into main with commit 08bbd67 May 8, 2026
24 checks passed
@amaksimo amaksimo deleted the feature/dsql-lint-skill branch May 8, 2026 21:28
ljainiaz pushed a commit to ljainiaz/mcp that referenced this pull request May 12, 2026
…slation (awslabs#3423)

Mirror the merged agent-plugins skill content (awslabs/agent-plugins#157)
to the MCP repo standalone skill and Kiro Power.

Skill (skills/dsql-skill/):
- Update SKILL.md: add dsql_lint to MCP Tools, update Workflows 2/6,
  rename Workflow 7 to 'Validate and Migrate to DSQL'
- Add references/dsql-lint.md: tool API, workflow steps, ORM guidance,
  unfixable error resolution, error handling
- Sync all 5 alias SKILL.md files

Kiro Power (kiro_power/):
- Update POWER.md: add dsql-lint steering entry, add dsql_lint tool,
  update Workflows 2/6/7
- Add steering/dsql-lint.md (same content as references/)

Paired with awslabs/agent-plugins#157 (canonical source, merged)
and awslabs#3350 (server tool, merged).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants