ptcg-2ply-bounded-search

ptcg-2ply-bounded-search is a skill for Claude Code, Codex from topprismdata/cultivating-ml-agent. It costs 181 tokens per session (1,588 once invoked), scanned A, original, MIT.

A method for adding two-step look-ahead search to a behaviour-cloning agent for Pokémon Trading Card Game battles. Behaviour cloning trains an agent to copy decisions from example play, while bounded search tests likely future outcomes before choosing an action.

In plain words
What is it for?
Use it when you already have a trained policy and value model, the game library provides the required search interface, and you want to evaluate possible actions over two turns.
Why use it?
A behaviour-cloning agent normally chooses from the current situation without looking ahead. The added search lets it compare candidate actions using simulated future states and the model’s value estimate.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when you already have a trained policy and value model, the game library provides the required search interface, and you want to evaluate possible actions over two turns.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/topprismdata/cultivating-ml-agent/ptcg-2ply-bounded-search
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.

Any agent
npx skills add topprismdata/cultivating-ml-agent --skill ptcg-2ply-bounded-search
Clone the repo
git clone --depth 1 https://github.com/topprismdata/cultivating-ml-agent

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ptcg-2ply-bounded-search

README.md
[![agentmods](https://agentmods.dev/badge/skills/topprismdata/cultivating-ml-agent/ptcg-2ply-bounded-search/github.svg)](https://agentmods.dev/skills/topprismdata/cultivating-ml-agent/ptcg-2ply-bounded-search)
Your own site
<a href="https://agentmods.dev/skills/topprismdata/cultivating-ml-agent/ptcg-2ply-bounded-search"><img src="https://agentmods.dev/badge/skills/topprismdata/cultivating-ml-agent/ptcg-2ply-bounded-search/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ptcg-2ply-bounded-search

Your own site · 80×15
<a href="https://agentmods.dev/skills/topprismdata/cultivating-ml-agent/ptcg-2ply-bounded-search"><img src="https://agentmods.dev/badge/skills/topprismdata/cultivating-ml-agent/ptcg-2ply-bounded-search.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 181 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,588 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00181 $0.01588
Opus 5 $0.00090 $0.00794
Sonnet 5 $0.00036 $0.00318
Haiku 4.5 $0.00018 $0.00159

Measured 12d ago against content hash 70cd8b6d1227, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

ptcg-2ply-bounded-search 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 12d 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.

skills/examples/ptcg-2ply-bounded-search/SKILL.md · 142 lines

How it starts

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

Pokémon TCG — 2-ply Bounded Search on BC Agent

Why search on top of BC?

Pure BC is reaction-based: it picks the highest-probability action at the current state. It cannot look ahead. The 1st-place LB 1204 model uses "RL + bounded search" — search is the structural advantage.

A BC model already has a value head (trained alongside the policy head). Re-encoding a hypothetical future state and reading the value gives a leaf evaluation — usable for any-tree, expectimax, or simple best-of-K scoring.

Algorithm (validated pipeline, v8)

def agent(obs_dict, deck, model):
    obs = to_observation_class(obs_dict)
    if obs.select is None: return deck
    options = obs.select.option
    if not options: return []

    # 1. Root forward (one shared pass)
    enc_idx, enc_val, enc_off, opt_t = encode(obs, deck, options)
    with torch.no_grad():
        root_logits, _ = model(enc_idx, enc_val, enc_off, opt_t)
    root_probs = sigmoid(root_logits)  # [N_opt]

    # 2. For each candidate option i:
    scores = []
    for i in range(N_opt):
        sample_scores = []
        for _ in range(N_SAMPLES):              # = 5
            opp = sample_opponent_hidden(obs, deck)  # SNORLAX pad
            ss = search_begin(obs, ..., opp)         # root branch
            # 2a: my move i
            s1 = search_step(ss.search_id, [i])
            # 2b: opponent's BC-greedy response
            opp_choice = bc_greedy(model, s1.observation, deck)
            # 2c: opponent's move
            s2 = search_step(s1.search_id, opp_choice)
            # 2d: leaf value
            leaf_v = encode_and_value(model, s2.observation, deck)
            sample_scores.append(root_probs[i] + GAMMA * leaf_v)
            search_release(ss.search_id)
        scores[i] = mean(sample_scores)

    # 3. top-k by score
    return topk_indices(scores, n_select)

Parameters (validated defaults)

Param Value Notes
N_SAMPLES 5 hidden state samples per option
GAMMA 0.5 leaf-value discount (lower = trust BC more)
Opponent model BC-greedy same model, sigmoid top-1
Hidden state padding SNORLAX=1072 unknown Pokemon, id=1 basic energy convention from probe_search.py
n_select max(obs.select.maxCount, minCount) same as v6/v7

Read the full file on GitHub · 142 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. 12d ago First seen · 142 lines · 181 tokens per session scan A 70cd8b6d1227

Subscribe to this mod's changes

ptcg-2ply-bounded-search is a skill published in the GitHub repository topprismdata/cultivating-ml-agent (5 stars, last pushed 15d ago), licensed MIT. It adds 181 tokens to every session and 1,588 once invoked, about $0.0009 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-31.

Related

Other skills, from other repositories

ai-unity-asset-pipeline

Build, install, run, and verify a reusable image-to-game-ready-3D pipeline for Unity with controlled ImageGen references, approved AI mesh providers, Blender MCP/CLI, modular era catalogs, Blender retopology/LOD/pivot processing, and Unity import/render proof. Use for 2D-to-3D assets, vehicles, aircraft, ships…

ezBuilder/code-brain · 95 tokens

agora-dungeon-game-dev

Build a 2D dungeon game where AI agents cooperate, work on businesses, and an orchestrator (human) guides them — Phaser 3 + TypeScript + React + Node backend with LLM agents.

DanceNitra/agora · 49 tokens

agency-godot-gameplay-scripter

Composition and signal integrity specialist - Masters GDScript 2.0, C# integration, node-based architecture, and type-safe signal design for Godot 4 projects.

BlackPearl-AI/BlackPearl-CodingAgent · 44 tokens

agency-game-audio-engineer

Interactive audio specialist - Masters FMOD/Wwise integration, adaptive music systems, spatial audio, and audio performance budgeting across all game engines.

BlackPearl-AI/BlackPearl-CodingAgent · 33 tokens

agency-godot-multiplayer-engineer

Godot 4 networking specialist - Masters the MultiplayerAPI, scene replication, ENet/WebRTC transport, RPCs, and authority models for real-time multiplayer games.

BlackPearl-AI/BlackPearl-CodingAgent · 42 tokens

agency-godot-shader-developer

Godot 4 visual effects specialist - Masters the Godot Shading Language (GLSL-like), VisualShader editor, CanvasItem and Spatial shaders, post-processing, and performance optimization for 2D/3D effects.

BlackPearl-AI/BlackPearl-CodingAgent · 53 tokens