Skip to content

Instantly share code, notes, and snippets.

@romgenie
Last active March 29, 2026 16:53
Show Gist options
  • Select an option

  • Save romgenie/8cc1ad04715b4e6b1c926bf1fbc0adf9 to your computer and use it in GitHub Desktop.

Select an option

Save romgenie/8cc1ad04715b4e6b1c926bf1fbc0adf9 to your computer and use it in GitHub Desktop.
Example coding workflow - STS2 MCP wrapper development flow

Development Workflow


Architecture

graph LR
    subgraph HOST ["Host (LIGHTHOUSE)"]
        W[sts2-mcp-wrapper/<br/>widgets + .env]
        S[STS2MCP/<br/>mod source]
        U[update_vm_ip.py]
    end

    subgraph VM1 ["win11-base VM"]
        G[STS2 Game + MCP Mod<br/>:15526 API]
    end

    subgraph VM2 ["openclaw-dev-02 VM"]
        O[OpenClaw Agent<br/>STS2MCP bridge]
    end

    W -- "API calls" --> G
    S -- "SCP deploy" --> G
    O -- "bridge" --> G
Loading

Deploy Flow

flowchart TD
    A[Identify Need] --> B{Client or Mod?}

    B -->|Client Widget| C[Edit widget code locally]
    C --> D[Test against live API]
    D --> E{Working?}
    E -->|No| C
    E -->|Yes| F[Lint with ruff]
    F --> G[Stage & Commit to sts2-mcp-wrapper]

    B -->|Mod Patch| H[Edit McpMod.StateBuilder.cs]
    H --> I[dotnet build locally]
    I --> J{Build OK?}
    J -->|No| H
    J -->|Yes| K[Commit & Push to fork/main]
    K --> L[SSH: SCP DLL to win11-base VM]
    L --> M[SSH: Restart game via scheduled task]
    M --> N[Test via API from host]
    N --> O{Working?}
    O -->|No| H
    O -->|Yes| P{Upstream?}
    P -->|Stage| Q[Create branch off origin/main\nPush to fork - no PR yet]
    P -->|Submit| R[Create PR against\nGennadiyev/STS2MCP]
    P -->|Later| G

    Q --> G
    R --> S[Monitor PR feedback]
    S --> T{Changes requested?}
    T -->|Yes| U[Update branch\nForce-push]
    U --> S
    T -->|Merged| V[Done]
Loading

Screenshot Loop (Visual Verification)

Use the screenshot-action-screenshot cycle to verify UI interactions:

# 1. Capture — runs in interactive session via scheduled task (uses SetForegroundWindow)
ssh hostname@<VM_IP> "schtasks /run /tn TakeScreenshot" && sleep 3
scp hostname@<VM_IP>:C:/Users/hostname/screenshot.png ./screenshot.png

# 2. Analyze screenshot to understand current UI state

# 3. Perform action via API

# 4. Re-capture — verify result
ssh hostname@<VM_IP> "schtasks /run /tn TakeScreenshot" && sleep 3
scp hostname@<VM_IP>:C:/Users/hostname/screenshot.png ./screenshot.png

# 5. Iterate if needed

Key Commands

Build, deploy, restart (one shot)

cd STS2MCP
dotnet build STS2_MCP.csproj -c Release -o out/STS2_MCP -p:STS2GameDir="D:\SteamLibrary\steamapps\common\Slay the Spire 2"
ssh hostname@<VM_IP> "powershell -Command \"Stop-Process -Name SlayTheSpire2 -Force -ErrorAction SilentlyContinue\""
scp STS2MCP/out/STS2_MCP/STS2_MCP.dll hostname@<VM_IP>:"C:/Program Files (x86)/Steam/steamapps/common/Slay the Spire 2/mods/"
ssh hostname@<VM_IP> "schtasks /run /tn LaunchSTS2"

Update VM IP after reboot

python update_vm_ip.py

Widgets

Command View
python widgets/dashboard.py Full dashboard
python widgets/combat/dashboard.py Combat
python widgets/game_state/dashboard.py Player state
python widgets/map/dashboard.py Map
python widgets/reference/dashboard.py Glossary
python widgets/reference/bestiary.py Bestiary
python widgets/game_state/profile.py Profile stats

API Endpoints

Game State

Endpoint Method Description
/api/v1/singleplayer GET Game state (combat, map, event, menu, etc.)
/api/v1/singleplayer POST Game actions (play_card, menu_select, etc.)

Player Data

Endpoint Method Description
/api/v1/profile GET Player profile (stats, discovery, encounters)
/api/v1/profiles GET List all profiles
/api/v1/profiles POST Switch/delete profiles
/api/v1/settings GET Game settings

Reference

Endpoint Method Description
/api/v1/bestiary GET All monsters and encounters
/api/v1/glossary/cards GET All cards for current character
/api/v1/glossary/relics GET Character relics
/api/v1/glossary/potions GET Character potions
/api/v1/glossary/keywords GET Keywords from all items

VM Access

VM User Key Purpose
win11-base hostname ct_vm_hyperv_ed25519 Game + MCP mod
openclaw-dev-02 ct-vm-template ct_vm_hyperv_ed25519 OpenClaw agent

Upstream Contributions (romgenie/STS2MCP)

  • Stage for upstream — commit on new branch, push to fork, no PR
  • Push queued PRs — create PRs against Gennadiyev/STS2MCP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment