[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6AFQ4EH4PP7HWC8T3525A4W":3,"skill-same:01M6AFQ4EH4PP7HWC8T3525A4W":107},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":49,"commitSha":50,"skillDirectory":51,"forksCount":52,"repositoryHtmlUrl":53,"repositoryHomepageUrl":54,"ownerHtmlUrl":55,"ownerBlogUrl":56,"ownerDescription":57,"updatedAt":58,"install":59,"resources":72},"01M6AFQ4EH4PP7HWC8T3525A4W","torchdrug",null,"Graph-based drug discovery toolkit. Molecular property prediction (ADMET), protein modeling, knowledge graph reasoning, molecular generation, retrosynthesis, GNNs (GIN, GAT, SchNet), 40+ datasets, for PyTorch-based ML on molecules, proteins, and biomedical graphs.","davila7\u002Fclaude-code-templates","davila7","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6216945?v=4","01M6ADEWWFPS191NFM0Y1EX1JH","Daniel Avila","01M6ADJHGM78PHQRD3XZTFDVKK",33481,"MIT","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Ftorchdrug\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[5,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"biomedical","ADMET","Protein","prediction","for","gin","gat","molecular","modeling","generation","proteins","pytorch","datasets","knowledge","discovery","knowledge graph","graph","reasoning","toolkit","ml","2026-11-10 10:12:30",false,"---\nname: torchdrug\ndescription: \"Graph-based drug discovery toolkit. Molecular property prediction (ADMET), protein modeling, knowledge graph reasoning, molecular generation, retrosynthesis, GNNs (GIN, GAT, SchNet), 40+ datasets, for PyTorch-based ML on molecules, proteins, and biomedical graphs.\"\n---\n\n# TorchDrug\n\n## Overview\n\nTorchDrug is a comprehensive PyTorch-based machine learning toolbox for drug discovery and molecular science. Apply graph neural networks, pre-trained models, and task definitions to molecules, proteins, and biological knowledge graphs, including molecular property prediction, protein modeling, knowledge graph reasoning, molecular generation, retrosynthesis planning, with 40+ curated datasets and 20+ model architectures.\n\n## When to Use This Skill\n\nThis skill should be used when working with:\n\n**Data Types:**\n- SMILES strings or molecular structures\n- Protein sequences or 3D structures (PDB files)\n- Chemical reactions and retrosynthesis\n- Biomedical knowledge graphs\n- Drug discovery datasets\n\n**Tasks:**\n- Predicting molecular properties (solubility, toxicity, activity)\n- Protein function or structure prediction\n- Drug-target binding prediction\n- Generating new molecular structures\n- Planning chemical synthesis routes\n- Link prediction in biomedical knowledge bases\n- Training graph neural networks on scientific data\n\n**Libraries and Integration:**\n- TorchDrug is the primary library\n- Often used with RDKit for cheminformatics\n- Compatible with PyTorch and PyTorch Lightning\n- Integrates with AlphaFold and ESM for proteins\n\n## Getting Started\n\n### Installation\n\n```bash\nuv pip install torchdrug\n# Or with optional dependencies\nuv pip install torchdrug[full]\n```\n\n### Quick Example\n\n```python\nfrom torchdrug import datasets, models, tasks\nfrom torch.utils.data import DataLoader\n\n# Load molecular dataset\ndataset = datasets.BBBP(\"~\u002Fmolecule-datasets\u002F\")\ntrain_set, valid_set, test_set = dataset.split()\n\n# Define GNN model\nmodel = models.GIN(\n    input_dim=dataset.node_feature_dim,\n    hidden_dims=[256, 256, 256],\n    edge_input_dim=dataset.edge_feature_dim,\n    batch_norm=True,\n    readout=\"mean\"\n)\n\n# Create property prediction task\ntask = tasks.PropertyPrediction(\n    model,\n    task=dataset.tasks,\n    criterion=\"bce\",\n    metric=[\"auroc\", \"auprc\"]\n)\n\n# Train with PyTorch\noptimizer = torch.optim.Adam(task.parameters(), lr=1e-3)\ntrain_loader = DataLoader(train_set, batch_size=32, shuffle=True)\n\nfor epoch in range(100):\n    for batch in train_loader:\n        loss = task(batch)\n        optimizer.zero_grad()\n        loss.backward()\n        optimizer.step()\n```\n\n## Core Capabilities\n\n### 1. Molecular Property Prediction\n\nPredict chemical, physical, and biological properties of molecules from structure.\n\n**Use Cases:**\n- Drug-likeness and ADMET properties\n- Toxicity screening\n- Quantum chemistry properties\n- Binding affinity prediction\n\n**Key Components:**\n- 20+ molecular datasets (BBBP, HIV, Tox21, QM9, etc.)\n- GNN models (GIN, GAT, SchNet)\n- PropertyPrediction and MultipleBinaryClassification tasks\n\n**Reference:** See `references\u002Fmolecular_property_prediction.md` for:\n- Complete dataset catalog\n- Model selection guide\n- Training workflows and best practices\n- Feature engineering details\n\n### 2. Protein Modeling\n\nWork with protein sequences, structures, and properties.\n\n**Use Cases:**\n- Enzyme function prediction\n- Protein stability and solubility\n- Subcellular localization\n- Protein-protein interactions\n- Structure prediction\n\n**Key Components:**\n- 15+ protein datasets (EnzymeCommission, GeneOntology, PDBBind, etc.)\n- Sequence models (ESM, ProteinBERT, ProteinLSTM)\n- Structure models (GearNet, SchNet)\n- Multiple task types for different prediction levels\n\n**Reference:** See `references\u002Fprotein_modeling.md` for:\n- Protein-specific datasets\n- Sequence vs structure models\n- Pre-training strategies\n- Integration with AlphaFold and ESM\n\n### 3. Knowledge Graph Reasoning\n\nPredict missing links and relationships in biological knowledge graphs.\n\n**Use Cases:**\n- Drug repurposing\n- Disease mechanism discovery\n- Gene-disease associations\n- Multi-hop biomedical reasoning\n\n**Key Components:**\n- General KGs (FB15k, WN18) and biomedical (Hetionet)\n- Embedding models (TransE, RotatE, ComplEx)\n- KnowledgeGraphCompletion task\n\n**Reference:** See `references\u002Fknowledge_graphs.md` for:\n- Knowledge graph datasets (including Hetionet with 45k biomedical entities)\n- Embedding model comparison\n- Evaluation metrics and protocols\n- Biomedical applications\n\n### 4. Molecular Generation\n\nGenerate novel molecular structures with desired properties.\n\n**Use Cases:**\n- De novo drug design\n- Lead optimization\n- Chemical space exploration\n- Property-guided generation\n\n**Key Components:**\n- Autoregressive generation\n- GCPN (policy-based generation)\n- GraphAutoregressiveFlow\n- Property optimization workflows\n\n**Reference:** See `references\u002Fmolecular_generation.md` for:\n- Generation strategies (unconditional, conditional, scaffold-based)\n- Multi-objective optimization\n- Validation and filtering\n- Integration with property prediction\n\n### 5. Retrosynthesis\n\nPredict synthetic routes from target molecules to starting materials.\n\n**Use Cases:**\n- Synthesis planning\n- Route optimization\n- Synthetic accessibility assessment\n- Multi-step planning\n\n**Key Components:**\n- USPTO-50k reaction dataset\n- CenterIdentification (reaction center prediction)\n- SynthonCompletion (reactant prediction)\n- End-to-end Retrosynthesis pipeline\n\n**Reference:** See `references\u002Fretrosynthesis.md` for:\n- Task decomposition (center ID → synthon completion)\n- Multi-step synthesis planning\n- Commercial availability checking\n- Integration with other retrosynthesis tools\n\n### 6. Graph Neural Network Models\n\nComprehensive catalog of GNN architectures for different data types and tasks.\n\n**Available Models:**\n- General GNNs: GCN, GAT, GIN, RGCN, MPNN\n- 3D-aware: SchNet, GearNet\n- Protein-specific: ESM, ProteinBERT, GearNet\n- Knowledge graph: TransE, RotatE, ComplEx, SimplE\n- Generative: GraphAutoregressiveFlow\n\n**Reference:** See `references\u002Fmodels_architectures.md` for:\n- Detailed model descriptions\n- Model selection guide by task and dataset\n- Architecture comparisons\n- Implementation tips\n\n### 7. Datasets\n\n40+ curated datasets spanning chemistry, biology, and knowledge graphs.\n\n**Categories:**\n- Molecular properties (drug discovery, quantum chemistry)\n- Protein properties (function, structure, interactions)\n- Knowledge graphs (general and biomedical)\n- Retrosynthesis reactions\n\n**Reference:** See `references\u002Fdatasets.md` for:\n- Complete dataset catalog with sizes and tasks\n- Dataset selection guide\n- Loading and preprocessing\n- Splitting strategies (random, scaffold)\n\n## Common Workflows\n\n### Workflow 1: Molecular Property Prediction\n\n**Scenario:** Predict blood-brain barrier penetration for drug candidates.\n\n**Steps:**\n1. Load dataset: `datasets.BBBP()`\n2. Choose model: GIN for molecular graphs\n3. Define task: `PropertyPrediction` with binary classification\n4. Train with scaffold split for realistic evaluation\n5. Evaluate using AUROC and AUPRC\n\n**Navigation:** `references\u002Fmolecular_property_prediction.md` → Dataset selection → Model selection → Training\n\n### Workflow 2: Protein Function Prediction\n\n**Scenario:** Predict enzyme function from sequence.\n\n**Steps:**\n1. Load dataset: `datasets.EnzymeCommission()`\n2. Choose model: ESM (pre-trained) or GearNet (with structure)\n3. Define task: `PropertyPrediction` with multi-class classification\n4. Fine-tune pre-trained model or train from scratch\n5. Evaluate using accuracy and per-class metrics\n\n**Navigation:** `references\u002Fprotein_modeling.md` → Model selection (sequence vs structure) → Pre-training strategies\n\n### Workflow 3: Drug Repurposing via Knowledge Graphs\n\n**Scenario:** Find new disease treatments in Hetionet.\n\n**Steps:**\n1. Load dataset: `datasets.Hetionet()`\n2. Choose model: RotatE or ComplEx\n3. Define task: `KnowledgeGraphCompletion`\n4. Train with negative sampling\n5. Query for \"Compound-treats-Disease\" predictions\n6. Filter by plausibility and mechanism\n\n**Navigation:** `references\u002Fknowledge_graphs.md` → Hetionet dataset → Model selection → Biomedical applications\n\n### Workflow 4: De Novo Molecule Generation\n\n**Scenario:** Generate drug-like molecules optimized for target binding.\n\n**Steps:**\n1. Train property predictor on activity data\n2. Choose generation approach: GCPN for RL-based optimization\n3. Define reward function combining affinity, drug-likeness, synthesizability\n4. Generate candidates with property constraints\n5. Validate chemistry and filter by drug-likeness\n6. Rank by multi-objective scoring\n\n**Navigation:** `references\u002Fmolecular_generation.md` → Conditional generation → Multi-objective optimization\n\n### Workflow 5: Retrosynthesis Planning\n\n**Scenario:** Plan synthesis route for target molecule.\n\n**Steps:**\n1. Load dataset: `datasets.USPTO50k()`\n2. Train center identification model (RGCN)\n3. Train synthon completion model (GIN)\n4. Combine into end-to-end retrosynthesis pipeline\n5. Apply recursively for multi-step planning\n6. Check commercial availability of building blocks\n\n**Navigation:** `references\u002Fretrosynthesis.md` → Task types → Multi-step planning\n\n## Integration Patterns\n\n### With RDKit\n\nConvert between TorchDrug molecules and RDKit:\n```python\nfrom torchdrug import data\nfrom rdkit import Chem\n\n# SMILES → TorchDrug molecule\nsmiles = \"CCO\"\nmol = data.Molecule.from_smiles(smiles)\n\n# TorchDrug → RDKit\nrdkit_mol = mol.to_molecule()\n\n# RDKit → TorchDrug\nrdkit_mol = Chem.MolFromSmiles(smiles)\nmol = data.Molecule.from_molecule(rdkit_mol)\n```\n\n### With AlphaFold\u002FESM\n\nUse predicted structures:\n```python\nfrom torchdrug import data\n\n# Load AlphaFold predicted structure\nprotein = data.Protein.from_pdb(\"AF-P12345-F1-model_v4.pdb\")\n\n# Build graph with spatial edges\ngraph = protein.residue_graph(\n    node_position=\"ca\",\n    edge_types=[\"sequential\", \"radius\"],\n    radius_cutoff=10.0\n)\n```\n\n### With PyTorch Lightning\n\nWrap tasks for Lightning training:\n```python\nimport pytorch_lightning as pl\n\nclass LightningTask(pl.LightningModule):\n    def __init__(self, torchdrug_task):\n        super().__init__()\n        self.task = torchdrug_task\n\n    def training_step(self, batch, batch_idx):\n        return self.task(batch)\n\n    def validation_step(self, batch, batch_idx):\n        pred = self.task.predict(batch)\n        target = self.task.target(batch)\n        return {\"pred\": pred, \"target\": target}\n\n    def configure_optimizers(self):\n        return torch.optim.Adam(self.parameters(), lr=1e-3)\n```\n\n## Technical Details\n\nFor deep dives into TorchDrug's architecture:\n\n**Core Concepts:** See `references\u002Fcore_concepts.md` for:\n- Architecture philosophy (modular, configurable)\n- Data structures (Graph, Molecule, Protein, PackedGraph)\n- Model interface and forward function signature\n- Task interface (predict, target, forward, evaluate)\n- Training workflows and best practices\n- Loss functions and metrics\n- Common pitfalls and debugging\n\n## Quick Reference Cheat Sheet\n\n**Choose Dataset:**\n- Molecular property → `references\u002Fdatasets.md` → Molecular section\n- Protein task → `references\u002Fdatasets.md` → Protein section\n- Knowledge graph → `references\u002Fdatasets.md` → Knowledge graph section\n\n**Choose Model:**\n- Molecules → `references\u002Fmodels_architectures.md` → GNN section → GIN\u002FGAT\u002FSchNet\n- Proteins (sequence) → `references\u002Fmodels_architectures.md` → Protein section → ESM\n- Proteins (structure) → `references\u002Fmodels_architectures.md` → Protein section → GearNet\n- Knowledge graph → `references\u002Fmodels_architectures.md` → KG section → RotatE\u002FComplEx\n\n**Common Tasks:**\n- Property prediction → `references\u002Fmolecular_property_prediction.md` or `references\u002Fprotein_modeling.md`\n- Generation → `references\u002Fmolecular_generation.md`\n- Retrosynthesis → `references\u002Fretrosynthesis.md`\n- KG reasoning → `references\u002Fknowledge_graphs.md`\n\n**Understand Architecture:**\n- Data structures → `references\u002Fcore_concepts.md` → Data Structures\n- Model design → `references\u002Fcore_concepts.md` → Model Interface\n- Task design → `references\u002Fcore_concepts.md` → Task Interface\n\n## Troubleshooting Common Issues\n\n**Issue: Dimension mismatch errors**\n→ Check `model.input_dim` matches `dataset.node_feature_dim`\n→ See `references\u002Fcore_concepts.md` → Essential Attributes\n\n**Issue: Poor performance on molecular tasks**\n→ Use scaffold splitting, not random\n→ Try GIN instead of GCN\n→ See `references\u002Fmolecular_property_prediction.md` → Best Practices\n\n**Issue: Protein model not learning**\n→ Use pre-trained ESM for sequence tasks\n→ Check edge construction for structure models\n→ See `references\u002Fprotein_modeling.md` → Training Workflows\n\n**Issue: Memory errors with large graphs**\n→ Reduce batch size\n→ Use gradient accumulation\n→ See `references\u002Fcore_concepts.md` → Memory Efficiency\n\n**Issue: Generated molecules are invalid**\n→ Add validity constraints\n→ Post-process with RDKit validation\n→ See `references\u002Fmolecular_generation.md` → Validation and Filtering\n\n## Resources\n\n**Official Documentation:** https:\u002F\u002Ftorchdrug.ai\u002Fdocs\u002F\n**GitHub:** https:\u002F\u002Fgithub.com\u002FDeepGraphLearning\u002Ftorchdrug\n**Paper:** TorchDrug: A Powerful and Flexible Machine Learning Platform for Drug Discovery\n\n## Summary\n\nNavigate to the appropriate reference file based on your task:\n\n1. **Molecular property prediction** → `molecular_property_prediction.md`\n2. **Protein modeling** → `protein_modeling.md`\n3. **Knowledge graphs** → `knowledge_graphs.md`\n4. **Molecular generation** → `molecular_generation.md`\n5. **Retrosynthesis** → `retrosynthesis.md`\n6. **Model selection** → `models_architectures.md`\n7. **Dataset selection** → `datasets.md`\n8. **Technical details** → `core_concepts.md`\n\nEach reference provides comprehensive coverage of its domain with examples, best practices, and common use cases.\n","# TorchDrug\n\n## Overview\n\nTorchDrug is a comprehensive PyTorch-based machine learning toolbox for drug discovery and molecular science. Apply graph neural networks, pre-trained models, and task definitions to molecules, proteins, and biological knowledge graphs, including molecular property prediction, protein modeling, knowledge graph reasoning, molecular generation, retrosynthesis planning, with 40+ curated datasets and 20+ model architectures.\n\n## When to Use This Skill\n\nThis skill should be used when working with:\n\n**Data Types:**\n- SMILES strings or molecular structures\n- Protein sequences or 3D structures (PDB files)\n- Chemical reactions and retrosynthesis\n- Biomedical knowledge graphs\n- Drug discovery datasets\n\n**Tasks:**\n- Predicting molecular properties (solubility, toxicity, activity)\n- Protein function or structure prediction\n- Drug-target binding prediction\n- Generating new molecular structures\n- Planning chemical synthesis routes\n- Link prediction in biomedical knowledge bases\n- Training graph neural networks on scientific data\n\n**Libraries and Integration:**\n- TorchDrug is the primary library\n- Often used with RDKit for cheminformatics\n- Compatible with PyTorch and PyTorch Lightning\n- Integrates with AlphaFold and ESM for proteins\n\n## Getting Started\n\n### Installation\n\n```bash\nuv pip install torchdrug\n# Or with optional dependencies\nuv pip install torchdrug[full]\n```\n\n### Quick Example\n\n```python\nfrom torchdrug import datasets, models, tasks\nfrom torch.utils.data import DataLoader\n\n# Load molecular dataset\ndataset = datasets.BBBP(\"~\u002Fmolecule-datasets\u002F\")\ntrain_set, valid_set, test_set = dataset.split()\n\n# Define GNN model\nmodel = models.GIN(\n    input_dim=dataset.node_feature_dim,\n    hidden_dims=[256, 256, 256],\n    edge_input_dim=dataset.edge_feature_dim,\n    batch_norm=True,\n    readout=\"mean\"\n)\n\n# Create property prediction task\ntask = tasks.PropertyPrediction(\n    model,\n    task=dataset.tasks,\n    criterion=\"bce\",\n    metric=[\"auroc\", \"auprc\"]\n)\n\n# Train with PyTorch\noptimizer = torch.optim.Adam(task.parameters(), lr=1e-3)\ntrain_loader = DataLoader(train_set, batch_size=32, shuffle=True)\n\nfor epoch in range(100):\n    for batch in train_loader:\n        loss = task(batch)\n        optimizer.zero_grad()\n        loss.backward()\n        optimizer.step()\n```\n\n## Core Capabilities\n\n### 1. Molecular Property Prediction\n\nPredict chemical, physical, and biological properties of molecules from structure.\n\n**Use Cases:**\n- Drug-likeness and ADMET properties\n- Toxicity screening\n- Quantum chemistry properties\n- Binding affinity prediction\n\n**Key Components:**\n- 20+ molecular datasets (BBBP, HIV, Tox21, QM9, etc.)\n- GNN models (GIN, GAT, SchNet)\n- PropertyPrediction and MultipleBinaryClassification tasks\n\n**Reference:** See `references\u002Fmolecular_property_prediction.md` for:\n- Complete dataset catalog\n- Model selection guide\n- Training workflows and best practices\n- Feature engineering details\n\n### 2. Protein Modeling\n\nWork with protein sequences, structures, and properties.\n\n**Use Cases:**\n- Enzyme function prediction\n- Protein stability and solubility\n- Subcellular localization\n- Protein-protein interactions\n- Structure prediction\n\n**Key Components:**\n- 15+ protein datasets (EnzymeCommission, GeneOntology, PDBBind, etc.)\n- Sequence models (ESM, ProteinBERT, ProteinLSTM)\n- Structure models (GearNet, SchNet)\n- Multiple task types for different prediction levels\n\n**Reference:** See `references\u002Fprotein_modeling.md` for:\n- Protein-specific datasets\n- Sequence vs structure models\n- Pre-training strategies\n- Integration with AlphaFold and ESM\n\n### 3. Knowledge Graph Reasoning\n\nPredict missing links and relationships in biological knowledge graphs.\n\n**Use Cases:**\n- Drug repurposing\n- Disease mechanism discovery\n- Gene-disease associations\n- Multi-hop biomedical reasoning\n\n**Key Components:**\n- General KGs (FB15k, WN18) and biomedical (Hetionet)\n- Embedding models (TransE, RotatE, ComplEx)\n- KnowledgeGraphCompletion task\n\n**Reference:** See `references\u002Fknowledge_graphs.md` for:\n- Knowledge graph datasets (including Hetionet with 45k biomedical entities)\n- Embedding model comparison\n- Evaluation metrics and protocols\n- Biomedical applications\n\n### 4. Molecular Generation\n\nGenerate novel molecular structures with desired properties.\n\n**Use Cases:**\n- De novo drug design\n- Lead optimization\n- Chemical space exploration\n- Property-guided generation\n\n**Key Components:**\n- Autoregressive generation\n- GCPN (policy-based generation)\n- GraphAutoregressiveFlow\n- Property optimization workflows\n\n**Reference:** See `references\u002Fmolecular_generation.md` for:\n- Generation strategies (unconditional, conditional, scaffold-based)\n- Multi-objective optimization\n- Validation and filtering\n- Integration with property prediction\n\n### 5. Retrosynthesis\n\nPredict synthetic routes from target molecules to starting materials.\n\n**Use Cases:**\n- Synthesis planning\n- Route optimization\n- Synthetic accessibility assessment\n- Multi-step planning\n\n**Key Components:**\n- USPTO-50k reaction dataset\n- CenterIdentification (reaction center prediction)\n- SynthonCompletion (reactant prediction)\n- End-to-end Retrosynthesis pipeline\n\n**Reference:** See `references\u002Fretrosynthesis.md` for:\n- Task decomposition (center ID → synthon completion)\n- Multi-step synthesis planning\n- Commercial availability checking\n- Integration with other retrosynthesis tools\n\n### 6. Graph Neural Network Models\n\nComprehensive catalog of GNN architectures for different data types and tasks.\n\n**Available Models:**\n- General GNNs: GCN, GAT, GIN, RGCN, MPNN\n- 3D-aware: SchNet, GearNet\n- Protein-specific: ESM, ProteinBERT, GearNet\n- Knowledge graph: TransE, RotatE, ComplEx, SimplE\n- Generative: GraphAutoregressiveFlow\n\n**Reference:** See `references\u002Fmodels_architectures.md` for:\n- Detailed model descriptions\n- Model selection guide by task and dataset\n- Architecture comparisons\n- Implementation tips\n\n### 7. Datasets\n\n40+ curated datasets spanning chemistry, biology, and knowledge graphs.\n\n**Categories:**\n- Molecular properties (drug discovery, quantum chemistry)\n- Protein properties (function, structure, interactions)\n- Knowledge graphs (general and biomedical)\n- Retrosynthesis reactions\n\n**Reference:** See `references\u002Fdatasets.md` for:\n- Complete dataset catalog with sizes and tasks\n- Dataset selection guide\n- Loading and preprocessing\n- Splitting strategies (random, scaffold)\n\n## Common Workflows\n\n### Workflow 1: Molecular Property Prediction\n\n**Scenario:** Predict blood-brain barrier penetration for drug candidates.\n\n**Steps:**\n1. Load dataset: `datasets.BBBP()`\n2. Choose model: GIN for molecular graphs\n3. Define task: `PropertyPrediction` with binary classification\n4. Train with scaffold split for realistic evaluation\n5. Evaluate using AUROC and AUPRC\n\n**Navigation:** `references\u002Fmolecular_property_prediction.md` → Dataset selection → Model selection → Training\n\n### Workflow 2: Protein Function Prediction\n\n**Scenario:** Predict enzyme function from sequence.\n\n**Steps:**\n1. Load dataset: `datasets.EnzymeCommission()`\n2. Choose model: ESM (pre-trained) or GearNet (with structure)\n3. Define task: `PropertyPrediction` with multi-class classification\n4. Fine-tune pre-trained model or train from scratch\n5. Evaluate using accuracy and per-class metrics\n\n**Navigation:** `references\u002Fprotein_modeling.md` → Model selection (sequence vs structure) → Pre-training strategies\n\n### Workflow 3: Drug Repurposing via Knowledge Graphs\n\n**Scenario:** Find new disease treatments in Hetionet.\n\n**Steps:**\n1. Load dataset: `datasets.Hetionet()`\n2. Choose model: RotatE or ComplEx\n3. Define task: `KnowledgeGraphCompletion`\n4. Train with negative sampling\n5. Query for \"Compound-treats-Disease\" predictions\n6. Filter by plausibility and mechanism\n\n**Navigation:** `references\u002Fknowledge_graphs.md` → Hetionet dataset → Model selection → Biomedical applications\n\n### Workflow 4: De Novo Molecule Generation\n\n**Scenario:** Generate drug-like molecules optimized for target binding.\n\n**Steps:**\n1. Train property predictor on activity data\n2. Choose generation approach: GCPN for RL-based optimization\n3. Define reward function combining affinity, drug-likeness, synthesizability\n4. Generate candidates with property constraints\n5. Validate chemistry and filter by drug-likeness\n6. Rank by multi-objective scoring\n\n**Navigation:** `references\u002Fmolecular_generation.md` → Conditional generation → Multi-objective optimization\n\n### Workflow 5: Retrosynthesis Planning\n\n**Scenario:** Plan synthesis route for target molecule.\n\n**Steps:**\n1. Load dataset: `datasets.USPTO50k()`\n2. Train center identification model (RGCN)\n3. Train synthon completion model (GIN)\n4. Combine into end-to-end retrosynthesis pipeline\n5. Apply recursively for multi-step planning\n6. Check commercial availability of building blocks\n\n**Navigation:** `references\u002Fretrosynthesis.md` → Task types → Multi-step planning\n\n## Integration Patterns\n\n### With RDKit\n\nConvert between TorchDrug molecules and RDKit:\n```python\nfrom torchdrug import data\nfrom rdkit import Chem\n\n# SMILES → TorchDrug molecule\nsmiles = \"CCO\"\nmol = data.Molecule.from_smiles(smiles)\n\n# TorchDrug → RDKit\nrdkit_mol = mol.to_molecule()\n\n# RDKit → TorchDrug\nrdkit_mol = Chem.MolFromSmiles(smiles)\nmol = data.Molecule.from_molecule(rdkit_mol)\n```\n\n### With AlphaFold\u002FESM\n\nUse predicted structures:\n```python\nfrom torchdrug import data\n\n# Load AlphaFold predicted structure\nprotein = data.Protein.from_pdb(\"AF-P12345-F1-model_v4.pdb\")\n\n# Build graph with spatial edges\ngraph = protein.residue_graph(\n    node_position=\"ca\",\n    edge_types=[\"sequential\", \"radius\"],\n    radius_cutoff=10.0\n)\n```\n\n### With PyTorch Lightning\n\nWrap tasks for Lightning training:\n```python\nimport pytorch_lightning as pl\n\nclass LightningTask(pl.LightningModule):\n    def __init__(self, torchdrug_task):\n        super().__init__()\n        self.task = torchdrug_task\n\n    def training_step(self, batch, batch_idx):\n        return self.task(batch)\n\n    def validation_step(self, batch, batch_idx):\n        pred = self.task.predict(batch)\n        target = self.task.target(batch)\n        return {\"pred\": pred, \"target\": target}\n\n    def configure_optimizers(self):\n        return torch.optim.Adam(self.parameters(), lr=1e-3)\n```\n\n## Technical Details\n\nFor deep dives into TorchDrug's architecture:\n\n**Core Concepts:** See `references\u002Fcore_concepts.md` for:\n- Architecture philosophy (modular, configurable)\n- Data structures (Graph, Molecule, Protein, PackedGraph)\n- Model interface and forward function signature\n- Task interface (predict, target, forward, evaluate)\n- Training workflows and best practices\n- Loss functions and metrics\n- Common pitfalls and debugging\n\n## Quick Reference Cheat Sheet\n\n**Choose Dataset:**\n- Molecular property → `references\u002Fdatasets.md` → Molecular section\n- Protein task → `references\u002Fdatasets.md` → Protein section\n- Knowledge graph → `references\u002Fdatasets.md` → Knowledge graph section\n\n**Choose Model:**\n- Molecules → `references\u002Fmodels_architectures.md` → GNN section → GIN\u002FGAT\u002FSchNet\n- Proteins (sequence) → `references\u002Fmodels_architectures.md` → Protein section → ESM\n- Proteins (structure) → `references\u002Fmodels_architectures.md` → Protein section → GearNet\n- Knowledge graph → `references\u002Fmodels_architectures.md` → KG section → RotatE\u002FComplEx\n\n**Common Tasks:**\n- Property prediction → `references\u002Fmolecular_property_prediction.md` or `references\u002Fprotein_modeling.md`\n- Generation → `references\u002Fmolecular_generation.md`\n- Retrosynthesis → `references\u002Fretrosynthesis.md`\n- KG reasoning → `references\u002Fknowledge_graphs.md`\n\n**Understand Architecture:**\n- Data structures → `references\u002Fcore_concepts.md` → Data Structures\n- Model design → `references\u002Fcore_concepts.md` → Model Interface\n- Task design → `references\u002Fcore_concepts.md` → Task Interface\n\n## Troubleshooting Common Issues\n\n**Issue: Dimension mismatch errors**\n→ Check `model.input_dim` matches `dataset.node_feature_dim`\n→ See `references\u002Fcore_concepts.md` → Essential Attributes\n\n**Issue: Poor performance on molecular tasks**\n→ Use scaffold splitting, not random\n→ Try GIN instead of GCN\n→ See `references\u002Fmolecular_property_prediction.md` → Best Practices\n\n**Issue: Protein model not learning**\n→ Use pre-trained ESM for sequence tasks\n→ Check edge construction for structure models\n→ See `references\u002Fprotein_modeling.md` → Training Workflows\n\n**Issue: Memory errors with large graphs**\n→ Reduce batch size\n→ Use gradient accumulation\n→ See `references\u002Fcore_concepts.md` → Memory Efficiency\n\n**Issue: Generated molecules are invalid**\n→ Add validity constraints\n→ Post-process with RDKit validation\n→ See `references\u002Fmolecular_generation.md` → Validation and Filtering\n\n## Resources\n\n**Official Documentation:** https:\u002F\u002Ftorchdrug.ai\u002Fdocs\u002F\n**GitHub:** https:\u002F\u002Fgithub.com\u002FDeepGraphLearning\u002Ftorchdrug\n**Paper:** TorchDrug: A Powerful and Flexible Machine Learning Platform for Drug Discovery\n\n## Summary\n\nNavigate to the appropriate reference file based on your task:\n\n1. **Molecular property prediction** → `molecular_property_prediction.md`\n2. **Protein modeling** → `protein_modeling.md`\n3. **Knowledge graphs** → `knowledge_graphs.md`\n4. **Molecular generation** → `molecular_generation.md`\n5. **Retrosynthesis** → `retrosynthesis.md`\n6. **Model selection** → `models_architectures.md`\n7. **Dataset selection** → `datasets.md`\n8. **Technical details** → `core_concepts.md`\n\nEach reference provides comprehensive coverage of its domain with examples, best practices, and common use cases.\n",{"name":5,"description":7},"main","2b749c82b5d11fac39d9a6e021ce3f5b8a541bd1","cli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Ftorchdrug",3931,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates","https:\u002F\u002Faitmpl.com","https:\u002F\u002Fgithub.com\u002Fdavila7","https:\u002F\u002Fdanielavila.me","Building AI dev tools with LLMs","2026-11-14 06:14:46",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add davila7\u002Fclaude-code-templates --skill torchdrug",{"tool":65,"command":66},"bunx","bunx skills add davila7\u002Fclaude-code-templates --skill torchdrug",{"tool":68,"command":69},"pnpm","pnpm dlx skills add davila7\u002Fclaude-code-templates --skill torchdrug","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Ftorchdrug\u002FSKILL.md",true,[73,79,83,87,91,95,99,103],{"path":74,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fcore_concepts.md","REFERENCE","参考文档",14394,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Ftorchdrug\u002Freferences\u002Fcore_concepts.md",{"path":80,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fdatasets.md",10951,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Ftorchdrug\u002Freferences\u002Fdatasets.md",{"path":84,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Fknowledge_graphs.md",8480,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Ftorchdrug\u002Freferences\u002Fknowledge_graphs.md",{"path":88,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Fmodels_architectures.md",13694,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Ftorchdrug\u002Freferences\u002Fmodels_architectures.md",{"path":92,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Fmolecular_generation.md",10074,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Ftorchdrug\u002Freferences\u002Fmolecular_generation.md",{"path":96,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":97,"sourceHtmlUrl":98},"references\u002Fmolecular_property_prediction.md",5667,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Ftorchdrug\u002Freferences\u002Fmolecular_property_prediction.md",{"path":100,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":101,"sourceHtmlUrl":102},"references\u002Fprotein_modeling.md",7737,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Ftorchdrug\u002Freferences\u002Fprotein_modeling.md",{"path":104,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":105,"sourceHtmlUrl":106},"references\u002Fretrosynthesis.md",11537,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Ftorchdrug\u002Freferences\u002Fretrosynthesis.md",[108,135,162,195,230,253],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":115,"publishedAt":44},"01M70NHBTQ8BV0A2SCAZXEPHCX","wealthville-pool-scoring","Score DeFi liquidity pools before providing liquidity. Returns a 0-100 pool score and an Enter\u002FHold\u002FExit\u002FReduce\u002FAvoid verdict with calibrated confidence for ~68,800 Solana pools and 575 EVM pools, plus a public miss-inclusive track record. Use when asked whether a pool is worth LPing into, which pools look best right now, or how accurate the scores have actually been.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fweb-data\u002Fwealthville-pool-scoring\u002FSKILL.md",[114],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[116,117,118,119,120,28,121,122,123,124,125,126,127,128,129,130,131,132,133,134],"scoring","pool","wealthville pool scoring","liquidity","which","exit","now","use","when","reduce","with","record","track","verdict","evm","solana","how","public","look",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":142,"publishedAt":44},"01M70MB6VR8ERJ4EM8D5KHBMEV","technical-debt-auditor","Scans a codebase and produces a quantified technical debt report with a prioritized remediation plan. Analyzes dead code, TODO\u002FFIXME\u002FHACK markers, dependency staleness, complexity hotspots, code duplication signals, test coverage gaps, unused exports, and outdated patterns. Use this skill when the user asks to audit their codebase for tech debt, wants a health check of their code quality, says things like \"where should I focus refactoring\", \"find code smells\", \"audit my codebase\", \"what technical debt do we have\", \"prioritize cleanup work\", or asks about code quality metrics. Also trigger when the user mentions \"code rot\", \"legacy cleanup\", \"refactoring priorities\", or wants to understand the overall health of a project before a major effort. Trigger even if the user doesn't say \"technical debt\" explicitly — any request to systematically assess code quality and identify improvement priorities belongs here.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fdevelopment\u002Ftechnical-debt-auditor\u002FSKILL.md",[141],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[143,144,145,146,147,148,149,150,151,152,153,124,154,155,156,157,158,159,160,161],"technical debt","debt","technical","technical debt auditor","auditor","coverage","complexity","markers","project","cleanup","unused","code","todo","work","plan","focus","signals","audit","dependency",{"skillNo":163,"name":164,"nameZh":6,"description":165,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":166,"categories":167,"keywords":177,"publishedAt":44},"01M70KPYH9QNHCNME5GJQGE22K","readonly-sql-guard","Make an agent's database access provably read-only. Use when an agent runs caller-supplied SQL against a production\u002FERP\u002Fanalytics database (a \"query\" MCP tool, text-to-SQL, an admin console), or when reviewing DB-access code for write\u002FDDL\u002Fside-effect\u002Ftransaction-escape risks. Checks what a statement CALLS, not just its shape.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fdatabase\u002Freadonly-sql-guard\u002FSKILL.md",[168,171,172],{"categoryNo":169,"categoryName":170,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":173,"categoryName":174,"taxonomyType":175,"taxonomyTypeDesc":176},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[178,179,180,181,182,183,184,28,185,186,187,188,189,190,191,123,192,193,124,194],"readonly","guard","sql guard","sql","readonly sql guard","erp","effect","read-only","db","just","tool","calls","only","MCP","access","database","query",{"skillNo":196,"name":197,"nameZh":6,"description":198,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":199,"licenseFileUrl":200,"sourceHtmlUrl":201,"categories":202,"keywords":206,"publishedAt":44},"01M6AFY6F7CC2BBZP1QD6VTNVC","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FSKILL.md",[203],{"categoryNo":204,"categoryName":205,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发",[207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,28,229],"artifacts builder","web","web artifacts builder","artifacts","builder","state","routing","state management","component","css","frontend","ui","Tools","file","components","shadcn","react","Tailwind","suite","jsx","html","single-file","ui components",{"skillNo":231,"name":232,"nameZh":6,"description":233,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":199,"licenseFileUrl":234,"sourceHtmlUrl":235,"categories":236,"keywords":241,"publishedAt":44},"01M6AFWF33SFV9Z3SF4PEEE4BF","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FSKILL.md",[237,240],{"categoryNo":238,"categoryName":239,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":204,"categoryName":205,"taxonomyType":21,"taxonomyTypeDesc":22},[242,243,244,245,246,208,247,217,218,248,42,249,250,28,251,126,252],"webapp testing","testing","webapp","browser","playwright","applications","debugging","logs","screenshots","local","behavior",{"skillNo":254,"name":255,"nameZh":6,"description":256,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":199,"licenseFileUrl":257,"sourceHtmlUrl":258,"categories":259,"keywords":267,"publishedAt":44},"01M6AF67Q67JJJ5V51JR2P52KA","discernment-nudge","After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals, or emails, estimates or projections, analysis or interpretation of data, factual claims they may rely on, or a multi-step argument — invoke this skill BEFORE finalizing your reply and then, if it applies, append 2-3 short follow-up questions, each tied to something specific in what you just produced, that help the user check key facts, probe the reasoning or assumptions, and notice missing context. Do this at most once per conversation. Skip it when the user asked a trivial how-to or simple lookup, wants a purely educational explanation, asked you only to format, convert, or assemble a file from content they provided, is writing code they will run, is doing creative writing or casual chat, or already asked you to double-check, cite, or review — the skill file explains these boundaries and the exact output format.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fdiscernment-nudge\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fdiscernment-nudge\u002FSKILL.md",[260,263,264],{"categoryNo":261,"categoryName":262,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":265,"categoryName":266,"taxonomyType":175,"taxonomyTypeDesc":176},"01JBSEEDCAT000000000000036","内容创作者",[268,269,270,271,272,41,273,274,210,275,220,154,276,277,278,279,280,190,281,124,282,283,284,285,286,132,287],"discernment nudge","nudge","interpretation","help","run","data","writing","lookup","content","review","conversation","short","up","invoke","you","analysis","claims","argument","assemble","recommendations"]