The .haiku file format
Filename rules, frontmatter fields, and body conventions for every Haiku spec.
A .haiku file is plain text with YAML frontmatter at the top and the test
steps in plain English below. The filename — not the frontmatter — chooses
the target.
Filename rules
Every spec must use the <base>.<platform>.haiku pattern:
Plain .haiku files (with no platform extension) are rejected by the CLI:
Recognised extensions:
| Extension | Target |
|---|---|
.ios.haiku | iOS Simulator |
.macos.haiku | macOS (coming) |
.web.haiku | Web (coming) |
.android.haiku | Android (coming) |
.py.haiku | Python |
.rs.haiku | Rust |
.go.haiku | Go (experimental) |
.ts.haiku / .tsx.haiku | TypeScript (experimental) |
.java.haiku | Java (experimental) |
.rb.haiku | Ruby (experimental) |
Frontmatter
YAML between --- delimiters at the top of the file.
| Field | Required | Notes |
|---|---|---|
intent | yes | One-line description of what this test proves |
tags | no | Free-form list — useful for grouping in CI |
critical | no | When true, signals that a failure should block a deploy |
verify | no | iOS-specific final-assertion natural-language string |
target | depends | Required for .ios.haiku (bundle_id, device) |
sources | no | Backend specs only — ordered list of source files the test exercises, most-called first |
target.module | no | Backend specs only — dotted module path (e.g. services.user_service) |
target.context | no | Backend specs only — extra module paths to feed the compiler |
iOS frontmatter
bundle_idmust be reverse-DNS (e.g.com.apple.Maps).devicemust be an installed simulator name. Runxcrun simctl list devices availableto see yours.
Backend frontmatter
Backend specs don't need a target.platform field — the filename carries
that. Use sources: to tell Haiku which files the test exercises, in
most-called-first order.
Body
Steps live below the closing ---. One step per line, plain English. Blank
lines and lines starting with # are ignored.
There's no fixed verb list — Haiku's compiler infers intent from context. See the Actions reference for examples of UI-side phrasings that work today.
Legacy: target.platform
Older specs included target.platform in the frontmatter (e.g. platform: ios_simulator). The field is still accepted for backward compatibility but is
no longer required — the filename's extension is the canonical signal. New
specs should omit it.