From bd6406b2476e7b04e849e231b7c486f657ba0c5d Mon Sep 17 00:00:00 2001 From: Mattie Fu Date: Thu, 18 Jun 2026 11:06:43 -0400 Subject: [PATCH 1/3] chore: add skill for basic development guidance --- .../skills/java-bigtable-development/SKILL.md | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 java-bigtable/.agents/skills/java-bigtable-development/SKILL.md diff --git a/java-bigtable/.agents/skills/java-bigtable-development/SKILL.md b/java-bigtable/.agents/skills/java-bigtable-development/SKILL.md new file mode 100644 index 000000000000..7222cf6cdedf --- /dev/null +++ b/java-bigtable/.agents/skills/java-bigtable-development/SKILL.md @@ -0,0 +1,31 @@ +--- +name: java-bigtable-development +description: Mandatory guidelines and actions for developing code within the java-bigtable directory. This skill ensures code quality, proper formatting, and testing conventions. +--- + +# Java Bigtable Development Guidelines + +When developing or modifying code within the `java-bigtable` directory, you must strictly follow these rules and perform these actions: + +## 1. Clean Up Imports +- After writing or updating code, **always** check that imports are properly cleaned up. +- Avoid using fully qualified class names (e.g., `x.y.z.Class`) directly inline in the code. +- Ensure all required classes are imported in the header of the Java file. +- Remove any unused imports. + +## 2. Code Formatting +- Automatically format the code using the `fmt-maven-plugin`. +- Before finalizing your changes, run the following command in the terminal from the `java-bigtable` directory or the relevant module directory: + ```bash + mvn com.spotify.fmt:fmt-maven-plugin:format + ``` +- **Troubleshooting**: If the formatting command fails, it is usually because of an incompatible JDK version. Ensure you are running it in an environment with the correct JDK version for the project (typically Java 11+ or 17+, depending on the project configuration). + +## 3. Unit Testing +- **Always write unit tests** for any new logic or modifications you implement. +- Follow **JUnit 5** conventions for writing and structuring tests (e.g., using `@Test`, `@BeforeEach`, etc., from `org.junit.jupiter.api`). +- Do not use JUnit 4 unless modifying an existing file that hasn't been migrated yet, but for new tests default to JUnit 5. + +## 4. Source Control +- **Always** pull the latest changes from the `main` branch of `git@github.com:googleapis/google-cloud-java.git` before starting work. +- Checkout a new branch for your development instead of committing directly to `main`. From 7c2fcb9ace3f6a8296a593c910df68fe84e6d061 Mon Sep 17 00:00:00 2001 From: Mattie Fu Date: Thu, 18 Jun 2026 11:15:40 -0400 Subject: [PATCH 2/3] reorder --- .../skills/java-bigtable-development/SKILL.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/java-bigtable/.agents/skills/java-bigtable-development/SKILL.md b/java-bigtable/.agents/skills/java-bigtable-development/SKILL.md index 7222cf6cdedf..386313e0e87b 100644 --- a/java-bigtable/.agents/skills/java-bigtable-development/SKILL.md +++ b/java-bigtable/.agents/skills/java-bigtable-development/SKILL.md @@ -7,25 +7,25 @@ description: Mandatory guidelines and actions for developing code within the jav When developing or modifying code within the `java-bigtable` directory, you must strictly follow these rules and perform these actions: -## 1. Clean Up Imports +## 1. Source Control +- **Always** pull the latest changes from the `main` branch of `git@github.com:googleapis/google-cloud-java.git` before starting work. +- Checkout a new branch for your development instead of committing directly to `main`. + +## 2. Unit Testing +- **Always write unit tests** for any new logic or modifications you implement. +- Follow **JUnit 5** conventions for writing and structuring tests (e.g., using `@Test`, `@BeforeEach`, etc., from `org.junit.jupiter.api`). +- Do not use JUnit 4 unless modifying an existing file that hasn't been migrated yet, but for new tests default to JUnit 5. + +## 3. Clean Up Imports - After writing or updating code, **always** check that imports are properly cleaned up. - Avoid using fully qualified class names (e.g., `x.y.z.Class`) directly inline in the code. - Ensure all required classes are imported in the header of the Java file. - Remove any unused imports. -## 2. Code Formatting +## 4. Code Formatting - Automatically format the code using the `fmt-maven-plugin`. - Before finalizing your changes, run the following command in the terminal from the `java-bigtable` directory or the relevant module directory: ```bash mvn com.spotify.fmt:fmt-maven-plugin:format ``` -- **Troubleshooting**: If the formatting command fails, it is usually because of an incompatible JDK version. Ensure you are running it in an environment with the correct JDK version for the project (typically Java 11+ or 17+, depending on the project configuration). - -## 3. Unit Testing -- **Always write unit tests** for any new logic or modifications you implement. -- Follow **JUnit 5** conventions for writing and structuring tests (e.g., using `@Test`, `@BeforeEach`, etc., from `org.junit.jupiter.api`). -- Do not use JUnit 4 unless modifying an existing file that hasn't been migrated yet, but for new tests default to JUnit 5. - -## 4. Source Control -- **Always** pull the latest changes from the `main` branch of `git@github.com:googleapis/google-cloud-java.git` before starting work. -- Checkout a new branch for your development instead of committing directly to `main`. +- **Troubleshooting**: If the formatting command fails, it is usually because of an incompatible JDK version. Ensure you are running it in an environment with the correct JDK version for the project (typically 17+, depending on the project configuration). From 50913038be6768240018a7efe35843478725a40a Mon Sep 17 00:00:00 2001 From: Mattie Fu Date: Thu, 18 Jun 2026 11:24:41 -0400 Subject: [PATCH 3/3] use agent.md instead --- .../skills/java-bigtable-development/SKILL.md => AGENTS.md} | 5 ----- 1 file changed, 5 deletions(-) rename java-bigtable/{.agents/skills/java-bigtable-development/SKILL.md => AGENTS.md} (88%) diff --git a/java-bigtable/.agents/skills/java-bigtable-development/SKILL.md b/java-bigtable/AGENTS.md similarity index 88% rename from java-bigtable/.agents/skills/java-bigtable-development/SKILL.md rename to java-bigtable/AGENTS.md index 386313e0e87b..ca1830dc9201 100644 --- a/java-bigtable/.agents/skills/java-bigtable-development/SKILL.md +++ b/java-bigtable/AGENTS.md @@ -1,8 +1,3 @@ ---- -name: java-bigtable-development -description: Mandatory guidelines and actions for developing code within the java-bigtable directory. This skill ensures code quality, proper formatting, and testing conventions. ---- - # Java Bigtable Development Guidelines When developing or modifying code within the `java-bigtable` directory, you must strictly follow these rules and perform these actions: