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

afs pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git

commit 722dc3fbeca87b152fb483c5bc7351a03d98afbc
Author: Andy Seaborne <[email protected]>
AuthorDate: Mon Sep 7 16:57:02 2026 +0100

    .claude coding conventions
---
 .../coding-conventions/java-coding-conventions.md  | 61 +++++++++++++++++++++
 .../coding-conventions/source-code-conventions.md  | 64 ++++++++++++++++++++++
 .../xml-formatting-conventions.md                  | 13 +++++
 3 files changed, 138 insertions(+)

diff --git a/.claude/skills/coding-conventions/java-coding-conventions.md 
b/.claude/skills/coding-conventions/java-coding-conventions.md
new file mode 100644
index 0000000000..78604c0483
--- /dev/null
+++ b/.claude/skills/coding-conventions/java-coding-conventions.md
@@ -0,0 +1,61 @@
+---
+name: java-coding-conventions
+description: House style for writing and reviewing Java and XML code in this 
repository. Use this skill whenever you are writing new Java code, editing 
existing Java files, generating code samples in Java, reviewing or refactoring 
Java code, or touching XML files (pom.xml, etc.) in this repo. Enforces brace 
style, indentation, and Javadoc conventions specific to this codebase — apply 
automatically, don't wait for the user to ask about "style" or "conventions" 
explicitly.
+---
+
+# Java Coding Conventions
+
+House style for this repository. Apply these rules by default to every Java 
and XML file you write or edit here, without being asked each time.
+
+## Java rules
+
+### Indentation
+- **4 spaces per indent level.** No tabs, anywhere, ever.
+- Continuation lines (wrapped method args, chained calls, long expressions) 
indent by an extra 8 spaces (two levels) from the start of the statement, to 
visually distinguish them from a new block.
+
+### Braces — K&R "Egyptian brackets"
+- The opening brace `{` stays on the **same line** as the 
declaration/statement, preceded by a single space.
+- The closing brace `}` starts a new line, aligned with the start of the 
opening statement.
+- `else`, `catch`, `finally` go on the **same line** as the preceding closing 
brace.
+- Braces are **not required** for single-line, single statement ones.
+- Braces are **required** for multi-line code blocks.
+ 
+```java
+public class OrderService {
+
+    public int computeTotal(List<Item> items) {
+        int total = 0;
+        for (Item item : items) {
+            if (item.isTaxable()) {
+                total += item.getPriceWithTax();
+            } else {
+                total += item.getPrice();
+            }
+        }
+        return total;
+    }
+
+    public void process() {
+        try {
+            doWork();
+        } catch (IOException e) {
+            log.error("Failed to process", e);
+        } finally {
+            cleanup();
+        }
+    }
+}
+```
+
+### Javadoc / comments
+- **No `@author` tags**, in any file, ever — not on new files, not when 
editing old ones. If you encounter an existing `@author` tag while editing a 
file for another reason, leave it unless the user asks you to clean it up 
(don't do drive-by removals that bloat an unrelated diff).
+- Javadoc is otherwise written normally: `/** ... */` blocks above public 
classes/methods, `@param`, `@return`, `@throws` as appropriate.
+
+### Other conventions (standard "common Java style" — flag deviations if you 
see them)
+- One top-level public class per file, filename matches the class name.
+- `UpperCamelCase` for classes/interfaces/enums, `lowerCamelCase` for 
methods/fields/variables, `UPPER_SNAKE_CASE` for constants.
+- Opening brace of a class/method body counts as level 0; the first statement 
inside is indented one level (4 spaces) from the class/method declaration.
+- Import order: standard groups (java.*, javax.*, third-party, then project 
packages), alphabetized within each group, with a blank line between groups.
+- Imports: Use wildcard imports for packages with 5 or more class imports.
+- Imports: Use wildcard static imports for 5 or more imports.
+- Line length: wrap around 80–100 columns rather than let lines run on 
indefinitely
diff --git a/.claude/skills/coding-conventions/source-code-conventions.md 
b/.claude/skills/coding-conventions/source-code-conventions.md
new file mode 100644
index 0000000000..a3347812a4
--- /dev/null
+++ b/.claude/skills/coding-conventions/source-code-conventions.md
@@ -0,0 +1,64 @@
+---
+name: source-code-conventions
+description: House style for writing and reviewing XML code in this repository.
+---
+
+## Source Code Conventions
+
+- Java must have a license header at the top of the file, followed by one 
blank line
+
+```java
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *   SPDX-License-Identifier: Apache-2.0
+ */
+```
+
+- XML file must have a license header starting at the second line of the file
+and followed by one blank line
+
+```xml
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     https://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+    
+     SPDX-License-Identifier: Apache-2.0
+-->
+```
+
+- Shell Bash scripts should have a license header after the `#!` line and
+followed by a blank line.
+
+```
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+```
diff --git a/.claude/skills/coding-conventions/xml-formatting-conventions.md 
b/.claude/skills/coding-conventions/xml-formatting-conventions.md
new file mode 100644
index 0000000000..0c039a4077
--- /dev/null
+++ b/.claude/skills/coding-conventions/xml-formatting-conventions.md
@@ -0,0 +1,13 @@
+---
+name: xml-formatting-conventions
+description: House style for writing and reviewing XML code in this repository.
+---
+
+## XML Formatting Conventions
+
+- **2 spaces per indent level.** No tabs.
+- One attribute per line only when a tag has many attributes and would 
otherwise run long; short tags keep attributes inline.
+- Self-closing tags (`<element .../>`) for elements with no children/content.
+- Closing tags aligned with the indentation level of their opening tag.
+
+(Note: keep XML indentation at 2 spaces even though Java in the same repo uses 
4 — they're intentionally different.)

Reply via email to