sts2_api_reference

A reference guide to the decompiled programming interface of Slay the Spire 2, a video game. It lists available code signatures and points to full decompiled source files for the game.

In plain words
What is it for?
Use it to look up classes, commands, cards, relics, players, and other game models, and to copy reference implementations such as the basic Strike attack card.
Why use it?
It helps developers understand how the game’s code is structured when creating or inspecting mods, without repeatedly searching through the compiled game files.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/cgxjdzz/agentthespire/sts2_api_reference
Clone the repo
git clone --depth 1 https://github.com/cgxjdzz/AgentTheSpire
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 12,237 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.12237
Opus 5 $0.00000 $0.06118
Sonnet 5 $0.00000 $0.02447
Haiku 4.5 $0.00000 $0.01224

Measured 3d ago against content hash 98e366f311ed, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sts2_api_reference scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

backend/agents/sts2_api_reference.md · 1,255 lines

How it starts

The opening of the file, as written. The whole thing — 1,255 lines — stays where its author put it; the contents beside it link to each section on GitHub.

STS2 反编译 API 参考

自动生成,来源:sts2.dll 反编译(ilspycmd v9.1.0) 只保留签名,不含方法体实现 游戏路径:见 config.json sts2_path 字段

⚡ 完整反编译源码(优先用这里,不要跑 ilspycmd)

反编译目录路径由 config.jsondecompiled_src_path 字段配置,已在你的 prompt 的 API Lookup 段注入。 若该段显示"NOT available",运行 python scripts/decompile_sts2.py --game-path <STS2路径> 生成。

常用子目录(在配置的反编译目录下):

MegaCrit.Sts2.Core.Commands\      ← DamageCmd, CardCmd, CardSelectCmd, RelicSelectCmd, PowerCmd...
MegaCrit.Sts2.Core.Models.Cards\  ← StrikeIronclad, 所有原版卡牌完整实现
MegaCrit.Sts2.Core.Models\        ← AbstractModel, RelicModel, CardModel, ModelDb
MegaCrit.Sts2.Core.Entities.Players\   ← Player
MegaCrit.Sts2.Core.CardSelection\      ← CardSelectorPrefs

只有在反编译目录里找不到时才用 ilspycmd。


官方参照实现(直接抄,不用反编译)

Attack 卡标准实现 — StrikeIronclad(原版基础攻击卡)

// 来源:sts2.dll MegaCrit.Sts2.Core.Models.Cards.StrikeIronclad(完整实现)
using System.Collections.Generic;
using System.Threading.Tasks;
using MegaCrit.Sts2.Core.Commands;                 // DamageCmd
using MegaCrit.Sts2.Core.Entities.Cards;           // CardType, CardRarity, TargetType, CardTag
using MegaCrit.Sts2.Core.GameActions.Multiplayer;  // PlayerChoiceContext, CardPlay
using MegaCrit.Sts2.Core.Localization.DynamicVars; // DamageVar
using MegaCrit.Sts2.Core.ValueProps;               // ValueProp

namespace MegaCrit.Sts2.Core.Models.Cards;

public sealed class StrikeIronclad : CardModel
{
    protected override HashSet<CardTag> CanonicalTags => new HashSet<CardTag> { CardTag.Strike };

    // DamageVar(baseValue, ValueProp.Move) — 伤害值,跟随力量/虚弱/脆弱自动计算
    protected override IEnumerable<DynamicVar> CanonicalVars =>
        [new DamageVar(6m, ValueProp.Move)];

    public StrikeIronclad()
        : base(1, CardType.Attack, CardRarity.Basic, TargetType.AnyEnemy) { }

    protected override async Task OnPlay(PlayerChoiceContext choiceContext, CardPlay cardPlay)
    {
        ArgumentNullException.ThrowIfNull(cardPlay.Target, "cardPlay.Target");
        await DamageCmd.Attack(base.DynamicVars.Damage.BaseValue)
            .FromCard(this)
            .Targeting(cardPlay.Target)
            .WithHitFx("vfx/vfx_attack_slash")   // 可选:命中特效
            .Execute(choiceContext);
    }

    protected override void OnUpgrade()
    {
        base.DynamicVars.Damage.UpgradeValueBy(3m);  // 6 → 9
    }
}

Read the full file on GitHub · 1,255 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 1,255 lines · 0 tokens per session scan A 98e366f311ed

Subscribe to this mod's changes

sts2_api_reference is an agent published in the GitHub repository cgxjdzz/AgentTheSpire (54 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 12,237 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

ue-replication-specialist

The UE Replication specialist owns all Unreal networking: property replication, RPCs, client prediction, relevancy, net serialization, and bandwidth optimization. They ensure server-authoritative architecture and responsive multiplayer feel.

Donchitos/Claude-Code-Game-Studios · 47 tokens

pixel-art-animation-reviewer

Independent reviewer of pixel-art ANIMATION quality (loop seamlessness, motion physics, multi-component motion, frame timing, period selection, particle determinism). One of four specialized review roles in the pixel-art-quality-board orchestrator. Use when the user asks to "check animation timing", "verify loop…

AnastasiyaW/codex-claude-code-config · 140 tokens

pixel-art-composition-reviewer

Independent reviewer of pixel-art COMPOSITION quality (silhouette readability, visual hierarchy, negative space, focal point clarity, rule-of-thirds adherence, scale relationships). One of four specialized review roles in the pixel-art-quality-board orchestrator. Use when the user asks to "check composition", "is this…

AnastasiyaW/codex-claude-code-config · 137 tokens

Creative Director

Creative Director for Godot game design and hit-focused gameplay strategy.

muratgur/ordinus · 2 tokens

SwiftlyS2-Plan-Implementation

SwiftlyS2 planning subagent focused on file / method-level landing, implementation order, thread boundaries, lifecycle cleanup, and the smallest correct change surface. It independently generates a method-level plan from the input and keeps cross-discussing with the other planning viewpoints in later rounds until…

2oaJ/SwiftlyS2-Toolkit · 68 tokens

game-state-manager

Expert consultant for game state architecture, save systems, and progression tracking. Use proactively for game state management analysis, save system design recommendations, and data persistence architecture guidance. Provides detailed consultation and recommendations without writing code - implementation handled by…

spacehendrix/clauder · 105 tokens