klok-gradle-plugin

Overview

The Klok Gradle plugin makes every project on the platform build itself the same way. An integration, a datamodel, an application or the framework apply it, fill in a handful of klok { } properties and get the rest: a timestamped version, the repositories and dependency bundles for their project type, publishing and release, and the facts the documentation and portal read out of the build. A project's own build script therefore holds its dependencies and nothing about the platform, and a change to how Klok builds reaches every project as a plugin release through the dependency catalog instead of a mass edit of build scripts.

Two mechanisms keep versions aligned. The release pipelines write published versions into the platform dependency catalog and, for a tenant's own datamodels and libraries, into that tenant's private catalog, and the task updateKlokLibsToml copies both into the project, so nobody pins a Klok version by hand. The plugin itself lives in that catalog and reads it the same way, using a released copy of its own task to refresh its dependencies.

The other half of the plugin is what it learns at build time. It scans the Java sources to write a documentation payload (routes, the datamodels they bind, their broker topics), lists every topic a service needs and checks it against the broker's state in Git, verifies route ids against the tenant's solution registry, and installs the platform and tenant instructions and skills for AI coding agents. A datamodel additionally gets Python and TypeScript packages from the schema its Java classes register on the broker, and no build of one is released before a compatibility check has compared it against every earlier release of the same major version.

Where this documentation comes from

This site is written by KlokDocumentationEgress from the project's code, its hand written klok-docs/ folder and the tenant's documentation generation settings, on every main pipeline of klok/framework/klok-gradle-plugin. Nobody edits it by hand.

To change Edit
Hand written pages, their order, and where a generated section appears in them klok-docs/ in klok/framework/klok-gradle-plugin
What is generated and how: chapters, sections, prompts, languages, model klok.dev, Tenant Administration, Documentation generation