se2-dev-game-code
Allows reading the decompiled C# code of Space Engineers 2
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Allows reading the decompiled C# code of Space Engineers 2
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Plugin development for Space Engineers 2. Search plugin code from PluginHub-SE2 for examples and patterns.
High level overview of Space Engineers 2 related development. Start here to understand the ecosystem (game client, Pulsar, PluginHub-SE2) and to route to the right se2-dev-* skill for plugins, mods, and decompiled code/handbook reference.
| name | se2-dev-game-code |
| description | Allows reading the decompiled C# code of Space Engineers 2 |
| license | MIT |
| allowed-tools | Read, Bash(*Prepare.bat*), Bash(*Clean.bat*), Bash(*prepare.sh*), Bash(*clean.sh*), Bash(*run_prepare.sh*), Bash(*test_search_game_code.bat*), Bash(*test_search_game_code.sh*), Bash(*test_graphify_game_code*), Bash(*graphify_check.sh*), Bash(*GraphifyCheck.bat*), Bash(command -v graphify*), Bash(graphify*), Bash(*GRAPHIFY_MAX_GRAPH_BYTES*), Bash(*uv run search_game_code.py *), Bash(*uv run index_code.py *), Bash(*busybox* grep *), Bash(*busybox* find *), Bash(*busybox* cat *), Bash(*busybox* head *), Bash(*busybox* tail *), Bash(*busybox* ls*), Bash(*busybox* wc *), Bash(*busybox* sort *), Bash(*busybox* uniq *), Bash(*busybox* tree*), Bash(grep *), Bash(find *), Bash(cat *), Bash(head *), Bash(tail *), Bash(ls *), Bash(wc *), Bash(sort *), Bash(uniq *), Bash(tree *) |
Allows reading the decompiled C# code of Space Engineers 2.
⚠️ CRITICAL: Commands run in a UNIX shell. Use bash syntax! On Windows this is BusyBox (busybox.exe <cmd>); on Linux use the native shell directly.
Examples:
test -f file.txt && echo existsls -la | head -10if exist file.txt (echo exists) - This will NOT workActions:
Prepare.bat on Windows, prepare.sh on Linux)search_game_code.pytest_search_game_code.bat on Windows, test_search_game_code.sh on Linux)Check these patterns in order - first match wins:
| Priority | Pattern | Example | Route |
|---|---|---|---|
| 1 | Empty or bare invocation | se2-dev-game-code | Show this help |
| 2 | Prepare keywords | se2-dev-game-code prepare, se2-dev-game-code setup, se2-dev-game-code init | prepare |
| 3 | Bash/shell keywords | se2-dev-game-code bash, se2-dev-game-code grep, se2-dev-game-code cat | bash |
| 4 | Search keywords | se2-dev-game-code search, se2-dev-game-code find class, se2-dev-game-code lookup | search |
| 5 | Test keywords | se2-dev-game-code test, se2-dev-game-code verify, se2-dev-game-code check | test |
The host system must have the following on PATH:
ilspycmd)⚠️ CRITICAL: Before running ANY commands, read CommandExecution.md to avoid common mistakes that cause command failures.
If the Prepare.DONE file is missing in this folder, you MUST run the one-time preparation steps first. See the prepare action.
After preparation the skill folder contains a Data junction (Windows) or symlink (Linux). The actual data lives outside the skill folder so that it is preserved across Clean.bat/Prepare.bat (Windows) or clean.sh/prepare.sh (Linux) cycles.
skills/se2-dev-game-code/
├── Data/ (junction/symlink → per-user persistent game-code data)
│ ├── .git/ local Git repository tracking decompiled sources
│ ├── .gitignore ignores CodeIndex/, Content/, __pycache__, *.py[cod], *.bak, *.log
│ ├── game_version.txt recorded SE2 version label
│ ├── Decompiled/ decompiled C# sources, organised per assembly (committed)
│ ├── Content/ textual game content (NOT committed - regenerated)
│ └── CodeIndex/ CSV indexes (NOT committed - regenerated)
├── Game2/ (junction/symlink → game's Game2, removed after preparation)
└── ... skill scripts and documentation
The Data folder points at the per-user persistent data directory:
%USERPROFILE%\.se2-dev\game-code\ (%USERPROFILE% is used rather than %LOCALAPPDATA% so the data sits outside any per-app UWP filesystem virtualization).~/.se2-dev/game-code/.Treat Data/Decompiled, Data/Content and Data/CodeIndex the same way on every platform.
The Data folder is a local Git repository. Every successful preparation creates a commit of the decompiled C# sources whose message is the game's version label.
This means:
git checkout any past commit inside Data/ to inspect or diff against an older build.Data/game_version.txt. If they differ (or the file is missing), Decompiled/, Content/ and CodeIndex/ are wiped and a fresh decompilation runs.Data/ to see exactly what changed.The repository uses an internal author/email (se2-dev-skills@localhost) so commits work even on machines without a configured global Git identity.
Preparation can build a separate Graphify graph for the decompiled game code under
Data/Decompiled (or SE2_DEV_GAME_CODE_GRAPH_ROOT). It is a navigable map of
call/inherit/reference edges plus clustered communities that answers structural
questions the CSV code index cannot. Prepare installs Graphify on Python 3.12 with the
fast native Rust Leiden clustering backend and, when that backend is available (needs
uv), builds the graph automatically in ~1-2 minutes. Where the fast backend cannot be
provisioned it falls back to slow single-core clustering (~10-30 minutes) and stays
opt-in with SE2_DEV_GRAPHIFY=1 (ask the user first); SE2_DEV_GRAPHIFY=0 disables it.
The Graphify tooling is shared by all se2-dev-* skills and lives in the
se2-dev skill. Read these on demand — skip them for normal search work:
Health check and query test (only meaningful once a graph is built):
bash ../se2-dev/graphify_check.sh Data/Decompiled --deep # is the graph usable?
./test_graphify_game_code.sh # run a few graph queries
# Find class declarations
uv run search_game_code.py class declaration CubeGridComponent
# Find method signatures
uv run search_game_code.py method signature OnAddedToScene
# Find class hierarchy
uv run search_game_code.py class children GameComponent
# Count results before viewing (useful for large result sets)
uv run search_game_code.py class usage CubeGridComponent --count
# Limit number of results
uv run search_game_code.py class usage CubeGridComponent --limit 10
# Paginate through results
uv run search_game_code.py class usage CubeGridComponent --limit 10 --offset 0
uv run search_game_code.py class usage CubeGridComponent --limit 10 --offset 20
Always check the game code when:
For building your own utility scripts to work with the indexes and decompiled code:
The textual part of the game's Content is copied into the Data/Content folder for free text search:
Data/CodeIndex/content_index.csv maps every textual content file to the decompiled C#
source files that reference it. Columns: rel_path (path relative to Data/Content/)
and usage (path of a C# source file in Data/Decompiled/ that references it). Each
content file appears once per usage, so you can filter and page by rel_path to see
all C# code that loads or references a given content file. Files with no known usages
have a single row with an empty usage column.
Data/Decompiled folder search only inside the C# source files (.cs) in general. If you work on transpiler or preloader patches, then also search in the IL code (.il) files.Data/Content folder search the files appropriate for the task. See ContentTypes.md for the list of types.Data/Decompiled folder. The decompiled game source tree must be there if the preparation succeeded.Data/Content folder. The copied game content must be there if the preparation succeeded.Follow the detailed instructions in:
The original source of this skill: https://github.com/CometWorks/skills2