se-dev-plugin

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

SE 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
  • if exist file.txt (echo exists)
    - Will NOT work
Actions:
  • prepare: Run one-time preparation (
    Prepare.bat
    on Windows,
    prepare.sh
    on Linux)
  • 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系统用
    Prepare.bat
    ,Linux系统用
    prepare.sh
  • bash:通过busybox执行UNIX shell命令
  • search:使用
    search_plugins.py
    搜索插件代码

Routing Decision

路由决策

Check these patterns in order - first match wins:
PriorityPatternExampleRoute
1Empty or bare invocation
se-dev-plugin
Show help
2Prepare keywords
se-dev-plugin prepare
,
se-dev-plugin setup
,
se-dev-plugin init
prepare
3Bash/shell keywords
se-dev-plugin bash
,
se-dev-plugin grep
,
se-dev-plugin cat
bash
4Search keywords
se-dev-plugin search
,
se-dev-plugin find class
,
se-dev-plugin lookup
search
按顺序检查以下匹配规则,匹配到第一条即生效:
优先级匹配模式示例路由指向
1空指令或直接调用
se-dev-plugin
显示帮助信息
2包含准备类关键词
se-dev-plugin prepare
,
se-dev-plugin setup
,
se-dev-plugin init
prepare
3包含Bash/Shell类关键词
se-dev-plugin bash
,
se-dev-plugin grep
,
se-dev-plugin cat
bash
4包含搜索类关键词
se-dev-plugin search
,
se-dev-plugin find class
,
se-dev-plugin lookup
search

Getting Started

快速开始

⚠️ CRITICAL: Before running ANY commands, read CommandExecution.md to avoid common mistakes that cause command failures.
If
Prepare.DONE
file missing in this folder, you MUST run one-time preparation steps first. See prepare action.
⚠️ 重要提示:在执行任何命令前,请阅读CommandExecution.md,避免因常见错误导致命令执行失败。
如果当前目录下缺少
Prepare.DONE
文件,必须先执行一次性准备步骤。详情请查看prepare操作文档

Essential 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):
  1. Patching.md - Start here: patch types, prefix/postfix basics, common patterns
  2. PatchInjections.md - Special parameters:
    __instance
    ,
    __result
    ,
    ___fields
    ,
    __state
  3. AccessTools.md - Reflection utilities to find methods, fields, and types
  4. TranspilerPatching.md - IL-level patching for complex modifications
  5. PatchingSpecialCases.md - Finalizers, reverse patches, auxiliary methods, priority
  6. PreloaderPatching.md - Pre-JIT patching (Mono.Cecil, client only)
Harmony补丁开发进阶文档(从基础开始,按需阅读高级内容):
  1. Patching.md - 入门指南:补丁类型、前缀/后缀基础、常见模式
  2. PatchInjections.md - 特殊参数:
    __instance
    ,
    __result
    ,
    ___fields
    ,
    __state
  3. AccessTools.md - 反射工具类,用于查找方法、字段和类型
  4. TranspilerPatching.md - IL级补丁,用于复杂修改
  5. PatchingSpecialCases.md - 终结器、反向补丁、辅助方法、优先级设置
  6. 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
    se-dev-plugin-sdk
    skill for that. Admins configure server plugins remotely via Quasar, the Magnetar control plane.
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
ClientPlugin
target,
ServerPlugin
target and
Shared
project. See ServerPlugin.md.
插件可针对以下一种或两种环境:
  • 客户端 — 运行在游戏客户端内,由Pulsar加载,发布在PluginHub
  • 服务端 — 运行在专用服务器内,由Magnetar加载,发布在MagnetarHub。服务端插件需通过Magnetar的PluginSdk声明配置;相关操作请使用**
    se-dev-plugin-sdk
    **技能。管理员可通过Quasar(Magnetar控制平面)远程配置服务端插件。
仅客户端插件可使用客户端插件模板。需要服务端配套的插件(或仅服务端插件)请使用服务端插件模板,该模板包含
ClientPlugin
目标、
ServerPlugin
目标和
Shared
项目。详情请查看ServerPlugin.md

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
se-dev-game-code
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.
客户端插件仅可在PluginHub发布。所有客户端插件必须开源,因为它们会在玩家机器上根据PluginHub注册的GitHub源码版本编译。插件提交时会进行安全审核,但仅为尽力而为,不提供任何法律担保。插件运行原生代码,可执行任意操作。审核PluginHub或MagnetarHub的提交(或更新)时,请遵循Review.md的规范。
如需搜索游戏反编译代码,请使用
se-dev-game-code
技能。这有助于理解游戏内部机制,以及如何正确与游戏交互、进行补丁开发。

Graphify Graph

Graphify图谱

Preparation builds a separate Graphify graph for downloaded plugin sources under
Data/Sources
(or
SE_DEV_PLUGIN_PROJECT_ROOT
). With the fast Rust clustering backend (Python 3.12 via
uv
, 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
SE_DEV_GRAPHIFY=1
;
SE_DEV_GRAPHIFY=0
disables it. Read on demand — skip for normal search work: build via GraphifyPrepare.md, query via GraphifyUsage.md.
准备操作会为
Data/Sources
(或
SE_DEV_PLUGIN_PROJECT_ROOT
)下的已下载插件源码构建独立的Graphify图谱。借助快速Rust聚类后端(通过
uv
自动配置的Python 3.12),准备操作会自动构建图谱;由于数据集较小,构建速度很快。若无法使用快速后端,则需通过设置
SE_DEV_GRAPHIFY=1
手动启用;设置
SE_DEV_GRAPHIFY=0
可禁用该功能。按需阅读相关文档:构建流程请查看GraphifyPrepare.md,查询方法请查看GraphifyUsage.md

References

参考链接

  • 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).
    <Id>
    is
    Owner/Repo
    .
  • MagnetarHub — server plugins (Magnetar).
    <Id>
    is a GUID; the GitHub repo is in
    <RepoId>
    .
Preparation clones both into
Data/PluginHub
and
Data/MagnetarHub
. Refresh them with
uv run download_pluginhub.py
and
uv run download_magnetarhub.py
. To point at a local registry checkout instead of (or in addition to) the cloned ones, set
SE_PLUGIN_REGISTRY_DIR
to a registry root (a folder containing
Plugins/*.xml
).
list_plugins.py
,
download_plugin_source.py
and the indexer all read every configured registry;
list_plugins.py
tags each entry with
[PluginHub]
or
[MagnetarHub]
.
两个注册表会被联合搜索,均采用相同的GitHub插件XML schema:
  • PluginHub — 客户端插件(Pulsar)。
    <Id>
    Owner/Repo
    格式。
  • MagnetarHub — 服务端插件(Magnetar)。
    <Id>
    为GUID格式;GitHub仓库信息在
    <RepoId>
    字段中。
准备操作会将两个注册表克隆到
Data/PluginHub
Data/MagnetarHub
目录下。可通过
uv run download_pluginhub.py
uv run download_magnetarhub.py
刷新注册表。若要指向本地注册表副本(替代或补充克隆的注册表),请设置
SE_PLUGIN_REGISTRY_DIR
为注册表根目录(包含
Plugins/*.xml
的文件夹)。
list_plugins.py
download_plugin_source.py
和索引器都会读取所有已配置的注册表;
list_plugins.py
会为每个条目标记
[PluginHub]
[MagnetarHub]

Plugin Code Search

插件代码搜索

Search source code of plugins from either registry for examples and patterns:
bash
undefined
搜索任意注册表中的插件源码,获取示例与模式参考:
bash
undefined

List 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