agentleFS
bmcszkbmcszk/agent-skills/skills/ebiten/deployment/SKILL.md

deployment

Skill1 starsChanged 2 months agoMITView on GitHub

Ebitengine cross-platform deployment: desktop, WebAssembly, mobile (iOS/Android), Steam, Nintendo Switch.

  • Installs packages

18 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use debugging, api-design and 1 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • BlockSkill

    debugging

    Debugging guidelines and best practices

    Also in 5 projects that use this

  • MicrosoftSkill

    api-design

    Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.

    Also in 4 projects that use this

  • NVIDIASkill

    testing

    Run Python and Rust tests for physicsnemo-curator using uv + pytest with coverage reporting via pytest-cov, and cargo-nextest for Rust tests. Includes benchmark workflows with pytest-benchmark and criterion.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 4 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 15 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create an HTML file to load the WASM module:

    line 93
  2. Very specific:

    Add to build.gradle: implementation files('libs/game.aar')

    line 192
  3. Very specific:

    Create an Activity that launches the Ebiten game view

    line 193
  4. Very specific:

    Create a UIViewController that presents the Ebiten view

    line 227
  5. Distinctive:

    Use this skill only when the task clearly matches the scope described above.

    line 417
  6. Distinctive:

    Do not treat the output as a substitute for environment-specific validation, testing, or expert review.

    line 418
  7. Distinctive:

    Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

    line 419

“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Deployment

Cross-platform builds for Ebitengine games: desktop, web, mobile, consoles.


Supported Platforms

PlatformStatusBackend
WindowsStableDirectX (default), OpenGL
macOSStableMetal (default), OpenGL
LinuxStableOpenGL
WebAssemblyStableWebGL
AndroidStableOpenGL ES
iOSStableMetal
Nintendo SwitchAvailable via paid licenseProprietary

Desktop Build

Basic Build

# Build for current platform
go build -o game .

# Windows
GOOS=windows GOARCH=amd64 go build -o game.exe .

# macOS
GOOS=darwin GOARCH=amd64 go build -o game .
GOOS=darwin GOARCH=arm64 go build -o game .

# Linux
GOOS=linux GOARCH=amd64 go build -o game .

CGO Dependencies

Ebitengine uses CGO on some platforms:

PlatformCGO RequiredNotes
WindowsNoPure Go with DirectX
macOSYesNeeds Xcode/Clang
LinuxYesNeeds gcc, libgl1-mesa-dev, libxcursor-dev, libxrandr-dev, libxinerama-dev, libxi-dev, libxxf86vm-dev, libc6-dev

Linux Dependencies

# Debian/Ubuntu
sudo apt-get install libc6-dev libgl1-mesa-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxxf86vm-dev libasound2-dev pkg-config

# Fedora
sudo dnf install mesa-libGL-devel libXcursor-devel libXrandr-devel libXinerama-devel libXi-devel libXxf86vm-devel alsa-lib-devel pkgconfig

# Arch
sudo pacman -S mesa libxcursor libxrandr libxinerama libxi libxxf86vm alsa-lib pkg-config

Windows Cross-Compile from Linux

GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc go build -o game.exe .

macOS Cross-Compile

Cross-compiling macOS binaries from Linux requires osxcross or similar toolchain. Alternatively, build on macOS directly or use CI.


WebAssembly

Build

GOOS=js GOARCH=wasm go build -o game.wasm .

HTML Shell

Create an HTML file to load the WASM module:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>My Game</title>
    <style>
        body { margin: 0; background: #000; }
        canvas { display: block; margin: auto; }
    </style>
</head>
<body>
    <canvas id="game"></canvas>
    <script src="wasm_exec.js"></script>
    <script>
        const go = new Go();
        WebAssembly.instantiateStreaming(
            fetch("game.wasm"), go.importObject
        ).then(result => {
            go.run(result.instance);
        });
    </script>
</body>
</html>

Copy wasm_exec.js from your Go installation:

cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" .

wasmserve for Development

go install github.com/hajimehoshi/wasmserve@latest
wasmserve -http=:8080 .

WASM Considerations

AspectDetail
AudioLimited to specific formats; no MP3 in some browsers
File systemNo direct file access; use embed.FS or HTTP fetch
Performance30-60% of native; heavy shaders may struggle
Binary sizeCan be large; use -ldflags="-s -w" to reduce
GamepadSupported via standard gamepad API
TouchSupported via touch events
FullscreenLimited browser support
Save dataUse gdata library or localStorage

Optimize WASM Binary

# Strip debug info
GOOS=js GOARCH=wasm go build -ldflags="-s -w" -o game.wasm .

# Further compress with gzip
gzip -9 -c game.wasm > game.wasm.gz

Serve with Content-Encoding: gzip for automatic decompression.


Android

Setup

# Install ebitenmobile tool
go install github.com/hajimehoshi/ebiten/v2/cmd/ebitenmobile@latest

Build

# Generate Android library
ebitenmobile bind -target android -o game.aar .

# For use in Android Studio project

Requirements

RequirementDetail
Android SDKAPI level 16+
NDKLatest recommended
Go version1.21+
minSdkVersion16

Integration with Android Project

  1. Run ebitenmobile bind -target android -o game.aar .
  2. Copy game.aar into Android Studio project's libs/ directory
  3. Add to build.gradle: implementation files('libs/game.aar')
  4. Create an Activity that launches the Ebiten game view

iOS

Setup

go install github.com/hajimehoshi/ebiten/v2/cmd/ebitenmobile@latest

Build

# Generate iOS framework
ebitenmobile bind -target ios -o Game.xcframework .

# For use in Xcode project

Requirements

RequirementDetail
Xcode14+
macOSRequired for build
Go version1.21+
Deployment targetiOS 13+

Integration with Xcode Project

  1. Run ebitenmobile bind -target ios -o Game.xcframework .
  2. Drag Game.xcframework into Xcode project
  3. Create a UIViewController that presents the Ebiten view

Mobile Input Considerations

Desktop InputMobile Equivalent
Keyboard arrowsTouch joystick / swipe
Space / Z / XTap buttons / multi-touch zones
Mouse clickTap
Mouse positionTouch position
EscapeBack button / gesture
GamepadBluetooth gamepad (supported)

Touch Controls Pattern

type TouchButton struct {
    Bounds  image.Rectangle
    Pressed bool
    ID      ebiten.TouchID
}

func (b *TouchButton) Update() {
    b.Pressed = false
    touchIDs := inpututil.AppendJustPressedTouchIDs(nil)
    for _, id := range touchIDs {
        x, y := ebiten.TouchPosition(id)
        if x >= b.Bounds.Min.X && x <= b.Bounds.Max.X &&
            y >= b.Bounds.Min.Y && y <= b.Bounds.Max.Y {
            b.Pressed = true
            b.ID = id
        }
    }
}

Steam Integration

import "github.com/hajimehoshi/go-steamworks"

func init() {
    steamworks.Init()
}

func (g *Game) Update() error {
    steamworks.Update()

    // Achievements
    steamworks.SetAchievement("first_win")
    steamworks.StoreStats()

    // Leaderboards
    steamworks.UploadLeaderboardScore("high_score", score)

    return nil
}

Requires Steamworks SDK installed. Only works when launched through Steam.


Build Optimization

Binary Size

# Strip symbols
go build -ldflags="-s -w" -o game .

# With UPX compression (optional, may trigger antivirus)
upx --best game

Embed Assets

//go:embed assets/*
var assets embed.FS

Using embed.FS eliminates external file dependencies and simplifies deployment.

Build Tags

// +build !mobile

package main

// Desktop-only code

// +build mobile

package main

// Mobile-specific code

CI/CD GitHub Actions

name: Build

on: [push, pull_request]

jobs:
  build:
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-go@v5
        with:
          go-version: '1.22'
      - name: Install Linux dependencies
        if: runner.os == 'Linux'
        run: |
          sudo apt-get update
          sudo apt-get install -y libgl1-mesa-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxxf86vm-dev libasound2-dev pkg-config
      - name: Build
        run: go build -ldflags="-s -w" -o game .

  wasm:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-go@v5
        with:
          go-version: '1.22'
      - name: Build WASM
        run: GOOS=js GOARCH=wasm go build -ldflags="-s -w" -o game.wasm .
      - uses: actions/upload-artifact@v4
        with:
          name: wasm-build
          path: game.wasm

  release:
    if: startsWith(github.ref, 'refs/tags/')
    runs-on: ubuntu-latest
    needs: [build, wasm]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-go@v5
        with:
          go-version: '1.22'
      - name: Build all platforms
        run: |
          GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o game-windows-amd64.exe .
          GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o game-darwin-arm64 .
          GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o game-linux-amd64 .
          GOOS=js GOARCH=wasm go build -ldflags="-s -w" -o game.wasm .
      - uses: softprops/action-gh-release@v1
        with:
          files: |
            game-windows-amd64.exe
            game-darwin-arm64
            game-linux-amd64
            game.wasm

Anti-Patterns

Don'tDo
Read files with os.Open() at runtimeUse embed.FS for portable assets
Hard-code file pathsUse embed.FS or relative paths from executable
Test only on your dev platformSet up CI for all target platforms
Skip mobile-specific input handlingAdd touch controls for mobile targets
Use CGO-dependent libraries for WASMStick to pure Go for WASM compatibility
Ignore WASM binary sizeStrip with -ldflags="-s -w" and gzip
Use os.ReadFile() for assetsUse embed.FS or resource manager
Assume desktop resolutionsHandle dynamic layouts in Layout()
Skip testing audio on mobile/WASMTest audio on each target platform

When to Use

This skill is applicable when building, packaging, or deploying an Ebitengine game for any platform: desktop, web, mobile, or console.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.