---
url: /agentic-ai/service-writer.md
---
# Service Writer

With the `service-writer` Prompt dataset, the [OpenCode Agent](opencode-agent.md) builds ALIDA services from a description. It writes the code, the meta-model, the manual and the tests, then opens a merge request on GitLab.

## Try it

1. Complete the [OpenCode quick start](opencode-agent.md#quick-start), connecting `service-writer` to `input-dataset-4`. `GITLAB_TOKEN` and `GITLAB_GROUP` are required here.
2. Describe what you want, for example: *"Create a service that removes rows with empty values from a CSV dataset."*
3. Agree a short name with the agent. It creates the repository `bda-BDAID-NAME`, for example `bda-42-clean-rows`.
4. Wait for the agent to report the result, then review the merge request.

::: tip The merge is yours
The agent never merges. Merging into `develop` builds the image and registers the service on ALIDA.
:::

## What you get

The agent pushes the branch `feat/<service-name>`, waits for the test pipeline (up to about 20 minutes) and reports one of these results:

| Result | Meaning |
| --- | --- |
| `PASSED` | The merge request into `develop` is open. |
| `FAILED` | The agent tries to fix the service at most twice, without weakening the tests. If it still fails, it reports the last log and stops. |
| `PENDING` | The commit is pushed but there is no result yet. The agent reports it and stops. |

## Change an existing service

Ask for the change in the same session, or set `GIT_URL` to the repository before running the workflow. The agent bumps the version and opens a new merge request. A new service starts at `1.0.0`; fixing its own failed pipeline does not change the version.

The full service name is at most 30 characters. For realistic tests, connect sample files as a dataset without a category: they are available in `/workspace/data`.

## Meta-model rules

The agent checks these rules before every commit and refuses to deliver a service that breaks them.

::: details Show the rules

* `name`, `version`, `description`, `accessLevel`, `url`, `properties` and `markDown` are required and non-empty; `markDown` has a `value`.
* `name` uses lowercase letters, digits and hyphens, starts with a letter, does not end with a hyphen, and is at most 30 characters.
* Every property has a unique, non-empty `key`.
* `valueType` is one of `STRING`, `BOOLEAN`, `DOUBLE`, `JSON`: use `DOUBLE` for any number. Only `resource` properties may have no `valueType`.
* No property key starts with `go_manager`.
* No text shaped like an HTML tag in descriptions.
* At most one property has `inputData: true` and at most one has `outputData: true`.
* `src/arguments.py` has an argument for every property except `assets` and properties of type `static` or `resource`.
* `BOOLEAN` arguments use `type=str2bool`, and `arguments.py` defines `str2bool`; `DOUBLE` arguments use `type=float` or `type=int`.
  :::
