se-dev-torch

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

SE Dev Torch Skill

《太空工程师》Torch开发技能

Torch plugin development for Space Engineers version 1.
This skill is for Torch framework itself: plugin lifecycle, manifests, commands, managers, patch helpers, and server UI integration. Use
se-dev-game-code
or
se-dev-server-code
alongside it when task crosses into Keen internals.
Compatibility: Plugins built with this skill target Torch onlynot compatible with Magnetar, which uses different patcher and SDK. For Magnetar server plugins use
se-dev-plugin
and
se-dev-plugin-sdk
skills. When starting from se-server-plugin-template, use its
last-torch-compatible
tag as basis, not current
main
(which dropped Torch target). See TorchPlugin.md.
CRITICAL: Commands run in a UNIX shell. Use bash syntax. On Windows this is BusyBox; on Linux/macOS use the native shell.
Examples:
  • test -f Prepare.DONE && echo ready
  • TORCH_ROOT=/path/to/Torch ./Prepare.sh
  • if exist Prepare.DONE echo ready
Actions:
  • prepare: Run one-time preparation (
    Prepare.bat
    on Windows,
    Prepare.sh
    on Linux/macOS, or
    run_prepare.sh
    as wrapper)
  • bash: Run UNIX shell commands via busybox
  • search: Search indexed Torch source using
    search_torch.py
适用于《太空工程师》1.x版本的Torch插件开发。
本技能针对Torch框架本身:插件生命周期、清单、命令、管理器、补丁助手及服务器UI集成。当任务涉及Keen内部代码时,请搭配使用
se-dev-game-code
se-dev-server-code
技能。
兼容性说明: 使用本技能构建的插件仅面向Torch——与Magnetar不兼容,后者使用不同的补丁器和SDK。开发Magnetar服务器插件请使用
se-dev-plugin
se-dev-plugin-sdk
技能。从se-server-plugin-template开始开发时,请以其**
last-torch-compatible
**标签为基础,而非当前的
main
分支(该分支已放弃Torch目标)。详情请参阅TorchPlugin.md
重要提示: 命令在UNIX shell中运行,请使用bash语法。Windows系统下使用BusyBox;Linux/macOS系统下使用原生shell。
示例:
  • test -f Prepare.DONE && echo ready
  • TORCH_ROOT=/path/to/Torch ./Prepare.sh
  • if exist Prepare.DONE echo ready
操作:
  • prepare:执行一次性准备操作(Windows系统用
    Prepare.bat
    ,Linux/macOS系统用
    Prepare.sh
    ,或使用
    run_prepare.sh
    作为包装器)
  • bash:通过busybox执行UNIX shell命令
  • search:使用
    search_torch.py
    搜索已索引的Torch源代码

Routing Decision

路由决策

Check these patterns in order:
PriorityPatternExampleRoute
1Empty or bare invocation
se-dev-torch
Show this help
2Prepare keywords
se-dev-torch prepare
,
se-dev-torch setup
,
se-dev-torch init
prepare
3Bash/shell keywords
se-dev-torch bash
,
se-dev-torch grep
,
se-dev-torch cat
bash
4Search keywords
se-dev-torch search
,
se-dev-torch find class
,
se-dev-torch lookup
search
按以下顺序检查模式:
优先级模式示例路由
1空调用或裸调用
se-dev-torch
显示本帮助文档
2包含Prepare相关关键词
se-dev-torch prepare
,
se-dev-torch setup
,
se-dev-torch init
prepare
3包含Bash/shell相关关键词
se-dev-torch bash
,
se-dev-torch grep
,
se-dev-torch cat
bash
4包含Search相关关键词
se-dev-torch search
,
se-dev-torch find class
,
se-dev-torch lookup
search

Requirements

环境要求

Host system must have following on
PATH
:
  • Python 3.11 or newer
  • git command line client
If user already has local Torch checkout, set
TORCH_ROOT
to that repository root before preparation. Otherwise skill clones
https://github.com/TorchAPI/Torch
into its persistent data folder.
宿主系统的
PATH
中必须包含以下工具:
  • Python 3.11或更高版本
  • git 命令行客户端
如果用户已本地检出Torch代码,请在执行准备操作前将
TORCH_ROOT
设置为该仓库的根目录。否则,本技能会将
https://github.com/TorchAPI/Torch
克隆到其持久化数据文件夹中。

Getting Started

快速开始

CRITICAL: Before running ANY commands, read CommandExecution.md.
If
Prepare.DONE
file missing in this folder, run one-time preparation first. See Prepare.md.
重要提示: 在执行任何命令前,请阅读CommandExecution.md
如果本文件夹中缺少
Prepare.DONE
文件,请先执行一次性准备操作。详情请参阅Prepare.md

Essential Documentation

核心文档

  • CommandExecution.md - command execution rules and quick start
  • QuickStart.md - first searches and common task entry points
  • TorchPlugin.md - Torch plugin authoring patterns
  • Architecture.md - where to inspect each subsystem in Torch source tree
  • CodeSearch.md - complete code search reference
  • Troubleshooting.md - common failure modes and what to check
  • CommandExecution.md - 命令执行规则及快速入门
  • QuickStart.md - 首次搜索及常见任务入口
  • TorchPlugin.md - Torch插件编写模式
  • Architecture.md - Torch源码树中各子系统的查看位置
  • CodeSearch.md - 完整代码搜索参考
  • Troubleshooting.md - 常见故障模式及排查要点

Quick Search Examples

快速搜索示例

bash
undefined
bash
undefined

Find the base plugin class

查找基础插件类

uv run search_torch.py class declaration TorchPluginBase
uv run search_torch.py class declaration TorchPluginBase

Find the Torch plugin API interfaces

查找Torch插件API接口

uv run search_torch.py interface declaration ITorchPlugin -n Torch.API.Plugins
uv run search_torch.py interface declaration ITorchPlugin -n Torch.API.Plugins

Inspect command definitions

查看命令定义

uv run search_torch.py class declaration CommandModule -n Torch.Commands uv run search_torch.py method signature RegisterPluginCommands
uv run search_torch.py class declaration CommandModule -n Torch.Commands uv run search_torch.py method signature RegisterPluginCommands

Inspect manager usage patterns

查看管理器使用模式

uv run search_torch.py class declaration DependencyManager -n Torch.Managers uv run search_torch.py interface declaration ITorchSessionManager -n Torch.API.Session
uv run search_torch.py class declaration DependencyManager -n Torch.Managers uv run search_torch.py interface declaration ITorchSessionManager -n Torch.API.Session

Find patching infrastructure

查找补丁基础设施

uv run search_torch.py namespace declaration PatchManager uv run search_torch.py class declaration PatchContext -n Torch.Managers.PatchManager
undefined
uv run search_torch.py namespace declaration PatchManager uv run search_torch.py class declaration PatchContext -n Torch.Managers.PatchManager
undefined

General Rules

通用规则

  • Search only indexed Torch repository selected during preparation.
  • Prefer
    manifest.xml
    metadata over
    [PluginAttribute]
    ;
    PluginAttribute
    is obsolete in Torch.
  • Prefer
    torch.Managers.GetManager<T>()
    or
    session.Managers.GetManager<T>()
    over obsolete
    ITorchBase.GetManager<T>()
    .
  • Use
    TorchPluginBase
    as normal starting point unless task clearly needs lower-level implementation.
  • If task is about Space Engineers game behavior rather than Torch framework behavior, use
    se-dev-game-code
    or
    se-dev-server-code
    as companion skill.
  • Preparation builds a separate Graphify graph for the selected Torch checkout (or
    SE_DEV_TORCH_PLUGIN_ROOT
    ). With the fast Rust clustering backend (Python 3.12 via
    uv
    , provisioned automatically) prepare builds it automatically (~1 minute for a Torch checkout). Where the fast backend is unavailable it stays opt-in with
    SE_DEV_GRAPHIFY=1
    ;
    SE_DEV_GRAPHIFY=0
    disables it. Read on demand — build via GraphifyPrepare.md, query via GraphifyUsage.md.
  • 仅搜索准备阶段选中的已索引Torch仓库。
  • 优先使用
    manifest.xml
    元数据而非
    [PluginAttribute]
    PluginAttribute
    在Torch中已过时。
  • 优先使用
    torch.Managers.GetManager<T>()
    session.Managers.GetManager<T>()
    而非已过时的
    ITorchBase.GetManager<T>()
  • 除非任务明确需要底层实现,否则请以
    TorchPluginBase
    作为常规起点。
  • 如果任务涉及《太空工程师》游戏行为而非Torch框架行为,请搭配使用
    se-dev-game-code
    se-dev-server-code
    技能。
  • 准备操作会为选中的Torch检出代码(或
    SE_DEV_TORCH_PLUGIN_ROOT
    )构建独立的Graphify图。借助快速的Rust聚类后端(通过
    uv
    自动配置的Python 3.12),准备操作会自动构建该图(Torch检出代码约需1分钟)。若无法使用快速后端,则需通过
    SE_DEV_GRAPHIFY=1
    手动启用;
    SE_DEV_GRAPHIFY=0
    则禁用该功能。按需阅读——通过GraphifyPrepare.md构建,通过GraphifyUsage.md查询。

Remarks

备注

Original source of this skill: https://github.com/CometWorks/skills
本技能的原始来源:https://github.com/CometWorks/skills