The main purpose of this demo is to show how AI agents can create code that works using test-driven design.
The example uses a GameTracker application, Spring Boot, Flyway and Oracle to make the result concrete. The agents take a source export, design a normalized Oracle model, generate the Flyway changes and import procedure, create utPLSQL tests, and validate the result against a running Oracle database. The goal is a working, testable change rather than generated code that only looks plausible.
The normalized-import demo runs as a closed loop:
- The analyst turns the source JSON into a candidate schema and import design.
- The test designer creates the utPLSQL package and test matrix.
- The validator checks the generated database objects, migrations, annotations and tests.
- The loop agent repairs failures and reruns the checks until the design passes or the retry limit is reached.
The workflow is defined in .github/agents/ and .github/prompts/. Its acceptance checks include valid Oracle objects, deterministic and idempotent imports, explicit reporting of excluded domains, Flyway's one-statement-per-changeset rule, annotation coverage and passing utPLSQL tests.
Oracle 26i is used to explore the latest functionalities, like the JSON to Relational duality views!
- Install a Java JDK of your choice if not already installed.
- Download Docker Desktop on your machine from docker.com and install. Alternatively Podman can be used.
- Go to directory src/main and run
./start.sh
The latest slim image of oracle will be pulled and started. Users utplsql and gametracker will be created in the PDB.
- Open a new terminal window. Go to src/main folder and run the following script to install SQLcl, skills and utPLSQL as well as copying grouvee_export.json to the Oracle directory:
./initialize_environment.sh
Example prompt to start the Oracle design loop (focused on getting working code for the game import)
- Open a new chat session in VS Code
- Ensure that prompt file .github/prompts/start-design-normalized-import.prompt.md is added to the context by selecting it from the Explorer view.
- Prompt away. Example:
Run the Oracle design loop provided in the attached prompt until all acceptance criteria are met.
You can create a connection for the gametracker user with the following details:
Username: gametracker
Password: gametracker
Hostname: localhost
Port: 1523
Service name: FREEPDB1
- Harness engineering for coding agent users
- Mitchell Hashimoto - My AI Adoption Journey
- Relocating Rigor
- Flyway by Redgate
- Database centric applications with Spring Boot and jOOQ
- Spring Initializr
- Accessing Relational Data using JDBC with Spring
This was once a demo on how Flyway can be used. Back then, I used Michael Simons excellent project as a starting point for creating the demo code:
http://github.com/michael-simons/DOAG2016/
Make sure that you look at the commits, as they are very thorough and educational! If you want to learn more about Spring Boot, JOOQ and Oracle Jet I strongly suggest that you explore it. Also read the accompanying blog posts: