Skip to content

Commit fef7bcc

Browse files
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>
1 parent 5cec86b commit fef7bcc

File tree

11 files changed

+930
-0
lines changed

11 files changed

+930
-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: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
# Skip if this is an automated version bump commit
25+
if: "!contains(github.event.head_commit.message, 'chore(plugin): bump version')"
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Bump plugin version
33+
id: bump
34+
run: |
35+
BUMP_TYPE="${{ github.event.inputs.bump_type || 'patch' }}"
36+
CURRENT=$(jq -r '.version' claude-plugin/claude.json)
37+
38+
IFS='.' read -r major minor patch <<< "$CURRENT"
39+
case $BUMP_TYPE in
40+
major) NEW_VERSION="$((major+1)).0.0" ;;
41+
minor) NEW_VERSION="$major.$((minor+1)).0" ;;
42+
patch) NEW_VERSION="$major.$minor.$((patch+1))" ;;
43+
esac
44+
45+
jq --arg v "$NEW_VERSION" '.version = $v' claude-plugin/claude.json > tmp.json
46+
mv tmp.json claude-plugin/claude.json
47+
48+
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
49+
echo "Bumped plugin version from $CURRENT to $NEW_VERSION"
50+
51+
- name: Commit and tag
52+
run: |
53+
git config user.name "github-actions[bot]"
54+
git config user.email "github-actions[bot]@users.noreply.github.com"
55+
git add claude-plugin/claude.json
56+
git commit -m "chore(plugin): bump version to ${{ steps.bump.outputs.version }}"
57+
git tag "plugin-v${{ steps.bump.outputs.version }}"
58+
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

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)