Contents

Spec Driven Development with Dart and Claude

The article showcases how this app was built from this Event model, that was created using the Claude Event Modeling plugin.

Why?

I have vibe-slopped the plugin. It was time to put it to action to show people what is possible to do in one evening.

How?

Creating a Jira story

First I needed a domain, which I have created using this Prompt in ChatGPT:

Describe me https://calendly.com/ in the format of a Jira Epic, the 20% of calendly.com that is 80% (the core) of the product; Describe it in a way a Product Manager that wants to implement the same tool (say for internal corporate use) would describe it as.

Which has resulted in the following “Jira” Epic:

Employees spend unnecessary time coordinating meetings through email, messaging platforms, and manual calendar checks. Scheduling a simple meeting often requires several interactions to identify a mutually convenient time, confirm availability, create a calendar invitation, and communicate subsequent changes.

We want employees to schedule meetings with colleagues without requiring manual coordination.

Full one can be read here.

Creating the model in Claude

Time to work with Claude, here are the prompts:

1
Using eventmodeling skills, create me a .em.hcl spec and a .html diagram for the product below: [jira-epic](./jira-epic.md)

The model was created, there were hotspots;

Claude responded with:

The spec and the emhcl-generated diagram are in the project folder. The model passes validate but not strict, because 13 business questions are still open. The diagram renders over localhost; it was blank in the app’s file preview.

Do you want to resolve the 13 open questions now?

My response:

1
Yes, go through them

After answering all questions, the following event model was created, view the spec here and the diagram here.

Project setup

Then I have setup the project with Dart and Jaspr:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
$ jaspr create em_calendly_example
Select a rendering mode: server: Build a server-rendered site.
Setup routing for different pages of your site? (Y/n) Yes
(Recommended) Use multi-page (server-side) routing? Choosing [no] sets up a single-page application with client-side routing instead. (Y/n) No
Setup Flutter web embedding? (y/N) No
Enable support for using Flutter web plugins in your project? (y/N) No
Use a custom backend package or framework for the server part of your project? (y/N) No
✓ Generated 28 file(s) (0.2s)
✓ [CLI]  (3.9s)

Created project em_calendly_example! In order to get started, run the following commands:
cd em_calendly_example
jaspr serve

Then I have installed jaspr skills and dart event model to code skills.

1
jaspr install-skills --agent general

Building the app

Then I gave this prompt to Opus 5.5 in omp and went to take a shower, then went to bed:

1
2
3
4
Using fmodel library, https://github.com/fraktalio/fstore-sql, supabase and jaspr turn /home/darcy/development/active/open_source/em-calendly-example/docs/internal-meeting-scheduler.em.hcl event model into a working code;
  First do a general commit for LICENSE (Apache 2.0), Makefile with `make gate` that runs code checks and tests and other relevant to dart jaspr project things; then create an app "framework", such that every "slice" that is
  then written from an event model, just "plugs" the slice into the app; then delegate to Haiku 5.5 the actual writing of each slice: a Haiku agent shall create one slice, commit it, ensure make gate passes and stop existing;
  then another new, fresh Haiku 5.5 agent implements the next slice; ask me any questions that you need answers for while working.

Opus 5.5 did ask some questions, here are the answers:

  1. Calendar: “Use https://pub.dev/packages/googleapis and have a Mock that works without a GCP project and key, if possible: so if a person supplies the gcp credentials and stuff in the environment -> real integration can…”
  2. SSO: Supabase Auth email+password (Recommended)
  3. Email: SMTP (local Supabase Mailpit) (Recommended)
  4. Read models: Materialized via fstore-sql streaming

And then?

Then I went to bed, woke up in the morning to a working project:

Working meeting scheduler app

Get the source code here, run it with:

1
2
make db-up    # starts Supabase and applies supabase/migrations
make serve    # http://localhost:8080

It has vertical slices, so event model slices are 1 to 1 mapped to the code:

Event model slices mapped one-to-one to code slices


Hope it was interesting and it helps you create apps with Event Modeling.

Resources: