Skip to content

Commit ae29a2f

Browse files
feat(docs): add Claude Code plugin for AI-assisted development (#598)
* feat(docs): add Claude Code plugin for AI-assisted development Add in-repo Claude Code plugin that enables AI coding agents to automatically discover and use JEngine APIs when users develop games with the framework. Plugin includes: - Main CLAUDE.md with JEngine patterns and conventions - Skills for JAction, JObjectPool, MessageBox, and Editor UI components - Marketplace configuration for automatic plugin updates - CI workflow for automated version bumps on release Also adds plugin-maintenance rule to keep documentation in sync with API changes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net> * docs: highlight AI-powered development in README Add Claude Code plugin as a key feature in the "Why JEngine?" section for both English and Chinese README files. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net> * fix: address code review feedback - Fix release-plugin.yml condition to handle workflow_dispatch events - Correct JObjectPool constructor signature (maxSize, not createFunc) - Fix JAction state parameter docs (value types work without boxing) - Update README AI feature wording for better clarity Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net> * fix(docs): correct JAction state parameter documentation State overloads DO NOT work with value types - they get boxed when passed as generic parameters. Updated docs to reflect this and recommend closures for value types. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net> * fix(ci): add explicit branch check to release-plugin workflow Prevents workflow from running on PR branches when the workflow file is being added. Only runs on master or manual dispatch. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net> --------- Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 5cec86b commit ae29a2f

File tree

13 files changed

+937
-0
lines changed

13 files changed

+937
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Plugin Maintenance
2+
3+
The `claude-plugin/` folder contains AI agent documentation for end users who install JEngine packages.
4+
5+
## When to Update
6+
7+
Update the plugin documentation when:
8+
- New public API added to JEngine.Util or JEngine.UI
9+
- API signature changes
10+
- New usage patterns discovered
11+
- Common mistakes identified
12+
13+
## Files to Update
14+
15+
| Package Change | Plugin File to Update |
16+
|---------------|----------------------|
17+
| JAction API | `claude-plugin/skills/jaction/SKILL.md` |
18+
| JObjectPool API | `claude-plugin/skills/jobjectpool/SKILL.md` |
19+
| MessageBox API | `claude-plugin/skills/messagebox/SKILL.md` |
20+
| Editor UI components | `claude-plugin/skills/editor-ui/SKILL.md` |
21+
| Design Tokens | `claude-plugin/skills/editor-ui/SKILL.md` |
22+
| New utility class | Create new skill in `claude-plugin/skills/` |
23+
| General patterns | `claude-plugin/CLAUDE.md` |
24+
25+
## Checklist for API Changes
26+
27+
- [ ] Update relevant SKILL.md with new/changed API
28+
- [ ] Add code examples for new features
29+
- [ ] Document common mistakes if any
30+
- [ ] Bump version in `claude-plugin/claude.json` (CI does this automatically on release)
31+
32+
## Version Sync
33+
34+
Plugin version is automatically bumped by CI when packages are released.
35+
For manual updates, bump the version in `claude-plugin/claude.json`:
36+
- Patch (x.x.1) for doc fixes
37+
- Minor (x.1.0) for new API coverage
38+
- Major (1.0.0) for breaking skill changes
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Release Plugin
2+
3+
on:
4+
push:
5+
paths:
6+
- 'claude-plugin/**'
7+
branches:
8+
- master
9+
workflow_dispatch:
10+
inputs:
11+
bump_type:
12+
description: 'Version bump type'
13+
required: true
14+
default: 'patch'
15+
type: choice
16+
options:
17+
- patch
18+
- minor
19+
- major
20+
21+
jobs:
22+
release-plugin:
23+
runs-on: ubuntu-latest
24+
# Only run on master branch, skip automated version bump commits
25+
if: |
26+
(github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch') &&
27+
(github.event_name == 'workflow_dispatch' || !contains(github.event.head_commit.message || '', 'chore(plugin): bump version'))
28+
steps:
29+
- uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0
32+
token: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Bump plugin version
35+
id: bump
36+
run: |
37+
BUMP_TYPE="${{ github.event.inputs.bump_type || 'patch' }}"
38+
CURRENT=$(jq -r '.version' claude-plugin/claude.json)
39+
40+
IFS='.' read -r major minor patch <<< "$CURRENT"
41+
case $BUMP_TYPE in
42+
major) NEW_VERSION="$((major+1)).0.0" ;;
43+
minor) NEW_VERSION="$major.$((minor+1)).0" ;;
44+
patch) NEW_VERSION="$major.$minor.$((patch+1))" ;;
45+
esac
46+
47+
jq --arg v "$NEW_VERSION" '.version = $v' claude-plugin/claude.json > tmp.json
48+
mv tmp.json claude-plugin/claude.json
49+
50+
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
51+
echo "Bumped plugin version from $CURRENT to $NEW_VERSION"
52+
53+
- name: Commit and tag
54+
run: |
55+
git config user.name "github-actions[bot]"
56+
git config user.email "github-actions[bot]@users.noreply.github.com"
57+
git add claude-plugin/claude.json
58+
git commit -m "chore(plugin): bump version to ${{ steps.bump.outputs.version }}"
59+
git tag "plugin-v${{ steps.bump.outputs.version }}"
60+
git push origin master --tags

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
@.claude/rules/coding-patterns.md
66
@.claude/rules/commit-conventions.md
77
@.claude/rules/package-creation.md
8+
@.claude/rules/plugin-maintenance.md
89

910
## Project Overview
1011

README.md

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

2324
## Overview

README_zh_cn.md

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

2324
## 概述

claude-plugin/CLAUDE.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# JEngine Framework
2+
3+
Unity framework for runtime hot updates. Unity 2022.3+, C#.
4+
5+
## Available Packages
6+
7+
### JEngine.Util (com.jasonxudeveloper.jengine.util)
8+
- **JAction**: Fluent API for chainable action sequences with zero-allocation async
9+
- **JObjectPool<T>**: Thread-safe generic object pool using lock-free CAS
10+
11+
### JEngine.UI (com.jasonxudeveloper.jengine.ui)
12+
- **MessageBox**: Async modal dialogs with UniTask (runtime)
13+
- **Editor Components**: JButton, JTextField, JStack, JCard, etc. (editor)
14+
- **Design Tokens**: Theme-aware colors, spacing, typography
15+
16+
## Key Patterns
17+
18+
### Always Use UniTask (not System.Threading.Tasks.Task)
19+
```csharp
20+
using Cysharp.Threading.Tasks;
21+
public async UniTask<bool> LoadAsync() { }
22+
```
23+
24+
### JAction - Always Dispose After Async
25+
```csharp
26+
using var action = await JAction.Create()
27+
.Do(static () => Debug.Log("Start"))
28+
.Delay(1f)
29+
.Do(static () => Debug.Log("After 1s"))
30+
.ExecuteAsync();
31+
```
32+
33+
### JObjectPool - Reset State on Return
34+
```csharp
35+
var pool = new JObjectPool<List<int>>(
36+
onReturn: static list => list.Clear()
37+
);
38+
var list = pool.Rent();
39+
pool.Return(list);
40+
```
41+
42+
### MessageBox - Await the Result
43+
```csharp
44+
bool ok = await MessageBox.Show("Title", "Message?", "Yes", "No");
45+
if (ok) { /* confirmed */ }
46+
```
47+
48+
### Editor UI - Use Design Tokens
49+
```csharp
50+
using JEngine.UI.Editor.Theming;
51+
using JEngine.UI.Editor.Components.Button;
52+
using JEngine.UI.Editor.Components.Layout;
53+
54+
var stack = new JStack(GapSize.MD)
55+
.Add(new JButton("Action", () => DoIt(), ButtonVariant.Primary));
56+
```

claude-plugin/README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# JEngine Claude Code Plugin
2+
3+
AI-powered development guide for JEngine Unity framework.
4+
5+
## Installation (Recommended: Marketplace)
6+
7+
Add the JEngine marketplace for **automatic updates**:
8+
9+
```bash
10+
# Add marketplace (one-time)
11+
claude plugin marketplace add https://github.com/JasonXuDeveloper/JEngine/tree/master/claude-plugin/marketplace.json
12+
13+
# Install plugin
14+
claude plugin install jengine@jengine-marketplace
15+
```
16+
17+
After this, plugin updates automatically when Claude Code starts.
18+
19+
## Alternative: Direct Install
20+
21+
```bash
22+
claude plugin install https://github.com/JasonXuDeveloper/JEngine/tree/master/claude-plugin
23+
```
24+
25+
(Note: Direct installs require manual updates)
26+
27+
## Features
28+
29+
After installation, Claude Code automatically:
30+
- Suggests JAction for sequential tasks, timers, and delays
31+
- Suggests JObjectPool for object pooling and GC optimization
32+
- Suggests MessageBox for confirmation dialogs
33+
- Suggests Editor UI components for custom inspectors and editor windows
34+
- Follows JEngine coding conventions (UniTask, namespaces, etc.)
35+
36+
## Skills Included
37+
38+
### JEngine.Util (Runtime)
39+
- `/jaction` - Chainable task system with zero-allocation async
40+
- `/jobjectpool` - Thread-safe object pooling
41+
42+
### JEngine.UI (Runtime + Editor)
43+
- `/messagebox` - Async modal dialogs
44+
- `/editor-ui` - Editor UI components (JButton, JStack, Tokens, etc.)
45+
46+
## Requirements
47+
48+
- Claude Code CLI
49+
- JEngine packages installed in your Unity project:
50+
- `com.jasonxudeveloper.jengine.util`
51+
- `com.jasonxudeveloper.jengine.ui`

claude-plugin/claude.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "jengine",
3+
"displayName": "JEngine Framework",
4+
"version": "1.0.0",
5+
"description": "AI development guide for JEngine Unity hot-update framework",
6+
"author": "JasonXuDeveloper",
7+
"repository": "https://github.com/JasonXuDeveloper/JEngine",
8+
"skills": ["skills/*/SKILL.md"],
9+
"claudeMd": "CLAUDE.md"
10+
}

claude-plugin/marketplace.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "jengine-marketplace",
3+
"description": "JEngine Framework plugins for AI-assisted Unity development",
4+
"owner": {
5+
"name": "JasonXuDeveloper",
6+
"url": "https://github.com/JasonXuDeveloper"
7+
},
8+
"plugins": [
9+
{
10+
"name": "jengine",
11+
"description": "AI development guide for JEngine Unity hot-update framework",
12+
"source": {
13+
"source": "github",
14+
"repo": "JasonXuDeveloper/JEngine",
15+
"path": "claude-plugin",
16+
"ref": "master"
17+
}
18+
}
19+
]
20+
}

0 commit comments

Comments
 (0)