OpenXava works remarkably well with AI coding assistants and agents such as GitHub Copilot, Cursor, Claude Code, Devin, Codex, JetBrains Junie, and others. There are several reasons for this:
You can see this in action in the Course with AI, where a complete business application is built using an AI agent with minimal manual intervention.
OpenXava includes specific optimizations to make AI coding assistants even more effective. These optimizations provide AI agents with project-specific context and real code examples, so they produce correct OpenXava code from the very first attempt.
Every new OpenXava project includes an AGENTS.md file in the project root. This is a special Markdown file that AI coding assistants automatically read to understand the conventions and rules of your project. Most modern AI-powered IDEs (Cursor, GitHub Copilot, Devin, etc.) recognize this file and use it as context when generating code.
The AGENTS.md file included with OpenXava projects contains:
This means that when you ask an AI agent to "create a Customer entity" or "write a test for the Invoice module," it will follow OpenXava conventions automatically.
In addition to AGENTS.md, the file points the AI agent to real code examples hosted in the OpenXava GitHub repository:
Since the examples are referenced by URL, there is nothing to generate or maintain in your project, and the AI always sees the examples of the latest version.
When an AI coding assistant opens your project, it reads AGENTS.md to learn the project rules. When it needs to generate a test or understand how OpenXava works, it follows the links to the code examples on GitHub. This combination of rules and examples results in much more accurate code generation.
Projects created with OpenXava 7.7 or later already include everything needed: the AGENTS.md file is in the project root and ready to use. No additional setup is required.
If your project does not have an AGENTS.md file yet, you can add AI coding assistant support manually:
Download the AGENTS.md file from the OpenXava GitHub repository and place it in your project root:
https://github.com/openxava/openxava/blob/master/openxava-archetype/AGENTS.md
After downloading, edit the file to replace the archetype placeholders with your actual project values:
For example, if your package is com.mycompany and your artifact is invoicing, change:
package ${package}.${artifactId}.model;
to:
package com.mycompany.invoicing.model;
That is all. No changes to your pom.xml are needed.
The AGENTS.md file is fully customizable. You can and should edit it to include conventions specific to your project. For example:
The more specific and detailed your AGENTS.md is, the better the AI coding assistant will understand your project and generate code that fits your standards. Think of it as onboarding documentation—not for a new developer, but for an AI agent.
In OpenXava 7.7 the code examples for AI agents were not linked from GitHub but unpacked into a local .xava folder in the project root, generated from the openxava-agents-examples Maven artifact. This artifact does not exist in OpenXava 8.0, where the examples are referenced directly on GitHub instead.
If your project was created with OpenXava 7.7, it contains a .xava/agents/ folder with test examples and controller definitions, and an unpack-agents-examples execution of the maven-dependency-plugin in its pom.xml that regenerates the folder on each build. When you upgrade to OpenXava 8.0 you must remove that execution, delete the .xava folder and update your AGENTS.md. See the migration guide for details.
If you stay on OpenXava 7.7, run mvn package to generate the .xava folder, and do not add it to .gitignore, because most AI coding assistants only search files that are inside the project and not ignored by Git.