text-to-sqllisted
Install: claude install-skill nicholyx/ai-skills
# Text-to-SQL Skill
Convert natural language questions into SQL queries and execute them against SQL databases.
## Phase 1: Project Setup
### Step 1: Ask about database connection
Ask user which database type they want to use:
**Option A: SQLite** (file-based, no credentials needed)
- User provides path to `.sqlite` or `.db` file
- Or places file in `database/` folder
**Option B: Server database** (PostgreSQL, MySQL, MariaDB, etc.)
- User creates `.env` file with connection details
- Supported: PostgreSQL, MySQL, MariaDB, and other SQL databases
### Step 2: Initialize project structure
Run the init script OR manually create structure:
**Option A: Use init script**
```bash
python scripts/init_project.py --target /path/to/project
```
**Option B: Manual setup**
```bash
mkdir -p database output/queries output/reports
```
Copy from skill folders to project root:
- `scripts/*.py` → project root (db_extractor.py, query_runner.py, list_databases.py, sql_helper.py)
- `assets/example.env` → project root
- `assets/requirements.txt` → project root
- `assets/.gitignore` → project root
Install dependencies:
```bash
pip install -r requirements.txt
```
### Step 3: Configure connection
**For SQLite:**
```bash
# Place database file
cp /path/to/database.sqlite database/
# Extract schema
python db_extractor.py --sqlite database/YOUR_DB.sqlite
```
**For server databases (PostgreSQL, MySQL, etc.):**
Copy and edit the template:
```bash
cp example.env .env
# Edit .env with actual cr