AI-Assisted Development
Storm is an AI-first ORM. Entities are plain Kotlin data classes or Java records. Queries are explicit SQL. Built-in verification lets AI validate its own work before anything touches production.
Database code affects data integrity, performance, and security. Generating it without understanding or verifying the result is not something Storm encourages.
Storm keeps you in control. ORMTemplate.validateSchema() validates that entities match the database. SqlCapture validates that queries match the intent. @StormTest runs both checks in an isolated in-memory database before anything reaches production. The AI generates code, then Storm verifies it. That is what AI-first means here.
Automated verification catches mistakes, but it does not replace understanding. Your data layer is not the place to let the codebase drift away from you.
Quick Setup
Install the Storm CLI and run it in your project:
npm install -g @storm-orm/cli
storm init
Or without installing globally:
npx @storm-orm/cli init
The interactive setup walks you through three steps:
1. Select AI tools
Choose which AI coding tools you use. Storm configures each one with rules, skills, and (optionally) a database-aware MCP server. You can select multiple tools if your team uses different editors.
| Tool | Rules | Skills | MCP |
|---|---|---|---|
| Claude Code | CLAUDE.md | .claude/skills/ | .mcp.json |
| Cursor | .cursor/rules/storm.md | .cursor/rules/ | .cursor/mcp.json |
| GitHub Copilot | .github/copilot-instructions.md | .github/instructions/ | (tool-dependent) |
| Windsurf | .windsurf/rules/storm.md | .windsurf/rules/ | (manual config) |
| Codex | AGENTS.md | - | .codex/config.toml |
Each tool stores its configuration in a different location, but the content is the same: Storm's conventions, entity rules, query patterns, and verification guidelines.
2. Rules and skills
For each selected tool, Storm installs two types of AI context:
Rules are a project-level configuration file that is always loaded by the AI tool. They contain Storm's key patterns, naming conventions, and critical constraints (immutable QueryBuilder, no collection fields on entities, Ref<T> for circular references, etc.). The rules ensure the AI follows Storm's conventions in every interaction, without you having to repeat them.
Skills are per-topic guides that the AI loads on demand when working on a specific task. Each skill contains focused instructions, code examples, and common pitfalls for one area of Storm. Skills are fetched from orm.st during setup and can be updated automatically on each run without requiring a CLI update.
| Skill | Purpose |
|---|---|
| storm-setup | Configure dependencies (detects Spring Boot, Ktor, or standalone) |
| storm-docs | Load full Storm documentation |
| storm-entity-kotlin | Create Kotlin entities |
| storm-entity-java | Create Java entities |
| storm-repository-kotlin | Write Kotlin repositories (framework-aware: Spring Boot, Ktor, standalone) |
| storm-repository-java | Write Java repositories |
| storm-query-kotlin | Kotlin QueryBuilder queries |
| storm-query-java | Java QueryBuilder queries |
| storm-sql-kotlin | Kotlin SQL Templates |
| storm-sql-java | Java SQL Templates |
| storm-json-kotlin / storm-json-java | JSON columns and JSON aggregation |
| storm-serialization-kotlin / storm-serialization-java | Entity serialization for REST APIs (framework-aware content negotiation) |
| storm-migration | Write Flyway/Liquibase migration SQL |
3. Database connection (optional)
If you have a local development database running, Storm can set up a schema-aware MCP server. This gives your AI tool access to your actual database structure (table definitions, column types, foreign keys) without exposing credentials or data.
The MCP server runs locally on your machine, exposes only schema metadata, and stores credentials in ~/.storm/ (outside your project, outside the LLM's reach). It supports PostgreSQL, MySQL, MariaDB, Oracle, SQL Server, SQLite, and H2.
With the database connected, three additional skills become available:
| Skill | Purpose |
|---|---|
| storm-schema | Inspect your live database schema |
| storm-validate | Compare entities against the live schema |
| storm-entity-from-schema | Generate, update, or refactor entities from database tables |
To reconfigure the database connection later, run storm mcp.
Manual Setup
If you prefer to configure your AI tool manually, Storm publishes two machine-readable documentation files following the llms.txt standard:
| File | URL | Best for |
|---|---|---|
llms.txt | orm.st/llms.txt | Quick reference with essential patterns and gotchas |
llms-full.txt | orm.st/llms-full.txt | Complete documentation for tools with large context windows |
- Claude Code
- Cursor
- Other Tools
Use @url to fetch Storm context in a conversation:
@url https://orm.st/llms-full.txt
Add Storm documentation as a doc source in Cursor settings:
- Open Settings > Features > Docs
- Click Add new doc
- Enter
https://orm.st/llms-full.txt
Most AI coding tools support adding context through URLs or pasted text. Point your tool at https://orm.st/llms-full.txt for complete documentation.
Why Storm Works Well With AI
AI works better when framework behavior is explicit and visible in source code.
Traditional ORMs rely on mechanisms that are powerful but implicit: proxy objects that intercept field access, lazy loading that triggers queries at unpredictable moments, persistence contexts that track entity state across transaction boundaries, and cascading rules that propagate changes through the object graph. These features serve real purposes, but they make AI-assisted development harder. The AI has to account for behavior that does not appear in the code. Code that compiles and looks correct can still break at runtime because of invisible framework state.
Storm eliminates all of that. Entities are plain Kotlin data classes or Java records. There are no proxies, no managed state, no persistence context, and no lazy loading. Queries are explicit, and what you see in the source code is exactly what happens at runtime. This makes Storm's behavior predictable for AI tools: the code is the complete picture.
The design choices that matter most:
- Immutable entities. No hidden state transitions for the AI to track or miss.
- No proxies. The entity class is the entity. No invisible bytecode transformations to account for.
- No persistence context. No session scope, flush ordering, or detachment rules that require deep framework knowledge.
- Convention over configuration. Fewer annotations and config files for the AI to keep consistent.
- Compile-time metamodel. Type errors caught at build time, not at runtime. The AI gets immediate feedback.
- Secure schema access. The MCP server gives AI tools structural database knowledge without exposing credentials or data.
Beyond the data model, Storm provides dedicated tooling for AI-assisted workflows:
- Skills guide AI tools through specific tasks (entity creation, queries, repositories, migrations) with framework-aware conventions and rules.
- A locally running MCP server gives AI tools access to your live database schema: table definitions, column types, constraints, and foreign keys. The AI can inspect your actual database structure to generate entities that match, or validate entities it just created.
- Built-in verification through
ORMTemplate.validateSchema()andSqlCapturelets the AI validate its own work. After generating entities, the AI can validate them against the database. After writing queries, it can capture and inspect the actual SQL. Both checks run in an isolated in-memory database through@StormTest, so verification happens before anything touches production. For dialect-specific code,@StormTestsupports a staticdataSource()factory method on the test class, allowing integration with Testcontainers to test against the actual target database.