.agents/skills/guides/references/guide-authoring-conventions.md
Micronaut Guides are generated tutorials. A single guide source can render several language and build-tool variants, so write source-backed content and avoid hard-coded generated paths where guide macros can do the work.
A regular guide normally lives at:
guides/<slug>/
|-- metadata.json
|-- <slug>.adoc
|-- java/
|-- groovy/
|-- kotlin/
`-- src/main/resources/
Use one root AsciiDoc file named <slug>.adoc unless metadata.json sets asciidoctor.
For a single generated application, metadata should use an app named default. For multi-application guides, create a directory per app name and place each language tree inside that app directory:
guides/<slug>/<app-name>/java/src/main/java/example/micronaut/...
guides/<slug>/<app-name>/kotlin/src/main/kotlin/example/micronaut/...
guides/<slug>/<app-name>/groovy/src/main/groovy/example/micronaut/...
Current upstream metadata is modeled by buildSrc/src/main/java/io/micronaut/guides/core/Guide.java and the generated schema at buildSrc/src/main/resources/guide-metadata.schema.json.
Required fields:
titleintroauthorscategoriespublicationDate in YYYY-MM-DDappsCommon optional fields:
minimumJavaVersionmaximumJavaVersioncloudskipGradleTestsskipMavenTestsasciidoctorlanguagestagsbuildToolstestFrameworkzipIncludesslugpublishbaseenvUse category labels from Category.java. At the inspected upstream revision, labels included Getting Started, Core Basics, Validation, Development, Testing, MCP, Object Storage, Email, Messaging, Logging, Scheduling, Cache, Patterns, i18n, Database Modeling, Data JDBC, Data JPA, Schema Migration, Data R2DBC, MongoDB, Data Access, Micronaut Security, Authorization Code, Client Credentials, Secrets Manager, HTTP Server, HTTP Client, Beyond JSON, JAX-RS, WebSockets, GraphQL, OpenAPI, JSON Schema, Distributed Tracing, Service Discovery, Distributed Configuration, Metrics, Distribution, Registry, GraalVM, Coordinated Restore at Checkpoint, Kubernetes, Serverless, AWS Lambda, Scale to Zero Containers, Views, Turbo, Static Resources, Kotlin, GraalPy, Spring Boot, and Boot to Micronaut Building a REST API. Refresh this list from current upstream before choosing a category.
Guide apps features must be valid Micronaut Starter features. If a feature is not available from Starter, inspect existing custom features in buildSrc/src/main/java/io/micronaut/guides/feature and dependency versions in buildSrc/src/main/resources/pom.xml. Add custom features only when the guide topic requires them and validation covers the change.
Example single-app metadata shape:
{
"title": "Micronaut HTTP Client",
"intro": "Learn how to use Micronaut HTTP Client.",
"authors": ["Sergio del Amo"],
"categories": ["HTTP Client"],
"publicationDate": "2026-05-06",
"apps": [
{
"name": "default",
"features": ["http-client"]
}
]
}
Guide source can use placeholders expanded by the build:
@language@@guideTitle@@guideIntro@@micronaut@@lang@@build@@testFramework@@authors@@languageextension@@testsuffix@@sourceDir@@minJdk@@api@@features@@features-words@Reusable snippets live under src/docs/common. Prefer existing snippets for headers, requirements, complete-solution, app creation, test, run, GraalVM, and next-step sections.
Common guide macros include:
common:<file>[]: include a common snippet.source:<ClassName>[]: include a source file from the current language's main source directory.resource:<file>[]: include a resource from src/main/resources.test:<ClassName>[]: include a test file and account for JUnit, Kotest, or Spock naming.testResource:<file>[]: include a test resource.callout:<name>[]: include a common callout snippet.external:<path>[]: include content from a base or external guide.dependency:<artifact>[groupId=...,scope=...,version=...]: render dependency lines.guideLink:<slug>[...]: link to another guide using guide-site paths.Most macros accept options such as tags, lines, indent, and app. Inspect nearby guides and buildSrc macro tests before using less common options.
Use custom exclusion blocks when a paragraph or instruction applies only to some render variants:
:exclude-for-languages:kotlin
This text renders for Java and Groovy, not Kotlin.
:exclude-for-languages:
:exclude-for-build:maven
Run `./gradlew run`.
:exclude-for-build:
Also inspect current support for JDK-based exclusions before writing Java-version-specific content.
publish defaults to true. Set publish: false only for draft, base, or partial guides that should not appear as public guide topics.
Use base when a guide extends reusable source or narrative from another guide. Inspect the base guide carefully; it may provide shared app code, common AsciiDoc, or resource files. Do not count publish: false guide directories as public topic coverage during dedupe, but do use them to avoid duplicating shared scaffolding.
example.micronaut unless nearby guides for the topic use another package.