AI Unified Process plugin for the Vaadin/jOOQ stack

GitHub stars
37

Install

/plugin install aiup-vaadin-jooq@aiup-marketplace

Run it inside Claude Code after adding the marketplace with /plugin marketplace add martinellich/aiup-marketplace.

Contents

Discovered from source

Skills 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

  1. Read docs/entity_model.md
  2. Read existing migrations to determine the next version number
  3. Create sequence definitions for each entity
  4. Create table definitions with columns, constraints, and foreign keys
  5. Order tables so that referenced tables are created before referencing tables
  6. 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

  1. Read the use case specification from docs/use_cases/
  2. Read the entity model from docs/entity_model.md
  3. Check existing code for patterns and conventions
  4. Implement the data access layer using jOOQ
  5. Verify the data access layer compiles and follows existing patterns
  6. Implement the Vaadin view following existing patterns
  7. Wire up the view with the data access layer
  8. 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.

ApproachLocationPurpose
Flyway migrationsrc/test/resources/db/migration/V*.sqlPopulate test data
Manual cleanup@AfterEach methodRemove test-created data

Key Helper Classes

ClassPurpose
com.github.mvysny.kaributesting.v10.LocatorJFind components
com.github.mvysny.kaributesting.v10.GridKtGrid assertions and interactions
com.github.mvysny.kaributesting.v10.NotificationsKtNotification assertions
com.github.mvysny.kaributesting.v10.pro.ConfirmDialogKtConfirmDialog 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 TypeExample
Grid sizeassertThat(GridKt._size(grid)).isEqualTo(10)
Component visibleassertThat(button.isVisible()).isTrue()
Component enabledassertThat(button.isEnabled()).isTrue()
Field valueassertThat(textField.getValue()).isEqualTo("x")
Collection sizeassertThat(items).hasSize(5)
NotificationsexpectNotifications("Success")

Workflow

  1. Read the use case specification
  2. Use TodoWrite to create a task for each test scenario
  3. Create test class using the template
  4. For each test:
    • Navigate to the view
    • Find components using LocatorJ
    • Perform interactions
    • Assert expected outcomes
    • Clean up test data if created during test
  5. Run tests to verify they pass
  6. 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
  7. Mark todos complete

Resources

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.

ApproachLocationPurpose
Flyway migrationsrc/test/resources/db/migration/V*.sqlExisting test data
Manual cleanup@AfterEach methodRemove test-created data

Test Class Structure

Extend from PlaywrightIT base class.

Template

Use templates/ExampleViewIT.java as the test class structure.

Key Classes

ClassPurpose
GridPwGrid interactions and assertions
pagePlaywright Page object for navigation
mopoVaadin 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 TypeExample
Text contentassertThat(row.getCell(0).innerText()).isEqualTo("x")
Input valueassertThat(field.inputValue()).isEqualTo("value")
Row countassertThat(gridPw.getRenderedRowCount()).isGreaterThan(0)
VisibilityassertThat(element.isVisible()).isTrue()
EnabledassertThat(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

  1. Read the use case specification
  2. Use TodoWrite to create a task for each test scenario
  3. Create test class extending PlaywrightIT
  4. 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
  5. Run tests to verify they pass
  6. 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
  7. Mark todos complete

Sponsors

Details

Marketplace
martinellich/aiup-marketplace
Source
aiup-vaadin-jooq
Category
Community

More from martinellich/aiup-marketplace

All 2