Claude-code-plugins-plus-skills file-to-code
git clone https://github.com/jeremylongshore/claude-code-plugins-plus-skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/jeremylongshore/claude-code-plugins-plus-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/plugins/skill-enhancers/file-to-code/skills/file-to-code" ~/.claude/skills/jeremylongshore-claude-code-plugins-plus-skills-file-to-code && rm -rf "$T"
plugins/skill-enhancers/file-to-code/skills/file-to-code/SKILL.mdFile to Code
Generate production-ready code from file specifications, data schemas, and requirements documents.
Overview
This skill reads structured input files -- CSV data, JSON schemas, SQL DDL statements, protobuf definitions, OpenAPI specs, or plain-text requirements -- and generates complete, production-ready code to process, serve, or transform that data. Instead of manually writing boilerplate models, validation logic, and CRUD endpoints, this skill analyzes the input structure and produces well-typed code with proper error handling, input validation, and test coverage.
The skill supports multiple output languages and frameworks. It infers types from data samples, respects constraints defined in schemas, and follows best practices for the target framework. When generating API endpoints, it includes request validation, error responses, and OpenAPI documentation. When generating data processing pipelines, it includes type coercion, null handling, and logging.
Instructions
-
Point to the input file or paste its contents:
- "Read
and generate a REST API for it"data/users.csv - "Here's my JSON schema:
-- generate TypeScript types and a validator"{ ... } - "Create a data pipeline from
"schema.sql
- "Read
-
Specify the target language and framework (optional -- the skill will infer reasonable defaults):
- Language: TypeScript, Python, Go, Rust, Java
- Framework: Express, FastAPI, Gin, Actix, Spring Boot
- If unspecified, defaults to TypeScript with Express for APIs, or Python for data processing
-
Indicate the scope of what you want generated:
- "Just the types" -- generates type definitions and interfaces only
- "Full CRUD API" -- generates routes, controllers, models, validation, and tests
- "Parser only" -- generates a file reader/parser with error handling
- "Everything" -- generates the full stack: types, API, tests, and documentation
-
Review the generated code. The skill creates files in your project directory following standard conventions (e.g.,
,src/models/
,src/routes/
). Inspect the output and request adjustments if needed.tests/
Output
Depending on the input and requested scope, the skill generates:
- Type Definitions: Interfaces, types, or structs matching the input schema with proper nullability and constraints.
- Validation Logic: Input validation using libraries appropriate to the target framework (Zod for TypeScript, Pydantic for Python, etc.).
- API Endpoints: RESTful routes with CRUD operations, request/response typing, error handling, and pagination support.
- Data Processors: File readers, parsers, and transformation pipelines with type coercion and error recovery.
- Test Suites: Unit tests covering happy paths, edge cases, and error conditions using the project's test framework.
- OpenAPI Spec: Auto-generated API documentation in OpenAPI 3.0 format when generating API endpoints.
Examples
Example 1: CSV to REST API
User: "Read
data/products.csv and generate a FastAPI app to serve this data."
The skill will:
- Read the CSV file and analyze column names, data types, and sample values.
- Generate a Pydantic model (
) with fields inferred from the CSV headers.Product - Create FastAPI routes:
,GET /products
,GET /products/{id}
,POST /products
,PUT /products/{id}
.DELETE /products/{id} - Add CSV ingestion logic to seed an SQLite database on startup.
- Generate pytest tests for each endpoint.
Example 2: JSON Schema to TypeScript
User: "Here's my API response schema. Generate TypeScript types and a Zod validator."
The skill will:
- Parse the JSON Schema, resolving
references and nested objects.$ref - Generate TypeScript interfaces for each schema definition.
- Create corresponding Zod schemas that enforce the same constraints (required fields, string patterns, numeric ranges).
- Export a
function that returns typed, validated data or a structured error.validate
Example 3: SQL DDL to Go Models
User: "Read
migrations/001_create_tables.sql and generate Go structs with sqlc-compatible annotations."
The skill will:
- Parse CREATE TABLE statements to extract table names, columns, types, and constraints.
- Map SQL types to Go types (e.g.,
toVARCHAR
,string
toTIMESTAMP
,time.Time
toBOOLEAN
).bool - Generate Go struct definitions with
anddb
tags.json - Create a
file with standard CRUD queries for sqlc to process.queries.sql
Error Handling
- Unrecognized file format: Prompts the user to specify the format or provide a sample of the expected structure.
- Ambiguous types: When column types cannot be inferred from data alone, asks the user to clarify (e.g., "Is
an enum or a free-text string?").status - Missing dependencies: Lists required packages (e.g.,
) and offers to generate apip install fastapi uvicorn
orrequirements.txt
.package.json - Large files: For files with many columns or tables, generates code incrementally and confirms scope before proceeding.
Prerequisites
- Input file accessible on disk (CSV, JSON Schema, SQL DDL, protobuf, or OpenAPI spec)
- Target language runtime installed (Node.js, Python, Go, etc.)
- Package manager available (
ornpm
) for installing generated dependenciespip
Resources
- JSON Schema specification — schema definition reference
- OpenAPI 3.0 specification — API description format
- Zod documentation — TypeScript-first schema validation