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. This page covers two approaches: starting from nothing, and adapting the official CI/CD template. From Scratch Use this approach 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 should run and in what order. What container image each step needs. Whether steps can run in parallel. Whether any step produces an artifact that 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: Dependencies: Compo.toml should declare std, cicd, process, and work at minimum. Resource sizes: cpu, memory, and storage in simpleStep have defaults that may not match your workload — adjust them. Step ordering: verify the -> wiring reflects the order and parallelism you described. Entrypoint: a main treatment should be declared as an entrypoint in Compo.toml. 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. 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 approach when you want to start from a working scaffold and have the AI adapt it to your project, rather than 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 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. Key things to verify: Step sequence: confirm the -> wiring matches the order you described. Parallel steps: steps that share the same trigger source run concurrently — check this is intentional. Artifact flow: if one step uses out_file and the next uses in_file, verify the file names match. Resource sizing: the template uses small defaults (cpu=100, memory=500) — adjust for your workload. Container images: check that the images match what your project needs. 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: “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 SkillGenerate with AI