Skip to main content
IntentLang

Examples

See how intent reads before any code is written.

Each example is a self-contained mission. Read it top to bottom, that is the point, and many now run: decisions evaluate, lifecycles simulate, and in-file tests pass through the deterministic compiler.

The executable parts run for real via @skillstech/intentlang , no AI, no generated code. Try one in the playground. The language is pre-1.0 and can still change.

Example files

Browse the .intent files.

Every example here is compiler-valid (CI gates it). Runnable ones also execute end to end with intent test.

A complete mission

The canonical CreateInvoice mission: a goal, its inputs and outputs, the guarantees that must always hold, forbidden behavior, targets, and how it is verified.

CreateInvoice.intent
1mission CreateInvoice
2
3goal
4 Generate an invoice from approved orders
5
6why
7 Customers need accurate invoices that are auditable and never duplicated.
8
9requires
10 Customer
11 ApprovedOrders
12
13input
14 customer: Customer
15 orders: List<Order>
16 idempotencyKey: IdempotencyKey
17
18output
19 invoice: Invoice
20
21guarantees
22 invoice.total is never negative
23 duplicate invoices are not created
24 every invoice is auditable
25
26never
27 create invoice for unapproved order
28 expose payment token in logs
29
30target
31 TypeScript
32 DotNet
33 OpenAPI
34 Tests
35 Markdown
36 Mermaid
37
38verify
39 unit tests
40 duplicate prevention test
41 audit trail test
42 security scan

Three layers

One mission, three levels of precision.

The same ResetPassword mission, written from beginner-friendly human intent down to compiler-ready executable intent.

Layer 1

Human Intent

Readable and structured. Anyone on the team, or an AI agent, can follow it on first read.

ResetPassword.intent
1mission ResetPassword
2
3goal
4 Let a user securely reset their password
5
6requires
7 verified email
8 reset token
9
10guarantees
11 token expires after 15 minutes
12 token can only be used once
13 password is never logged
Layer 2

Typed Intent

A precise engineering mode with semantic types and explicit constraints.

ResetPassword.intent
1mission ResetPassword
2
3input
4 email: Email
5 token: ResetToken
6 newPassword: Secret
7
8output
9 result: PasswordResetResult
10
11constraints
12 token.ttl <= 15 minutes
13 password.minLength >= 12
14
15never
16 log(newPassword)
17 return token
Layer 3

Executable Intent

Compiler-ready mode that names a target, its implementation choices, and the checks to run.

ResetPassword.intent
1mission ResetPassword
2
3target
4 DotNet
5
6style
7 ASP.NET Core
8 EntityFramework
9 BCrypt
10
11verify
12 test token expiration
13 test one time use
14 test password hash stored
15 test raw password not logged

Beyond a single function

IntentLang for whole systems.

IntentLang is architecture aware. Services, APIs, events, and tests are all first-class, so the meaning of a system lives in one place.

Architecture as code

IntentLang understands services: what they own, consume, and publish, their data store, and who owns them.

Billing.intent
1service BillingService
2
3owns
4 Invoice
5 PaymentAttempt
6
7consumes
8 OrderApproved
9
10publishes
11 InvoiceCreated
12
13database
14 Postgres
15
16owner
17 Finance Platform Team

API intent

Method, path, required permissions, inputs, outputs, and the errors an endpoint can return.

CreateInvoiceApi.intent
1api CreateInvoice
2
3method
4 POST
5
6path
7 /invoices
8
9requires
10 authenticated user
11 permission invoice:create
12
13input
14 CreateInvoiceRequest
15
16output
17 InvoiceResponse
18
19errors
20 400 InvalidOrder
21 401 Unauthorized
22 409 DuplicateInvoice

Event intent

Who publishes an event, who consumes it, its payload, and the guarantees it must uphold.

InvoiceCreated.intent
1event InvoiceCreated
2
3publishedBy
4 BillingService
5
6consumedBy
7 NotificationService
8 ReportingService
9
10payload
11 invoiceId: InvoiceId
12 customerId: CustomerId
13 total: Money
14
15guarantees
16 event is idempotent
17 event contains no payment secrets

Behavior-first tests

Given, When, Then. Tests describe behavior in the same language as the intent they verify.

DuplicateInvoicePrevention.intent
1test DuplicateInvoicePrevention
2
3given
4 approved order already invoiced
5
6when
7 CreateInvoice runs again
8
9then
10 no duplicate invoice is created
11 existing invoice is returned

Want to try writing intent?

The playground is a preview where you can sketch missions today. Execution and compilation are coming later.