# Sql

> A Claude skill from graysurf/agent-kit.

- **Type:** Skill
- **Install:** `agentstack add skill-graysurf-agent-kit-sql`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [graysurf](https://agentstack.voostack.com/s/graysurf)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [graysurf](https://github.com/graysurf)
- **Source:** https://github.com/graysurf/agent-kit/tree/main/skills/tools/sql/sql

## Install

```sh
agentstack add skill-graysurf-agent-kit-sql
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# SQL

## Contract

Prereqs:

- `bash` available on `PATH`.
- Dialect client available on `PATH`:
  - `postgres`: `psql` (the runner tries Homebrew `libpq/bin` when available)
  - `mysql`: `mysql` (the runner tries Homebrew `mysql-client/bin` when available)
  - `mssql`: `sqlcmd` (the runner tries Homebrew `mssql-tools18/bin` when available)
- Connection settings provided via exported env vars and/or an env file.

Inputs:

- Dialect subcommand: `postgres`, `mysql`, or `mssql`.
- `--prefix `: env var prefix.
- `--env-file `: file to `source` for env vars (use `/dev/null` to rely on already-exported env vars).
- One of:
  - `--query ""`
  - `--file `
  - `-- ` (pass-through to the selected client)

Outputs:

- Query results printed to stdout from the selected client; diagnostics to stderr.

Exit codes:

- `0`: success
- `2`: wrapper usage error
- non-zero: connection/auth/query error from the selected client or wrapper

Failure modes:

- Missing client binary, missing required prefixed env vars, or DB unreachable/auth failure.

## Overview

Use this canonical SQL skill for all supported database clients. Pick the dialect with the first argument:

- `postgres` uses `psql` and `_PGHOST`, `_PGPORT`, `_PGUSER`, `_PGPASSWORD`,
  `_PGDATABASE`.
- `mysql` uses `mysql` and `_MYSQL_HOST`, `_MYSQL_PORT`, `_MYSQL_USER`,
  `_MYSQL_PASSWORD`, `_MYSQL_DB`.
- `mssql` uses `sqlcmd` and `_MSSQL_HOST`, `_MSSQL_PORT`, `_MSSQL_USER`,
  `_MSSQL_PASSWORD`, `_MSSQL_DB`.

MSSQL optional extras:

- `_MSSQL_TRUST_CERT`: set to `1|true|yes` to pass `-C` to `sqlcmd`.
- `_MSSQL_SCHEMA`: passed as `-v schema=` to `sqlcmd`.

Prefer read-only queries unless the user explicitly requests data changes.

## Quick Start

Run PostgreSQL:

```bash
$AGENT_HOME/skills/tools/sql/sql/scripts/sql.sh \
  postgres \
  --prefix TEST \
  --env-file /dev/null \
  --query "select 1;"
```

Run MySQL:

```bash
$AGENT_HOME/skills/tools/sql/sql/scripts/sql.sh \
  mysql \
  --prefix TEST \
  --env-file /dev/null \
  --query "select 1;"
```

Run SQL Server:

```bash
$AGENT_HOME/skills/tools/sql/sql/scripts/sql.sh \
  mssql \
  --prefix TEST \
  --env-file /dev/null \
  --query "select 1;"
```

## Safety Rules

Ask before running `UPDATE`, `DELETE`, `INSERT`, `MERGE`, `TRUNCATE`, or schema changes.

## Output and Clarification Rules

- Follow the shared template at `$AGENT_HOME/skills/tools/sql/_shared/references/ASSISTANT_RESPONSE_TEMPLATE.md`.

## Scripts (only entrypoints)

- `$AGENT_HOME/skills/tools/sql/sql/scripts/sql.sh`

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [graysurf](https://github.com/graysurf)
- **Source:** [graysurf/agent-kit](https://github.com/graysurf/agent-kit)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-graysurf-agent-kit-sql
- Seller: https://agentstack.voostack.com/s/graysurf
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
