DocsWith AIBuild a Pipeline with AIBuild a Pipeline with AI Once the Mélodium skill is installed, you can ask an AI assistant to write or adapt a CI/CD pipeline for your project. Two approaches work well: starting from nothing, or adapting the official CI/CD template. From Scratch Use this when you have no existing Mélodium project and want the AI to generate everything from a plain description. Describe Your Pipeline Tell the AI what your project needs in plain terms, you don’t need to know any Mélodium syntax. A useful prompt covers what the project is (language, build tool, test framework), what steps the pipeline runs and in what order, what container image each step needs, whether steps can run in parallel, and whether one step produces an artifact the next step consumes. Example: Create a Mélodium CI/CD project for a Rust application. The pipeline should have two steps: 1. Build: run "cargo build --release" in a rust:latest container, output the binary. 2. Test: run "cargo test" in a rust:latest container, in parallel with the build. Use simpleStep for both. Wire them so build and test run in parallel, both triggered by startup. Generate a complete project with Compo.toml and a main.mel file. Use location="compose" for local testing. Review the Generated Project The AI will produce a Compo.toml and one or more .mel files. Before running anything, check that Compo.toml declares std, cicd, process, and work at minimum; that the -> wiring actually reflects the order and parallelism you described; and that a main treatment is declared as an entrypoint in Compo.toml. Also look at the cpu, memory, and storage values in simpleStep, the defaults rarely match your real workload, so adjust them. Run Locally Ask the AI to write the files directly, or copy the generated content into a new project folder. Then run: melodium .melodium-ci/Compo.toml With location="compose" in the CicdDispatchEngine, Mélodium uses Podman Compose or Docker Compose to spin up runners locally, so no Cadence.CI account is needed for this first test. Note The container runtime must be running. This is the default with Docker. On Podman, start the service first: podman system service --time 0 unix:///run/user/1000/podman/podman.sock From the CI/CD Template Use this when you’d rather start from a working scaffold and have the AI adapt it to your project, instead of generating everything from scratch. Create the Template Project At the root of your repository: melodium new --template cicd --path .melodium-ci cicd This creates .melodium-ci/ with a Compo.toml, a lib-root.mel with working build and test treatments, and an advanced.mel with a more explicit runner setup. The template is already a valid CI/CD program, the AI’s job is just to adapt it to your project. Share the Template and Describe Your Needs Open your AI conversation, attach .melodium-ci/lib-root.mel, and describe what your project needs. The AI will rewrite the build and test treatments, and add others, to match. Example: Here is my Mélodium CI/CD template (lib-root.mel). My project is a Node.js application. Update the pipeline to: 1. Install dependencies with "npm ci" in a node:20 container. 2. Run "npm run build" and "npm test" in parallel after install completes. 3. If both succeed, run "npm run deploy" in a node:20 container. Keep the same entrypoint parameters. Use simpleStep throughout. Example with artifact passing: Update the pipeline so the build step compiles a Go binary and streams it directly to the test step, which runs integration tests against the binary without recompiling. Use out_file in the build step and simpleStepWithInput in the test step. Review the Changes Read through the modified .mel file before running it. Make sure the -> wiring matches the order you described, that steps sharing the same trigger source are meant to run concurrently, and that artifact file names line up: if one step uses out_file and the next uses in_file, the names need to match. The template ships with small resource defaults (cpu=100, memory=500) and container images that were picked for the example, both are worth revisiting for your workload. Validate syntax at any point with: melodium check .melodium-ci/lib-root.mel Run and Iterate melodium .melodium-ci/Compo.toml \ --api_token <YOUR_RUN_API_TOKEN> \ --output_directory ./logs \ --repository_clone_url <FULL_CLONE_URL>.git \ --repository_clone_ref main Or with local distribution, no external cluster needed: melodium .melodium-ci/Compo.toml \ --work_location compose \ --api_token <YOUR_RUN_API_TOKEN> \ --output_directory ./logs \ --repository_clone_url <FULL_CLONE_URL>.git \ --repository_clone_ref main Iterating with the AI In both approaches, keep asking the AI to refine the pipeline as you go. Some prompts that work well: “Add a deploy step that only runs if both build and test succeed.” “Make the build step stream the binary to the test step instead of rebuilding.” “Add a lint step that runs in parallel with the build.” “Add a step that always runs, even if the build fails.” “Switch to the advanced runner setup so I can control container resources individually.” The AI can read and modify the .mel files it generated. For the advanced runner setup (setupRunner / stepOn / stopRunner), ask it to rewrite using advanced.mel as the base, the skill includes the full reference for those treatments. You can always validate the result without running the full pipeline: melodium check .melodium-ci/lib-root.mel Going Further Once the pipeline works locally, connect it to Cadence.CI and your Git service: Run on GitHub Actions Run on GitLab CI Advanced pipeline patterns Install the Mélodium MCP ServerGenerate with AI