Merge pull request #4 from xr843/feat/multi-platform-plugin

feat: multi-platform plugin support (Claude Code, Cursor, Codex, OpenCode, Gemini)
This commit is contained in:
Tim Ren
2026-04-08 21:41:56 +08:00
committed by GitHub
15 changed files with 312 additions and 26 deletions
+20
View File
@@ -0,0 +1,20 @@
{
"name": "master-skill",
"description": "Chinese Buddhist Master AI Skills — 8 historical masters with source-cited teachings",
"owner": {
"name": "xr843",
"email": "xr843@users.noreply.github.com"
},
"plugins": [
{
"name": "master-skill",
"description": "Chinese Buddhist Master AI teaching personas — 8 prebuilt masters with CBETA-cited doctrinal responses, RAG-grounded in FoJin knowledge graph",
"version": "0.3.0",
"source": "./",
"author": {
"name": "xr843",
"email": "xr843@users.noreply.github.com"
}
}
]
}
+22
View File
@@ -0,0 +1,22 @@
{
"name": "master-skill",
"description": "Chinese Buddhist Master AI teaching personas — 8 prebuilt masters with CBETA-cited doctrinal responses, RAG-grounded in FoJin knowledge graph",
"version": "0.3.0",
"author": {
"name": "xr843",
"email": "xr843@users.noreply.github.com"
},
"homepage": "https://github.com/xr843/Master-skill",
"repository": "https://github.com/xr843/Master-skill",
"license": "MIT",
"keywords": [
"buddhism",
"chinese-buddhism",
"ai-persona",
"digital-humanities",
"rag",
"cbeta",
"fojin",
"agent-skills"
]
}
+45
View File
@@ -0,0 +1,45 @@
# Installing Master-skill for Codex
## Quick Install
```bash
# Clone the repository
git clone https://github.com/xr843/Master-skill.git ~/.codex/master-skill
# Create skills symlink
ln -sf ~/.codex/master-skill/prebuilt ~/.agents/skills/master-skill
ln -sf ~/.codex/master-skill/SKILL.md ~/.agents/skills/create-master/SKILL.md
```
Restart Codex to discover the new skills.
## Windows (PowerShell)
```powershell
git clone https://github.com/xr843/Master-skill.git "$env:USERPROFILE\.codex\master-skill"
cmd /c mklink /J "$env:USERPROFILE\.agents\skills\master-skill" "$env:USERPROFILE\.codex\master-skill\prebuilt"
```
## Available Skills After Install
- `/xuanzang` — Xuanzang (Yogacara)
- `/kumarajiva` — Kumarajiva (Madhyamaka)
- `/huineng` — Huineng (Chan/Zen)
- `/zhiyi` — Zhiyi (Tiantai)
- `/fazang` — Fazang (Huayan)
- `/yinguang` — Yinguang (Pure Land)
- `/ouyi` — Ouyi (Tiantai-Pure Land)
- `/xuyun` — Xuyun (Chan, Five Schools)
- `/compare-masters` — Multi-tradition comparison
- `/create-master` — Generate new master
## Tool Mapping
| Skill references | Codex equivalent |
|---|---|
| `Read` | `read_file` |
| `Write` | `write_file` |
| `Edit` | `edit_file` |
| `Bash` | `shell` |
| `Grep` | `grep` |
| `Glob` | `glob` |
+22
View File
@@ -0,0 +1,22 @@
{
"name": "master-skill",
"displayName": "Master Skill",
"description": "Chinese Buddhist Master AI teaching personas — 8 prebuilt masters with CBETA-cited doctrinal responses",
"version": "0.3.0",
"author": {
"name": "xr843",
"email": "xr843@users.noreply.github.com"
},
"homepage": "https://github.com/xr843/Master-skill",
"repository": "https://github.com/xr843/Master-skill",
"license": "MIT",
"keywords": [
"buddhism",
"ai-persona",
"digital-humanities",
"rag",
"agent-skills"
],
"skills": "./prebuilt/",
"hooks": "./hooks/hooks-cursor.json"
}
+46
View File
@@ -0,0 +1,46 @@
# Installing Master-skill for OpenCode
## Quick Install
Add to your `opencode.json`:
```json
{
"plugin": ["master-skill@git+https://github.com/xr843/Master-skill.git"]
}
```
OpenCode will automatically install and register all skills.
## Pin a Version
```json
{
"plugin": ["master-skill@git+https://github.com/xr843/Master-skill.git#v0.3.0"]
}
```
## Available Skills After Install
- `/xuanzang` — Xuanzang (Yogacara)
- `/kumarajiva` — Kumarajiva (Madhyamaka)
- `/huineng` — Huineng (Chan/Zen)
- `/zhiyi` — Zhiyi (Tiantai)
- `/fazang` — Fazang (Huayan)
- `/yinguang` — Yinguang (Pure Land)
- `/ouyi` — Ouyi (Tiantai-Pure Land)
- `/xuyun` — Xuyun (Chan, Five Schools)
- `/compare-masters` — Multi-tradition comparison
- `/create-master` — Generate new master
## Tool Mapping
| Skill references | OpenCode equivalent |
|---|---|
| `Read` | `read_file` |
| `Write` | `write_file` |
| `Edit` | `edit_file` |
| `Bash` | `shell` |
| `Grep` | `grep` |
| `Glob` | `glob` |
| `Skill` | `skill` (native) |
+9
View File
@@ -0,0 +1,9 @@
{
"files": [
{"path": "package.json", "field": "version"},
{"path": ".claude-plugin/plugin.json", "field": "version"},
{"path": ".claude-plugin/marketplace.json", "field": "plugins.0.version"},
{"path": ".cursor-plugin/plugin.json", "field": "version"},
{"path": "gemini-extension.json", "field": "version"}
]
}
+2
View File
@@ -0,0 +1,2 @@
@./SKILL.md
@./prebuilt/compare/SKILL.md
+22 -5
View File
@@ -88,24 +88,41 @@ npx master-skill install --all
npx master-skill list npx master-skill list
``` ```
**Claude Code** **Claude Code(插件方式)**
```bash ```bash
# 即将上线插件市场,目前使用手动安装:
git clone https://github.com/xr843/Master-skill ~/Master-skill git clone https://github.com/xr843/Master-skill ~/Master-skill
cd ~/Master-skill && pip install -r requirements.txt cd ~/Master-skill && pip install -r requirements.txt
for d in prebuilt/*/; do ln -sf "$(pwd)/$d" ~/.claude/skills/"$(basename $d)"; done for d in prebuilt/*/; do ln -sf "$(pwd)/$d" ~/.claude/skills/"$(basename $d)"; done
ln -sf "$(pwd)" ~/.claude/skills/create-master ln -sf "$(pwd)" ~/.claude/skills/create-master
``` ```
**Codex CLI** **Cursor**
```bash ```bash
git clone https://github.com/xr843/Master-skill ~/Master-skill git clone https://github.com/xr843/Master-skill ~/Master-skill
cd ~/Master-skill && pip install -r requirements.txt # Cursor 自动检测 .cursor-plugin/plugin.json 并注册技能
for d in prebuilt/*/; do ln -sf "$(pwd)/$d" ~/.codex/skills/"$(basename $d)"; done
ln -sf "$(pwd)" ~/.codex/skills/create-master
``` ```
**OpenCode**
`opencode.json` 中添加:
```json
{
"plugin": ["master-skill@git+https://github.com/xr843/Master-skill.git"]
}
```
**Codex CLI**
参见 [.codex/INSTALL.md](.codex/INSTALL.md)
**Gemini CLI**
本项目包含 `gemini-extension.json``GEMINI.md`,Gemini CLI 自动发现并加载。
### 使用预置法师 ### 使用预置法师
在支持 AgentSkills 的环境(Claude Code / Codex CLI / OpenClaw)中直接调用: 在支持 AgentSkills 的环境(Claude Code / Codex CLI / OpenClaw)中直接调用:
+14 -20
View File
@@ -76,39 +76,33 @@ No installation required — try all pre-built masters directly in your browser:
### Installation ### Installation
**NPX (recommended)**
```bash
npx master-skill install --all # Install all 8 masters
npx master-skill list # List available masters
```
**Claude Code** **Claude Code**
```bash ```bash
git clone https://github.com/xr843/Master-skill ~/Master-skill git clone https://github.com/xr843/Master-skill ~/Master-skill
cd ~/Master-skill && pip install -r requirements.txt cd ~/Master-skill && pip install -r requirements.txt
# Register skills (symlink to ~/.claude/skills/)
for d in prebuilt/*/; do ln -sf "$(pwd)/$d" ~/.claude/skills/"$(basename $d)"; done for d in prebuilt/*/; do ln -sf "$(pwd)/$d" ~/.claude/skills/"$(basename $d)"; done
ln -sf "$(pwd)" ~/.claude/skills/create-master ln -sf "$(pwd)" ~/.claude/skills/create-master
``` ```
**Codex CLI** **Cursor** — Clone the repo; Cursor auto-detects `.cursor-plugin/plugin.json`.
```bash **OpenCode** — Add to `opencode.json`:
git clone https://github.com/xr843/Master-skill ~/Master-skill
cd ~/Master-skill && pip install -r requirements.txt ```json
# Register skills (symlink to ~/.codex/skills/) {"plugin": ["master-skill@git+https://github.com/xr843/Master-skill.git"]}
for d in prebuilt/*/; do ln -sf "$(pwd)/$d" ~/.codex/skills/"$(basename $d)"; done
ln -sf "$(pwd)" ~/.codex/skills/create-master
``` ```
**OpenClaw** **Codex CLI** — See [.codex/INSTALL.md](.codex/INSTALL.md)
```bash **Gemini CLI** — Auto-discovered via `gemini-extension.json` and `GEMINI.md`.
git clone https://github.com/xr843/Master-skill ~/.openclaw/workspace/skills/create-master
cd ~/.openclaw/workspace/skills/create-master && pip install -r requirements.txt
```
**Manual**
```bash
git clone https://github.com/xr843/Master-skill
cd Master-skill && pip install -r requirements.txt
```
### Use a Pre-built Master ### Use a Pre-built Master
+6
View File
@@ -0,0 +1,6 @@
{
"name": "master-skill",
"description": "Chinese Buddhist Master AI teaching personas — 8 prebuilt masters with CBETA-cited doctrinal responses",
"version": "0.3.0",
"contextFileName": "GEMINI.md"
}
+10
View File
@@ -0,0 +1,10 @@
{
"version": 1,
"hooks": {
"sessionStart": [
{
"command": "./hooks/session-start"
}
]
}
}
+16
View File
@@ -0,0 +1,16 @@
{
"hooks": {
"SessionStart": [
{
"matcher": "startup|clear|compact",
"hooks": [
{
"type": "command",
"command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start",
"async": false
}
]
}
]
}
}
+29
View File
@@ -0,0 +1,29 @@
: ; # Polyglot wrapper — runs as cmd.exe on Windows, bash on Unix
: ; exec bash "$0" "$@" 2>/dev/null
: ; exit
@echo off
setlocal enabledelayedexpansion
set "HOOK=%~1"
set "HOOK_DIR=%~dp0"
:: Try common Git for Windows bash locations
for %%B in (
"C:\Program Files\Git\bin\bash.exe"
"C:\Program Files (x86)\Git\bin\bash.exe"
"%LOCALAPPDATA%\Programs\Git\bin\bash.exe"
) do (
if exist %%B (
%%B "%HOOK_DIR%%HOOK%" %2 %3 %4 %5
exit /b %ERRORLEVEL%
)
)
:: Fallback: try bash from PATH
where bash >nul 2>&1 && (
bash "%HOOK_DIR%%HOOK%" %2 %3 %4 %5
exit /b %ERRORLEVEL%
)
:: No bash found — exit silently
exit /b 0
+47
View File
@@ -0,0 +1,47 @@
#!/usr/bin/env bash
# Master-skill session-start hook
# Injects available masters list into conversation context on session start.
# Compatible with Claude Code, Cursor, and Copilot CLI.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PLUGIN_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
# Build masters list from prebuilt/ directory
MASTERS_LIST=""
for dir in "$PLUGIN_ROOT"/prebuilt/*/; do
[ -d "$dir" ] || continue
name=$(basename "$dir")
[ "$name" = "compare" ] && continue
skill_file="$dir/SKILL.md"
if [ -f "$skill_file" ]; then
# Extract lineage from frontmatter
lineage=$(grep '^lineage:' "$skill_file" 2>/dev/null | head -1 | sed 's/^lineage: *//' || echo "")
if [ -n "$lineage" ]; then
MASTERS_LIST="${MASTERS_LIST} /${name} — ${lineage}\n"
fi
fi
done
# Build the context message
CONTEXT="Master-skill plugin loaded. Available Buddhist masters:
${MASTERS_LIST} /compare-masters — multi-tradition comparison
/create-master — generate new master from FoJin knowledge graph
All doctrinal responses include CBETA citations linked to fojin.app."
# Escape for JSON embedding
CONTEXT_ESCAPED=$(echo "$CONTEXT" | python3 -c "import sys,json; print(json.dumps(sys.stdin.read()))" 2>/dev/null || echo "\"$CONTEXT\"")
# Platform detection and output format
if [ -n "${CURSOR_PLUGIN_ROOT:-}" ]; then
# Cursor format
echo "{\"additional_context\": $CONTEXT_ESCAPED}"
elif [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] && [ -z "${COPILOT_CLI:-}" ]; then
# Claude Code format
echo "{\"hookSpecificOutput\": {\"additionalContext\": $CONTEXT_ESCAPED}}"
else
# Copilot CLI / SDK standard format
echo "{\"additionalContext\": $CONTEXT_ESCAPED}"
fi
+2 -1
View File
@@ -1,6 +1,7 @@
{ {
"name": "master-skill", "name": "master-skill",
"version": "0.3.0", "version": "0.3.0",
"type": "module",
"description": "Chinese Buddhist Master AI Skills — RAG-grounded, source-cited, fidelity-tested", "description": "Chinese Buddhist Master AI Skills — RAG-grounded, source-cited, fidelity-tested",
"bin": { "bin": {
"master-skill": "./bin/cli.mjs" "master-skill": "./bin/cli.mjs"
@@ -8,5 +9,5 @@
"keywords": ["claude-skills", "agent-skills", "buddhism", "ai-persona", "rag", "digital-humanities"], "keywords": ["claude-skills", "agent-skills", "buddhism", "ai-persona", "rag", "digital-humanities"],
"license": "MIT", "license": "MIT",
"repository": {"type": "git", "url": "https://github.com/xr843/Master-skill"}, "repository": {"type": "git", "url": "https://github.com/xr843/Master-skill"},
"files": ["bin/", "prebuilt/", "scripts/"] "files": ["bin/", "prebuilt/", "scripts/", "hooks/", ".claude-plugin/", ".cursor-plugin/", ".codex/", ".opencode/"]
} }