TopRank Skills

Home / Claw Skills / 搜索 / intern_pubchem_name_conversion
Official OpenClaw rules 54%

intern_pubchem_name_conversion

Convert molecules between IUPAC, SMILES, and molecular formula using PubChem as the source of truth. Use this whenever the user asks to convert, normalize, or cross-check molecular representations in chemistry/science workflows (including Intern research tasks). Prefer API lookup over memory; do not guess.

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 intern_pubchem_name_conversion 技能。 若已安装,则直接安装 intern_pubchem_name_conversion 技能。

Overview

Skill Key
guox18/intern-pubchem-name-conversion
Author
guox18
Source Repo
openclaw/skills
Version
-
Source Path
skills/guox18/intern-pubchem-name-conversion
Latest Commit SHA
1845478cb8894083c1c66bcc9ca73810191c348a

Extracted Content

SKILL.md excerpt

# Intern PubChem Name Conversion

Convert one molecular representation into all three fields:
- `smiles`
- `iupac`
- `formula`

## When to use

Use this skill when the user asks to:
- convert IUPAC <-> SMILES
- fetch molecular formula from IUPAC/SMILES
- validate molecule identity against PubChem

Do not use this skill for:
- reaction mechanism explanation
- quantum chemistry simulation
- docking or property prediction beyond PubChem identifiers

## Input contract

Expect one input value and one type:
- `input_type`: `iupac` or `smiles`
- `input_value`: raw string

If the user gives only one string without type:
- treat strings with many bond symbols (`=`, `#`, `[`, `]`, `@`) as `smiles`
- otherwise treat as `iupac`/name query

## Required behavior

Always query PubChem first. Do not answer from memory when tools are available.

1) URL-encode the full input string:

```bash
ENCODED=$(python3 -c 'import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1], safe=""))' "$INPUT_VALUE")
```

2) Build the primary endpoint:
- If `input_type == iupac`:
  - `https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/{ENCODED}/property/SMILES,IUPACName,MolecularFormula/JSON`
- If `input_type == smiles`:
  - `https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/smiles/{ENCODED}/property/SMILES,IUPACName,MolecularFormula/JSON`

3) If `smiles` primary endpoint is non-200, retry once with:
- `https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/fastidentity/smiles/{ENCODED}/property/SMILES,IUPACName,MolecularFormula/JSON`

4) If still non-200, do CID fallback:
- Resolve CID:
  - iupac: `.../compound/name/{ENCODED}/cids/JSON`
  - smiles: `.../compound/smiles/{ENCODED}/cids/JSON`
- Then fetch properties by CID:
  - `.../compound/cid/{CID}/property/SMILES,IUPACName,MolecularFormula/JSON`

5) Parse `PropertyTable.Properties[0]` and map:
- `smiles <- SMILES` (fallback `ConnectivitySMILES`)
- `iupac <- IUPACName`
- `formula <- MolecularFormula`

## Output format

Return JSON only (no markdo...

Related Claw Skills