diff --git a/docs/README.skills.md b/docs/README.skills.md index 0d4812b2..2672bc6a 100644 --- a/docs/README.skills.md +++ b/docs/README.skills.md @@ -192,6 +192,7 @@ See [CONTRIBUTING.md](../CONTRIBUTING.md#adding-skills) for guidelines on how to | [java-refactoring-remove-parameter](../skills/java-refactoring-remove-parameter/SKILL.md) | Refactoring using Remove Parameter in Java Language | None | | [java-springboot](../skills/java-springboot/SKILL.md) | Get best practices for developing applications with Spring Boot. | None | | [javascript-typescript-jest](../skills/javascript-typescript-jest/SKILL.md) | Best practices for writing JavaScript/TypeScript tests using Jest, including mocking strategies, test structure, and common patterns. | None | +| [javax-to-jakarta-migration](../skills/javax-to-jakarta-migration/SKILL.md) | Migrate Java code from javax.* to jakarta.* namespace. Use when upgrading to Tomcat 11, Jakarta EE 10, or when javax imports are detected in the codebase. | None | | [kotlin-mcp-server-generator](../skills/kotlin-mcp-server-generator/SKILL.md) | Generate a complete Kotlin MCP server project with proper structure, dependencies, and implementation using the official io.modelcontextprotocol:kotlin-sdk library. | None | | [kotlin-springboot](../skills/kotlin-springboot/SKILL.md) | Get best practices for developing applications with Spring Boot and Kotlin. | None | | [legacy-circuit-mockups](../skills/legacy-circuit-mockups/SKILL.md) | Generate breadboard circuit mockups and visual diagrams using HTML5 Canvas drawing techniques. Use when asked to create circuit layouts, visualize electronic component placements, draw breadboard diagrams, mockup 6502 builds, generate retro computer schematics, or design vintage electronics projects. Supports 555 timers, W65C02S microprocessors, 28C256 EEPROMs, W65C22 VIA chips, 7400-series logic gates, LEDs, resistors, capacitors, switches, buttons, crystals, and wires. | `references/28256-eeprom.md`
`references/555.md`
`references/6502.md`
`references/6522.md`
`references/6C62256.md`
`references/7400-series.md`
`references/assembly-compiler.md`
`references/assembly-language.md`
`references/basic-electronic-components.md`
`references/breadboard.md`
`references/common-breadboard-components.md`
`references/connecting-electronic-components.md`
`references/emulator-28256-eeprom.md`
`references/emulator-6502.md`
`references/emulator-6522.md`
`references/emulator-6C62256.md`
`references/emulator-lcd.md`
`references/lcd.md`
`references/minipro.md`
`references/t48eeprom-programmer.md` | diff --git a/skills/javax-to-jakarta-migration/SKILL.md b/skills/javax-to-jakarta-migration/SKILL.md new file mode 100644 index 00000000..549bb866 --- /dev/null +++ b/skills/javax-to-jakarta-migration/SKILL.md @@ -0,0 +1,69 @@ +--- +name: javax-to-jakarta-migration +description: "Migrate Java code from javax.* to jakarta.* namespace. Use when upgrading to Tomcat 11, Jakarta EE 10, or when javax imports are detected in the codebase." +argument-hint: "File, package, or module to migrate" +--- + +# javax → jakarta Migration Skill + +## When to Use +- Upgrading to Tomcat 11 / Jakarta EE 10+ +- Code review detects `javax.*` imports +- Migrating an existing project to the jakarta namespace + +## Procedure + +### Step 1 — Scan for javax Usage +Search the codebase for all `javax.*` imports that need migration: +``` +javax.servlet.* → jakarta.servlet.* +javax.persistence.* → jakarta.persistence.* +javax.validation.* → jakarta.validation.* +javax.annotation.* → jakarta.annotation.* +javax.inject.* → jakarta.inject.* +javax.enterprise.* → jakarta.enterprise.* +javax.faces.* → jakarta.faces.* +javax.ws.rs.* → jakarta.ws.rs.* +javax.el.* → jakarta.el.* +javax.json.* → jakarta.json.* +javax.mail.* → jakarta.mail.* +javax.websocket.* → jakarta.websocket.* +``` + +**Do NOT migrate** these (they remain in `javax.*`): +- `javax.sql.*` — part of JDK +- `javax.naming.*` — part of JDK (JNDI) +- `javax.crypto.*` — part of JDK +- `javax.net.*` — part of JDK +- `javax.security.auth.*` — part of JDK +- `javax.swing.*`, `javax.xml.parsers.*` — JDK packages + +### Step 2 — Update pom.xml +Replace dependency coordinates: + +| Old | New | +|-----|-----| +| `javax.servlet:javax.servlet-api` | `jakarta.servlet:jakarta.servlet-api:6.0.0` | +| `javax.persistence:javax.persistence-api` | `jakarta.persistence:jakarta.persistence-api:3.1.0` | +| `javax.validation:validation-api` | `jakarta.validation:jakarta.validation-api:3.0.2` | +| `javax.annotation:javax.annotation-api` | `jakarta.annotation:jakarta.annotation-api:2.1.1` | + +### Step 3 — Update web.xml (if present) +```xml + + + + + +``` + +### Step 4 — Update Java Source Files +Replace all `javax.` imports with `jakarta.` equivalents in `.java` files. + +### Step 5 — Verify +1. Run `mvn clean compile` or `gradlew build` — fix any compilation errors +2. Run `mvn test` or `gradlew test` — ensure all tests pass +3. Search for any remaining `javax.*` imports (excluding JDK packages) + +### Output +Provide a migration summary listing all files changed, imports replaced, and any manual steps required.