Skip to main content

Project Baseline Reference

This reference describes the structure and format of project baselines, including the k5-baseline.yaml configuration file, ZIP archive structure, and API operations.

Baseline ZIP Archive Structure

A project baseline is distributed as a ZIP archive with the following structure:

baseline-name-VERSION.zip
├── k5-baseline.yaml # Baseline metadata and configuration (required)
├── k5-oml.yaml # OML configuration (required)
├── .recipes/ # Recipes folder (optional)
│ ├── skills/ # Skills for implementation generation
│ │ └── *.md # Markdown files
│ ├── commands/ # Commands for prompt window
│ │ └── *.md # Markdown files
│ └── rules/ # Validation and enforcement rules
│ └── *.md # Markdown files
└── README.md # Documentation (optional)

File Requirements

  • Required files: k5-baseline.yaml, k5-oml.yaml
  • Optional files: README.md, .recipes/ folder with any structure
  • Allowed extensions (root level): .yaml, .yml, .txt, .md
  • Recipes folder: Any file types allowed under .recipes/
  • Maximum size: 16 MB

Excluded Files

The following files are automatically excluded during processing:

  • MacOS resource fork files (._ *)
  • __MACOSX/ folders and their contents

k5-baseline.yaml Format

The k5-baseline.yaml file defines the baseline metadata and configuration.

Required Fields

id: "baseline-identifier" # Unique baseline identifier
version: "1.0.0" # Semantic version
name: "Baseline Display Name" # Human-readable name

Optional Fields

description: "Detailed description of the baseline"
tags:
- "domain-driven-design"
- "microservices"
icon: "Application" # Icon identifier
color: "#0f62fe" # Hex color code

Coding Assistant Preferences

Define folder mappings for different coding assistants:

codingAssistantPreferences:
bob:
baseFolder: "./.bob"
cursor:
baseFolder: "./.cursor"
github:
baseFolder: "./.github"

Requirements:

  • Each coding assistant entry must have a baseFolder property (string)
  • The baseFolder specifies where the assistant's configuration is stored
  • Optional mapping array defines source-to-target path transformations

Complete Example

id: "ddd-quarkus-baseline"
version: "1.3.2"
name: "Domain Service based on Quarkus"
description: "A baseline configuration for implementing a domain service based on Quarkus with domain-driven-design principles"
tags:
- "ddd"
- "quarkus"
- "domain-driven-design"
icon: "Application"
color: "#ca3131"
codingAssistantPreferences:
bob:
baseFolder: "./.bob"

k5-oml.yaml Format

The k5-oml.yaml file defines the OML configuration. See OML Configuration Reference for complete details.

Required Structure

id: "modeling-configuration-id"
version: "1.0.0"
name: "Configuration Name"
description: "Configuration description"

layers:
- id: "layer-id"
name: "Layer Name"
description: "Layer description"

systemDefinitions:
- id: "k5-oml-system"
version: "1.0.0"

profiles:
- id: "profile-id"
version: "1.0.0"

Baseline Lifecycle States

StatusDescriptionAllowed Operations
DRAFTUnder development, can be modifiedUpload new file, Download, Publish, Deprecate, Delete
PUBLISHEDReleased for use, immutableDownload, Deprecate
DEPRECATEDNo longer recommendedDownload, Re-publish

State Transitions

DRAFT ──────────> PUBLISHED ──────────> DEPRECATED
│ │ │
│ │ │
└───────────────────┴──────────────────────┘
(Delete only from DRAFT)

API Operations

Upload Baseline

Endpoint: POST /api/project-baselines

Request:

  • Content-Type: multipart/form-data
  • Field: baselineFile (ZIP file, max 16 MB)
  • Allowed extensions: .zip
  • Allowed MIME types: application/zip, application/x-zip-compressed, application/octet-stream

Validation:

  • ZIP must contain k5-baseline.yaml and k5-oml.yaml
  • All referenced OML profiles must exist
  • Baseline ID + version combination must be unique (for new baselines)
  • For updates: baseline must be in DRAFT status

Response: 201 Created

{
"baselineId": "ddd-quarkus-baseline",
"baselineVersion": "1.3.2",
"name": "Domain Service based on Quarkus",
"status": "DRAFT",
"description": "...",
"tags": ["ddd", "quarkus"],
"icon": "Application",
"color": "#ca3131"
}

List Baselines

Endpoint: GET /api/project-baselines

Query Parameters:

  • publishedBaselineOnly: true | false (filter for published baselines only)
  • latestVersionOnly: true | false (show only latest version of each baseline)

Response: 200 OK

[
{
"baselineId": "ddd-quarkus-baseline",
"baselineVersion": "1.3.2",
"name": "Domain Service based on Quarkus",
"status": "PUBLISHED",
"k5Oml": { ... }
}
]

Get Baseline Metadata

Endpoint: GET /api/project-baselines/:baselineId/:version

Response: 200 OK

{
"baselineId": "ddd-quarkus-baseline",
"baselineVersion": "1.3.2",
"name": "Domain Service based on Quarkus",
"status": "PUBLISHED",
"k5Oml": {
"id": "ddd-quarkus-config",
"version": "1.0.0",
"layers": [...],
"profiles": [...]
}
}

Download Baseline

Endpoint: GET /api/project-baselines/:baselineId/:version/download

Authorization: Requires admin privileges

Response: 200 OK

  • Content-Type: application/zip
  • Content-Disposition: attachment; filename="baseline-id-version.zip"
  • Body: ZIP file buffer

Update Baseline Status

Endpoint: PUT /api/project-baselines/:baselineId/:version/status

Authorization: Requires admin privileges

Request Body:

{
"status": "PUBLISHED"
}

Allowed Transitions:

  • DRAFTPUBLISHED
  • DRAFTDEPRECATED
  • PUBLISHEDDEPRECATED
  • DEPRECATEDPUBLISHED

Validation for Publishing:

  • Baseline ZIP file must be valid
  • All referenced OML profiles must exist and be published

Response: 204 No Content

Delete Baseline

Endpoint: DELETE /api/project-baselines/:baselineId/:version

Authorization: Requires admin privileges

Restrictions:

  • Only baselines in DRAFT status can be deleted
  • Published and deprecated baselines cannot be deleted

Response: 204 No Content

Validation Rules

ZIP Archive Validation

  1. Required files present: k5-baseline.yaml, k5-oml.yaml
  2. File extensions (root level): Only .yaml, .yml, .txt, .md allowed
  3. Recipes folder: Any file types allowed under .recipes/
  4. Size limit: Maximum 16 MB
  5. System files: MacOS resource forks and __MACOSX folders excluded

k5-baseline.yaml Validation

  1. Required fields: id, version, name must be present
  2. Version format: Must follow semantic versioning
  3. Coding assistant preferences: If present, each assistant must have baseFolder property

k5-oml.yaml Validation

  1. Required fields: id, version, name, layers must be present
  2. Profile references: All referenced profiles must exist in the system
  3. System definitions: Must reference valid system definition IDs

Status Change Validation

  1. Publishing: All referenced profiles must be in PUBLISHED status
  2. Deletion: Only DRAFT baselines can be deleted
  3. Re-upload: Only DRAFT baselines can be re-uploaded

Error Codes

ErrorDescription
ProjectBaselineValidationErrorZIP structure or YAML content is invalid
ProjectBaselineAlreadyExistsErrorBaseline with same ID and version already exists
ProjectBaselineNotFoundErrorBaseline with specified ID and version not found
ProjectBaselineStatusUpdateNotAllowedErrorStatus transition not allowed
ProjectBaselineDeleteNotAllowedErrorDeletion not allowed (not in DRAFT status)
ProjectBaselineReferenceNotPublishedErrorReferenced profile not published
ProjectBaselineVersionIsLowerThanLatestErrorNew version is lower than existing latest version

Best Practices

  1. Versioning: Use semantic versioning (MAJOR.MINOR.PATCH)
  2. Testing: Thoroughly test baselines in DRAFT before publishing
  3. Profile dependencies: Ensure all referenced profiles are published first
  4. Documentation: Include comprehensive README.md in the ZIP
  5. Recipes organization: Structure recipes logically in subdirectories
  6. File naming: Use k5- prefix for workbench-managed files
  7. Size optimization: Keep ZIP archives under 16 MB
  8. Backward compatibility: Consider compatibility when creating new versions