Skip to main content

Bootstrap a Service from a Shared Design Model

๐ŸŽฏLet's prove it!

In this hands-on trial, you will bootstrap a production-ready microservice from a shared design model and experience first-hand how structured design intent transforms your coding assistant from guessing to consistently implementing your organisation's standards.

Before you startโ€‹

Estimated time: 15-20 minutes
What you need: Your own IDE and coding assistant, access to our trial environment.

About your trial environment

Your trial environment includes everything you need to get started: a dedicated, isolated tenant in the IBM DevOps Solution Workbench, and a GitLab instance with repositories for all your projects - including our reference application Roboflow ready for you to explore.

You bring your own IDE and coding assistant โ€” whatever you normally use. In our screenshots throughout these trials we use Visual Studio Code with GitHub Copilot.

Solution Designer
The Solution Designer is your main workspace in Workbench. This is where architecture is modelled, design decisions are captured, and structured context is created for your coding assistant. Your trial comes with a dedicated, isolated tenant. Log in using the credentials from your trial onboarding email.

GitLab
Every project in the Solution Designer is backed by a Git repository in your trial's dedicated GitLab group. Throughout the trial, you usually access GitLab repositories through the Solution Designer since URLs are specific to your tenant.

To find the Repository URL for any project:

  1. Open the project in the Solution Designer
  2. On the Overview page that opens, you'll find "General Information" on the right hand side.
  3. The link under "Acronym" takes you directly to the GitLab repository for that project.
  4. Log into GitLab using the "Keycloak" button.

Cloning a project to work in your own IDE requires a Personal Access Token (PAT). To create one:

  1. Log into your Trial GitLab (using the Keycloak button)
  2. Click your profile icon in the upper right corner and select Preferences
  3. Go to Access โ†’ Personal Access Tokens
  4. Create a token with read_repository, write_repository and api scope

Cloning a project

To clone a project, you can either use the "Code" button in the GitLab UI and copy the "Clone with HTTPS" URL or you can copy the URL directly from the Solution Designer project page. To do this:

  1. Open the project in the Solution Designer
  2. Expand the footer bar that says "Git"
  3. Copy the URL

In both cases, use a terminal and run git clone <URL> -b <optional-branch-name> and use your username and the created PAT as the password when prompted.

Cloning via SSH is disabled in the trial environment for security reasons.

RoboFlow
Your trial environment comes preloaded with RoboFlow โ€” a fictional B2B webshop for robotics parts that serves as the reference application across all trial experiences. Its services are already designed and documented in the Solution Designer, ready for you to explore and build on.


Step 1 โ€” Orient yourselfโ€‹

You are working with RoboFlow โ€” a fictional B2B webshop for robotics parts that serves as the reference application across all trial experiences. If you are new to the scenario or want a quick overview of the system and its services, expand the section below.

About the RoboFlow reference application

The RoboFlow reference application

The trials in this section are built around RoboFlow โ€” a fictional B2B webshop for robotics parts that serves as the reference application across all trial experiences. If you want to find out about RoboFlow's ambitions and requirements, you can head to the RoboFlow overview page for a quick introduction.

RoboFlow's system is composed of multiple microservices, each designed and documented in the Workbench. The starting point is an architecture project โ€” a high-level view of the system that shows which services exist, how they relate, and what responsibilities they carry. RoboFlow's architecture is modelled using C4 notation, one of the modelling languages IBM DevOps Solution Workbench supports out of the box.

The diagram below is the Container Diagram (Level 2) of the RoboFlow system in the RoboFlow architecture project โ€” one level below the overall system context (L1), showing the individual services and their relationships. You can also open it directly in the Workbench.

RoboFlow Container Diagram

The system includes a WebShop Frontend, a Basket Service, a Checkout Service, a Payment Service, and others. Three services are central to the trials:

  • Checkout Service โ€” orchestrates the checkout flow, applies discounts, and initiates payment
  • Payment Service โ€” handles all payment processing and integrates with external payment providers
  • Gift Card Service โ€” manages gift card balances, validates voucher codes, and tracks redemptions

Each service usually has its own service project in the Workbench โ€” a separate, more detailed specification that defines the service's boundaries, domain model, interfaces, and the architectural decisions that apply to it. This is where the real design work happens.

Explore a serviceโ€‹

As an example, let's look at the Checkout Service.

Now that you have a feel for how services are structured in the Workbench, let's put it to work. You have a new requirement waiting.


Step 2 - Meet your new requirementโ€‹

โ—๏ธYour task

The Gift Card Service has already been designed. Your job is to implement it.

RoboFlow has a new requirement: Customers should be able to pay with gift card vouchers at checkout. The architect already designed the Gift Card Service and documented it in the Workbench โ€” service boundaries defined, domain model specified, architectural decisions attached. What doesn't exist yet is the implementation. That's what you're about to do.

Let's start by orienting ourselves in the Workbench and retrieving the URL of the Git repository to clone the project.

Open Workbench by clicking here.

Intro to Workbenchโ€‹

Let's grab the URL, head to our IDE and generate the service based on this specification.


Step 3 โ€” Clone the projectโ€‹

To clone the project, you will need the Git URL from the Workbench and a Personal Access Token. If you haven't set this up yet, see the About your trial environment section above.

Step 4 โ€” Generate the serviceโ€‹

Nothing in the codebase is generated yet. Your project only contains the design specification of the Gift Card Service in the folder src-design, but the implementation still needs to be created.

Through Project Baselines, your coding assistant has access to predefined skills and commands that encode your organisation's standards โ€” entity patterns, structural conventions, compliance rules โ€” contributed once by your experts and available to every developer automatically.

These skills and commands assemble the full design intent at generation time by pulling from the design model created in Workbench.

This is why the prompt is short, everything the AI needs is already there. With k5-generate - one of the provided skills - your coding assistant will generate the complete Gift Card Service based on the design specification in the Workbench.

We will explore that design after the next step. For now, just run the command and let it generate the service.

โ—๏ธinfo

This will take a few minutes. Move to the next step while it runs.


Step 5 โ€” Explore while it generatesโ€‹

While the service is being generated, open the .github folder in your project. Here you will find the skills that k5 is applying right now.

โ„น๏ธnote

If you are using a different coding assistant, the name of the folder would be different (e.g., .cursor, .claude, ...).

Browse the filesโ€‹

These skills are supplied by Workbench through the Project Baselines feature, which means they are defined by experts once and encode the standards for how services should be generated based on a given design model.

These files serve two purposes:

  1. They encode the knowledge of your organisation's experts: your Java specialist's entity patterns, your architect's structural conventions, your compliance rules. They define how code should be written.
  2. They assemble the full design intent for the AI at generation time, pulling in the design model: the service name, the domain entities, their relationships, the interfaces, the architectural decisions your team attached in the Workbench.

This is the compounding effect that makes Workbench different. An expert contributes once. That contribution becomes part of every generation run, and is the same for every developer and across services โ€” without anyone needing to remember or enforce it.

One command. No description required.โ€‹

Notice that you didn't have to describe any of the service specifics to the AI. No prompt explaining the entity relationships, no text describing which external services the Giftcard Service depends on, no instructions about how adapters should be wired. All of that is already in the model โ€” relationships between entities, dependencies on other services, interface contracts โ€” modeled precisely, leaving no room for interpretation.

k5-generate is short because the design is complete.


Step 6 โ€” Read what the AI readโ€‹

Go back to the Workbench and open the Giftcard Service project. While your service is being generated, we look at what the AI is working from.

The domain modelโ€‹

Open the Domain Diagram. The link above should take your directly there. If not, navigate to "Diagrams" in the left sidebar and open the diagram with the name "Domain Diagram".

You are looking at the Giftcard aggregate โ€” the core of the service.

Domain Model Giftcard Service

Notice what is already defined here:

  • The Giftcard entity and its relationship to the Transaction value object, where every redemption, activation, and refund is recorded as a transaction
  • The three commands Activate, Redeem and Refund
  • The business errors and when they are triggered: balance not sufficient, transaction not found, refund amount exceeds original
  • The business event Gift Card Activated โ€” signalling the outside world when activation succeeds

Now click on the Redeem command. In the details panel on the right, open the description. This is the business logic your architect wrote:

Domain Model Giftcard Service
  • Check the balance; if insufficient, throw BalanceNotSufficient
  • If sufficient, create a Transaction instance, subtract the amount, generate a transaction ID

Everything is here: the technical decisions, the description of the business logic. It is structured and attached to the element it describes, which means the AI has precise context without needing to guess at what you meant.

The APIโ€‹

Open the API diagram by navigating to "Diagrams" in the left sidebar and the opening the "API Diagram". The commands you just read surface here as REST operations โ€” Redeem, Refund, Activate, each mapped to an endpoint. The DB collection is explicit. The domain service is there.

API Diagram Giftcard Service

The relationship between the domain entities and the API was defined in the model, and the generator followed it.

๐ŸŒŸThe point of this step

A developer joining this team tomorrow could open this project and understand the service without asking anyone. And so could the AI. And with the guidelines defined once by the organisation's experts, the AI can generate a service that is consistent with the team's standards. Every time, for every developer.


Step 7 โ€” Explore the generated serviceโ€‹

Head back to your IDE. When the generation is complete you have a fully functioning Java Spring Boot microservice - ready to be deployed.

๐Ÿ’กtip

Dependent on the LLM you choose, generation might not yet be completed. Check out the files that have already been generated by your Coding Assistant.

Browse through what was created:

  • Entities โ€” the Giftcard entity and the Transaction value object, with the relationship you saw in the domain model
  • Persistence layer โ€” repository and database wiring, ready to connect to the Giftcards DB Collection
  • Commands โ€” Activate, Redeem, Refund, each as a structured class reflecting the command logic you read in the Workbench
  • Domain services โ€” the GetGiftcardsForCustomer service, as defined
  • REST API โ€” controllers and endpoints mapping directly to the API diagram you explored
  • Eventing โ€” the GiftCardActivated business event, wired up and ready
  • Unit tests โ€” generated alongside the code right away
  • README โ€” documenting the service structure automatically

The entity relationships, the error conditions, the API structure โ€” none of it was described in a prompt. It was modeled, and the Coding Assistant followed it.

๐ŸŒŸOne thing worth finding

Find the Redeem command class. You will notice the business logic described in the Workbench โ€” the balance check, the transaction creation, the error handling โ€” is already implemented.


What just happenedโ€‹

You gave the AI something real to work from.

Not a lengthy text prompt describing your architecture. Not a ticket that assumed the developer already knew all the architectural decisions that have been made for the system. A machine-readable design model โ€” with service boundaries, domain entities, interfaces, and architectural decisions all attached where they belong. And guidelines encoded in the model that ensure that each service is generated the same way as the next.

Without any background about the system, or searching for instructions on how to create a Java Spring Boot service for RoboFlow, you generated a fully functioning microservice that is consistent with the rest of the system.


Go deeperโ€‹