Agent skill

Reaction Forward Prediction

by PKU-YuanGroup in PKU-YuanGroup/OpenAI4S

Predict ranked products from reactants and reagents with ReactionT5v2-forward; use for outcome prediction or round-trip recovery.

MITAuto-check passed

Install Reaction Forward Prediction

skills CLI
$ npx skills add PKU-YuanGroup/OpenAI4S --skill reaction-forward-prediction -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install PKU-YuanGroup/OpenAI4S reaction-forward-prediction --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/PKU-YuanGroup/OpenAI4S.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/reaction-forward-prediction .claude/skills/reaction-forward-prediction && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
reaction-forward-prediction
GitHub stars
622
Token cost
~2k tokens
SKILL.md length
665 words
Files
3
Skills in repo
17
Repo updated
First seen
Licence
MIT

At a glance

Predict ranked products from reactants and reagents with ReactionT5v2-forward; use for outcome prediction or round-trip recovery.

  • Works in 5 steps: Keep precursors and reagents in… → Generate no more top-k products than the… → Parse and canonicalize each predicted… → …
  • Outcome prediction
  • SKILL.md covers Install and run, Scenario 4 benchmark contract, Round-trip check and Output contract, plus 1 more section
  • Calls git, conda and python; reaches github.com

What it does

Reaction Forward Prediction is an agent skill from PKU-YuanGroup/OpenAI4S. Predict ranked products from reactants and reagents with ReactionT5v2-forward; use for outcome prediction or round-trip recovery. Product rank is not reaction feasibility.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `README.md` and `README_zh.md`).

The repository describes itself as: Open-source AI agent for scientific research. Analyze data in Python/R with Claude, GPT, Gemini, and more. The licence is MIT.

When your agent uses it

  • Outcome prediction
  • Round-trip recovery

Example prompts

  • “/reaction-forward-prediction”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Keep precursors and reagents in different fields; missing reagents are an
  2. Generate no more top-k products than the review can inspect.
  3. Parse and canonicalize each predicted product with RDKit.
  4. Compare canonical intended product against the top-k set and record its rank.
  5. Preserve nonmatching top products as possible model disagreements or

What it can do on your machine

Read from SKILL.md and the folder at commit 4a72e87. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • conda
    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    Also links to:

    • huggingface.co

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Reaction Forward Prediction loads about 2k tokens when it runs. Until then it costs about 50 tokens; SKILL.md has 665 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~50
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from PKU-YuanGroup/OpenAI4S at commit 4a72e87, republished under its MIT licence (© PKU-YuanGroup). 665 words, ~1,993 tokens.

Download SKILL.mdSave it as .claude/skills/reaction-forward-prediction/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
reaction-forward-prediction
description
Predict ranked products from reactants and reagents with ReactionT5v2-forward; use for outcome prediction or round-trip recovery. Product rank is not reaction feasibility.
license
MIT
origin
openai4s

Forward reaction prediction

Answer one scientific question: given reactants and a separately declared reagent/condition string, which product structures does the model rank highest? For retrosynthesis review, test whether the intended product appears in the forward model's top-k outputs. Call this round-trip recovery, not proof that the reaction works.

Use sagawa/ReactionT5v2-forward by default. It is a 2025 peer-reviewed, MIT-licensed 0.2B model distributed as safetensors and runs through ordinary Transformers.

Install and run

Install in a separate environment; do not add these packages to OpenAI4S core:

bash
conda create -n reactiont5 python=3.11 -y
conda run -n reactiont5 python -m pip install \
  "torch" "transformers==4.40.2" "tokenizers==0.19.1" \
  "huggingface_hub[cli]==0.35.0" \
  sentencepiece rdkit datasets accelerate pandas

Acquire an immutable local model snapshot and a reviewed source checkout from an operator terminal whose current directory is the writable session workspace. The revisions below are the reviewed revisions for this recipe; do not replace either with main. A future revision requires a new review and provenance record before use.

bash
set -eu

REACTIONT5_ROOT="$PWD/models/reactiont5"
SOURCE_COMMIT="76eb08068e10fe255cae5d563a91e1c1e9abac54"
FORWARD_REVISION="933114058cb2604dc1bf536dbebdfcefbe83d4fc"

mkdir -p "$REACTIONT5_ROOT"
if [ ! -d "$REACTIONT5_ROOT/source/.git" ]; then
  git clone https://github.com/sagawatatsuya/ReactionT5v2.git \
    "$REACTIONT5_ROOT/source"
fi
git -C "$REACTIONT5_ROOT/source" cat-file -e "${SOURCE_COMMIT}^{commit}"
git -C "$REACTIONT5_ROOT/source" checkout --detach "$SOURCE_COMMIT"
test "$(git -C "$REACTIONT5_ROOT/source" rev-parse HEAD)" = "$SOURCE_COMMIT"
SOURCE_STATUS="$(git -C "$REACTIONT5_ROOT/source" status \
  --porcelain --untracked-files=all)"
test -z "$SOURCE_STATUS"

conda run -n reactiont5 hf download sagawa/ReactionT5v2-forward \
  --revision "$FORWARD_REVISION" \
  --local-dir "$REACTIONT5_ROOT/forward-$FORWARD_REVISION"

The final assertion must remain empty; if a reused checkout has modified or untracked files, stop instead of executing it as reviewed source.

Record the two revisions and hashes of the downloaded regular files. Keep the snapshot outside version control. The batch CLI imports repository-local modules, so run prediction.py with task_forward as its working directory and pass only the reviewed local snapshot:

bash
REACTIONT5_ROOT="$PWD/models/reactiont5"
FORWARD_REVISION="933114058cb2604dc1bf536dbebdfcefbe83d4fc"

HF_HUB_OFFLINE=1 conda run -n reactiont5 \
  --cwd "$REACTIONT5_ROOT/source/task_forward" \
  python prediction.py \
  --input_data "$PWD/reactions.csv" \
  --model_name_or_path "$REACTIONT5_ROOT/forward-$FORWARD_REVISION" \
  --input_max_length 150 --num_beams 5 --num_return_sequences 5 \
  --batch_size 16 --output_dir "$PWD/forward-output"

Run that block from the session workspace root so $PWD expands to absolute workspace input/output paths. For a single record, select the environment in its own OpenAI4S Python Cell:

python
host.env.use("reactiont5")

After the switch succeeds, load only the reviewed local snapshot in a new Cell:

python
import os
from pathlib import Path

from transformers import AutoModelForSeq2SeqLM, AutoTokenizer

reviewed_revision = "933114058cb2604dc1bf536dbebdfcefbe83d4fc"
snapshot = Path.cwd() / "models" / "reactiont5" / f"forward-{reviewed_revision}"
if not snapshot.is_dir():
    raise FileNotFoundError(f"reviewed snapshot is missing: {snapshot}")
os.environ["HF_HUB_OFFLINE"] = "1"
tokenizer = AutoTokenizer.from_pretrained(snapshot, local_files_only=True)
model = AutoModelForSeq2SeqLM.from_pretrained(snapshot, local_files_only=True)
model.eval()
text = "REACTANT:CCBr.OCCREAGENT:"
inputs = tokenizer(text, return_tensors="pt")
generated = model.generate(
    **inputs,
    num_beams=5,
    num_return_sequences=5,
    return_dict_in_generate=True,
    output_scores=True,
)
products = [
    tokenizer.decode(row, skip_special_tokens=True).replace(" ", "").rstrip(".")
    for row in generated.sequences
]

Record the model ID, reviewed revision, local file hashes, source commit, package versions, device, beam settings, and input string. Never fall back from a missing local snapshot to a moving Hub model ID.

For a reproducible OpenAI4S deployment, use the pinned reactiont5v2 plan in ../retrosynthesis_planning/reaction_model_deployment.py, download sagawa/ReactionT5v2-forward at revision 933114058cb2604dc1bf536dbebdfcefbe83d4fc, snapshot every downloaded file, and pass the local snapshot to ReactionModelBackend("reactiont5_forward", ...). The worker forces local_files_only=True; implicit Hugging Face downloads are not allowed during inference. top_k is limited to 1--10 and max_new_tokens to 1--256; record both values with each run.

The pinned snapshot has passed a real CPU model-card canary in the external model root: the declared reactant/reagent example returned CN1CCC=C(CO)C1, exactly matching the published expected product. This proves that the pinned files load and the input protocol is reproduced; it is not a chemistry-wide accuracy claim.

Show full SKILL.md (289 more words)Show less

Scenario 4 benchmark contract

Use ../retrosynthesis_planning/forward_benchmark.py with the frozen separated reactant/reagent inputs. Preserve every submitted beam, including empty, invalid, and duplicate products. The private evaluator compares against all recorded products and reports both isomeric and connectivity Top-K accuracy so stereochemistry-only failures remain visible. A connectivity hit is not silently promoted to an exact stereochemical hit.

Pin the Hugging Face revision for reproducible work and record resolved commit, model ID, package versions, device, beam settings, and input string.

Round-trip check

  1. Keep precursors and reagents in different fields; missing reagents are an explicit unknown, not an empty condition claim.
  2. Generate no more top-k products than the review can inspect.
  3. Parse and canonicalize each predicted product with RDKit.
  4. Compare canonical intended product against the top-k set and record its rank.
  5. Preserve nonmatching top products as possible model disagreements or byproduct hypotheses.

Do not multiply a backward-model score by a forward-model score unless both were calibrated together on a deployment-matched held-out set. If the backward and forward checkpoints share training data, round-trip agreement is correlated evidence rather than an independent experiment.

Output contract

Return reactants, reagents, ranked canonical products, invalid outputs, intended product rank or null, top-k recovery, raw sequence scores when available, and model provenance. Do not emit a boolean feasible field.

Failure modes

SymptomAction
intended product absentReport failed top-k recovery; inspect reagent encoding, stereochemistry, salts, and candidate chemistry.
invalid SMILESRetain the raw string for audit, mark parse failure, and exclude it from canonical matching.
all top products identicalReport low beam diversity instead of presenting duplicates as support.
CPU latency is highBatch requests or move the isolated environment to a GPU; do not reduce provenance or validation.

Primary sources: https://github.com/sagawatatsuya/ReactionT5v2 and https://huggingface.co/sagawa/ReactionT5v2-forward.

© PKU-YuanGroup, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files in skills/reaction-forward-prediction of PKU-YuanGroup/OpenAI4S.

  • SKILL.md
  • README.md
  • README_zh.md

Open the folder on GitHubat commit 4a72e87

Compare with similar skills

Reaction Forward Prediction next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Reaction Forward Prediction compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Reaction Forward Prediction this skillPKU-YuanGroup/OpenAI4S622—~2kAutomated safety check: PassMIT
Autopilot Predictruvnet/ruflo74k—~337Automated safety check: PassMIT
Prediction Market Oracle Researchaffaan-m/ECC277k1 repos~577Automated safety check: PassMIT
Prediction Market Risk Reviewaffaan-m/ECC276k1 repos~471Automated safety check: PassMIT
Footballbin Predictionsdavila7/claude-code-templates33k—~634Automated safety check: PassMIT
Gmail Message Forwardergoogleworkspace/cli31k—~763Automated safety check: PassApache-2.0

Similar skills

  • Autopilot Predict

    ruvnet/ruflo

    Use learned patterns and current state to predict the optimal next action

    74k GitHub stars~337 tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Research prediction markets as data sources or oracle signals for products, agents, dashboards, and corporate decision intelligence.

    277k GitHub starsUsed in 1 repo~577 tokens
    Knowledge ManagementAuto-check passed
  • Review prediction-market, basket, oracle, and trading-agent workflows for compliance, safety, data-quality, privacy, and execution risk.

    276k GitHub starsUsed in 1 repo~471 tokens
    Data & AnalyticsAuto-check passed
  • Footballbin Predictions

    davila7/claude-code-templates

    Get AI-powered match predictions for Premier League and Champions League including scores, next goal, and corners.

    33k GitHub stars~634 tokensUpdated yesterday
    Auto-check passed
  • Gmail Message Forwarder

    googleworkspace/cli

    Forwards an existing Gmail message to new recipients from the command line with the gws CLI, with options for notes, attachments, CC, BCC and drafts.

    31k GitHub stars~763 tokensUpdated 4 days ago
    Productivity & AutomationAuto-check passed
  • Find Gmail messages with a specific label and forward them to another address.

    31k GitHub stars~226 tokensUpdated 4 days ago
    Productivity & AutomationAuto-check passed

More from PKU-YuanGroup/OpenAI4S

All 17 skills in this repo
  • Single Cell Rna Analysis

    PKU-YuanGroup/OpenAI4S

    Reproducible Scanpy workflow for human or mouse 10x scRNA-seq and snRNA-seq count matrices: single-sample descriptive QC, clustering and annotation, or comparative donor-aware pseudobulk DE and Milo…

    622 GitHub stars~1.3k tokensUpdated 2 days ago
    Auto-check passed
  • Bioprobench

    PKU-YuanGroup/OpenAI4S

    Score an LLM's biological-protocol reasoning on the BioProBench benchmark: protocol QA, step ordering, error detection, protocol generation, and LLM-judged error reasoning; or generate the responses.

    622 GitHub stars~2.3k tokensUpdated 2 days ago
    Auto-check passed
  • Reaction Atom Mapping

    PKU-YuanGroup/OpenAI4S

    Map atoms and changed bonds for a complete reaction with RXNMapper.

    622 GitHub stars~1.2k tokensUpdated 2 days ago
    Auto-check passed
  • Reaction Yield Estimation

    PKU-YuanGroup/OpenAI4S

    Estimate yield for a fully specified reactant/reagent/product record with ReactionT5v2-yield.

    622 GitHub stars~2.3k tokensUpdated 2 days ago
    Auto-check passed
  • Rfdiffusion

    PKU-YuanGroup/OpenAI4S

    Generate de novo protein backbones with RFdiffusion for protein-target binders, hotspot-conditioned interfaces, motif scaffolding, partial diffusion, or symmetric assemblies.

    622 GitHub stars~2.2k tokensUpdated 2 days ago
    Auto-check passed
  • Single Step Retrosynthesis

    PKU-YuanGroup/OpenAI4S

    Generate ranked one-step precursor sets for a product with RetroChimera; use for disconnection ideas or expansion-policy calls.

    622 GitHub stars~1.8k tokensUpdated 2 days ago
    Auto-check passed

Questions about Reaction Forward Prediction

What does Reaction Forward Prediction do?

Predict ranked products from reactants and reagents with ReactionT5v2-forward; use for outcome prediction or round-trip recovery. Reaction Forward Prediction is an agent skill from PKU-YuanGroup/OpenAI4S. Predict ranked products from reactants and reagents with ReactionT5v2-forward; use for outcome prediction or round-trip recovery.

When should I use Reaction Forward Prediction?

Reaction Forward Prediction fits situations like: outcome prediction; round-trip recovery.

How do I install Reaction Forward Prediction in Claude Code?

Run `npx skills add PKU-YuanGroup/OpenAI4S --skill reaction-forward-prediction -a claude-code`. Or copy the skill folder (skills/reaction-forward-prediction in PKU-YuanGroup/OpenAI4S) into .claude/skills/reaction-forward-prediction in your project. Claude Code loads it when a task matches its description.

How do I install Reaction Forward Prediction in Codex?

Run `npx skills add PKU-YuanGroup/OpenAI4S --skill reaction-forward-prediction -a codex`. Or copy the skill folder (skills/reaction-forward-prediction in PKU-YuanGroup/OpenAI4S) into .agents/skills/reaction-forward-prediction in your project. Codex loads it when a task matches its description.

Can I use Reaction Forward Prediction in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add PKU-YuanGroup/OpenAI4S --skill reaction-forward-prediction -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/reaction-forward-prediction, .gemini/skills/reaction-forward-prediction, .github/skills/reaction-forward-prediction and .opencode/skills/reaction-forward-prediction in your project.

What does Reaction Forward Prediction need to run?

Going by SKILL.md and its folder, Reaction Forward Prediction needs the command-line tools its instructions call (git, conda and python). Our summary lists: Python 3.

Does Reaction Forward Prediction access the network?

SKILL.md names 2 domains. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. As links in the text: huggingface.co. This is read from the text; nothing was executed.

Is Reaction Forward Prediction safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Reaction Forward Prediction use?

Reaction Forward Prediction is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Reaction Forward Prediction use?

About 2k tokens (SKILL.md is roughly 8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Reaction Forward Prediction?

Skills that share tags, products or a category with Reaction Forward Prediction: Autopilot Predict (ruvnet/ruflo, 74k stars), Prediction Market Oracle Research (affaan-m/ECC, 277k stars), Prediction Market Risk Review (affaan-m/ECC, 276k stars) and Footballbin Predictions (davila7/claude-code-templates, 33k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Reaction Forward Prediction?

PKU-YuanGroup (a GitHub organization) maintains it in PKU-YuanGroup/OpenAI4S, which has 622 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 9, 2026.

Source: PKU-YuanGroup/OpenAI4S on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.