File to Database
БесплатноЗапускает вложенные скриптыНе проверенUse when the user wants to build a database from data files (CSV/Excel/JSON/JSONL/TSV), design a schema from raw data, or turn flat files into tables — AND…
от thomaszhou22377 установок в других каталогахОб этом скилле
Database Generator Skill
Turn data files (CSV / Excel / JSON / JSONL / TSV) into a validated database:
scan → infer → model → DDL → verify, following the pluggable methodology in references/methodology.md throughout.
Onboarding (First Use)
When the user first triggers this skill and memory/file_to_database_state.json doesn't exist, run a one-time setup:
Introduce capability (one sentence): "I can turn CSV/Excel/JSON data files into a validated database, then let you operate it in natural language."
Quick configuration:
Default database engine(Default: SQLite)
- SQLite(zero-install, single-file, personal projectsrecommended)
- PostgreSQL(Multi-user / cloud deployment)
Enable runtime natural-language operations(Default: Yes)
- Yes (CRUD in natural language after database is built)
- No (build database only, skip runtime mode)
Write initial state file
memory/file_to_database_state.json(JSON format, withonboarded: trueand timestamp)Confirm completion: _"Setup done! Just use it from now on. Say 'reset settings' anytime to reconfigure."
Onboarding runs exactly once. Subsequent activations read the state file directly. When the user says "reset settings", delete the state file and re-run setup.
Startup Flow
- Read
references/methodology.md(the methodology is the soul of this skill; read it first, always) - Detect the runtime environment:
python3 --version≥ 3.8 → script engine available- Unavailable → fall back to pure LLM mode (the agent analyzes file samples itself; slightly lower precision, inform the user)
- Ask the user for file paths (or a directory) and confirm the target engine (default: SQLite; PostgreSQL/Supabase when multi-user concurrency or cloud is needed; MySQL and MongoDB supported)
Intake Triage (required reading for non-data files)
When the user provides files that are not CSV/Excel/JSON/JSONL/TSV (e.g. PDF textbooks, PPTX, DOCX, images), never enter the build pipeline directly and never refuse service — follow the triage in references/intake.md:
- Intent already clear (e.g. "build a database from this book's exercises") → take the structuring path: LLM extracts to a JSONL intermediate format (with page numbers for traceability) → show a 10-item sample for user confirmation → return to the standard pipeline
- Intent unclear → ask once with options: ① extract content and build a database ② read/summarize only ③ did you mean to send a different file; never guess the task for the user
- File type determines capability boundaries; user intent determines the workflow
Main Flow (staged loop; each stage leaves a checkable artifact)
Step 1: Scan & Profile (scripts/infer_schema.py)
Generate a statistical profile for every data file:
python3 scripts/infer_schema.py --input <file-or-dir> [--sample N] --json
Output: per-column type inference (int/float/bool/date/uuid/text), null rate, cardinality, uniqueness, max length, sample values. Done when: one profile per file; the agent reviews ambiguous columns (mixed types, overlong text).
Step 2: Relation Discovery (scripts/detect_relations.py)
python3 scripts/detect_relations.py --profiles <profiles.json> --json
Output: primary-key candidates, foreign-key candidates (name matching + value-set containment, with confidence scores). Done when: every FK candidate carries confidence and evidence; low-confidence ones are listed for the user — never silently guessed.
Step 3: Data Modeling (execute per methodology.md)
- Entity identification: one file → one table (whether to normalize wide tables follows the split rules in the methodology)
- Cardinality annotation: 1:1 / 1:N / N:M (N:M requires an explicit junction table)
- 3NF by default; denormalize only for queries named in the methodology, and always annotate which query is served
- Open-questions list: the methodology requires listing every question the spec leaves unanswered for the user — no silent invention
Step 4: Produce Deliverables
Output per the layout in references/output-format.md:
schema.sql(DDL: tables, constraints, indexes — each index annotated with the query it serves)ERD(Mermaid erDiagram)seed.pyorseed.sql(script importing data from source files, including type conversions)migrations/(reversible migrations, expand-and-contract mode)
Step 5: Verification (run against a database when available; manual walkthrough otherwise)
# With a local Postgres / Docker / Supabase branch:
psql -f schema.sql && python3 seed.py
# One negative test per constraint: insert a forbidden row, assert rejection
# EXPLAIN the key queries to confirm the planned indexes are actually used
Without a database: walk through the Step 7 checklist from the methodology item by item and output the walkthrough report.
Runtime Mode (after the database is built)
Once the database exists, the skill ent
Установить File to Database в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл File to Database?
Use when the user wants to build a database from data files (CSV/Excel/JSON/JSONL/TSV), design a schema from raw data, or turn flat files into tables — AND when the user later talks to that database in natural language (add, query, update, delete records; 'how many...'; 'show me...'). Scans files, infers column types, detects candidate foreign keys, applies the methodology in references/methodology.md to produce DDL, ERD, seed scripts, and validation; runtime operations follow references/operations.md (intent → SQL → safe execution → natural-language report). Do NOT use for ORM code generation or pure database concept discussions.
Как установить скилл File to Database?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл File to Database запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic