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
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.
In this repository45 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- admet-predictionSkill
- antibody-design-iggmSkill
- antibody-structure-prediction-tfoldSkill
- binding-affinity-prediction-prodigySkill
- biomedical-literature-searchSkill
- biomed-skill-creatorSkill
- biomed-skill-routerSkill
- cellxgene-census-querySkill
- chembl-querySkill
- disease-drug-intelligenceSkill
- drug-candidate-discoverySkill
- drug-drug-interaction-analysisSkill
- drug-lead-analysisSkill
- functional-protein-designSkill
- iupac-name-identification-biot5Skill
- kegg-querySkill
- molecule-biochemical-significance-query-biot5Skill
- mutation-design-aavSkill
- mutation-design-gfpSkill
- ppi-string-querySkill
- protein-function-predictionSkill
- protein-ligand-binding-analysis-plipSkill
- protein-mutation-analysisSkill
- protein-structure-design-boltzgenSkill
- protein-subcellular-localization-prediction-biot5Skill
- pubchem-querySkill
- similar-protein-retrievalSkill
- single-cell-atac-seq-peak-calling-annotaionSkill
- single-cell-atac-seq-qc-processingSkill
- single-cell-foundation-model-geneformerSkill
- single-cell-foundation-model-langcellSkill
- single-cell-foundation-model-scgptSkill
- single-cell-multi-omics-analysis-scviSkill
- single-cell-multi-omics-data-harmonizationSkill
- single-cell-proteomics-data-processingSkill
- single-cell-proteomics-peptide-identificationSkill
- single-cell-scrna-seq-analysis-scanpySkill
- single-cell-foundation-model-stofmSkill
- spatial-transcriptomics-spatial-data-ioSkill
- structure-prediction-boltz-2Skill
- target-based-lead-designSkill
- target-drug-reportSkill
- text-based-molecule-editingSkill
- uniprot-querySkill
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
- Distinctive: line 15
RDKit Rule Scripting via Code Gen: Write and execute RDKit Python scripts on-the-fly to validate expert heuristics (e.g., ring strain, …
- Distinctive: line 22
Use this if the user selects Mode A.
- Very specific: line 33
If an explored reaction branch proves unfeasible, use your fallback mechanics to prune it: python …
- Very specific: line 34
WAIT for the expert's decision on which M_n Node to attack next.
- Very specific: line 37
If the user selects Mode B, do not process using Mode A!
- Very specific: line 40
When the tree root reaches solved: True or the expert concludes the session:
- Distinctive: line 50
Step Economy: Always favor convergent syntheses over long linear sequences to maximize overall yield.
- Distinctive: line 53
Format: When presenting intermediate molecules, use standardized naming and occasionally output SMILES strings to keep the context …
≈ “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.
Files
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
- 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).
- 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.
- 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.
- *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 (solvedstatus pushing to root) to track ultimate pipeline success over deep sequences. - 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>).
- 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 thisSKILL.mdfile to determine the skill's root directory (<SKILL_DIR>). Read<SKILL_DIR>/references/api_endpoints.mdand<SKILL_DIR>/assets/route_report.mdfor context. If you need to restart or clear a cluttered tree, runrm route_state.json(on Linux/Mac) ordel route_state.json(on Windows) in the workspace. - 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 strictCanonical_SMILESand key properties. - Initialization: Initialize the MCTS tree using the Canonical SMILES via
python <SKILL_DIR>/scripts/route_state_manager.py --init "<Canonical_SMILES>". - 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 viapython <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 booleanstrueorfalsedepending on the vendor verification). DO NOT expand the exact same reaction twice. - Visualize, Recall, & Pause:
- Execute
python <SKILL_DIR>/scripts/render_tree.pyand direct the user to previewtree_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_nNode to attack next.
- Execute
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.
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
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.

