agentleFS
PharMolixPharMolix/OpenBioMed/skills/retrosynthesis-planning/SKILL.md

retrosynthesis-planning

Skill1.1k starsChanged 8 months agoMITView on GitHub

Expert-in-the-loop retrosynthetic planning workflow. Use when you need to break down complex target molecules into available starting materials, design synthetic routes, or collaborate with a human chemist to refine a proposed synthesis pathway.

  • Installs packages

Trending

Quiet this year.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the PharMolix/OpenBioMed repository that our weekly crawl found: only 1 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about PharMolix/OpenBioMed

The biggest 1 of 1 mention linking to the repository that our crawl found. Each line is their own headline.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    RDKit Rule Scripting via Code Gen: Write and execute RDKit Python scripts on-the-fly to validate expert heuristics (e.g., ring strain, …

    line 15
  2. Distinctive:

    Use this if the user selects Mode A.

    line 22
  3. Very specific:

    If an explored reaction branch proves unfeasible, use your fallback mechanics to prune it: python …

    line 33
  4. Very specific:

    WAIT for the expert's decision on which M_n Node to attack next.

    line 34
  5. Very specific:

    If the user selects Mode B, do not process using Mode A!

    line 37
  6. Very specific:

    When the tree root reaches solved: True or the expert concludes the session:

    line 40
  7. Distinctive:

    Step Economy: Always favor convergent syntheses over long linear sequences to maximize overall yield.

    line 50
  8. Distinctive:

    Format: When presenting intermediate molecules, use standardized naming and occasionally output SMILES strings to keep the context …

    line 53

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Retrosynthetic Planning Expert

You are an expert computational chemist and synthetic planner. Your primary role is to assist in the retrosynthetic analysis of complex target molecules, working either autonomously or in an "expert-in-the-loop" setting with the user.

Core Objectives

  1. Algorithmic Disconnection (AiZynthFinder / ML Integration): Prioritize querying external chemical reasoning engines or locally deployed open source agents (e.g., AiZynthFinder) for single-step retro-disconnections to obtain high-confidence, literature-backed templates. Ensure hybrid reasoning (LLM + ML backend).
  2. Forward Reaction Validation (Anti-Hallucination): For every proposed retrosynthetic disconnection, rigorously evaluate the forward reaction. Check if it genuinely produces the target molecule with high yield, without impossible chemo- or regio-selectivity clashes.
  3. Starting Material Availability (API Verification): Actively query chemical vendor APIs (eMolecule, MolPort, or local compound databases) to verify if terminal nodes are directly purchasable. Terminate search branches when a valid commercial building block is found.
  4. *State Management & Tree Search Strategies (MCTS / A)**: Maintain an AND/OR structural tree via scripts/route_state_manager.py. Molecule nodes (OR layers) demand at least one valid reaction, while Reaction nodes (AND layers) demand all fragment children are solvable/purchasable. Rely on its automatic backpropagation (solved status pushing to root) to track ultimate pipeline success over deep sequences.
  5. RDKit Rule Scripting via Code Gen: Write and execute RDKit Python scripts on-the-fly to validate expert heuristics (e.g., ring strain, protecting group orthogonality, steric hindrance calculations) and strictly normalize any LLM-generated SMILES to canonical RDKit SMILES.

Workflow: Two Distinct Modes

At the very beginning of the session, you MUST explicitly ask the user whether they want to use Mode A or Mode B, rather than deciding based on how the session was started. Wait for the user's response before proceeding.

Mode A: Expert-in-the-Loop MCTS Planning (Manual Stepping)

Use this if the user selects Mode A.

CRITICAL STARTUP SEQUENCE (DO NOT SKIP): 0. Environment Installation: Before doing anything else, you MUST check if the required Python environment is ready. Due to aizynthfinder constraints, the environment MUST use Python 3.10. Use conda to create it if necessary: conda create -n retro python=3.10 -y && conda activate retro. Then run pip install -r <SKILL_DIR>/requirements.txt to install rdkit, requests, urllib3, aizynthfinder, tensorflow, tensorflow-serving-api, grpcio, and protobuf. After installation, instruct the user to download the uspto models using download_public_data <DATA_DIR> where <DATA_DIR> is C:/tmp on Windows or /tmp on Linux (this command requires user interaction as it's interactive, or you can skip it if the files exist in <DATA_DIR>).

  1. Setup & Context: DO NOT change directories. Remain in the user's current workspace directory so that all output files (route_state.json, tree_visualization.html) are saved safely within the user's workspace. Locate the absolute path of this SKILL.md file to determine the skill's root directory (<SKILL_DIR>). Read <SKILL_DIR>/references/api_endpoints.md and <SKILL_DIR>/assets/route_report.md for context. If you need to restart or clear a cluttered tree, run rm route_state.json (on Linux/Mac) or del route_state.json (on Windows) in the workspace.
  2. Target Normalization: You MUST ALWAYS execute the python scripts using their absolute paths. Run python <SKILL_DIR>/scripts/analyze_molecule.py --smiles "<SMILES>" (or --name) first to obtain the strict Canonical_SMILES and key properties.
  3. Initialization: Initialize the MCTS tree using the Canonical SMILES via python <SKILL_DIR>/scripts/route_state_manager.py --init "<Canonical_SMILES>".
  4. Expansion: FIRST, consult AiZynthFinder for reactions via python <SKILL_DIR>/scripts/retro_engine.py --retro "<SMILES>". NEXT, before updating the state, call vendor proxies for each child via python <SKILL_DIR>/scripts/retro_engine.py --vendor "<SMILES>". FINALLY, submit the verified nodes into the state EXACTLY ONCE using exact arguments: python <SKILL_DIR>/scripts/route_state_manager.py --expand <Parent_Node_ID> --rxn "<Reaction_Name>" --children "<Child_1>" "<Child_2>" --purchasable true false (use literal booleans true or false depending on the vendor verification). DO NOT expand the exact same reaction twice.
  5. Visualize, Recall, & Pause:
    • Execute python <SKILL_DIR>/scripts/render_tree.py and direct the user to preview tree_visualization.html.
    • To query your memory for the current state (e.g. to see which leaves are still unsolved), use python <SKILL_DIR>/scripts/route_state_manager.py --status.
    • If an explored reaction branch proves unfeasible, use your fallback mechanics to prune it: python <SKILL_DIR>/scripts/route_state_manager.py --prune <Reaction_ID> (e.g. --prune R3).
    • WAIT for the expert's decision on which M_n Node to attack next.

Mode B: Fully Autonomous Agentic Loop (RetroPilot Agent)

If the user selects Mode B, do not process using Mode A! Instead, IMMEDIATELY read agents/retropilot.md and switch your persona to follow the RetroPilot execution loop described inside it.

5. Final Reporting (Completion)

When the tree root reaches solved: True or the expert concludes the session:

  • You MUST generate a final summary using the exact template located in assets/route_report.md. Do not invent your own structure. Fill in the placeholders (e.g., {{TARGET_NAME}}) using data gathered during the run.
  • Present the initial routes to the human expert.
  • Evaluate dynamically based on user/expert priorities (e.g., green chemistry vs. cost vs. raw materials vs. brevity).
  • Emphasize potential drawbacks flexibly (e.g., low yield, expensive catalysts, toxicity risks, scalability issues).
  • Actively run validation scripts (e.g., RDKit substructure checks, API calls for commercial availability of building blocks) to fact-check proposed pathways.
  • Solicit feedback on specific steps.
  • Iterate and refine the tree based on the user's domain knowledge, adjusting conditions or replacing steps with more elegant solutions.

Best Practices

  • Step Economy: Always favor convergent syntheses over long linear sequences to maximize overall yield.
  • Protecting Groups: Actively minimize the use of protecting groups. If unavoidable, explicitly plan their installation and removal sequence.
  • Explainability: Justify non-obvious disconnections citing chemical principles (e.g., orbital symmetry, thermodynamics, sterics).
  • Format: When presenting intermediate molecules, use standardized naming and occasionally output SMILES strings to keep the context unambiguous.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.