This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


The following commit(s) were added to refs/heads/main by this push:
     new c814873b7e Improve AI agent code formatting rules
c814873b7e is described below

commit c814873b7e5941c4c97ed85c9aee4877d7964fdd
Author: James Netherton <[email protected]>
AuthorDate: Thu Aug 13 13:54:29 2026 +0100

    Improve AI agent code formatting rules
---
 AGENTS.md | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/AGENTS.md b/AGENTS.md
index 08047c5f1c..2de131dece 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -26,7 +26,7 @@ Apache Camel Quarkus provides Quarkus extensions for Apache 
Camel components, en
 - Do NOT directly modify generated files under `docs/modules` or 
`src/main/generated` as they are automatically updated by maven
 - Do NOT use dynamic class loading or reflection (impacts native compilation)
 - Do NOT introduce Spring Boot or Spring unless explicitly required
-- Do NOT commit changes without running `./mvnw process-resources -Pformat` 
first
+- Do NOT run `./mvnw process-resources -Pformat -T1C` speculatively — it is 
needed only for certain changes, and only immediately before committing (see 
"Code Formatting")
 
 ## Technology Stack
 - Java 17+
@@ -66,7 +66,7 @@ examples/            # Example projects (separate repo: 
camel-quarkus-examples)
 ./mvnw clean install                           # full build with JVM tests
 ./mvnw clean install -pl integration-tests/kafka -Dnative  # native tests for 
a specific module (only for integration-tests/ or integration-test-groups/ 
modules)
 ./mvnw clean install -pl extensions/kafka -am  # single extension
-./mvnw process-resources -Pformat              # format code & update metadata
+./mvnw process-resources -Pformat -T1C         # format code & update metadata 
(commit-time only, see "Code Formatting")
 ```
 
 **Tip:** Use `mvnd` (Maven Daemon) for faster builds. Use `-T1C` for parallel 
builds (1 thread per CPU core).
@@ -80,6 +80,18 @@ examples/            # Example projects (separate repo: 
camel-quarkus-examples)
 ./mvnw test -pl integration-tests/kafka  # specific module
 ```
 
+## Code Formatting
+
+`./mvnw process-resources -Pformat -T1C` — run it once, immediately before 
committing, and only when the change actually needs it. For many changes it is 
a no-op. Never run it after individual edits.
+
+**Run** when you added files (license headers) or edited a `pom.xml` 
containing a `mvn process-resources` comment reference (for sorting or virtual 
dependencies).
+
+**Skip** for Java-only or docs-only edits: the default build already formats 
Java and sorts imports at `process-sources` (unless `-Dquickly`).
+
+To regenerate one extension's docs on its own: `./mvnw -pl 
extensions/kafka/deployment process-classes`.
+
+It rewrites files in place, so run it **before `git add`**, or re-stage after. 
Always run it from the project root and pass `-T1C`.
+
 ## Extension Structure
 ```
 extensions/kafka/
@@ -170,8 +182,9 @@ After making changes, run the following from the project 
root to sync and regene
 ```
 
 ### 6. Format & style
+Deferred to commit time — do not run this after each edit. See "Code 
Formatting".
 ```bash
-./mvnw process-resources -Pformat
+./mvnw process-resources -Pformat -T1C
 ```
 
 ## Integration Tests

Reply via email to