
aiup-vaadin-jooq
AI Unified Process plugin for the Vaadin/jOOQ stack
- GitHub stars
- 37
Install
/plugin install aiup-vaadin-jooq@aiup-marketplaceRun it inside Claude Code after adding the marketplace with /plugin marketplace add martinellich/aiup-marketplace.
Contents
Discovered from sourceSkills 4
Flyway Migration
Instructions
Create Flyway database migration scripts based on docs/entity_model.md.
Use sequences for primary keys.
DO NOT
- Use auto-increment for primary keys (use sequences instead)
- Create migrations that drop existing tables without explicit user confirmation
- Skip foreign key constraints defined in the entity model
File Naming Convention
Flyway versioned migrations follow this naming pattern:
V001__create_room_type_table.sql
V002__create_guest_table.sql
V003__create_reservation_table.sql
Example Migration
-- V001__create_room_type_table.sql
CREATE SEQUENCE room_type_seq START WITH 1 INCREMENT BY 1 CACHE 50;
CREATE TABLE room_type
(
id BIGINT DEFAULT nextval('room_type_seq') PRIMARY KEY,
name VARCHAR(50) NOT NULL UNIQUE,
description VARCHAR(500),
capacity INTEGER NOT NULL CHECK (capacity BETWEEN 1 AND 10),
price DECIMAL(10, 2) NOT NULL CHECK (price >= 0)
);
Workflow
- Read
docs/entity_model.md - Read existing migrations to determine the next version number
- Create sequence definitions for each entity
- Create table definitions with columns, constraints, and foreign keys
- Order tables so that referenced tables are created before referencing tables
- Validate the migration:
- Verify all entities from the entity model have corresponding tables
- Verify all foreign keys reference tables that are created in the same or earlier migration
- Verify sequence names follow the pattern
{table_name}_seq - Verify the SQL syntax is valid for the target database
Implement Use Case
Instructions
Implement the use case $ARGUMENTS using Vaadin for the UI layer and jOOQ for data access.
Don't create tests – there are the karibu-test and playwright-test skills for that.
Check the Vaadin and jOOQ MCP servers for guidance.
DO NOT
- Create test classes (use dedicated testing skills instead)
Workflow
- Read the use case specification from
docs/use_cases/ - Read the entity model from
docs/entity_model.md - Check existing code for patterns and conventions
- Implement the data access layer using jOOQ
- Verify the data access layer compiles and follows existing patterns
- Implement the Vaadin view following existing patterns
- Wire up the view with the data access layer
- Verify the full implementation compiles successfully
Resources
- Use the Vaadin MCP server for component documentation
- Use the jOOQ MCP server for query DSL reference
- Use the JavaDocs MCP server for API documentation
Karibu Test
Instructions
Create Karibu unit tests for Vaadin views based on the use case $ARGUMENTS. Karibu Testing allows server-side testing of Vaadin components without a browser.
Use the KaribuTesting MCP server for documentation and code generation.
DO NOT
- Use Mockito for mocking
- Use @Transactional annotation (transaction boundaries must stay intact)
- Use services, repositories, or DSLContext to create test data
- Delete all data in cleanup (only remove data created during the test)
- Use browser-based testing patterns (this is server-side testing)
Test Data Strategy
Create test data using Flyway migrations in src/test/resources/db/migration.
| Approach | Location | Purpose |
|---|---|---|
| Flyway migration | src/test/resources/db/migration/V*.sql | Populate test data |
| Manual cleanup | @AfterEach method | Remove test-created data |
Key Helper Classes
| Class | Purpose |
|---|---|
| com.github.mvysny.kaributesting.v10.LocatorJ | Find components |
| com.github.mvysny.kaributesting.v10.GridKt | Grid assertions and interactions |
| com.github.mvysny.kaributesting.v10.NotificationsKt | Notification assertions |
| com.github.mvysny.kaributesting.v10.pro.ConfirmDialogKt | ConfirmDialog interactions |
Template
Use templates/ExampleViewTest.java as the test class structure.
Common Patterns
Navigate to View
UI.getCurrent().navigate(PersonView.class);
Find Components
// Find by type
var grid = _get(Grid.class);
var button = _get(Button.class, spec -> spec.withCaption("Save"));
var textField = _get(TextField.class, spec -> spec.withLabel("Name"));
// Find all matching
List<Button> buttons = _find(Button.class);
Grid Operations
// Get grid size
assertThat(GridKt._size(grid)).isEqualTo(100);
// Get selected items
Set<PersonRecord> selected = grid.getSelectedItems();
// Select a row
GridKt._selectRow(grid, 0);
// Get cell component (for action buttons)
GridKt._getCellComponent(grid, 0, "actions")
.getChildren()
.filter(Button.class::isInstance)
.findFirst()
.map(Button.class::cast)
.ifPresent(Button::click);
// Get cell value
String name = GridKt._getFormattedRow(grid, 0).get("name");
Form Interactions
// Set field values
_get(TextField.class, spec -> spec.withLabel("Name"))._setValue("John");
_get(ComboBox.class, spec -> spec.withLabel("Country"))._setValue(country);
_get(DatePicker.class, spec -> spec.withLabel("Birth Date"))._setValue(LocalDate.of(1990, 1, 1));
// Click button
_get(Button.class, spec -> spec.withCaption("Save"))._click();
Notification Assertions
// Expect notification
expectNotifications("Record saved successfully");
// Assert no notifications
assertThat(NotificationsKt.getNotifications()).isEmpty();
ConfirmDialog
// Click confirm in dialog
ConfirmDialogKt._fireConfirm(_get(ConfirmDialog.class));
// Click cancel
ConfirmDialogKt._fireCancel(_get(ConfirmDialog.class));
Assertions Reference
Use AssertJ or Karibu Testing assertions:
| Assertion Type | Example |
|---|---|
| Grid size | assertThat(GridKt._size(grid)).isEqualTo(10) |
| Component visible | assertThat(button.isVisible()).isTrue() |
| Component enabled | assertThat(button.isEnabled()).isTrue() |
| Field value | assertThat(textField.getValue()).isEqualTo("x") |
| Collection size | assertThat(items).hasSize(5) |
| Notifications | expectNotifications("Success") |
Workflow
- Read the use case specification
- Use TodoWrite to create a task for each test scenario
- Create test class using the template
- For each test:
- Navigate to the view
- Find components using LocatorJ
- Perform interactions
- Assert expected outcomes
- Clean up test data if created during test
- Run tests to verify they pass
- If a test fails:
- Check component locators with
_dump()to inspect the component tree - Verify test data exists in the Flyway test migrations
- Ensure navigation to the correct view before finding components
- Check component locators with
- Mark todos complete
Resources
- Karibu Testing documentation: https://github.com/mvysny/karibu-testing/tree/master/karibu-testing-v10
- Use the KaribuTesting MCP server for additional patterns
Playwright Test
Instructions
Create Playwright integration tests for Vaadin views on the use case $ARGUMENTS. Playwright tests run in a real browser against a running application.
DO NOT
- Use Mockito for mocking
- Access services, repositories, or DSLContext directly
- Delete all data in cleanup (only remove data created during the test)
- Forget to wait for Vaadin connections to settle after interactions
- Assume all grid rows are rendered (viewport limits visible rows)
Test Data Strategy
Use existing test data from Flyway migrations in src/test/resources/db/migration.
| Approach | Location | Purpose |
|---|---|---|
| Flyway migration | src/test/resources/db/migration/V*.sql | Existing test data |
| Manual cleanup | @AfterEach method | Remove test-created data |
Test Class Structure
Extend from PlaywrightIT base class.
Template
Use templates/ExampleViewIT.java as the test class structure.
Key Classes
| Class | Purpose |
|---|---|
| GridPw | Grid interactions and assertions |
| page | Playwright Page object for navigation |
| mopo | Vaadin connection helper |
Common Patterns
Navigate to View
page.navigate("http://localhost:%d/persons".formatted(localServerPort));
Wait for Vaadin Connection
Always wait after interactions that trigger server communication:
mopo.waitForConnectionToSettle();
Grid Operations
GridPw gridPw = new GridPw(page);
// Get rendered row count (viewport limited!)
int count = gridPw.getRenderedRowCount();
// Get specific row
GridPw.RowPw row = gridPw.getRow(0);
// Get cell text
String text = row.getCell(0).innerText();
// Select row
row.select();
mopo.waitForConnectionToSettle();
Locate Vaadin Components
// Text field by label
Locator nameField = page.locator("vaadin-text-field")
.filter(new Locator.FilterOptions().setHasText("Name"))
.locator("input");
// Button by text
Locator saveButton = page.locator("vaadin-button")
.filter(new Locator.FilterOptions().setHasText("Save"));
// ComboBox
Locator comboBox = page.locator("vaadin-combo-box")
.filter(new Locator.FilterOptions().setHasText("Country"));
Form Interactions
// Get input value
String value = nameField.inputValue();
// Fill text field
nameField.fill("New Value");
// Click button
saveButton.click();
mopo.waitForConnectionToSettle();
// Clear and fill
nameField.clear();
nameField.fill("Updated Value");
ComboBox Interactions
// Open and select
comboBox.click();
page.locator("vaadin-combo-box-item")
.filter(new Locator.FilterOptions().setHasText("Option 1"))
.click();
mopo.waitForConnectionToSettle();
Dialog Interactions
// Confirm dialog
page.locator("vaadin-confirm-dialog")
.locator("vaadin-button")
.filter(new Locator.FilterOptions().setHasText("Confirm"))
.click();
mopo.waitForConnectionToSettle();
Assertions Reference
Use AssertJ assertions:
| Assertion Type | Example |
|---|---|
| Text content | assertThat(row.getCell(0).innerText()).isEqualTo("x") |
| Input value | assertThat(field.inputValue()).isEqualTo("value") |
| Row count | assertThat(gridPw.getRenderedRowCount()).isGreaterThan(0) |
| Visibility | assertThat(element.isVisible()).isTrue() |
| Enabled | assertThat(element.isEnabled()).isTrue() |
Viewport Considerations
Playwright tests run in a real browser with viewport constraints:
- Not all grid rows may be rendered
- Use
isGreaterThan()instead of exact counts for grids - Scroll if needed to access off-screen elements
Workflow
- Read the use case specification
- Use TodoWrite to create a task for each test scenario
- Create test class extending PlaywrightIT
- For each test:
- Navigate to the view
- Wait for connection to settle
- Locate components using Vaadin selectors
- Perform interactions (always wait after)
- Assert expected outcomes
- Clean up test data if created during test
- Run tests to verify they pass
- If a test fails:
- Verify the view loaded correctly (check page URL and title)
- Ensure
mopo.waitForConnectionToSettle()is called after every interaction - Check that test data exists in the Flyway test migrations
- For grid assertions, use
isGreaterThan()instead of exact counts
- Mark todos complete
MCP servers 5
Sponsors
Details
- Marketplace
- martinellich/aiup-marketplace
- Source
- aiup-vaadin-jooq
- Category
- Community