text2sql-system-prompt-updater

Update Text2SQL system prompts with failure-pattern analysis and regression checks.

4|Updated Oct 10, 2025
One-click install
npx skills add https://github.com/JanuaryLabs/deepagents --skill text2sql-system-prompt-updater
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: text2sql-system-prompt-updater
Source: https://github.com/JanuaryLabs/deepagents/tree/main/.codex/skills/text2sql-system-prompt-updater
Command: npx skills add https://github.com/JanuaryLabs/deepagents --skill text2sql-system-prompt-updater

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill formalizes a failure-pattern driven workflow to improve Text2SQL system prompts and reduce recurring SQL generation errors and regressions while avoiding one-off, benchmark-specific fixes.

Core Features & Use Cases

  • Failure-driven iteration: Scope failing ranges, capture representative failures, cluster by behavior, and validate prompt-policy changes with reruns and regression checks.
  • Policy-first prompt edits: Produce concise, durable fragment-based rules that enforce schema grounding, minimality, predicate precision, and aggregation correctness without embedding dataset literals.
  • Safe guardrails: Follow explicit non-negotiables such as not changing the model-under-test, avoiding dataset-specific examples, and preferring fragment primitives over persona edits.
  • Use Case: When SQL generation quality regresses across tests, use this Skill to update packages/text2sql/src/lib/agents/sql.agent.ts and packages/context/src/lib/fragments with general rules that address clustered failure classes.

Quick Start

Use this skill to refine fragment-based prompt policies for a scoped failing range and rerun only the failed records until the failure categories stabilize.

Frequently Asked Questions about text2sql-system-prompt-updater

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix recurring Text2SQL prompt failures without overfitting to benchmark data?

To fix recurring Text2SQL prompt failures, apply a failure-pattern driven workflow that clusters failing queries by behavior and enforces generalizable, non-benchmark-specific policy rules to update system prompts. This ensures fragment edits address broad failure classes rather than specific test cases.

What is the best way to prevent SQL generation regressions when updating agent prompts?

Preventing SQL generation regressions requires iterative scoped evaluation with regression checks after applying policy-driven prompt edits. You rerun only the failed records from a scoped failing range until the failure categories stabilize, ensuring new rules do not break previously passing SQL generation.

How do I update Text2SQL system prompts to enforce schema grounding and predicate precision?

Updating Text2SQL system prompts involves producing concise, durable fragment-based rules that enforce schema grounding, minimality, predicate precision, and aggregation correctness. These policy-first edits are applied to context fragments without embedding dataset literals.

Can I modify the model-under-test when debugging Text2SQL generation errors?

No, you cannot modify the model-under-test when debugging Text2SQL generation errors. Safe guardrails dictate keeping the model constant, avoiding dataset-specific examples, and preferring fragment primitives over persona edits to isolate the impact of prompt policy changes.

When should I use fragment primitives instead of persona edits for SQL agent prompt engineering?

You should use fragment primitives instead of persona edits when you need durable, targeted policy rules for SQL generation. Fragment primitives allow precise enforcement of schema grounding and predicate precision without the broad, unpredictable behavioral shifts associated with persona modifications.

Why does my Text2SQL prompt update fail to generalize across different SQL queries?

Text2SQL prompt updates fail to generalize when they contain dataset-specific examples or one-off fixes instead of broad policy rules. Hardening prompts requires clustering failures by behavior and applying generalizable rules to context fragments to address entire failure classes.