Skip to main content
Version: Next

AI-assisted authoring

An AI assistant can write, check and review a Kanoniq model with you. Kanoniq puts its rules in a file in your repository for the assistant to read, checks every change the assistant makes, and publishes this documentation in forms an assistant reads. What an assistant writes is a draft for you to review: see the AI Disclaimer.

Working with an assistant​

  1. Give it the brief. A repository kq init makes holds AGENTS.md, the authoring brief, which tells an assistant how to write the model: model only what runs, state everything and ask where a choice could go two ways, never write an Id or the .g.kq file, and validate a change before proposing it. CLAUDE.md and .github/copilot-instructions.md point Claude Code and GitHub Copilot at it.
  2. Ask for a task in plain words: a draft from a description, the construct for a situation, a review of what is there. Prompt recipes has a prompt for each.
  3. Let it run the validate loop below on every change.
  4. Review the change as you would a colleague's, then commit the .kq files and the .g.kq file kq build writes.

Your first model with an AI assistant takes you through it once.

The validate loop​

The brief has an assistant check each change with kq validate before it shows the change to you:

  1. It changes the .kq files under model/.
  2. It runs kq validate --format sarif . at the repository's root, which writes one SARIF log on standard output: each finding with its rule code, its message and the file and line it is on, and each rule linking its page in this documentation, which says how to fix it.
  3. It fixes what the log reports and runs it again, until the model is clean or only questions for you remain, which it asks.
  4. It runs kq build ., which writes model/<name>.g.kq with every element's Id.

SARIF output is free, like every format of kq validate, so an assistant needs no license to read the findings. See SARIF in code scanning.

In this section​

© 2026 Extenza Works. All rights reserved.