diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9bfd5ca..70aa4fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,9 +19,15 @@ jobs: java-version: '21' distribution: 'temurin' cache: maven + server-id: github + server-username: GITHUB_ACTOR + server-password: PACKAGES_READ_TOKEN - name: Build all modules - run: mvn -B clean package -DskipTests + run: mvn -B clean package -DskipTests -P skills-jar + env: + GITHUB_ACTOR: ${{ github.actor }} + PACKAGES_READ_TOKEN: ${{ secrets.PACKAGES_READ_TOKEN }} - name: Check SPI platform parity run: ./check-spi-parity.sh @@ -284,8 +290,11 @@ jobs: distribution: 'temurin' cache: maven server-id: github + server-username: GITHUB_ACTOR + server-password: GITHUB_TOKEN - name: Deploy snapshots to GitHub Packages - run: mvn -B clean package org.apache.maven.plugins:maven-deploy-plugin:3.1.2:deploy -DskipTests -DaltDeploymentRepository=github::https://maven.pkg.github.com/webliteca/teavm-lambda + run: mvn -B clean package org.apache.maven.plugins:maven-deploy-plugin:3.1.2:deploy -DskipTests -P skills-jar -DaltDeploymentRepository=github::https://maven.pkg.github.com/webliteca/teavm-lambda env: + GITHUB_ACTOR: ${{ github.actor }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CLAUDE.md b/CLAUDE.md index 7a70db0..a3ee867 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -150,6 +150,42 @@ Multi-module Maven project: | `jvm-server` | javac → bytecode, maven-shade uber JAR | Single JAR in `target/` | `teavm-lambda-adapter-httpserver` | | `jvm-war` | javac → bytecode, maven-war WAR | WAR file in `target/` | `teavm-lambda-adapter-war` | +## Claude Code Skill + +A Claude Code skill is packaged from `skills/teavm-lambda/` via the `skills-jar` Maven profile. The skill JAR is deployed to GitHub Packages alongside the library artifacts. + +### Building the skill JAR + +```bash +mvn clean package -P skills-jar +# Produces target/teavm-lambda-parent-0.1.0-SNAPSHOT-skills.jar +``` + +The `skills-jar` profile requires GitHub Packages authentication (configured in CI via `PACKAGES_READ_TOKEN`). Builds without the profile skip the plugin entirely. + +### Installing the skill + +```bash +# From source (into another project) +cp -r skills/teavm-lambda /path/to/project/.claude/skills/teavm-lambda + +# From source (user-level, all projects) +cp -r skills/teavm-lambda ~/.claude/skills/teavm-lambda + +# From GitHub Packages JAR +mvn dependency:copy -Dartifact=ca.weblite:teavm-lambda-parent:0.1.0-SNAPSHOT:jar:skills \ + -DoutputDirectory=/tmp/teavm-lambda-skill -Dmdep.stripVersion=true +mkdir -p ~/.claude/skills/teavm-lambda +unzip -o /tmp/teavm-lambda-skill/teavm-lambda-parent-skills.jar -d ~/.claude/skills/teavm-lambda +``` + +### Skill contents + +- `SKILL.md` — main skill definition (quickstart, annotations, API reference, middleware, deployment) +- `references/` — 12 deep-dive docs (API signatures, pom.xml templates, routing, security, database, deployments, gotchas) +- `assets/examples/` — 4 starter projects (minimal-hello, crud-postgres, jwt-protected, cloudrun-deploy) +- `scripts/` — `generate-api-signatures.sh` regenerates `references/api-signatures.md` from source + ## Code Conventions - Standard Maven layout: `src/main/java/` diff --git a/README.md b/README.md index 7878af3..22c9765 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,47 @@ Path traversal is blocked and MIME types are detected from file extensions. | `teavm-lambda-demo` | Demo REST API for AWS Lambda | | `teavm-lambda-demo-cloudrun` | Demo REST API + static web UI for Cloud Run | +## Claude Code Skill + +This project ships a [Claude Code](https://claude.ai/code) skill that teaches Claude how to build, deploy, and debug teavm-lambda applications. It includes API references, pom.xml templates, example projects, and common gotchas. + +### Install from GitHub Packages + +Download and extract the skills JAR into your project or home directory: + +```bash +# Project-level (applies to this project only) +mvn dependency:copy -Dartifact=ca.weblite:teavm-lambda-parent:0.1.0-SNAPSHOT:jar:skills \ + -DoutputDirectory=/tmp/teavm-lambda-skill \ + -Dmdep.stripVersion=true +mkdir -p .claude/skills/teavm-lambda +unzip -o /tmp/teavm-lambda-skill/teavm-lambda-parent-skills.jar -d .claude/skills/teavm-lambda + +# Or user-level (applies to all your projects) +mkdir -p ~/.claude/skills/teavm-lambda +unzip -o /tmp/teavm-lambda-skill/teavm-lambda-parent-skills.jar -d ~/.claude/skills/teavm-lambda +``` + +### Install from source + +If you have the teavm-lambda repo cloned: + +```bash +# Project-level +cp -r /path/to/teavm-lambda/skills/teavm-lambda .claude/skills/teavm-lambda + +# Or user-level +cp -r /path/to/teavm-lambda/skills/teavm-lambda ~/.claude/skills/teavm-lambda +``` + +### What's included + +| Directory | Contents | +|-----------|----------| +| `SKILL.md` | Main skill definition — quickstart, annotations, API reference, middleware, deployment | +| `references/` | 12 deep-dive docs: API signatures, pom.xml templates, routing, security, database, deployments, gotchas | +| `assets/examples/` | 4 starter projects: minimal-hello, crud-postgres, jwt-protected, cloudrun-deploy | + ## Testing ```bash diff --git a/pom.xml b/pom.xml index 35da20f..0156654 100644 --- a/pom.xml +++ b/pom.xml @@ -294,6 +294,37 @@ + + skills-jar + + + github + https://maven.pkg.github.com/webliteca/skills-jar-maven-plugin + + + + + + ca.weblite + skills-jar-plugin + 0.1.1 + false + + ${project.basedir}/skills/teavm-lambda + + + + skills-jar + package + + package + + + + + + + sign-artifacts