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
38 changes: 38 additions & 0 deletions .claude/rules/plugin-maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Plugin Maintenance

The `claude-plugin/` folder contains AI agent documentation for end users who install JEngine packages.

## When to Update

Update the plugin documentation when:
- New public API added to JEngine.Util or JEngine.UI
- API signature changes
- New usage patterns discovered
- Common mistakes identified

## Files to Update

| Package Change | Plugin File to Update |
|---------------|----------------------|
| JAction API | `claude-plugin/skills/jaction/SKILL.md` |
| JObjectPool API | `claude-plugin/skills/jobjectpool/SKILL.md` |
| MessageBox API | `claude-plugin/skills/messagebox/SKILL.md` |
| Editor UI components | `claude-plugin/skills/editor-ui/SKILL.md` |
| Design Tokens | `claude-plugin/skills/editor-ui/SKILL.md` |
| New utility class | Create new skill in `claude-plugin/skills/` |
| General patterns | `claude-plugin/CLAUDE.md` |

## Checklist for API Changes

- [ ] Update relevant SKILL.md with new/changed API
- [ ] Add code examples for new features
- [ ] Document common mistakes if any
- [ ] Bump version in `claude-plugin/claude.json` (CI does this automatically on release)

## Version Sync

Plugin version is automatically bumped by CI when packages are released.
For manual updates, bump the version in `claude-plugin/claude.json`:
- Patch (x.x.1) for doc fixes
- Minor (x.1.0) for new API coverage
- Major (1.0.0) for breaking skill changes
60 changes: 60 additions & 0 deletions .github/workflows/release-plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Release Plugin

on:
push:
paths:
- 'claude-plugin/**'
branches:
- master
workflow_dispatch:
inputs:
bump_type:
description: 'Version bump type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major

jobs:
release-plugin:
runs-on: ubuntu-latest
# Only run on master branch, skip automated version bump commits
if: |
(github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch') &&
(github.event_name == 'workflow_dispatch' || !contains(github.event.head_commit.message || '', 'chore(plugin): bump version'))
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Bump plugin version
id: bump
run: |
BUMP_TYPE="${{ github.event.inputs.bump_type || 'patch' }}"
CURRENT=$(jq -r '.version' claude-plugin/claude.json)

IFS='.' read -r major minor patch <<< "$CURRENT"
case $BUMP_TYPE in
major) NEW_VERSION="$((major+1)).0.0" ;;
minor) NEW_VERSION="$major.$((minor+1)).0" ;;
patch) NEW_VERSION="$major.$minor.$((patch+1))" ;;
esac

jq --arg v "$NEW_VERSION" '.version = $v' claude-plugin/claude.json > tmp.json
mv tmp.json claude-plugin/claude.json

echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "Bumped plugin version from $CURRENT to $NEW_VERSION"

- name: Commit and tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add claude-plugin/claude.json
git commit -m "chore(plugin): bump version to ${{ steps.bump.outputs.version }}"
git tag "plugin-v${{ steps.bump.outputs.version }}"
git push origin master --tags
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@.claude/rules/coding-patterns.md
@.claude/rules/commit-conventions.md
@.claude/rules/package-creation.md
@.claude/rules/plugin-maintenance.md

## Project Overview

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- **Zero/Minimal GC** - UniTask (GC-free async) + Nino (high-performance serialization)
- **All Platforms** - iOS, Android, Windows, macOS, WebGL, WeChat, Douyin, Alipay, TapTap
- **Secure Updates** - Obfuscate hot update DLL + encrypt resources (assets & DLL/PDB) with XOR/AES/ChaCha20
- **AI-Accelerated** - Intelligent AI [seamlessly integrated](claude-plugin/), deeply understands JEngine to boost productivity
- **Commercial Ready** - Production-proven by individuals and enterprise teams

## Overview
Expand Down
1 change: 1 addition & 0 deletions README_zh_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- **零/极低GC** - UniTask(无GC异步)+ Nino(高性能序列化)
- **全平台支持** - iOS、Android、Windows、macOS、WebGL、微信、抖音、支付宝、TapTap
- **安全更新** - 热更DLL混淆 + 资源(资产和DLL/PDB)支持XOR/AES/ChaCha20加密
- **AI赋能** - AI[深度理解JEngine](claude-plugin/),无缝融入开发流程,效率倍增
- **商用验证** - 经个人和企业团队生产环境验证

## 概述
Expand Down
56 changes: 56 additions & 0 deletions claude-plugin/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# JEngine Framework

Unity framework for runtime hot updates. Unity 2022.3+, C#.

## Available Packages

### JEngine.Util (com.jasonxudeveloper.jengine.util)
- **JAction**: Fluent API for chainable action sequences with zero-allocation async
- **JObjectPool<T>**: Thread-safe generic object pool using lock-free CAS

### JEngine.UI (com.jasonxudeveloper.jengine.ui)
- **MessageBox**: Async modal dialogs with UniTask (runtime)
- **Editor Components**: JButton, JTextField, JStack, JCard, etc. (editor)
- **Design Tokens**: Theme-aware colors, spacing, typography

## Key Patterns

### Always Use UniTask (not System.Threading.Tasks.Task)
```csharp
using Cysharp.Threading.Tasks;
public async UniTask<bool> LoadAsync() { }
```

### JAction - Always Dispose After Async
```csharp
using var action = await JAction.Create()
.Do(static () => Debug.Log("Start"))
.Delay(1f)
.Do(static () => Debug.Log("After 1s"))
.ExecuteAsync();
```

### JObjectPool - Reset State on Return
```csharp
var pool = new JObjectPool<List<int>>(
onReturn: static list => list.Clear()
);
var list = pool.Rent();
pool.Return(list);
```

### MessageBox - Await the Result
```csharp
bool ok = await MessageBox.Show("Title", "Message?", "Yes", "No");
if (ok) { /* confirmed */ }
```

### Editor UI - Use Design Tokens
```csharp
using JEngine.UI.Editor.Theming;
using JEngine.UI.Editor.Components.Button;
using JEngine.UI.Editor.Components.Layout;

var stack = new JStack(GapSize.MD)
.Add(new JButton("Action", () => DoIt(), ButtonVariant.Primary));
```
51 changes: 51 additions & 0 deletions claude-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# JEngine Claude Code Plugin

AI-powered development guide for JEngine Unity framework.

## Installation (Recommended: Marketplace)

Add the JEngine marketplace for **automatic updates**:

```bash
# Add marketplace (one-time)
claude plugin marketplace add https://github.com/JasonXuDeveloper/JEngine/tree/master/claude-plugin/marketplace.json

# Install plugin
claude plugin install jengine@jengine-marketplace
```

After this, plugin updates automatically when Claude Code starts.

## Alternative: Direct Install

```bash
claude plugin install https://github.com/JasonXuDeveloper/JEngine/tree/master/claude-plugin
```

(Note: Direct installs require manual updates)

## Features

After installation, Claude Code automatically:
- Suggests JAction for sequential tasks, timers, and delays
- Suggests JObjectPool for object pooling and GC optimization
- Suggests MessageBox for confirmation dialogs
- Suggests Editor UI components for custom inspectors and editor windows
- Follows JEngine coding conventions (UniTask, namespaces, etc.)

## Skills Included

### JEngine.Util (Runtime)
- `/jaction` - Chainable task system with zero-allocation async
- `/jobjectpool` - Thread-safe object pooling

### JEngine.UI (Runtime + Editor)
- `/messagebox` - Async modal dialogs
- `/editor-ui` - Editor UI components (JButton, JStack, Tokens, etc.)

## Requirements

- Claude Code CLI
- JEngine packages installed in your Unity project:
- `com.jasonxudeveloper.jengine.util`
- `com.jasonxudeveloper.jengine.ui`
10 changes: 10 additions & 0 deletions claude-plugin/claude.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "jengine",
"displayName": "JEngine Framework",
"version": "1.0.0",
"description": "AI development guide for JEngine Unity hot-update framework",
"author": "JasonXuDeveloper",
"repository": "https://github.com/JasonXuDeveloper/JEngine",
"skills": ["skills/*/SKILL.md"],
"claudeMd": "CLAUDE.md"
}
20 changes: 20 additions & 0 deletions claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "jengine-marketplace",
"description": "JEngine Framework plugins for AI-assisted Unity development",
"owner": {
"name": "JasonXuDeveloper",
"url": "https://github.com/JasonXuDeveloper"
},
"plugins": [
{
"name": "jengine",
"description": "AI development guide for JEngine Unity hot-update framework",
"source": {
"source": "github",
"repo": "JasonXuDeveloper/JEngine",
"path": "claude-plugin",
"ref": "master"
}
}
]
}
Loading