К основному содержанию
скилл CX Codex

console-backend — скилл для Claude Code: установка

Скилл console-backend для Claude Code разбирает логи PS2Recomp и ранжирует проблемы backend. Он подключается после остановки игры или команды про syscall, IOP и stub.

MIT ★ 449 обновлён 2026-10-22

Установить в Claude Code · Через маркетплейс плагинов Все способы и платформы ↓
/plugin marketplace add Jakeschincariol/console-skill
/plugin install console-skill@console-skill
Открыть на GitHub

Что делает console-backend

Скилл console-backend читает runtime-логи PS2Recomp и превращает необработанные stub, TODO syscall, ошибки IOP RPC, сбои чтения диска и нетранслированные инструкции в список исправлений. Для каждого пункта он выводит число повторов, первый PC и RA, а также подходящий инструмент: TOML binding, файл .cpp, entry point с recompilation или game override.

Скилл ничего не записывает в checkout: результатом становится таблица для console/STATE.md. С --repo он читает реальные имена обработчиков и номера syscall; без этого использует встроенную таблицу стандартных EE kernel syscall и предполагает расположение файлов. Для запуска команд нужен python3, а для точного разбора нужен checkout PS2Recomp и лог из console/runs/.

Какие задачи решает

  • разобрать лог после остановки игры
  • составить список необработанных PS2 stub по приоритету
  • определить обработчик для syscall и его номер
  • найти причину сбоя чтения файла или диска
  • отличить проблему IOP от ошибки runtime

Примеры запросов агенту

  • Просканируй console/runs/latest.log, найди причины остановки и сопоставь их с checkout ../PS2Recomp: python3 console-backend/stubs.py scan console/runs/latest.log --repo ../PS2Recomp
  • Собери Markdown-таблицу из логов console/runs/*.log: python3 console-backend/stubs.py scan console/runs/*.log --markdown
  • Определи, какой обработчик связан с syscall 0x3C: python3 console-backend/stubs.py syscall 0x3C --repo ../PS2Recomp

Как установить console-backend

1Через маркетплейс плагинов

/plugin marketplace add Jakeschincariol/console-skill
/plugin install console-skill@console-skill

Команда ставит плагин console-skill целиком, со всеми его скиллами

2Через Skills CLI (Vercel)

npx skills add Jakeschincariol/console-skill --skill console-backend -a claude-code

3Вручную: положить файлы

~/.claude/skills/console-backend/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/console-backend/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о console-backend

Как установить console-backend в Claude Code?

В Claude Code выполните /plugin marketplace add Jakeschincariol/console-skill, затем /plugin install console-skill@console-skill.

Что делает console-backend?

Он разбирает логи PS2Recomp, ранжирует необработанные stub, syscall, ошибки IOP и диска, а затем указывает подходящий способ исправления и файл, где его искать.

Что нужно для работы console-backend?

Нужен python3 и runtime-лог, например console/runs/latest.log. Checkout PS2Recomp с параметром --repo даёт реальные имена обработчиков и номера syscall.

Исходный текст

SKILL.md · MIT
---
name: console-backend
description: >-
  Backend Engineer. Builds the engine room the recompiled game runs on: syscalls, kernel stubs, file
  and disc I/O, the IOP. Reads PS2Recomp runtime logs and turns every "Unimplemented PS2 stub",
  "[Syscall TODO]", missing function, unhandled IOP RPC, failed disc read and untranslated
  instruction into a ranked fix list: count, first PC and RA, and the exact fix tool (a TOML binding,
  the runtime .cpp file to implement it in, an entry point and a recompile, or a game override).
  With the user's PS2Recomp checkout it reads the real handler names and syscall numbers. Writes
  nothing into the checkout; prints a table for console/STATE.md. Use when the user says
  "unimplemented stub", "syscall TODO", "it crashes at boot", "fix the backend", "it can't find a
  file", "the IOP", "what is syscall 0x3C", or after /console-tester reports a stop.
argument-hint: "scan <log> [--repo PATH] [--markdown] | handlers --repo PATH | syscall <num>"
---

# console-backend

The Backend Engineer makes the runtime under the recompiled game complete enough for it to run.
The generated code is a literal translation of the game; everything it expects from the PS2 (the
kernel, the SDK libraries, the disc, the I/O processor) has to exist in `ps2xRuntime` and `ps2xIOP`.
Every missing piece shows up as a log line. This skill reads those lines, ranks them, and says which
of the four fix tools applies and in which file.

Honest limits: the tool reads logs and the checkout; it does not write C++ for you. Some fixes are a
one-line `case` in the dispatcher, others are a whole subsystem. A game usually stops at the first
missing piece, so expect one fix per run early on, and fix in order.

`${CLAUDE_SKILL_DIR}` below is this skill's folder (where this SKILL.md lives).

```bash
python3 "${CLAUDE_SKILL_DIR}/stubs.py" scan console/runs/latest.log --repo ../PS2Recomp   # ranked fixes
python3 "${CLAUDE_SKILL_DIR}/stubs.py" scan console/runs/*.log --markdown                # table for STATE.md
python3 "${CLAUDE_SKILL_DIR}/stubs.py" handlers --repo ../PS2Recomp --grep sceCd         # real handler names
python3 "${CLAUDE_SKILL_DIR}/stubs.py" handlers --repo ../PS2Recomp --todo               # handlers still TODO
python3 "${CLAUDE_SKILL_DIR}/stubs.py" syscall 0x3C --repo ../PS2Recomp                  # name a syscall
python3 "${CLAUDE_SKILL_DIR}/stubs.py" syscall -0x1A                                     # interrupt variant
```

`scan` exits 1 when it finds something to fix and 0 on a clean log; every command takes `--json`.

## What it reads and writes

| File | What |
| --- | --- |
| runtime logs (`console/runs/*.log` from /console-tester, or saved stdout+stderr) | read, line by line, any size |
| `ps2xRuntime/include/ps2_call_list.h` (with `--repo`) | `PS2_SYSCALL_LIST` and `PS2_STUB_LIST`: the handler names a binding may use |
| `ps2xRuntime/src/lib/Kernel/Syscalls/Dispatcher.cpp` (with `--repo`) | which syscall number goes to which handler |
| `ps2xRuntime/src/lib/Kernel/**/*.cpp` (with `--repo`) | where each handler lives and which are still `TODO_NAMED` |
| stdout | the ranked list, or a Markdown table to paste into STATE.md's "Stubs and syscalls" |

Without `--repo` it uses a built-in table of standard EE kernel syscalls and guesses files from
names, and says so. Read `reference/runtime-layers.md` before the first fix of a session: the three
layers, how a call reaches a handler, triage stubs, the IOP, disc I/O and the subsystem file map.

## The layers, in short

| Layer | What | Rule |
| --- | --- | --- |
| Recompiled code | `ps2xRuntime/src/runner/*.cpp`, one C++ function per game function, dispatched by guest ADDRESS through one function table | never edited, never listed |
| Runtime | `ps2xRuntime/src/lib/`: kernel syscalls (`Kernel/Syscalls/`), SDK stubs (`Kernel/Stubs/`), memory, GS, VU, audio, pad, files; `ps2xIOP/`: the game's IRX modules | your fixes go in its `.cpp` files |
| Host | raylib (window, input, sound), the file system, FFmpeg | untouched |

A bound stub calls a named handler; an unbound or skipped one logs `Unimplemented PS2 stub called`
and throws; a `syscall` goes through `Kernel/Syscalls/Dispatcher.cpp` and an unknown number logs
`[Syscall TODO]` and returns 0. Subsystem by subsystem, the first file to open is in section 7 of
`reference/runtime-layers.md` (threads and semaphores, interrupts, SIF and modules, `fio*`, `sceCd*`,
memory card, pad, audio, GS, movies, libc).

## The method

1. **Read STATE.md first** (`state.py show` from /console-reverse): the phase, the runner command,
   the stub table, the open strikes.
2. **Get one log per run.** /console-tester (`run.py boot`) keeps them in `console/runs/`; by hand,
   run the command from STATE.md with a short timeout and save stdout and stderr.
3. **Scan it**: `stubs.py scan <log> --repo <PS2Recomp>`. Issues come in the order they first
   appeared. The first one usually caused the stop ("ended the run"); later ones can be
   consequences. Note that unknown syscalls do not stop the game (the runtime returns 0), so an
   early `[Syscall TODO]` is a prime suspect for a strange crash later.
4. **Pick the fix tool the scan names, then check it in the source** before writing anything:

| The log says | Fix tool | Where |
| --- | --- | --- |
| a handler that is still `TODO_NAMED` | Runtime C++ | its `Kernel/Stubs/<File>.cpp` |
| `sub_XXXXXXXX` or a name with no handler | TOML | bind `"<Handler>@0xADDR"`, or recompile it if it is game code, or `ret0@` for one run to classify it |
| a handler that works but logged anyway | TOML | it is in `skip`: move it to `stubs` |
| `[Syscall TODO]` | Runtime C++ | a `case` in `Kernel/Syscalls/Dispatcher.cpp` (+ the handler in `Kernel/Syscalls/<File>.cpp`) |
| missing function, `codeRegion=yes` | Recompiler | `entry_points` hint in the TOML, then re-run `ps2_recomp` (batch them) |
| missing function, `codeRegion=no` | Investigate | overlay, second program or bad pointer: the caller at RA-8 |
| `[IOP/RPC trace:unhandled]` | IOP | is the IRX on the extracted disc and loaded? then ps2xIOP imports |
| `sceCdSearchFile failed` | Disc files | the file, the extraction, the run path |
| `sceCdRead unresolved LBN` | Game override | point `cdImage` at the user's own plain `.iso` |
| `fatal exception: Unhandled ... at 0x.. raw=0x..` | Game override | replace that function; record it as an upstream issue |

5. **Triage stubs are temporary.** `ret0@`/`ret1@`/`reta0@` only answer "does it get further if this
   succeeds?". Record each one in STATE.md as TEMPORARY and promote it: bind the real handler,
   implement the TODO handler, or write an override. Never leave one on a function that allocates
   memory, creates a thread or carries game logic.
6. **Prefer fixes that do not touch headers.** Implementing an existing TODO handler or adding a
   dispatcher `case` rebuilds the runtime library only. A new name in `PS2_STUB_LIST`
   (`ps2_call_list.h`) rebuilds every generated file: ask first, or put the body in a game override
   with `runtime.replaceFunction(addr, fn)` instead.
7. **Every replacement function returns with `ctx->pc = getRegU32(ctx, 31);`** unless it calls the
   original. Arguments are `getRegU32(ctx, 4..7)`, results `setReturnU32/S32`, guest pointers
   `getMemPtr(rdram, addr)` (null when invalid).
8. **Build through /console-reverse's build gate, run, scan again**, and compare with the previous
   log (/console-tester `triage.py compare`). Fixed: update the row in STATE.md and log one line.
   Same stop after a fix: `state.py strike`; at three strikes, stop guessing (circuit breaker).

Write C++ only after the adversarial check from /console-reverse: what you will change, why it fixes
the cause, what it could break, and whether you read the code or remembered it.

## IOP and disc I/O in one paragraph each

**IOP.** ps2xIOP runs the game's own IRX modules from the extracted disc on an R3000A interpreter,
with generic HLE services only for MCSERV, LIBSD and DBCMAN. `[SIF module] load-emulated ...` lines
show what loaded. An unhandled SID means the serving module is missing, failed to load, or needs an
import the virtual IOP kernel lacks (`ps2xIOP/src/emulator/`). No BIOS is involved or wanted.

**Disc and files.** `cdrom0:` is the folder of the ELF passed to the runner, `mc0/` sits beside it,
and the runtime matches names as written (on Linux, case matters). Replacing a file in the extracted
folder swaps it in the game, no ISO rebuild. Games that read raw sectors need a plain 2048-byte
`.iso` of the user's own disc set as `cdImage` in a game override (`reference/runtime-layers.md`
has the snippet; `iso.py plain` in /console-reverse converts a raw `.bin`).

## Guard rails

- **Bring your own game.** Only games the user owns, dumped from their own disc. Never download
  ISOs, ELFs, IRX modules or BIOS files, never help find them, never ask for them. PS2Recomp needs no
  BIOS, and neither do these fixes.
- **Nothing from the game gets published.** Logs can quote game strings and paths: keep them local.
  The disc, the ELF, the IRX modules and the recompiled C++ stay on the user's machine; runtime fixes
  you write are yours to share (they contain no game code), as are overrides that only hold addresses
  and your own logic. Upstream issues carry an address and an instruction word, never game files.
- **Not affiliated with Sony.** PlayStation is a trademark of Sony Interactive Entertainment.
- **Skill-specific:** never edit generated `runner/*.cpp` or list `runner/`; never edit a header
  without the user's OK; never clean the build; read-only access to the checkout from these tools.

## Hands off to

`/console-tester` to run again and compare logs, `/console-reverse` for entry points, re-exports,
recompiles and the build gate, `/console-mod` when the fix is a game-specific override,
`/console-controller`, `/console-graphics`, `/console-sound` and `/console-saves` when the first
issue sits in their subsystem.

© Jake Schincariol · MIT · Jakeschincariol/console-skill

Похожие скиллы

Все скиллы по теме «Бэкенд и API» →
godot-platform-console thedivergentai Скилл godot-platform-console для Godot под PlayStation, Xbox и Switch: интерфейс с геймпада, требования TRC/TCR, достижения и облачные сохранения, плюс скрипты под бюджет памяти и атомарные сейвы. CX Codex +1 323установок JavaScript Console omerimzali Промпт JavaScript Console превращает диалог с нейросетью в эмулятор консоли JavaScript. Модель выводит только результат выполнения команд без лишних пояснений. GP ChatGPT ★ 178 201звёзд репо backend-development Mindrally Скилл backend-development задаёт агенту правила бэкенд-разработки на C++ и Elixir/Phoenix: именование, управление памятью, контексты Phoenix, обработка ошибок. CX Codex +1 799установок strace-ltrace mohitmishra786 Скилл strace-ltrace для Claude Code помогает ИИ находить причины некорректной работы Linux-программ без отладчика, включая потерю файлов конфигурации и проблемы с сетевыми соединениями. CX Codex +1 782установок game-launch AlterLab-IEU Скилл game-launch для Claude Code выстраивает график релиза игры в Steam, Epic, на консолях и смартфонах. Рассчитывает сроки модерации витрин, проверяет комплаенс и готовит решение о запуске. CX Codex +1 ★ 57звёзд репо dotnet-backend-patterns Seth Hobson Скилл dotnet-backend-patterns для Claude Code даёт паттерны разработки на C# и .NET: async-код, DI, EF Core, кэширование и тестирование. Создаёт backend API и MCP-серверы, помогает рецензировать C#-код. CX Codex +1 19 076установок

Из того же набора12

Весь набор →
console-levels Скилл console-levels для Claude Code находит на извлечённом диске PS2 архивы уровней, распаковывает их в отдельные файлы и собирает обратно после правок. Запускается на просьбу «распакуй этот архив». CX Codex +1 ★ 449звёзд репо console-anywhere Скилл console-anywhere для Claude Code готовит сборку PS2Recomp для выбранного устройства и собирает папку для игрока. Запускается по просьбе собрать порт для Steam Deck, Android, Mac или другого поддерживаемого устройства. CX Codex +1 ★ 449звёзд репо console-sound Скилл console-sound для Claude Code извлекает аудиодорожки из файлов PS2 и добавляет в них собственные записи. Он работает с форматами VAG и SPU2 ADPCM, преобразуя их в WAV для редактирования. CX Codex +1 ★ 449звёзд репо console-controller Скилл console-controller для Claude Code подключает геймпады, клавиатуру и touch-управление к PS2Recomp. Меняет раскладку, стики и ввод для двух игроков. CX Codex +1 ★ 449звёзд репо console-tester Скилл console-tester для Claude Code автоматизирует плейтестинг портов PS2. Запускает ELF через ps2EntryRunner, отслеживает сбои, разбирает логи по адресам и сравнивает дампы с PCSX2. CX Codex +1 ★ 449звёзд репо console-mod Скилл console-mod для Claude Code переносит читы и патчи PCSX2 в порты PS2Recomp. Запускается по запросу добавить чит, портировать .pnach или изменить механику игры. CX Codex +1 ★ 449звёзд репо console-graphics Скилл console-graphics для Claude Code выгружает и пересобирает PS2-текстуры, а также ищет патчи широкого экрана. Запускается по запросам о 16:9 и проблемах рендера. CX Codex +1 ★ 449звёзд репо console-reverse Скилл console-reverse для Claude Code ведёт декомпиляцию через PS2Recomp при портировании игр с дисков PlayStation 2. Он читает образ диска, находит загрузочный ELF и ведёт память проекта. CX Codex +1 ★ 449звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой