[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M73H72Y0SYNFXCBD8KRP6NXT":3,"skill-same:01M73H72Y0SYNFXCBD8KRP6NXT":54},{"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":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":35,"ownerHtmlUrl":36,"ownerBlogUrl":37,"ownerDescription":38,"updatedAt":39,"install":40,"resources":53},"01M73H72Y0SYNFXCBD8KRP6NXT","medchem",null,"Applies medicinal chemistry filters for compound triage, using drug-likeness rules (Lipinski, Veber, CNS), structural alert catalogs (PAINS, NIBR, ChEMBL), complexity metrics, and the medchem query language for library filtering.","bg-szy\u002FTOP-SKILLS","bg-szy","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F106576190?v=4","01M73A4E8KPV67SFXRY8XZGNBX","ShuZhiyong","01M73A4E96MQ294MHM74TZBVQD",6,"Apache-2.0 license","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fawesome-skills\u002Fmedchem\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: medchem\ndescription: Applies medicinal chemistry filters for compound triage, using drug-likeness rules (Lipinski, Veber, CNS), structural alert catalogs (PAINS, NIBR, ChEMBL), complexity metrics, and the medchem query language for library filtering.\nlicense: Apache-2.0 license\nallowed-tools: Read Write Edit Bash\ncompatibility: Requires Python 3.11+ with medchem, datamol, and RDKit. Optional Lilly demerits require native tools built with medchem install-lilly, a C++ compiler, make, zlib, and Ruby; installation needs network access. Other filters run locally without credentials.\nmetadata:\n  version: \"1.4\"\n  last-reviewed: \"2026-10-01\"\n  skill-author: K-Dense Inc.\n---\n\n# Medchem\n\n## Overview\n\nMedchem is a Python library from [datamol-io](https:\u002F\u002Fgithub.com\u002Fdatamol-io\u002Fmedchem) for molecular filtering and prioritization in drug discovery. Apply literature-derived drug-likeness rules, named alert catalogs, complexity thresholds, chemical-group detection, and a custom query language to triage compound libraries at scale. Filters are context-specific guidelines — combine with domain expertise and target knowledge.\n\n**Verified runtime:** medchem **2.1.1**, datamol **0.13.0**, RDKit **2026.3.6**; Python **3.11+**. `RuleFilters` and structural classes return pandas DataFrames. Filters run locally; installation and documentation lookup need network access. Lilly native execution was not tested in this review.\n\n## When to Use This Skill\n\nThis skill should be used when:\n- Applying drug-likeness rules (Lipinski, Veber, CNS, lead-like) to compound libraries\n- Filtering molecules by structural alerts, PAINS, or NIBR screening-deck rules\n- Prioritizing compounds for hit-to-lead or lead optimization\n- Calculating complexity metrics against ZINC-derived thresholds\n- Detecting functional groups or named substructure catalogs\n- Building multi-criteria filters with the medchem query language\n\n## Installation\n\n```bash\nuv pip install \"medchem==2.1.1\" \"datamol==0.13.0\" \"rdkit==2026.3.6\"\n```\n\nOptional Lilly integration: install the upstream checksum-pinned native tools beside the active Python. This downloads source, builds executables, and runs native regression tests (C++ compiler, make, zlib, Ruby; WSL on Windows). This installation command is documented upstream, not executed here:\n\n```bash\nmedchem install-lilly\n```\n\n## Core Capabilities\n\n### 1. Medicinal Chemistry Rules\n\nApply established drug-likeness rules via `medchem.rules`.\n\n**List available rules:**\n\n```python\nimport medchem as mc\n\nmc.rules.RuleFilters.list_available_rules_names()\n# ['rule_of_five', 'rule_of_five_beyond', 'rule_of_four', 'rule_of_three', ...]\n```\n\n**Single rule on one molecule:**\n\n```python\nimport datamol as dm\nimport medchem as mc\n\nsmiles = \"CC(=O)OC1=CC=CC=C1C(=O)O\"  # aspirin\nmc.rules.basic_rules.rule_of_five(smiles)   # True\nmc.rules.basic_rules.rule_of_cns(smiles)    # True\nmc.rules.basic_rules.rule_of_veber(smiles)  # True\n```\n\n**Multiple rules with `RuleFilters` (returns a DataFrame):**\n\n```python\nimport datamol as dm\nimport medchem as mc\n\nmols = [dm.to_mol(s) for s in smiles_list]\n\nrfilter = mc.rules.RuleFilters(\n    rule_list=[\"rule_of_five\", \"rule_of_oprea\", \"rule_of_cns\", \"rule_of_leadlike_soft\"]\n)\ndf = rfilter(mols=mols, n_jobs=-1, progress=True, keep_props=False)\n\n# Columns: mol, pass_all, pass_any, rule_of_five, rule_of_oprea, ...\npassing = df[df[\"pass_all\"]]\n```\n\nExamples below use already parsed `mol_list`, `smiles_list`, and `candidates` supplied by the caller; reject missing\u002Fempty structures before filtering. Use `keep_props=True` to include computed descriptors (`mw`, `clogp`, `tpsa`, etc.) in the result.\n\n### 2. Structural Alert Filters\n\nDetect problematic patterns with `medchem.structural`. Both classes return **DataFrames** with `pass_filter`, `status`, and `reasons` columns.\n\n**Common alerts (ChEMBL-derived rule sets):**\n\n```python\nimport medchem as mc\n\nalert_filter = mc.structural.CommonAlertsFilters(alerts_set=[\"BMS\", \"Dundee\", \"Glaxo\"])\ndf = alert_filter(mols=mol_list, n_jobs=-1, progress=True)\n# df columns: mol, pass_filter, status, reasons\n\nclean = df[df[\"pass_filter\"]]\n```\n\n**NIBR filters (Novartis screening-deck curation):**\n\n```python\nnibr_filter = mc.structural.NIBRFilters()\ndf = nibr_filter(mols=mol_list, n_jobs=-1, progress=True)\n# df columns: mol, pass_filter, status, severity, reasons, n_covalent_motif, special_mol\n```\n\nThe class rejects explicit exclusion alerts. To also reject accumulated flag severity ≥10, use `df[\"pass_filter\"] & (df[\"severity\"] \u003C 10)`, or `mc.functional.nibr_filter(..., max_severity=10)`. The functional cutoff is strict `\u003C 10` and assumes valid molecules: it checks severity alone and can admit parse failures with severity zero. Prevalidate inputs.\n\n### 3. Named Catalog Filters (PAINS, Brenk, etc.)\n\nUse `medchem.catalogs.NamedCatalogs` for RDKit `FilterCatalog` instances, or the functional API:\n\n```python\nimport medchem as mc\n\n# List available named catalogs\nmc.catalogs.list_named_catalogs()\n# ['tox', 'pains', 'pains_a', 'brenk', 'nibr', 'zinc', ...]\n\n# Functional API — True means molecule passes (no alert match)\npasses = mc.functional.catalog_filter(mols=mol_list, catalogs=[\"pains\"], n_jobs=-1)\n\n# Or via catalog objects\npasses = mc.functional.catalog_filter(\n    mols=mol_list,\n    catalogs=[mc.catalogs.NamedCatalogs.pains()],\n    n_jobs=-1,\n)\n```\n\n`alert_filter` is a different API: it uses the ChEMBL common-alert collection names from `CommonAlertsFilters.list_default_available_alerts()`, not every `NamedCatalogs` name. For example, `brenk` and `pains_a` belong in `catalog_filter`. Set common-alert sets explicitly; the current class implementation defaults to BMS only. `catalog_filter` rejects the string names `nibr` and `bredt`; use their dedicated functional filters. Raw NIBR catalog matches include annotations, regardless of severity.\n\n### 4. Functional API\n\n`medchem.functional` provides one-call wrappers that return boolean masks (True = passes):\n\n```python\nimport medchem as mc\n\nmc.functional.rules_filter(mols=mol_list, rules=[\"rule_of_five\", \"rule_of_cns\"], n_jobs=-1)\nmc.functional.nibr_filter(mols=mol_list, max_severity=10, n_jobs=-1)\nmc.functional.catalog_filter(mols=mol_list, catalogs=[\"pains\", \"brenk\"], n_jobs=-1)\nmc.functional.complexity_filter(mols=mol_list, complexity_metric=\"bertz\", limit=\"99\", n_jobs=-1)\n```\n\nOther helpers: `catalog_filter`, `chemical_group_filter`, `lilly_demerit_filter` (requires optional binaries), `macrocycle_filter`, `bredt_filter`, `protecting_groups_filter`, and more. Pass copies to `bredt_filter` (`[Chem.Mol(m) for m in mol_list]`, after `from rdkit import Chem`): its in-place kekulization changes later aromatic alert matches in 2.1.1.\n\n### 5. Chemical Groups\n\nDetect functional groups and curated pattern collections via `medchem.groups`:\n\n```python\nimport medchem as mc\n\n# Browse available group collections\nmc.groups.list_default_chemical_groups()\n# ['privileged_scaffolds', 'common_warhead_covalent_inhibitors', 'rings_in_drugs', ...]\n\ngroup = mc.groups.ChemicalGroup(groups=[\"privileged_scaffolds\"])\ngroup.has_match(mol)                          # bool\ngroup.get_matches(mol)                        # DataFrame, including a matches column\nmatching_mols = [mol for mol in mol_list if group.has_match(mol)]\n# group.filter(names=[...]) narrows pattern names in place; it does not filter molecules.\n\n# Returns a boolean mask: True means the molecule does NOT match the group\nmc.functional.chemical_group_filter(mols=mol_list, chemical_group=group, n_jobs=-1)\n```\n\nCustom groups use `groups_db` CSV with both `smiles` and `smarts`, plus `name` and `group` columns. SMILES and SMARTS matching can differ; record the representation and `exact_match` setting.\n\n### 6. Molecular Complexity\n\nCompare complexity metrics to precomputed, molecular-weight-binned ZINC-15 thresholds. Valid default limit labels are `median`, `90`, `99`, `999` (99.9th percentile), and `max`; `95` is not provided. `spacialscore` needs a custom threshold file. All metrics use an upper cutoff, including QED; do not interpret that as selecting high QED.\n\n```python\nimport medchem as mc\n\n# Single molecule\ncf = mc.complexity.ComplexityFilter(limit=\"99\", complexity_metric=\"bertz\")\ncf(mol)  # True if below 99th-percentile threshold\n\n# Batch via functional API\nmc.functional.complexity_filter(\n    mols=mol_list,\n    complexity_metric=\"bertz\",  # also: sas, qed, whitlock, barone, smcm, twc\n    limit=\"99\",\n    n_jobs=-1,\n)\n\n# Direct metric functions\nmc.complexity.WhitlockCT(mol)\nmc.complexity.BaroneCT(mol)\n```\n\n### 7. Scaffold Constraints\n\n`medchem.constraints.Constraints` matches a core scaffold and applies per-atom constraint functions — not simple MW\u002FLogP ranges. For property bounds, use `RuleFilters`, descriptors via `mc.rules.list_descriptors()`, or the query language.\n\n```python\nimport datamol as dm\nimport medchem as mc\n\ncore = dm.from_smarts(\"c1cncc([*:1])c1\")\nfor atom in core.GetAtoms():\n    if atom.GetAtomMapNum() == 1:\n        atom.SetProp(\"query\", \"aromatic_sidechain\")\nconstraints = mc.constraints.Constraints(\n    core=core,\n    constraint_fns={\"aromatic_sidechain\": lambda fragment: dm.descriptors.n_aromatic_atoms(fragment) > 0},\n)\nassert not constraints(dm.to_mol(\"CN(C)C(=O)c1cncc(C)c1\"))\nassert constraints(dm.to_mol(\"c1ccc(cc1)-c1cccnc1\"))\n```\n\n### 8. Medchem Query Language\n\nBuild multi-criteria filters with `medchem.query.QueryFilter`:\n\n```python\nimport medchem as mc\n\n# Rule + alert combination\nqf = mc.query.QueryFilter('MATCHRULE(\"rule_of_five\") AND NOT HASALERT(\"pains\")')\nmask = qf(mols=mol_list, n_jobs=-1)  # list[bool]\n\n# CNS-like with property bounds\nqf = mc.query.QueryFilter('MATCHRULE(\"rule_of_cns\") AND HASPROP(\"tpsa\", \u003C=, 90)')\nmask = qf(mols=mol_list, n_jobs=-1)\n```\n\n**Query syntax:**\n- `MATCHRULE(\"rule_of_five\")` — apply a named rule\n- `HASALERT(\"pains\")` — match a named catalog (`pains`, `brenk`, `nibr`, `tox`, …)\n- `HASPROP(\"mw\", \u003C, 500)` — compare a descriptor (unquoted comparator)\n- `HASGROUP(\"Primary amines\")` — match a functional-group name from `mc.groups.get_functional_group_map()`; collection names such as `privileged_scaffolds` are not valid here\n- `HASSUBSTRUCTURE(\"c1ccccc1\")` — substructure match\n- Operators: `AND`, `OR`, `NOT`\n\nList available descriptors: `mc.rules.list_descriptors()`\n\n## Workflow Patterns\n\n### Pattern 1: Initial Triage of a Compound Library\n\nBefore filtering, assign stable source-row IDs and separate failed SMILES\u002FSDF\nparses from valid molecules that fail a chemical rule. Retain original structure\ntext and a rejected-input table; report input, parsed, rule-failed, and retained\ncounts. The bundled loader removes invalid molecules (and resets tabular indices),\nso do not align results back to the original file by row position. The example\nbelow assumes all supplied structures parse successfully.\n\n```python\nimport datamol as dm\nimport medchem as mc\nimport pandas as pd\n\ndf = pd.read_csv(\"compounds.csv\")\nmols = [dm.to_mol(s) for s in df[\"smiles\"]]\n\n# Drug-likeness rules\nrules_df = mc.rules.RuleFilters(rule_list=[\"rule_of_five\", \"rule_of_veber\"])(mols=mols, n_jobs=-1)\n\n# PAINS + common alerts via query\nqf = mc.query.QueryFilter('MATCHRULE(\"rule_of_five\") AND NOT HASALERT(\"pains\")')\npass_mask = qf(mols=mols, n_jobs=-1)\n\ndf[\"passes_rules\"] = rules_df[\"pass_all\"].values\ndf[\"drug_like\"] = pass_mask\nfiltered_df = df[df[\"drug_like\"]]\nfiltered_df.to_csv(\"filtered_compounds.csv\", index=False)\n```\n\n### Pattern 2: Lead Optimization Filtering\n\n```python\nimport medchem as mc\n\nrules_df = mc.rules.RuleFilters(rule_list=[\"rule_of_leadlike_soft\"])(mols=candidates, n_jobs=-1)\nnibr_df = mc.structural.NIBRFilters()(mols=candidates, n_jobs=-1)\ncomplex_mask = mc.functional.complexity_filter(\n    mols=candidates, complexity_metric=\"bertz\", limit=\"90\", n_jobs=-1\n)\n\npasses = (\n    rules_df[\"pass_all\"]\n    & nibr_df[\"pass_filter\"]\n    & (nibr_df[\"severity\"] \u003C 10)\n    & complex_mask\n)\n```\n\n### Pattern 3: Detect Functional Groups\n\n```python\nimport medchem as mc\n\ngroup = mc.groups.ChemicalGroup(groups=[\"common_warhead_covalent_inhibitors\"])\nmatches = [group.has_match(mol) for mol in mol_list]\nwarhead_mols = [mol for mol, m in zip(mol_list, matches) if m]\n```\n\n## Best Practices\n\n1. **Context matters** — marketed drugs often violate Ro5; prodrugs and natural products are common exceptions.\n2. **Combine filters** — rules, alert catalogs, and complexity thresholds work best together.\n3. **Use parallelization** — pass `n_jobs=-1` for libraries >1000 molecules.\n4. **Check return types** — `RuleFilters` and structural classes return DataFrames; functional helpers return boolean arrays.\n5. **Lilly demerits are optional** — run `medchem install-lilly` in the active environment; default max demerits is 160 in the functional API.\n6. **Document decisions** — retain `status`, `reasons`, and `severity` columns and record salt handling, protonation, tautomer, stereochemistry, and package versions. No normalization is automatic in the bundled loader.\n7. **Interpret alerts cautiously** — PAINS and reactive motifs indicate review priorities, not measured assay interference or toxicity; require assay-specific controls. Complexity is a library-relative heuristic, not a synthesis feasibility assessment. The upstream complexity filter admits NaN scores, so calculate and validate finite scores when a metric can be undefined.\n\n## Resources\n\n### references\u002Fapi_guide.md\nModule-by-module API reference with signatures, return types, and patterns.\n\n### references\u002Frules_catalog.md\nCatalog of available rules, alert sets, complexity metrics, and filter selection guidelines.\n\n### scripts\u002Ffilter_molecules.py\nBatch filtering script for CSV\u002FTSV\u002FSDF or one-SMILES-per-line TXT inputs with configurable rules, named catalogs, and complexity thresholds. Run the command from the skill directory in the installed environment. `--groups` adds annotations; it does not exclude matches. `--filter-output` retains all-filter passes, while its summary covers the full parsed library. Unknown group\u002Fcatalog names and unavailable requested Lilly filters fail. Existing `passes_*` input annotations do not act as newly evaluated filters. The loader requires RDKit-valid molecules even for Lilly; use raw SMILES with the native wrapper separately when LillyMol-specific valence handling matters. Invalid inputs are removed; retain stable IDs and a separate rejected-input table before invoking the script.\n\n```bash\nuv run python scripts\u002Ffilter_molecules.py input.csv \\\n  --rules rule_of_five,rule_of_cns --pains --nibr --output filtered.csv\n```\n\n## Documentation\n\n- Official docs: https:\u002F\u002Fmedchem-docs.datamol.io\u002F\n- GitHub: https:\u002F\u002Fgithub.com\u002Fdatamol-io\u002Fmedchem\n- PyPI: https:\u002F\u002Fpypi.org\u002Fproject\u002Fmedchem\u002F (2.1.1)\n\n## Citing Scientific Agent Skills\n\nThis skill is part of Scientific Agent Skills by K-Dense. If it materially contributed to a\nmanuscript, report, presentation, or code release, add the paper to the references or\nsoftware section and tell the user you did so:\n\n> Kassis, T., Agarwal, V., He, Y., Patel, D., & Brueckner, A. M. (2026). Scientific Agent\n> Skills: A Library of Procedural Knowledge for Research Agents. arXiv:2609.00065.\n> https:\u002F\u002Fdoi.org\u002F10.48550\u002FarXiv.2609.00065\n\nAlways cite the current version. The DOI and https:\u002F\u002Farxiv.org\u002Fabs\u002F2609.00065 resolve to the\nlatest arXiv version, so never append a version suffix such as `v1`. When network access is\navailable, fetch https:\u002F\u002Farxiv.org\u002Fabs\u002F2609.00065 (or\nhttp:\u002F\u002Fexport.arxiv.org\u002Fapi\u002Fquery?id_list=2609.00065) before writing the reference and take\nthe author list, year, and version from that record. If the record lists a journal reference\nor publisher DOI, cite the published version instead.\n","# Medchem\n\n## Overview\n\nMedchem is a Python library from [datamol-io](https:\u002F\u002Fgithub.com\u002Fdatamol-io\u002Fmedchem) for molecular filtering and prioritization in drug discovery. Apply literature-derived drug-likeness rules, named alert catalogs, complexity thresholds, chemical-group detection, and a custom query language to triage compound libraries at scale. Filters are context-specific guidelines — combine with domain expertise and target knowledge.\n\n**Verified runtime:** medchem **2.1.1**, datamol **0.13.0**, RDKit **2026.3.6**; Python **3.11+**. `RuleFilters` and structural classes return pandas DataFrames. Filters run locally; installation and documentation lookup need network access. Lilly native execution was not tested in this review.\n\n## When to Use This Skill\n\nThis skill should be used when:\n- Applying drug-likeness rules (Lipinski, Veber, CNS, lead-like) to compound libraries\n- Filtering molecules by structural alerts, PAINS, or NIBR screening-deck rules\n- Prioritizing compounds for hit-to-lead or lead optimization\n- Calculating complexity metrics against ZINC-derived thresholds\n- Detecting functional groups or named substructure catalogs\n- Building multi-criteria filters with the medchem query language\n\n## Installation\n\n```bash\nuv pip install \"medchem==2.1.1\" \"datamol==0.13.0\" \"rdkit==2026.3.6\"\n```\n\nOptional Lilly integration: install the upstream checksum-pinned native tools beside the active Python. This downloads source, builds executables, and runs native regression tests (C++ compiler, make, zlib, Ruby; WSL on Windows). This installation command is documented upstream, not executed here:\n\n```bash\nmedchem install-lilly\n```\n\n## Core Capabilities\n\n### 1. Medicinal Chemistry Rules\n\nApply established drug-likeness rules via `medchem.rules`.\n\n**List available rules:**\n\n```python\nimport medchem as mc\n\nmc.rules.RuleFilters.list_available_rules_names()\n# ['rule_of_five', 'rule_of_five_beyond', 'rule_of_four', 'rule_of_three', ...]\n```\n\n**Single rule on one molecule:**\n\n```python\nimport datamol as dm\nimport medchem as mc\n\nsmiles = \"CC(=O)OC1=CC=CC=C1C(=O)O\"  # aspirin\nmc.rules.basic_rules.rule_of_five(smiles)   # True\nmc.rules.basic_rules.rule_of_cns(smiles)    # True\nmc.rules.basic_rules.rule_of_veber(smiles)  # True\n```\n\n**Multiple rules with `RuleFilters` (returns a DataFrame):**\n\n```python\nimport datamol as dm\nimport medchem as mc\n\nmols = [dm.to_mol(s) for s in smiles_list]\n\nrfilter = mc.rules.RuleFilters(\n    rule_list=[\"rule_of_five\", \"rule_of_oprea\", \"rule_of_cns\", \"rule_of_leadlike_soft\"]\n)\ndf = rfilter(mols=mols, n_jobs=-1, progress=True, keep_props=False)\n\n# Columns: mol, pass_all, pass_any, rule_of_five, rule_of_oprea, ...\npassing = df[df[\"pass_all\"]]\n```\n\nExamples below use already parsed `mol_list`, `smiles_list`, and `candidates` supplied by the caller; reject missing\u002Fempty structures before filtering. Use `keep_props=True` to include computed descriptors (`mw`, `clogp`, `tpsa`, etc.) in the result.\n\n### 2. Structural Alert Filters\n\nDetect problematic patterns with `medchem.structural`. Both classes return **DataFrames** with `pass_filter`, `status`, and `reasons` columns.\n\n**Common alerts (ChEMBL-derived rule sets):**\n\n```python\nimport medchem as mc\n\nalert_filter = mc.structural.CommonAlertsFilters(alerts_set=[\"BMS\", \"Dundee\", \"Glaxo\"])\ndf = alert_filter(mols=mol_list, n_jobs=-1, progress=True)\n# df columns: mol, pass_filter, status, reasons\n\nclean = df[df[\"pass_filter\"]]\n```\n\n**NIBR filters (Novartis screening-deck curation):**\n\n```python\nnibr_filter = mc.structural.NIBRFilters()\ndf = nibr_filter(mols=mol_list, n_jobs=-1, progress=True)\n# df columns: mol, pass_filter, status, severity, reasons, n_covalent_motif, special_mol\n```\n\nThe class rejects explicit exclusion alerts. To also reject accumulated flag severity ≥10, use `df[\"pass_filter\"] & (df[\"severity\"] \u003C 10)`, or `mc.functional.nibr_filter(..., max_severity=10)`. The functional cutoff is strict `\u003C 10` and assumes valid molecules: it checks severity alone and can admit parse failures with severity zero. Prevalidate inputs.\n\n### 3. Named Catalog Filters (PAINS, Brenk, etc.)\n\nUse `medchem.catalogs.NamedCatalogs` for RDKit `FilterCatalog` instances, or the functional API:\n\n```python\nimport medchem as mc\n\n# List available named catalogs\nmc.catalogs.list_named_catalogs()\n# ['tox', 'pains', 'pains_a', 'brenk', 'nibr', 'zinc', ...]\n\n# Functional API — True means molecule passes (no alert match)\npasses = mc.functional.catalog_filter(mols=mol_list, catalogs=[\"pains\"], n_jobs=-1)\n\n# Or via catalog objects\npasses = mc.functional.catalog_filter(\n    mols=mol_list,\n    catalogs=[mc.catalogs.NamedCatalogs.pains()],\n    n_jobs=-1,\n)\n```\n\n`alert_filter` is a different API: it uses the ChEMBL common-alert collection names from `CommonAlertsFilters.list_default_available_alerts()`, not every `NamedCatalogs` name. For example, `brenk` and `pains_a` belong in `catalog_filter`. Set common-alert sets explicitly; the current class implementation defaults to BMS only. `catalog_filter` rejects the string names `nibr` and `bredt`; use their dedicated functional filters. Raw NIBR catalog matches include annotations, regardless of severity.\n\n### 4. Functional API\n\n`medchem.functional` provides one-call wrappers that return boolean masks (True = passes):\n\n```python\nimport medchem as mc\n\nmc.functional.rules_filter(mols=mol_list, rules=[\"rule_of_five\", \"rule_of_cns\"], n_jobs=-1)\nmc.functional.nibr_filter(mols=mol_list, max_severity=10, n_jobs=-1)\nmc.functional.catalog_filter(mols=mol_list, catalogs=[\"pains\", \"brenk\"], n_jobs=-1)\nmc.functional.complexity_filter(mols=mol_list, complexity_metric=\"bertz\", limit=\"99\", n_jobs=-1)\n```\n\nOther helpers: `catalog_filter`, `chemical_group_filter`, `lilly_demerit_filter` (requires optional binaries), `macrocycle_filter`, `bredt_filter`, `protecting_groups_filter`, and more. Pass copies to `bredt_filter` (`[Chem.Mol(m) for m in mol_list]`, after `from rdkit import Chem`): its in-place kekulization changes later aromatic alert matches in 2.1.1.\n\n### 5. Chemical Groups\n\nDetect functional groups and curated pattern collections via `medchem.groups`:\n\n```python\nimport medchem as mc\n\n# Browse available group collections\nmc.groups.list_default_chemical_groups()\n# ['privileged_scaffolds', 'common_warhead_covalent_inhibitors', 'rings_in_drugs', ...]\n\ngroup = mc.groups.ChemicalGroup(groups=[\"privileged_scaffolds\"])\ngroup.has_match(mol)                          # bool\ngroup.get_matches(mol)                        # DataFrame, including a matches column\nmatching_mols = [mol for mol in mol_list if group.has_match(mol)]\n# group.filter(names=[...]) narrows pattern names in place; it does not filter molecules.\n\n# Returns a boolean mask: True means the molecule does NOT match the group\nmc.functional.chemical_group_filter(mols=mol_list, chemical_group=group, n_jobs=-1)\n```\n\nCustom groups use `groups_db` CSV with both `smiles` and `smarts`, plus `name` and `group` columns. SMILES and SMARTS matching can differ; record the representation and `exact_match` setting.\n\n### 6. Molecular Complexity\n\nCompare complexity metrics to precomputed, molecular-weight-binned ZINC-15 thresholds. Valid default limit labels are `median`, `90`, `99`, `999` (99.9th percentile), and `max`; `95` is not provided. `spacialscore` needs a custom threshold file. All metrics use an upper cutoff, including QED; do not interpret that as selecting high QED.\n\n```python\nimport medchem as mc\n\n# Single molecule\ncf = mc.complexity.ComplexityFilter(limit=\"99\", complexity_metric=\"bertz\")\ncf(mol)  # True if below 99th-percentile threshold\n\n# Batch via functional API\nmc.functional.complexity_filter(\n    mols=mol_list,\n    complexity_metric=\"bertz\",  # also: sas, qed, whitlock, barone, smcm, twc\n    limit=\"99\",\n    n_jobs=-1,\n)\n\n# Direct metric functions\nmc.complexity.WhitlockCT(mol)\nmc.complexity.BaroneCT(mol)\n```\n\n### 7. Scaffold Constraints\n\n`medchem.constraints.Constraints` matches a core scaffold and applies per-atom constraint functions — not simple MW\u002FLogP ranges. For property bounds, use `RuleFilters`, descriptors via `mc.rules.list_descriptors()`, or the query language.\n\n```python\nimport datamol as dm\nimport medchem as mc\n\ncore = dm.from_smarts(\"c1cncc([*:1])c1\")\nfor atom in core.GetAtoms():\n    if atom.GetAtomMapNum() == 1:\n        atom.SetProp(\"query\", \"aromatic_sidechain\")\nconstraints = mc.constraints.Constraints(\n    core=core,\n    constraint_fns={\"aromatic_sidechain\": lambda fragment: dm.descriptors.n_aromatic_atoms(fragment) > 0},\n)\nassert not constraints(dm.to_mol(\"CN(C)C(=O)c1cncc(C)c1\"))\nassert constraints(dm.to_mol(\"c1ccc(cc1)-c1cccnc1\"))\n```\n\n### 8. Medchem Query Language\n\nBuild multi-criteria filters with `medchem.query.QueryFilter`:\n\n```python\nimport medchem as mc\n\n# Rule + alert combination\nqf = mc.query.QueryFilter('MATCHRULE(\"rule_of_five\") AND NOT HASALERT(\"pains\")')\nmask = qf(mols=mol_list, n_jobs=-1)  # list[bool]\n\n# CNS-like with property bounds\nqf = mc.query.QueryFilter('MATCHRULE(\"rule_of_cns\") AND HASPROP(\"tpsa\", \u003C=, 90)')\nmask = qf(mols=mol_list, n_jobs=-1)\n```\n\n**Query syntax:**\n- `MATCHRULE(\"rule_of_five\")` — apply a named rule\n- `HASALERT(\"pains\")` — match a named catalog (`pains`, `brenk`, `nibr`, `tox`, …)\n- `HASPROP(\"mw\", \u003C, 500)` — compare a descriptor (unquoted comparator)\n- `HASGROUP(\"Primary amines\")` — match a functional-group name from `mc.groups.get_functional_group_map()`; collection names such as `privileged_scaffolds` are not valid here\n- `HASSUBSTRUCTURE(\"c1ccccc1\")` — substructure match\n- Operators: `AND`, `OR`, `NOT`\n\nList available descriptors: `mc.rules.list_descriptors()`\n\n## Workflow Patterns\n\n### Pattern 1: Initial Triage of a Compound Library\n\nBefore filtering, assign stable source-row IDs and separate failed SMILES\u002FSDF\nparses from valid molecules that fail a chemical rule. Retain original structure\ntext and a rejected-input table; report input, parsed, rule-failed, and retained\ncounts. The bundled loader removes invalid molecules (and resets tabular indices),\nso do not align results back to the original file by row position. The example\nbelow assumes all supplied structures parse successfully.\n\n```python\nimport datamol as dm\nimport medchem as mc\nimport pandas as pd\n\ndf = pd.read_csv(\"compounds.csv\")\nmols = [dm.to_mol(s) for s in df[\"smiles\"]]\n\n# Drug-likeness rules\nrules_df = mc.rules.RuleFilters(rule_list=[\"rule_of_five\", \"rule_of_veber\"])(mols=mols, n_jobs=-1)\n\n# PAINS + common alerts via query\nqf = mc.query.QueryFilter('MATCHRULE(\"rule_of_five\") AND NOT HASALERT(\"pains\")')\npass_mask = qf(mols=mols, n_jobs=-1)\n\ndf[\"passes_rules\"] = rules_df[\"pass_all\"].values\ndf[\"drug_like\"] = pass_mask\nfiltered_df = df[df[\"drug_like\"]]\nfiltered_df.to_csv(\"filtered_compounds.csv\", index=False)\n```\n\n### Pattern 2: Lead Optimization Filtering\n\n```python\nimport medchem as mc\n\nrules_df = mc.rules.RuleFilters(rule_list=[\"rule_of_leadlike_soft\"])(mols=candidates, n_jobs=-1)\nnibr_df = mc.structural.NIBRFilters()(mols=candidates, n_jobs=-1)\ncomplex_mask = mc.functional.complexity_filter(\n    mols=candidates, complexity_metric=\"bertz\", limit=\"90\", n_jobs=-1\n)\n\npasses = (\n    rules_df[\"pass_all\"]\n    & nibr_df[\"pass_filter\"]\n    & (nibr_df[\"severity\"] \u003C 10)\n    & complex_mask\n)\n```\n\n### Pattern 3: Detect Functional Groups\n\n```python\nimport medchem as mc\n\ngroup = mc.groups.ChemicalGroup(groups=[\"common_warhead_covalent_inhibitors\"])\nmatches = [group.has_match(mol) for mol in mol_list]\nwarhead_mols = [mol for mol, m in zip(mol_list, matches) if m]\n```\n\n## Best Practices\n\n1. **Context matters** — marketed drugs often violate Ro5; prodrugs and natural products are common exceptions.\n2. **Combine filters** — rules, alert catalogs, and complexity thresholds work best together.\n3. **Use parallelization** — pass `n_jobs=-1` for libraries >1000 molecules.\n4. **Check return types** — `RuleFilters` and structural classes return DataFrames; functional helpers return boolean arrays.\n5. **Lilly demerits are optional** — run `medchem install-lilly` in the active environment; default max demerits is 160 in the functional API.\n6. **Document decisions** — retain `status`, `reasons`, and `severity` columns and record salt handling, protonation, tautomer, stereochemistry, and package versions. No normalization is automatic in the bundled loader.\n7. **Interpret alerts cautiously** — PAINS and reactive motifs indicate review priorities, not measured assay interference or toxicity; require assay-specific controls. Complexity is a library-relative heuristic, not a synthesis feasibility assessment. The upstream complexity filter admits NaN scores, so calculate and validate finite scores when a metric can be undefined.\n\n## Resources\n\n### references\u002Fapi_guide.md\nModule-by-module API reference with signatures, return types, and patterns.\n\n### references\u002Frules_catalog.md\nCatalog of available rules, alert sets, complexity metrics, and filter selection guidelines.\n\n### scripts\u002Ffilter_molecules.py\nBatch filtering script for CSV\u002FTSV\u002FSDF or one-SMILES-per-line TXT inputs with configurable rules, named catalogs, and complexity thresholds. Run the command from the skill directory in the installed environment. `--groups` adds annotations; it does not exclude matches. `--filter-output` retains all-filter passes, while its summary covers the full parsed library. Unknown group\u002Fcatalog names and unavailable requested Lilly filters fail. Existing `passes_*` input annotations do not act as newly evaluated filters. The loader requires RDKit-valid molecules even for Lilly; use raw SMILES with the native wrapper separately when LillyMol-specific valence handling matters. Invalid inputs are removed; retain stable IDs and a separate rejected-input table before invoking the script.\n\n```bash\nuv run python scripts\u002Ffilter_molecules.py input.csv \\\n  --rules rule_of_five,rule_of_cns --pains --nibr --output filtered.csv\n```\n\n## Documentation\n\n- Official docs: https:\u002F\u002Fmedchem-docs.datamol.io\u002F\n- GitHub: https:\u002F\u002Fgithub.com\u002Fdatamol-io\u002Fmedchem\n- PyPI: https:\u002F\u002Fpypi.org\u002Fproject\u002Fmedchem\u002F (2.1.1)\n\n## Citing Scientific Agent Skills\n\nThis skill is part of Scientific Agent Skills by K-Dense. If it materially contributed to a\nmanuscript, report, presentation, or code release, add the paper to the references or\nsoftware section and tell the user you did so:\n\n> Kassis, T., Agarwal, V., He, Y., Patel, D., & Brueckner, A. M. (2026). Scientific Agent\n> Skills: A Library of Procedural Knowledge for Research Agents. arXiv:2609.00065.\n> https:\u002F\u002Fdoi.org\u002F10.48550\u002FarXiv.2609.00065\n\nAlways cite the current version. The DOI and https:\u002F\u002Farxiv.org\u002Fabs\u002F2609.00065 resolve to the\nlatest arXiv version, so never append a version suffix such as `v1`. When network access is\navailable, fetch https:\u002F\u002Farxiv.org\u002Fabs\u002F2609.00065 (or\nhttp:\u002F\u002Fexport.arxiv.org\u002Fapi\u002Fquery?id_list=2609.00065) before writing the reference and take\nthe author list, year, and version from that record. If the record lists a journal reference\nor publisher DOI, cite the published version instead.\n",{"name":5,"license":15,"metadata":24,"description":7,"allowed-tools":28,"compatibility":29},{"version":25,"skill-author":26,"last-reviewed":27},"1.4","K-Dense Inc.","2026-10-01","Read Write Edit Bash","Requires Python 3.11+ with medchem, datamol, and RDKit. Optional Lilly demerits require native tools built with medchem install-lilly, a C++ compiler, make, zlib, and Ruby; installation needs network access. Other filters run locally without credentials.","master","fd76f882a04e445e899d5cfb2732f2105ea054ee","skills\u002Fawesome-skills\u002Fmedchem",0,"https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS","https:\u002F\u002Fbg-szy.github.io\u002FTOP-SKILLS\u002F","https:\u002F\u002Fgithub.com\u002Fbg-szy","https:\u002F\u002Fwww.ecust.edu.cn\u002F","a student of East China University of Science and Technology","2026-11-15 03:38:02",{"source":8,"skillName":5,"commands":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add bg-szy\u002FTOP-SKILLS --skill medchem",{"tool":46,"command":47},"bunx","bunx skills add bg-szy\u002FTOP-SKILLS --skill medchem",{"tool":49,"command":50},"pnpm","pnpm dlx skills add bg-szy\u002FTOP-SKILLS --skill medchem","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fawesome-skills\u002Fmedchem\u002FSKILL.md",true,[],[55,64,71,78,85,92],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":59,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":63},"01M7DXW9N826PKXK174PVW3038","serpmaven","Scrape Google search results (SERP) to JSON with SERP Maven (serpmaven) - a real Chrome browser on a residential proxy with sticky sessions. Run it as a CLI, a Python library, a local HTTP search API (`serve`), an MCP server or a Docker image; set the proxy login, workers, pages and cost tracking. Use when the user wants Google results, rank tracking, a self-hosted SERP API, or live Google search for an AI agent.","MIT","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fserpmaven\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":59,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":63},"01M7DXVHSTWDV65475QEQ915M7","revnu-landing-page-audit","Find out why a landing page isn't turning visitors into signups, demos or sales. Audits one page against what the ad, post or search that sends people there promised, then checks the first screen, proof, call to action, friction and mobile. Returns at most 7 prioritized fixes, plus what is fine and what could not be checked; rewrites specific lines and fixes the page in the repo when asked. Never promises a conversion lift. Works without a Revnu account. Use when the user says or asks: \"audit my landing page\", \"why isn't this page converting\", \"review my homepage\", \"my ads get clicks but no signups\", \"people bounce from the pricing page\", \"CRO review\", \"improve conversion rate\", \"is my hero section clear\", \"roast my landing page\", \"rewrite my headline\", \"what's wrong with this page\", \"landing page feedback\", \"make the signup page convert better\". Not for SEO or AI-search audits, page speed engineering on its own, or building a new page from scratch.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-landing-page-audit\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":59,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":63},"01M7DXV8X2D7B3VTD4HHYYHTGR","revnu-growth-context","Write down once who buys, what they're stuck on, what it costs, what proof you have and what you've already tried, so every growth task starts from facts instead of a questionnaire. Creates or updates .agents\u002Frevnu-growth.md from the repo, the live site and the user, and imports an existing product-marketing.md. Use when the user says \"set up our marketing context\", \"who is our ideal customer\", \"write our ICP\", \"describe the product for marketing\", \"positioning doc\", \"what's our brand voice\", \"remember this about our customers\", \"log what we tried\", \"what have we learned from marketing\", \"we changed pricing, update the context\", \"update our growth notes\", \"summarize the business for the agent\", \"import my product-marketing.md\", \"start a growth doc\", or before a first marketing, SEO, outreach or launch task when no context file exists. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-growth-context\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":59,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":63},"01M7DXV0DGJ1G0A60PAHC6J3C5","revnu-get-listed","Get onto the third-party pages AI answers and search cite when buyers ask for the best tool in your category: \"best X\" roundups, directories, review sites, GitHub awesome lists, community threads and comparison pages. Finds which ones are cited, ranks them by fit and effort, and drafts each submission, PR or pitch by the target's own rules. Use when the user says \"get us listed\", \"which directories should we submit to\", \"how do we get into best-of lists\", \"why does ChatGPT recommend competitors and not us\", \"get mentioned in AI answers\", \"submit to awesome lists\", \"get on G2\", \"where are our competitors listed\", \"pitch listicle authors\", \"find backlink opportunities\", \"launch directories\", \"get into roundups\", \"Product Hunt alternatives\", \"where should we be listed\", \"get cited by Perplexity\". Never submits, pays or posts without a yes. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-get-listed\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":59,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":63},"01M7DXTSPMGT9D6DSS0HP9BSTA","revnu-ai-readiness-audit","Audit whether your website gives ChatGPT, Perplexity, Claude, Gemini and Google's AI Overviews something worth quoting, and fix the pages that don't. Use when the user says or asks \"is my site ready for AI search\", \"audit my site for AI answers\", \"AEO audit\", \"GEO audit\", \"why doesn't ChatGPT quote our pricing\", \"make our pages citable by AI\", \"do I need llms.txt\", \"does schema help with ChatGPT\", \"check our structured data\", \"is our content visible without JavaScript\", \"AI SEO audit\", \"optimize our homepage for AI answers\", \"LLM SEO check\", \"why does AI get our product wrong\", \"fix our site for AI Overviews\". Checks fetchability and indexability, answers in the raw HTML, entity facts, schema (including JS-injected markup), headings, dates and llms.txt, then gives at most 10 prioritised fixes and edits the repo when asked. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-ai-readiness-audit\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":59,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":63},"01M7DXSZHCVTRS620GC3S97JZV","proxy-troubleshooting","Diagnose residential proxy failures, with NodeMaven's gateway as the reference - 407 with correct credentials, 406, 410, 500, a connection that hangs, ERR_TUNNEL_CONNECTION_FAILED in a browser, Playwright or Puppeteer ignoring proxy credentials, a sticky session that changes IP, geo-targeting that is silently ignored, passwords with special characters, and unexpected traffic from headless Chrome. Use when a proxy connection fails, returns the wrong location, or costs more traffic than expected.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fproxy-troubleshooting\u002FSKILL.md",[],[]]