se-dev-plugin
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSE Dev Plugin Skill
SE Dev Plugin Skill(《太空工程师》插件开发技能)
Plugin development for Space Engineers version 1.
⚠️ CRITICAL: Commands run in UNIX shell. Use bash syntax. On Windows this is BusyBox; on Linux use native shell.
Examples:
- ✅
test -f file.txt && echo exists - ✅
ls -la | head -10 - ❌ - Will NOT work
if exist file.txt (echo exists)
Actions:
- prepare: Run one-time preparation (on Windows,
Prepare.baton Linux)prepare.sh - bash: Run UNIX shell commands via busybox
- search: Search plugin code using
search_plugins.py
针对《太空工程师》1.x版本的插件开发。
⚠️ 重要提示:命令在UNIX shell中运行,请使用bash语法。Windows系统下使用BusyBox;Linux系统下使用原生shell。
示例:
- ✅
test -f file.txt && echo exists - ✅
ls -la | head -10 - ❌ - 无法正常运行
if exist file.txt (echo exists)
操作指令:
- prepare:执行一次性准备操作(Windows系统用,Linux系统用
Prepare.bat)prepare.sh - bash:通过busybox执行UNIX shell命令
- search:使用搜索插件代码
search_plugins.py
Routing Decision
路由决策
Check these patterns in order - first match wins:
| Priority | Pattern | Example | Route |
|---|---|---|---|
| 1 | Empty or bare invocation | | Show help |
| 2 | Prepare keywords | | prepare |
| 3 | Bash/shell keywords | | bash |
| 4 | Search keywords | | search |
按顺序检查以下匹配规则,匹配到第一条即生效:
| 优先级 | 匹配模式 | 示例 | 路由指向 |
|---|---|---|---|
| 1 | 空指令或直接调用 | | 显示帮助信息 |
| 2 | 包含准备类关键词 | | prepare |
| 3 | 包含Bash/Shell类关键词 | | bash |
| 4 | 包含搜索类关键词 | | search |
Getting Started
快速开始
⚠️ CRITICAL: Before running ANY commands, read CommandExecution.md to avoid common mistakes that cause command failures.
If file missing in this folder, you MUST run one-time preparation steps first. See prepare action.
Prepare.DONE⚠️ 重要提示:在执行任何命令前,请阅读CommandExecution.md,避免因常见错误导致命令执行失败。
如果当前目录下缺少文件,必须先执行一次性准备步骤。详情请查看prepare操作文档。
Prepare.DONEEssential Documentation
核心文档
- CommandExecution.md - ⚠️ READ THIS FIRST - Windows command execution details; on Linux keep bash syntax and use
prepare.sh
- CommandExecution.md - ⚠️ 请首先阅读此文档 - Windows系统命令执行细节;Linux系统请保持bash语法并使用
prepare.sh
Plugin Development Documentation
插件开发文档
Read appropriate documents for further details:
- Plugin.md Plugin development (shared skills for both client and server)
- ClientPlugin.md Client plugin development (relevant on client side)
- ServerPlugin.md Server plugin development (relevant on server side)
- Guide.md Use this to answer questions about plugin development process in general.
- Review.md How to review a plugin for inclusion on PluginHub / MagnetarHub (manifest conformance, commit pin, security audit, from-source build).
- Publicizer.md How to use Krafs publicizer to access internal, protected or private members in original game code (optional).
- OtherPluginsAsExamples.md How to look into source code of other plugins as examples.
如需进一步了解细节,请阅读对应文档:
- Plugin.md 插件开发基础(客户端与服务端通用技能)
- ClientPlugin.md 客户端插件开发(仅适用于客户端场景)
- ServerPlugin.md 服务端插件开发(仅适用于服务端场景)
- Guide.md 用于解答插件开发流程相关的通用问题
- Review.md 插件纳入PluginHub / MagnetarHub的审核标准(清单一致性、提交版本锁定、安全审计、源码构建)
- Publicizer.md 如何使用Krafs publicizer访问游戏原始代码中的内部、受保护或私有成员(可选操作)
- OtherPluginsAsExamples.md 如何查看其他插件的源码作为开发示例
Harmony Patching Documentation
Harmony补丁开发文档
Progressive documentation for Harmony patching (start with basics, then read advanced topics as needed):
- Patching.md - Start here: patch types, prefix/postfix basics, common patterns
- PatchInjections.md - Special parameters: ,
__instance,__result,___fields__state - AccessTools.md - Reflection utilities to find methods, fields, and types
- TranspilerPatching.md - IL-level patching for complex modifications
- PatchingSpecialCases.md - Finalizers, reverse patches, auxiliary methods, priority
- PreloaderPatching.md - Pre-JIT patching (Mono.Cecil, client only)
Harmony补丁开发进阶文档(从基础开始,按需阅读高级内容):
- Patching.md - 入门指南:补丁类型、前缀/后缀基础、常见模式
- PatchInjections.md - 特殊参数:,
__instance,__result,___fields__state - AccessTools.md - 反射工具类,用于查找方法、字段和类型
- TranspilerPatching.md - IL级补丁,用于复杂修改
- PatchingSpecialCases.md - 终结器、反向补丁、辅助方法、优先级设置
- PreloaderPatching.md - JIT前补丁(仅适用于客户端,基于Mono.Cecil)
Targets: Client and Server
目标环境:客户端与服务端
Plugins target one or both of:
- Client — runs inside game client, loaded by Pulsar, released on PluginHub.
- Server — runs inside dedicated server, loaded by Magnetar, released on MagnetarHub. Server plugins declare their configuration through Magnetar's PluginSdk; use skill for that. Admins configure server plugins remotely via Quasar, the Magnetar control plane.
se-dev-plugin-sdk
A client-only plugin uses client plugin template. A plugin that also needs server side companion (or is server-only) uses server plugin template, which has target, target and project. See ServerPlugin.md.
ClientPluginServerPluginShared插件可针对以下一种或两种环境:
- 客户端 — 运行在游戏客户端内,由Pulsar加载,发布在PluginHub
- 服务端 — 运行在专用服务器内,由Magnetar加载,发布在MagnetarHub。服务端插件需通过Magnetar的PluginSdk声明配置;相关操作请使用****技能。管理员可通过Quasar(Magnetar控制平面)远程配置服务端插件。
se-dev-plugin-sdk
Plugin Distribution
插件分发
Client plugins released exclusively on PluginHub. All client plugins must be open source, since they are compiled on
player's machine from GitHub source revision identified by its PluginHub registration. Plugins are
reviewed for safety and security on submission, but only on best effort basis, without any legal guarantees.
Plugins run native code and can do anything. When reviewing a submission (or update) to PluginHub or
MagnetarHub, follow Review.md.
Use skill to search game's decompiled code. Need this to
understand how game's internals work and how to interface with it and patch it properly.
se-dev-game-code客户端插件仅可在PluginHub发布。所有客户端插件必须开源,因为它们会在玩家机器上根据PluginHub注册的GitHub源码版本编译。插件提交时会进行安全审核,但仅为尽力而为,不提供任何法律担保。插件运行原生代码,可执行任意操作。审核PluginHub或MagnetarHub的提交(或更新)时,请遵循Review.md的规范。
如需搜索游戏反编译代码,请使用技能。这有助于理解游戏内部机制,以及如何正确与游戏交互、进行补丁开发。
se-dev-game-codeGraphify Graph
Graphify图谱
Preparation builds a separate Graphify graph for downloaded plugin sources under
(or ). With the fast Rust clustering backend
(Python 3.12 via , provisioned automatically) prepare builds it automatically; this
corpus is small so it is quick either way. Where the fast backend is unavailable it stays
opt-in with ; disables it. Read on demand — skip
for normal search work: build via GraphifyPrepare.md, query
via GraphifyUsage.md.
Data/SourcesSE_DEV_PLUGIN_PROJECT_ROOTuvSE_DEV_GRAPHIFY=1SE_DEV_GRAPHIFY=0准备操作会为(或)下的已下载插件源码构建独立的Graphify图谱。借助快速Rust聚类后端(通过自动配置的Python 3.12),准备操作会自动构建图谱;由于数据集较小,构建速度很快。若无法使用快速后端,则需通过设置手动启用;设置可禁用该功能。按需阅读相关文档:构建流程请查看GraphifyPrepare.md,查询方法请查看GraphifyUsage.md。
Data/SourcesSE_DEV_PLUGIN_PROJECT_ROOTuvSE_DEV_GRAPHIFY=1SE_DEV_GRAPHIFY=0References
参考链接
- Pulsar Plugin loader for Space Engineers game client
- Pulsar Installer Installer for Pulsar on Windows
- PluginHub Public plugin registry for Pulsar
- Magnetar Plugin loader for Space Engineers dedicated server
- MagnetarHub Public plugin registry for Magnetar
- Pulsar 《太空工程师》游戏客户端插件加载器
- Pulsar Installer Windows系统下Pulsar的安装程序
- PluginHub Pulsar的公共插件注册表
- Magnetar 《太空工程师》专用服务器插件加载器
- MagnetarHub Magnetar的公共插件注册表
Plugin Registries
插件注册表
Two registries are searched together, both using the same GitHub-plugin XML schema:
- PluginHub — client plugins (Pulsar). is
<Id>.Owner/Repo - MagnetarHub — server plugins (Magnetar). is a GUID; the GitHub repo is in
<Id>.<RepoId>
Preparation clones both into and . Refresh them with
and . To point at a local
registry checkout instead of (or in addition to) the cloned ones, set
to a registry root (a folder containing ).
, and the indexer all read every configured
registry; tags each entry with or .
Data/PluginHubData/MagnetarHubuv run download_pluginhub.pyuv run download_magnetarhub.pySE_PLUGIN_REGISTRY_DIRPlugins/*.xmllist_plugins.pydownload_plugin_source.pylist_plugins.py[PluginHub][MagnetarHub]两个注册表会被联合搜索,均采用相同的GitHub插件XML schema:
- PluginHub — 客户端插件(Pulsar)。为
<Id>格式。Owner/Repo - MagnetarHub — 服务端插件(Magnetar)。为GUID格式;GitHub仓库信息在
<Id>字段中。<RepoId>
准备操作会将两个注册表克隆到和目录下。可通过和刷新注册表。若要指向本地注册表副本(替代或补充克隆的注册表),请设置为注册表根目录(包含的文件夹)。、和索引器都会读取所有已配置的注册表;会为每个条目标记或。
Data/PluginHubData/MagnetarHubuv run download_pluginhub.pyuv run download_magnetarhub.pySE_PLUGIN_REGISTRY_DIRPlugins/*.xmllist_plugins.pydownload_plugin_source.pylist_plugins.py[PluginHub][MagnetarHub]Plugin Code Search
插件代码搜索
Search source code of plugins from either registry for examples and patterns:
bash
undefined搜索任意注册表中的插件源码,获取示例与模式参考:
bash
undefinedList available plugins (tagged by registry), or search them
列出所有可用插件(按注册表标记),或进行搜索
uv run list_plugins.py
uv run list_plugins.py --search "camera"
uv run list_plugins.py
uv run list_plugins.py --search "camera"
Download a plugin's source (use the EXACT name, GUID/Id, or Owner/Repo from the list)
下载插件源码(请使用列表中显示的精确名称、GUID/Id或Owner/Repo格式)
uv run download_plugin_source.py "Tool Switcher"
uv run download_plugin_source.py CometWorks/essentials
uv run download_plugin_source.py "Tool Switcher"
uv run download_plugin_source.py CometWorks/essentials
Index downloaded plugins (automatic after download)
索引已下载的插件(下载后自动执行)
uv run index_plugins.py
uv run index_plugins.py
Search plugin code
搜索插件代码
uv run search_plugins.py class declaration Plugin
uv run search_plugins.py method signature Patch
uv run search_plugins.py class declaration Plugin
uv run search_plugins.py method signature Patch
Count results before viewing (useful for large result sets)
在查看结果前统计数量(适用于结果集较大的场景)
uv run search_plugins.py class usage Plugin --count
uv run search_plugins.py class usage Plugin --count
Limit number of results
限制结果数量
uv run search_plugins.py class usage IPlugin --limit 20
The registries contain descriptions of all available plugins. Download sources for plugins
that may help with your task, then index and search them.
See [search action](./actions/search.md) for complete documentation.uv run search_plugins.py class usage IPlugin --limit 20
注册表包含所有可用插件的描述。下载可能对当前任务有帮助的插件源码,然后进行索引和搜索。
完整文档请查看[search操作文档](./actions/search.md)。Action References
操作参考文档
Follow detailed instructions in:
- prepare action - One-time preparation
- bash action - Run UNIX shell commands via busybox
- search action - Search plugin code for examples
详细操作说明请查看:
- prepare操作文档 - 一次性准备操作
- bash操作文档 - 通过busybox执行UNIX shell命令
- search操作文档 - 搜索插件代码获取示例
Remarks
备注
Original source of this skill: https://github.com/CometWorks/skills
本技能的原始源码:https://github.com/CometWorks/skills