Skip to main content

AI coding assistant prompt collection

Available in product edition: Professional

This collection provides specialized prompts for AI coding assistants like Cursor IDE and GitHub Copilot to generate code from your IBM DevOps Solution Workbench design files. These prompts leverage your architectural design patterns to create consistent, design-compliant code.

❗️Beta Feature

This prompt collection is part of our beta Custom Stacks feature and may not be fully optimized yet. We're continuously improving the prompts and welcome your feedback.

How to Use​

  1. Copy the relevant prompt from the sections below
  2. Customize placeholders (e.g., <EntityXYZ>, <NamespaceXYZ>) with your specific names
  3. Paste into your AI coding assistant (Cursor or GitHub Copilot) and let the AI generate code based on your design files
πŸ’‘tip

Ensure your design files are up-to-date for best results. The AI assistant relies on this context to generate accurate code.

⚠Important Disclaimer

The quality of generated code depends entirely on the AI coding assistant's capabilities and training data. Always review, test and validate AI-generated code before using it in production. The design files provide context, but the final code quality and correctness are the responsibility of the developer.

The prompts in this collection have been verified and work effectively with the following AI coding assistants:

  • Cursor IDE - An AI-first code editor with powerful code generation capabilities
  • GitHub Copilot - GitHub's AI pair programmer that integrates with various IDEs

Both tools can effectively use the prompts below in combination with your design files to generate consistent, design-compliant code.

❗️info

These prompts have been verified with "Auto" model selection and premium models (e.g. Claude 4.5 Sonnet). Results may vary with different models.

Preparation​

To set the baseline for AI coding assistants in order to be able to generate code from your design files, it makes sense to extend the projects Readme.md with some general information about the project structure.

We recommend the following content to be placed into the Readme.md:

## Design files
* the design-files under `/src-design` represent the designed building blocks of the project
* the subfolder structure reflects the different design element types (e.g. domain entities under `/entity`)

### Source code
* the source code can be found under `/src`

#### Entity classes
* entity classes are grouped inside a folder, where each entity is represented by a separate file
❗️info

If you want to have your source code structured in a different way, feel free to adjust the content accordingly.

As an alternative, you can also define custom rules around where to find the design files and how the source code should be structured.

Create intitial structure​

Create initial structure corresponding to designed namespaces
Create initial folders under src for all the api, domain and integration namespaces (namespace level only) and update Readme.md accordingly.

Entity implementation​

Create classes for one entity and dependent items
Based on the design files, create a class with properties for entity <EntityXYZ> including all not existing entities that it is relying on.
Create classes for all entities of a namespace
Based on the design files, create classes with properties for all entities defined in namespace <NamespaceXYZ>.
List discrepancies between design and current implementation
Based on the entity design files, list all places where the current implementation doesn't match.
Ensure alignment of entity implementation with design specification
Make sure existing entities and their properties align with design files.

For one entity:

Make sure entity <EntityXYZ> and it’s properties align with design files.

Data persistence​

Implement data persistence for root entities
Based on the design files, implement data persistence for all root entities of domain namespace <NamespaceXYZ>.

Business logic implementation​

Implement commands of an entity
Implement all commands of entity <EntityXYZ> as methods on the entity.

If you want to make sure that only directly associated commands are implemented you can add the following:

Ignore the parent commands.
Implement all commands of a namespace
Implement all commands defined in namespace <NamespaceXYZ> as methods on the entities. Make sure you implement them according to the described implementation logic.
Implement one domain service
Implement domain service <ServiceXYZ> as separate service class.
Implement all services of a namespace
Based on the service design files, implement all domain services of namespace <NamespaceXYZ>. Make sure you implement them according to the described implementation logic.
List discrepancies between design and current implementation
Based on the command and domain service design files and their described implementation logic, list all places where the current implementation doesn't match.
Ensure alignment of current implementation with design specification
Make sure existing command and domain service implementations align with design files.

For one command:

Make sure command <CommandXYZ> aligns with design files.

For one service:

Make sure service <ServiceXYZ> aligns with design files.

API implementation​

Implement provisioning of a REST API

The following prompt is recommended to be used if the domain implementation (if required) is already present so that it can be reused in the REST API implementation:

Based on the design files, create and implement the API defined in namespace <APINamespaceXYZ>.

If the domain implementation is not yet there, but it is required to create a skeleton first and later on wire the REST API to the domain, the following prompts can be used:

Create a skeleton of the REST API defined in namespace <APINamespaceXYZ> with no implementation.
Implement REST API defined in namespace <APINamespaceXYZ> and make sure you make use of the domain implementation where it makes sense.
Implement Swagger UI

Depending on your settings, this might be already implemented after the "Implement provisioning of a REST API" prompt.

Implement a Swagger UI for the REST API <APINamespaceXYZ>.
Setup Swagger UI for local development

According to how the API specification is generated, local usage of the Swagger UI might not work out of the box.

Ensure Swagger UI works for local development.
List discrepancies between design and current implementation
Based on the API namespace design files, list all places where the current implementation doesn't match.
Ensure alignment of API implementation with design specification
Make sure API <APINamespaceXYZ> aligns with defined OpenAPI specification and described logic implementation.

Integration implementation​

Implement integration of external REST APIs
Based on the design files, create the implementation for the integration namespace <IntegrationNamespaceXYZ>.
List discrepancies between design and current implementation
Based on the integration namespace design files, list all places where the current implementation doesn't match.
Ensure alignment of integration implementation with design specification
Make sure implementation of integration namespace <IntegrationNamespaceXYZ> aligns with design files.

Custom rules​

If you want AI coding assistants to generate code in a specific way, it can make sense to extend the assistant rules according to your special needs.