Skip to main content
Version: 0.4.0

Your first model with an AI assistant

Make a repository, describe a small system to an AI assistant, and let it write the model, check it and build it, while you review what it wrote. About fifteen minutes. The same steps by hand are Your first model in VS Code and Your first model from the command line.

1. Install​

Install the kq command line, as Install describes, and an AI assistant that works in a folder and runs commands in it, such as Claude Code or GitHub Copilot in VS Code. In a terminal, check kq runs:

kq --help

It prints an overview of the commands.

2. Make a repository​

Make a repository for a small clinic's booking system, say clinic/:

kq init clinic

Among the files it writes is AGENTS.md, the authoring brief: what an assistant needs to write a Kanoniq model, its rules first. Beside it, CLAUDE.md and .github/copilot-instructions.md point Claude Code and GitHub Copilot at it. Open the clinic/ folder in your assistant: the brief is the first thing it reads there.

3. Describe the system​

Tell the assistant what the system is, in plain words, and what to do with it:

Our clinic has a booking app where patients book appointments, a booking service
behind it with an HTTP API, and a reminder job that calls that API to send
reminders. Model it in model/clinic.kq. Ask me about anything you cannot name.

It writes model/clinic.kq, and where the description leaves a choice open, such as which technology a component runs on, it asks you rather than guessing, as the brief tells it to.

4. Watch it check its work​

Before it shows you the model, the assistant runs kq validate --format sarif ., as the brief tells it to, and fixes what it reports. Suppose its first draft has the reminder job call the booking service itself rather than its API:

reminder-job -> booking-service over http auth client-credentials

The log holds one result, KQ022: a connection lands on an interface or a channel, never on a component. The assistant reads the rule's page, names the interface, and runs kq validate again, until the model is clean.

5. Review the model​

Read what it wrote, as you would a colleague's:

ecosystem clinic "Clinic" { domain appointments "Appointments" { function book-appointment "Book an appointment" function send-reminder "Send a reminder" } platform booking "Booking" { component booking-app "Booking App" : user-facing-app technology "React" { spa booking-ui "Booking" } component booking-service "Booking Service" : backend technology "Java" component reminder-job "Reminder Job" : job technology "Java" booking-app -> booking-service/bookings-api over http auth user-token reminder-job -> booking-service/bookings-api over http auth client-credentials booking-app realizes appointments/book-appointment booking-service realizes appointments/book-appointment reminder-job realizes appointments/send-reminder } }

The domain and its functions say what the clinic does; the platform holds the components that do it, a job being code that runs on a schedule and that nothing calls. Each connection names the interface it calls and the credential it carries, and bookings-api is declared by naming it. Ask the assistant to explain anything you would have written otherwise: the brief has it name every element it relies on by its path, such as clinic/booking/reminder-job.

Drawn, the model is:

The diagram in words

2026-10-30-ai-assistant · Whole model

Boxes

  • Clinic (Ecosystem)
    • Appointments (Domain)
      • Book an appointment (Function)
      • Send a reminder (Function)
    • Booking (Platform)
      • Booking App (User-facing app)
        • Booking (SPA)
      • Booking Service (Backend)
        • bookings-api (HTTP API)
      • Reminder Job (Job)

Lines

  • Booking App → bookings-api: connection, HTTP · user-token
  • Reminder Job → bookings-api: connection, HTTP · client-credentials
  • Booking App → Book an appointment: realization
  • Booking Service → Book an appointment: realization
  • Reminder Job → Send a reminder: realization

6. Build and commit it​

Once you agree with the model, the assistant runs kq build ., or you do. It writes model/clinic.g.kq, which holds every element's Id: neither you nor the assistant ever edits it. Commit every .kq file, model/clinic.g.kq included, with AGENTS.md and its two pointer files.

Next​

© 2026 Extenza Works. All rights reserved.