windbot AGENTS.md

Project guidance for WindBot, a C# program that plays the card game Yu-Gi-Oh! through compatible game servers. It explains the project structure, information limits, and how decisions travel through the program.

In plain words
What is it for?
Use it when changing WindBot's network handling, game state, card-deck decision logic, startup flow, or project files.
Why use it?
It gives coding agents the project-specific rules they need to avoid guessing hidden card information or misusing this older .NET Framework codebase.

Instructions file for CodexOpenCode

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 instructions/iceygo/windbot/agents-md
Clone the repo
git clone --depth 1 https://github.com/IceYGO/windbot

Made for: Codex, OpenCode.

Per session 5,254 This file is loaded in full into every session.
When invoked 5,254 The same file — it is already loaded in full.
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.05254 $0.05254
Opus 5 $0.02627 $0.02627
Sonnet 5 $0.01051 $0.01051
Haiku 4.5 $0.00525 $0.00525

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

Security

Grade A, and why

windbot AGENTS.md 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 2d 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.

AGENTS.md · 169 lines

How it starts

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

AGENTS.md

项目定位

  • WindBot 是面向 YGOPro/YGOSharp/SRVPro 协议的 C# 决斗机器人,本质上是一个自动操作的 YGOPro 客户端。
  • 主程序基于 .NET Framework 4.8,解决方案支持 Any CPU 和 x86,当前默认平台与 CI 主验证平台为 Any CPU;项目是旧式非 SDK .csproj,不要默认使用仅适用于现代 .NET/SDK 项目的工具和 API。
  • 机器人只能使用服务器发给当前客户端的信息。对方手牌、牌组、盖卡等未公开信息通常只有数量或 Id == 0 的占位对象,不能读取、推断或硬编码其真实内容。
  • 服务器在要求客户端响应时已经给出了合法操作候选。牌组 AI 的职责主要是判断“现在是否值得这样做”以及“选哪个目标”,而不是复述发动条件。

解决方案与运行链路

解决方案包含两个项目:

  • WindBot.csproj:控制台主程序,包含网络协议、客户端状态和全部决斗 AI;输出 WindBot.exe
  • BotWrapper/BotWrapper.csproj:供 YGOPro 人机模式调用的轻量启动器,整理启动参数并启动 WindBot.exe;输出 Bot.exe

主程序的调用链如下:

  1. Program.cs 读取命令行或配置文件,初始化牌组注册表和 cards.cdb,然后以单实例模式或 HTTP server 模式启动机器人。
  2. Game/GameClient.cs 建立连接、进入房间并把收到的数据包交给 GameBehavior
  3. Game/GameBehavior.csStocMessage/GameMessage 解包,更新 DuelClientFieldClientCard 等客户端可见状态,并在需要响应时调用 GameAI
  4. Game/GameAI.cs 整理服务端给出的合法候选,按优先级查询当前牌组的 Executor 并返回决策;GameBehavior 负责验证、编码并把响应发回服务器。
  5. Game/AI/DecksManager.cs 通过反射发现带 [Deck] 的执行器,并为每局实例化对应牌组 AI。
  6. Game/AI/Executor.cs 定义公共回调和有序的 CardExecutor 列表;各牌组通常继承 DefaultExecutor

server 模式会为每个 HTTP 请求创建独立线程和独立的 GameClient/Duel/Executor。不要把单局可变状态放进静态字段,也不要让不同机器人实例共享未同步的牌组状态。

目录职责

  • Game/:决斗状态、消息处理、主阶段/战斗阶段动作模型。
  • Game/AI/:AI 调度、选择队列、通用决策、卡片扩展方法和领域常量。
  • Game/AI/Decks/:各牌组的专用执行器,是新增或调整牌组逻辑的首选位置。
  • Game/AI/Enums/:跨牌组共享的已知卡分类,例如压制卡、危险怪兽、不可取对象等。
  • YGOSharp.Network/:TCP 数据帧和 CTOS/STOC 协议层。
  • YGOSharp.OCGWrapper/YGOSharp.OCGWrapper.Enums/:卡片数据库模型和协议/规则枚举。
  • Decks/:运行时 .ydk 牌组文件。
  • Dialogs/:运行时 JSON 对话资源。
  • BotWrapper/:外部 bot 启动包装器及其配置。

层次边界应保持清晰:

  • 协议解析和客户端状态同步放在 GameBehavior/网络层。
  • 通用、确实能被多个牌组复用的决策放在 DefaultExecutorAIUtilCardExtension 或共享枚举中。
  • 单一牌组的展开路线、卡片优先级和临时标志留在对应牌组执行器中。
  • 不要为了一个牌组的特例污染协议层或全局默认逻辑。

AI 决策模型

AddExecutor 顺序就是优先级

GameAI 会按注册顺序遍历 Executor.Executors,再遍历服务器给出的候选卡;第一个匹配且返回 true 的执行器立即胜出。因此:

  • 构造函数中的 AddExecutor 顺序具有决定性影响,调整顺序属于行为修改,不是格式整理。
  • 更具体、更紧急的响应放在前面,通用处理和兜底放在后面。
  • 同一张卡的不同效果或不同局面可以注册多次;需要用 CardActivateDescriptionCurrentTiming 和当前连锁状态区分。
  • AddExecutor(type, cardId) 表示匹配后无条件接受;只应在所有合法出现时都适合执行的场景使用。
  • GoToBattlePhaseGoToEndPhaseSurrender 等没有卡片上下文,其条件函数不能依赖 Card

Read the full file on GitHub · 169 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. 2d ago First seen · 169 lines · 5,254 tokens per session scan A 6261d7e4c834

Subscribe to this mod's changes

windbot AGENTS.md is an instructions file published in the GitHub repository IceYGO/windbot (103 stars, last pushed 3d ago), licensed MIT. It adds 5,254 tokens to every session, about $0.0263 per session on Opus 5. 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 instructions, from other repositories

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens