Design, implement, test, and ship SQL-backed persistence for Go CLIs using database/sql, explicit pool ownership, bounded startup checks, embedded migrations, transaction boundaries, parameterized queries, adapter error mapping, Scanner and Valuer types, SQLite or server databases, and real-driver integration tests.
NewMaintained
Automatic
◆Coding pack
Last verified 8/16/2026
What it changes
Passed 22 of 25 test cases with the skill, and 22 of 25 without it.
Without skill88%
With skill88%
Checks it passed that the model alone missed
The smoke test verifies that application startup and connectivity check succeed with production configurations.
The CI smoke test executes the built CLI binary to verify database initialization and schema migration execution against a real environment.
1 fixed21 passed either way2 still failing1 broke
Pass-rate lift
0 pp
Tokens
+3%
Agent turns
0%
Response time
-24%
Model gemini-3.6-flashMeasured 8/16/2026v122 of 25 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
A test case the skill fixed. Same model, same prompt, with and without the skill.
Prompt
We are creating a CI pipeline for our Go CLI binary. Beyond unit tests, what smoke test step should be performed on the compiled CLI binary regarding storage?
What was checked, without and with the skill
Checked
Without skill
With skill
The CI smoke test executes the built CLI binary to verify database initialization and schema migration execution against a real environment.
Missed
Passed
The smoke test verifies that application startup and connectivity check succeed with production configurations.
Missed
Passed
case-17 · gemini-3.6-flash · 8/16/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md53 linessingle file
Go CLI SQL Storage
Treat *sql.DB as a long-lived pool owned by the composition root. Keep SQL,
driver behavior, migrations, and sensitive connection details inside adapters.
Core Workflow
Choose the database and driver from workload, platform, and distribution needs.
Define domain operations and transaction ownership before repository methods.
Open and configure one long-lived pool at the composition root.
Verify required startup connectivity with a bounded PingContext.
Apply versioned migrations using an explicit serialization policy.
Implement parameterized queries and map driver errors to stable domain errors.
Test consumers with fakes and adapters with the real driver and production schema.
Build the final artifact and smoke-test database initialization.
Read Next
Task
Load
Design storage for a CLI
guidelines.md, workflows/build-sql-storage.md
Add or change migrations
workflows/apply-schema-migrations.md
Test an adapter
workflows/test-sql-adapter.md
Review pools, transactions, queries, or conversions
references/sql-storage/rules.md
Understand driver and pool contracts
references/sql-storage/knowledge.md
Build a multi-process SQLite cache
references/sql-storage/sqlite.md
Review patterns
references/sql-storage/examples.md
Guardrails
Do not treat sql.Open as a connectivity check.
Do not interpolate untrusted values or identifiers into SQL.
Do not treat embedded schema text as a migration system.
Do not expose driver error types as the application contract.
Do not use a broad repository interface that mirrors an adapter.
Do not assume an in-memory SQLite database is shared across pooled connections.
Source Notes
Guidance is transformed and paraphrased from Inanc Gumus, *Go by Example: