se-dev-torch
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSE 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 or alongside it when task crosses into Keen internals.
se-dev-game-codese-dev-server-codeCompatibility: Plugins built with this skill target Torch only — not compatible with Magnetar, which uses different patcher and SDK. For Magnetar server plugins use and skills. When starting from se-server-plugin-template, use its tag as basis, not current (which dropped Torch target). See TorchPlugin.md.
se-dev-pluginse-dev-plugin-sdklast-torch-compatiblemainCRITICAL: 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 readyTORCH_ROOT=/path/to/Torch ./Prepare.shif exist Prepare.DONE echo ready
Actions:
- prepare: Run one-time preparation (on Windows,
Prepare.baton Linux/macOS, orPrepare.shas wrapper)run_prepare.sh - 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-codese-dev-server-code兼容性说明: 使用本技能构建的插件仅面向Torch——与Magnetar不兼容,后者使用不同的补丁器和SDK。开发Magnetar服务器插件请使用和技能。从se-server-plugin-template开始开发时,请以其****标签为基础,而非当前的分支(该分支已放弃Torch目标)。详情请参阅TorchPlugin.md。
se-dev-pluginse-dev-plugin-sdklast-torch-compatiblemain重要提示: 命令在UNIX shell中运行,请使用bash语法。Windows系统下使用BusyBox;Linux/macOS系统下使用原生shell。
示例:
test -f Prepare.DONE && echo readyTORCH_ROOT=/path/to/Torch ./Prepare.shif exist Prepare.DONE echo ready
操作:
- prepare:执行一次性准备操作(Windows系统用,Linux/macOS系统用
Prepare.bat,或使用Prepare.sh作为包装器)run_prepare.sh - bash:通过busybox执行UNIX shell命令
- search:使用搜索已索引的Torch源代码
search_torch.py
Routing Decision
路由决策
Check these patterns in order:
| Priority | Pattern | Example | Route |
|---|---|---|---|
| 1 | Empty or bare invocation | | Show this help |
| 2 | Prepare keywords | | prepare |
| 3 | Bash/shell keywords | | bash |
| 4 | Search keywords | | search |
按以下顺序检查模式:
| 优先级 | 模式 | 示例 | 路由 |
|---|---|---|---|
| 1 | 空调用或裸调用 | | 显示本帮助文档 |
| 2 | 包含Prepare相关关键词 | | prepare |
| 3 | 包含Bash/shell相关关键词 | | bash |
| 4 | 包含Search相关关键词 | | 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 to that repository root before preparation. Otherwise skill clones into its persistent data folder.
TORCH_ROOThttps://github.com/TorchAPI/Torch宿主系统的中必须包含以下工具:
PATH- Python 3.11或更高版本
- git 命令行客户端
如果用户已本地检出Torch代码,请在执行准备操作前将设置为该仓库的根目录。否则,本技能会将克隆到其持久化数据文件夹中。
TORCH_ROOThttps://github.com/TorchAPI/TorchGetting Started
快速开始
CRITICAL: Before running ANY commands, read CommandExecution.md.
If file missing in this folder, run one-time preparation first. See Prepare.md.
Prepare.DONE重要提示: 在执行任何命令前,请阅读CommandExecution.md。
如果本文件夹中缺少文件,请先执行一次性准备操作。详情请参阅Prepare.md。
Prepare.DONEEssential 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
undefinedbash
undefinedFind 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
undefineduv run search_torch.py namespace declaration PatchManager
uv run search_torch.py class declaration PatchContext -n Torch.Managers.PatchManager
undefinedGeneral Rules
通用规则
- Search only indexed Torch repository selected during preparation.
- Prefer metadata over
manifest.xml;[PluginAttribute]is obsolete in Torch.PluginAttribute - Prefer or
torch.Managers.GetManager<T>()over obsoletesession.Managers.GetManager<T>().ITorchBase.GetManager<T>() - Use as normal starting point unless task clearly needs lower-level implementation.
TorchPluginBase - If task is about Space Engineers game behavior rather than Torch framework behavior, use or
se-dev-game-codeas companion skill.se-dev-server-code - Preparation builds a separate Graphify graph for the selected Torch checkout (or
). With the fast Rust clustering backend (Python 3.12 via
SE_DEV_TORCH_PLUGIN_ROOT, provisioned automatically) prepare builds it automatically (~1 minute for a Torch checkout). Where the fast backend is unavailable it stays opt-in withuv;SE_DEV_GRAPHIFY=1disables it. Read on demand — build via GraphifyPrepare.md, query via GraphifyUsage.md.SE_DEV_GRAPHIFY=0
- 仅搜索准备阶段选中的已索引Torch仓库。
- 优先使用元数据而非
manifest.xml;[PluginAttribute]在Torch中已过时。PluginAttribute - 优先使用或
torch.Managers.GetManager<T>()而非已过时的session.Managers.GetManager<T>()。ITorchBase.GetManager<T>() - 除非任务明确需要底层实现,否则请以作为常规起点。
TorchPluginBase - 如果任务涉及《太空工程师》游戏行为而非Torch框架行为,请搭配使用或
se-dev-game-code技能。se-dev-server-code - 准备操作会为选中的Torch检出代码(或)构建独立的Graphify图。借助快速的Rust聚类后端(通过
SE_DEV_TORCH_PLUGIN_ROOT自动配置的Python 3.12),准备操作会自动构建该图(Torch检出代码约需1分钟)。若无法使用快速后端,则需通过uv手动启用;SE_DEV_GRAPHIFY=1则禁用该功能。按需阅读——通过GraphifyPrepare.md构建,通过GraphifyUsage.md查询。SE_DEV_GRAPHIFY=0
Remarks
备注
Original source of this skill: https://github.com/CometWorks/skills
本技能的原始来源:https://github.com/CometWorks/skills