Hamburger Cross Icon
Mix Project Exists
+
Elixir Collector

Mix Project Exists + Elixir Collector

Guardrail Collector Beta Devex Build And Ci

Enforce Mix Project Exists using data collected by Elixir Collector. Automatically check devex build and ci standards on every PR.

Guardrail: Ensures the project has a mix.exs file. Required for all Elixir projects managed with Mix.
Data Source: Analyze Elixir/Mix projects to collect project metadata, Hex dependencies, CI/CD command tracking, and test coverage. Detects Phoenix, LiveView, and Ecto frameworks, and handles umbrella projects by walking `apps/*/mix.exs`.

How Elixir Collector Powers This Guardrail

The Elixir Collector gathers metadata from your languages, build systems. This data flows into Lunar's Component JSON, where the Mix Project Exists guardrail evaluates it against your standards.

When enabled, this check runs automatically on every PR and in AI coding workflows, providing real-time enforcement with actionable feedback.

1
Elixir Collector Gathers Data Collector
Extracts metadata from code, configs, and tool outputs
2
{ } Component JSON
Data centralized in structured format for evaluation
3
Mix Project Exists Checks Guardrail
Pass/fail result with actionable feedback in PRs

Quick Start Configuration

Add both the collector and policy to your lunar-config.yml to enable this guardrail.

📄 lunar-config.yml
# Step 1: Enable the Elixir Collector
collectors:
  - uses: github://earthly/lunar-lib/collectors/elixir@v1.0.5
    # with: ...

# Step 2: Enable the Elixir Project Guardrails
policies:
  - uses: github://earthly/lunar-lib/policies/elixir@v1.0.5
    include: [mix-project-exists]
    # with: ...

What Elixir Collector Collects

This collector gathers the following data that the Mix Project Exists guardrail evaluates.

Collector code

project

Analyzes Elixir project structure by detecting mix.exs, mix.lock, .credo.exs, .formatter.exs, dialyzer config, and test directory. Parses project name/version, Elixir version requirement, OTP apps, umbrella members, and framework usage (Phoenix, LiveView, Ecto). Writes project metadata to .lang.elixir.

Collector code

dependencies

Extracts direct dependencies from mix.exs and resolved transitive versions from mix.lock when present. Captures Hex package name and version for each dependency. Writes dependency data to .lang.elixir.dependencies.

Collector ci-before-command

cicd

Records every mix command executed in CI pipelines along with the Elixir runtime version. Writes command strings and version info to .lang.elixir.cicd for audit trails and build reproducibility analysis.

Collector ci-after-command

test-coverage

Extracts coverage percentage from excoveralls or mix test --cover output after tests complete. Parses coverage reports and writes results to .lang.elixir.tests.coverage.

Example Data Flow

Here's an example of the data that Elixir Collector writes to the Component JSON, which Mix Project Exists then evaluates.

{ } component.json From Elixir Collector
{
  "lang": {
    "elixir": {
      "version": "1.16.2",
      "otp_version": "26",
      "build_systems": ["mix"],
      "mix_exs_exists": true,
      "mix_lock_exists": true,
      "project_name": "my_app",
      "project_version": "0.1.0",
      "elixir_requirement": "~> 1.15",
      "otp_apps": ["my_app"],
      "test_directory_exists": true,
      "credo_configured": true,
      "dialyzer_configured": true,
      "formatter_configured": true,
      "frameworks": ["phoenix", "phoenix_live_view", "ecto"],
      "umbrella": {
        "is_umbrella": true,
        "apps": ["my_app_web", "my_app_core"]
      },
      "source": { "tool": "mix", "integration": "code" },
      "cicd": {
        "cmds": [
          { "cmd": "mix test --cover", "version": "1.16.2" },
          { "cmd": "mix deps.get", "version": "1.16.2" }
        ]
      },
      "tests": {
        "coverage": {
          "percentage": 85.0,
          "source": { "tool": "excoveralls", "integration": "ci" }
        }
      },
      "dependencies": {
        "direct": [
          { "path": "phoenix", "version": "~> 1.7" },
          { "path": "phoenix_live_view", "version": "~> 0.20" },
          { "path": "ecto_sql", "version": "~> 3.10" }
        ],
        "transitive": [
          { "path": "telemetry", "version": "1.2.1" }
        ],
        "source": { "tool": "hex", "integration": "code" }
      }
    }
  },
  "testing": {
    "coverage": {
      "percentage": 85.0,
      "source": { "tool": "excoveralls", "integration": "ci" }
    }
  }
}

Configuration Options

Elixir Project Guardrails Inputs

Input Required Default Description

Ready to Automate Your Standards?

See how Lunar can turn your AGENTS.md, engineering wiki, compliance docs, or postmortem action items into automated guardrails with our 200+ built-in guardrails.

Works with any process
check AI agent rules & prompt files
check Post-mortem action items
check Security & compliance policies
check Testing & quality requirements
Automate Now
Paste your AGENTS.md or manual process doc and get guardrails in minutes
Book a Demo