Coding agents

Using .em.hcl with coding agents

A coding agent can draft .em.hcl, run the validator, fix diagnostics, and render the result.

That makes a useful little feedback loop.

Works today

1. Draft

Describe the Events, actors, ownership, and workflow.

2. Validate

Run eventmodeling-hcl validate.

3. Fix

Use the source position and EMxxx diagnostic.

4. Diagram

Render the model and review its causal shape.

5. Review

A person checks whether it describes the business.

Validation has limits. It catches language and model-structure errors. It does not tell you whether the business model is correct.

Possible next step

Feed one validated workflow to a coding agent as structured context for implementing that slice.

The CLI does not generate an application. The implementation still needs engineering decisions, tests, and review.

Prompt examples

  • Draft a model Here are the business Events for {domain}: {list}. Draft a valid .em.hcl model. Choose a workflow pattern for each slice and add scenarios.
  • Fix a validator error eventmodeling-hcl validate produced this diagnostic: {diagnostic}. Fix the model without changing the intended business behavior.
  • Implement one workflow Here is one validated .em.hcl workflow: {workflow}. Implement its {command handler / projection / endpoint} in {language}. State any assumptions.

Try the loop

Start with a small model and keep a person in the review step.