Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
36 changes: 36 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/`
Expand Down
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 31 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,37 @@
</build>

<profiles>
<profile>
<id>skills-jar</id>
<pluginRepositories>
<pluginRepository>
<id>github</id>
<url>https://maven.pkg.github.com/webliteca/skills-jar-maven-plugin</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>ca.weblite</groupId>
<artifactId>skills-jar-plugin</artifactId>
<version>0.1.1</version>
<inherited>false</inherited>
<configuration>
<skillDirectory>${project.basedir}/skills/teavm-lambda</skillDirectory>
</configuration>
<executions>
<execution>
<id>skills-jar</id>
<phase>package</phase>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>sign-artifacts</id>
<build>
Expand Down
Loading