Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

360tools (Cursor Agent Skill)

Agent skill for DohmBoy64Bit/360toolsUpdated — static recompilation of Xbox 360 games (XBLA STFS/LIVE/PIRS/CON or disc ISO) through ReXGlue SDK (rexglue init / rexglue codegen) to native x86-64 executables.

Modernized ReXGlue-native fork of sp00nznet/360tools. Legacy XenonRecomp workflow is documented in resources/08-legacy-xenonrecomp.md only when needed.

This skill follows the ps2-recomp-Agent-SKILL design: §1–§10 behavioral constraint system, boot phases, guardrails, and persistent X360_PROJECT_STATE.md.

This skill is a playbook and reference layer for the AI agent. It does not include the 360toolsUpdated repository, ReXGlue SDK, or game binaries.

Synced with upstream 360toolsUpdated @ e395ae9 (ReXGlue-only docs: rexglue-workflow.md, speed-fix.md; no binary-analysis.md).


How to treat the agent

Do not treat the agent as a casual chatbot. Treat it as a junior reverse engineer working on your machine with a written playbook.

  1. It is autonomous: The agent should run extract_stfs.py, rexglue codegen, cmake --build, and your recomp .exe directly when appropriate. Let it work through compiler output unless it asks you to run something locally.
  2. It has persistent memory: On first use it creates X360_PROJECT_STATE.md in your game / recomp project root (from scripts/project-state-template.md). That file is its external memory — pause Monday, open a new chat Thursday, paste the Quick resume prompt, and it picks up phase, paths, TOML overrides, and crash tables.
  3. It has guardrails: It should not default to XenonRecomp, invent removed docs (binary-analysis.md), or put durable fixes inside generated/. If it loops on the same crash without updating the state file, stop and use Quick resume or correct the markdown directly.

What you get

Included in the skill Not included (you provide separately)
SKILL.md — §1–§10 constraint system, boot sequence, Ghidra MCP rules Clone of 360toolsUpdated
resources/ — numbered playbooks (pipeline, stubs, ghidra-mcp, guardrails, phases) Owned XBLA package or ISO, default.xex (no redistribution)
scripts/project-state-template.mdX360_PROJECT_STATE.md in your game project ReXGlue SDK build (Clang, MSVC, CMake, Ninja), Ghidra 12.1 + ghidra-mcp
Optimized skill description for agent triggering (XBLA/rexglue/ghidra-mcp keywords) Game binaries
Eval prompts under evals/ (development only)

Prerequisites (your PC setup)

For the agent to work without guessing:

  1. Windows 10/11 (primary path: clang-cl + MSVC 2022 Windows SDK)
    • Install Clang and CMake/Ninja (Visual Studio Installer → Individual components: C++ Clang tools for Windows, CMake tools).
  2. Python 3.8+ — in your 360toolsUpdated clone: pip install -r requirements.txt (pycryptodome for STFS crypto).
  3. Git clones:
    • 360toolsUpdated
    • rexglue-sdk (often tools/rexglue-sdk inside 360toolsUpdated)
    • Apply patches 0001–0005 from 360toolsUpdated/patches/ before building the SDK (patches/rexglue_patches_audit.md).
  4. Owned game input: XBLA STFS/LIVE/PIRS/CON package or Xbox 360 ISO (encrypted ISOs may need extract-xiso).
  5. Optional RE: Ghidra 12.1 + bethington/ghidra-mcp — agent auto-configs MCP for Cursor, Codex, Claude, Antigravity, OpenCode, etc. (resources/04-ghidra-mcp-playbook.md).
  6. Skill placement: Install the skill (folder or .skill package) where your agent reads skills; keep 360toolsUpdated and your rexglue game project in the workspace you open in the IDE.

Not for OG Xbox: use xboxrecomp-skill for default.xbe / x86.


Installation

Option 1: Skill folder

Copy or symlink this directory to a skills path your agent reads:

Scope Path
Personal (Cursor) ~/.cursor/skills/360tools/
Agents (Codex-style) ~/.agents/skills/360tools/
Project (repo-only) .cursor/skills/360tools/

The folder must contain SKILL.md at its root.

Option 2: Download 360tools.skill (recommended)

GitHub Releases attach a pre-built 360tools.skill ZIP.

  1. Open Releases and download 360tools.skill from the latest tag (v1.3.0 when published).
  2. Install through Cursor's skill import UI (or unpack into ~/.cursor/skills/360tools/).
  3. Clone 360toolsUpdated and follow Clone the toolkit below.

evals/ is omitted from the package (development-only).

Option 3: Build .skill yourself

cd path/to/skill-creator
python -m scripts.package_skill path/to/360tools-skill path/to/output

Produces 360tools.skill (no .git, no evals/).


Clone the toolkit (required)

git clone https://github.com/DohmBoy64Bit/360toolsUpdated.git
cd 360toolsUpdated
pip install -r requirements.txt
git clone --recursive https://github.com/rexglue/rexglue-sdk.git tools/rexglue-sdk

Apply ReXGlue SDK patches 0001–0005 from patches/ before building the SDK (see SKILL.md and patches/rexglue_patches_audit.md).


Start a session

On first use, the agent should copy scripts/project-state-template.mdX360_PROJECT_STATE.md in your game / recomp project root (the folder with rexglue init output and *_config.toml — not inside the skill install).

Attach this skill in Agent chat, then use one of the prompts below.

The universal starter prompt

Copy-paste this entire block to activate the skill. Works for a new project, a half-built recomp repo, or resuming after context loss.

Read 360tools/SKILL.md and execute §2 Boot sequence.
Also read resources/02-rexglue-pipeline.md and resources/03-runtime-stubs-and-toml.md.
If present, read my local 360toolsUpdated/docs/rexglue-workflow.md and docs/speed-fix.md.
Do NOT proceed until those skill files are loaded.
Do NOT recommend XenonRecomp, extract_pe.py, or docs/binary-analysis.md
until you have verified what exists in MY clone.

Then:

1. INSPECT my workspace. Look for:
   - X360_PROJECT_STATE.md (persistent memory)
   - 360toolsUpdated/ clone (tools/, patches/, docs/)
   - extracted/default.xex or assets/default.xex
   - *_config.toml, generated/, CMake build/
   - optional code/ or game reference repo
   If X360_PROJECT_STATE.md is missing, create it from the skill's
   scripts/project-state-template.md in my GAME PROJECT root.

2. If a CMake build directory exists, read CMakeCache.txt and report
   generator, compiler, and build type. Do NOT change config without my OK.

3. ASK me once for anything you still cannot detect (game title, STFS/ISO
   path, 360toolsUpdated path, recomp project root, current phase).

4. REPORT: package type, current phase, next single step, and which doc
   you will read next. Wait for my go-ahead before mass edits or codegen.

5. Do not invent TOML fields or tool flags — verify in my 360toolsUpdated
   clone and rexglue-sdk tree before claiming APIs exist.

Why this works: read first → detect second → ask third → act last. The agent cannot skip boot, cannot assume your layout, and cannot cite removed upstream docs.

Quick resume (new chat, same project)

You already ran the universal starter; context is full or you opened a new chat:

Read 360tools/SKILL.md §2 Boot sequence and resources/02-rexglue-pipeline.md.

Read X360_PROJECT_STATE.md in this repo (including Quick rules and
Learned patterns). Resume from Current phase and Active blockers.
Do not re-bootstrap paths that already exist unless they contradict the state file.
Report the next single step and wait for my go-ahead.

Fresh game (you know exactly what you want)

Skip Q&A when paths and goals are already decided:

Read 360tools/SKILL.md §2 Boot sequence and resources/02-rexglue-pipeline.md.

I'm recompiling: [GAME TITLE]
Package / ISO at: [ABSOLUTE PATH]
360toolsUpdated clone: [ABSOLUTE PATH]
Recomp project root: [ABSOLUTE PATH — rexglue init folder]
Optional reference code/: [PATH or "none"]

Create or update X360_PROJECT_STATE.md from scripts/project-state-template.md.
Start at PHASE_EXTRACT or PHASE_REXGLUE_INIT as appropriate — report findings
and wait before running rexglue codegen or applying patches without my OK.

How to collaborate (human-in-the-loop)

Xbox 360 static recomp still needs your judgment:

  • Monitor X360_PROJECT_STATE.md — keep it open in split view. Correct wrong paths, phase, or guest VAs directly; the agent re-reads on refresh triggers.
  • Watch durable fix locations — if it edits generated/ for a stub or switch table, redirect: TOML [[functions]] / [[switch_tables]], stubs.cpp, or ReXGlue SDK patches — then re-run rexglue codegen when needed.
  • Context degradation — after a long chat, if the agent forgets ReXGlue vs XenonRecomp or invents tool flags, stop. New chat → Quick resume.
  • Ghidra MCP — import default.xex, set base from xex_info.py, leave Ghidra running; agent uses resources/04-ghidra-mcp-playbook.md for MCP auto-config before claiming decompilation.
  • Build / codegen — let cmake --build and rexglue codegen finish; the agent should read full output, not claim success from partial logs.
  • Session close — ask: "Update X360_PROJECT_STATE.md Learned patterns and session log before we stop."

Typical pipeline (reference)

python tools/extract_stfs.py path/to/XBLA_PACKAGE extracted/
git clone --recursive https://github.com/rexglue/rexglue-sdk.git tools/rexglue-sdk
# git apply patches/0001-0005 in rexglue-sdk; build SDK
rexglue init --app_name mygame --app_root my_project/
cp extracted/default.xex my_project/assets/
rexglue codegen mygame_config.toml
cmake -B build -G Ninja && cmake --build build

Example one-liner prompts (after the universal starter):

  • "Walk me through extract_stfs to rexglue codegen and config TOML for first build."
  • "My XBLA recomp runs at half speed — VdSwap QPC fix from speed-fix.md?"
  • "Codegen failed on switch tables — where do durable TOML fixes go?"
  • "Codex user — auto-config ghidra-mcp for guest VA crash before [[functions]] overrides."

The agent should read your local 360toolsUpdated clone and this skill's resources/ — not invent APIs or cite removed docs (binary-analysis.md).


Troubleshooting

Symptom Tell the agent
Defaults to XenonRecomp / extract_pe.py "Stop. Read SKILL.md — 360toolsUpdated is ReXGlue-only. Verify tools in my clone."
Cites binary-analysis.md "That doc was removed @ e395ae9. Use xex_info.py and docs/rexglue-workflow.md."
Puts fixes in generated/ "Durable fixes go in TOML/stubs.cpp. Regenerate with rexglue codegen."
Forgets paths or phase "Context refresh — read X360_PROJECT_STATE.md and resume."
Half speed (~30 FPS logic) "Check docs/speed-fix.md VdSwap QPC limiter — primary ReXGlue speed fix."
Codegen switch validation error "[[switch_tables]] + extract_switch_tables.py fallback; Ghidra MCP at dispatch VA if needed."
Ghidra MCP not working "Read resources/04-ghidra-mcp-playbook.md — detect my frontend and auto-config before RE."
Asks you to compile for it "You run cmake --build and read the full output per SKILL.md."

Skill layout

360tools-skill/
├── README.md
├── CHANGELOG.md
├── SKILL.md                  # §1–§10 behavioral constraint system
├── LICENSE
├── scripts/
│   ├── project-state-template.md   → X360_PROJECT_STATE.md
│   └── run_game_agent_template.bat → run_game_agent.bat
├── examples/
│   ├── rexglue-config-template.toml
│   └── stubs-template.cpp
├── evals/                    # dev only (not in .skill package)
│   ├── evals.json
│   └── trigger_eval.json
└── resources/
    ├── 01-x360-xex-and-guest-model.md
    ├── 02-rexglue-pipeline.md      # boot required
    ├── 03-runtime-stubs-and-toml.md # boot required
    ├── 04-ghidra-mcp-playbook.md
    ├── 05-debugging-quickref.md
    ├── 06-tool-commands.md
    ├── 07-upstream-docs-index.md
    ├── 08-legacy-xenonrecomp.md
    ├── 09-agent-guardrails.md
    ├── 10-operational-phases.md
    ├── 11-decisional-brain.md
    ├── 12-packaging-dev.md
    └── db-x360-index.md

Changelog (skill repo)

Release Highlights
v1.3.0 PS2 Agent SKILL design refactor: resources/ numbered playbooks, §1–§10 SKILL.md, guardrails/phases/brain, run_game template, examples — full feature parity with v1.2.0
v1.2.0 Upstream audit @ e395ae9; ghidra-mcp frontend auto-config; trigger description; eval iterations 7–8
v1.1.0 ReXGlue-native pipeline (rexglue codegen, patches 0001–0005, no XenonRecomp default path)
v1.0.0 Initial sp00nznet/360tools + XenonRecomp era skill

License and legal

  • Skill text: MIT (this repo).
  • Upstream 360toolsUpdated is MIT.
  • You must own any Xbox 360 software you extract or recompile. Do not distribute copyrighted XEX, STFS packages, or assets.

Links

About

Cursor agent skill for sp00nznet/360tools - Xbox 360 static recompilation (XBLA/XenonRecomp/ReXGlue)

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages