一键导入
pymol-setup
Use when connecting Claude to PyMOL, troubleshooting socket errors, or setting up the PyMOL integration for the first time
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when connecting Claude to PyMOL, troubleshooting socket errors, or setting up the PyMOL integration for the first time
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when working with PyMOL for molecular visualization tasks including loading structures, creating representations, coloring, selections, and basic analysis.
Use when setting up, configuring, running, or inspecting La-Proteina protein generation tasks including unconditional design and motif scaffolding. Helps build configs and visualize outputs through PyMOL.
Use when setting up, configuring, running, or inspecting Proteina-Complexa protein binder design, ligand binder design, AME motif scaffolding, or monomer motif scaffolding. Helps build configs, select targets, and visualize outputs through PyMOL.
Use when validating protein designs with AlphaFold2/AlphaFold3/ESMFold predictions, coloring by pLDDT or pAE, computing self-consistency RMSD, or screening design candidates through PyMOL.
Use when comparing multiple protein designs, ranking design candidates, tracking design iterations, overlaying before/after structures, or performing batch visual QC through PyMOL.
Use when analyzing protein-protein or protein-ligand interfaces in designed complexes, computing buried surface area, identifying hotspot contacts, or characterizing binding interfaces through PyMOL.
| name | pymol-setup |
| description | Use when connecting Claude to PyMOL, troubleshooting socket errors, or setting up the PyMOL integration for the first time |
| version | 0.2.0 |
Set up Claude Code to work with PyMOL. This skill installs pymol-agent-bridge (the Python library that lets Claude talk to PyMOL over a local socket) and configures the connection.
Guiding principles:
~/.pymolrc without the user's explicit go-ahead.pymol-agent-bridge should be installed in a virtual environment, not globally. Help the user choose the right one.Tell the user: "Let me check if pymol-agent-bridge is already configured on your system."
~/.pymol-agent-bridge/bin/pymol-agent-bridge info --json 2>/dev/null || echo "NOT_CONFIGURED"
Read the output:
version, plugin_path, wrapper_path) → already installed. Tell the user what version is configured and skip to Step 4 (Test Connection).Before installing anything, understand the user's setup. Run these checks:
# Check for existing virtual environments and package managers
ls -d .venv venv env .env 2>/dev/null # common venv dirs in cwd
ls pyproject.toml setup.py setup.cfg 2>/dev/null # project files
which uv 2>/dev/null # uv available?
which conda 2>/dev/null # conda available?
which poetry 2>/dev/null # poetry available?
which pymol 2>/dev/null # pymol already on PATH?
python3 -c "import pymol; print(pymol.__file__)" 2>/dev/null # pymol importable?
Present your findings to the user. Summarize what you found — e.g., "I see you have a .venv/ in this project and uv is installed. PyMOL appears to be installed via conda at /path/to/pymol."
You must ask the user where they want pymol-agent-bridge installed. Do not assume. Present options based on what you discovered, in this preference order:
.venv/. Would you like to install pymol-agent-bridge there?".venv/ using uv venv / python3 -m venv?"Wait for the user's response before proceeding.
pymol-agent-bridgeOnce the user has chosen an environment, tell them what you're about to do:
"I'm going to install pymol-agent-bridge into [chosen environment]. This is the Python library that creates a socket connection between Claude and PyMOL."
Then install using the appropriate method:
# If using uv with a project venv:
uv pip install pymol-agent-bridge --python .venv/bin/python
# If using uv to create a new venv first:
uv venv .venv && uv pip install pymol-agent-bridge --python .venv/bin/python
# If using plain venv:
python3 -m venv .venv && .venv/bin/pip install pymol-agent-bridge
# If using conda:
conda install -n <env-name> pip && conda run -n <env-name> pip install pymol-agent-bridge
# If using poetry:
poetry add pymol-agent-bridge
If Step 2's discovery did not find PyMOL, tell the user: "I couldn't find a PyMOL installation on your system. You'll need PyMOL to use these skills."
Ask the user which method they prefer. Common options:
brew install pymol (macOS, easiest)conda install -c conda-forge pymol-open-source (conda users)pip install pymol-open-source-whl (pre-built wheels, note: no pymol CLI command — use python -m pymol)apt install pymol, etc.)Do not install PyMOL without the user's explicit choice.
pymol-agent-bridge setupTell the user: "Now I'll run pymol-agent-bridge setup. This does three things:
~/.pymolrc so PyMOL can receive commands from Claude~/.pymol-agent-bridge/bin/pymol-agent-bridge"Ask the user if it's OK to proceed (since this modifies ~/.pymolrc).
Then run setup using the Python where pymol-agent-bridge was installed:
# If pymol-agent-bridge is in a project venv:
.venv/bin/pymol-agent-bridge setup
# If in a conda env:
conda run -n <env-name> pymol-agent-bridge setup
# If installed globally (not recommended):
pymol-agent-bridge setup
Tell the user: "Let me verify the connection works. I'll launch PyMOL and send a test command."
~/.pymol-agent-bridge/bin/pymol-agent-bridge launch
Wait a moment for PyMOL to start, then:
~/.pymol-agent-bridge/bin/pymol-agent-bridge exec "print('Claude connection successful!')"
If this succeeds, tell the user the connection is working. If it fails, go to Troubleshooting.
Tell the user: "By default, Claude will ask your permission each time it runs a PyMOL command. If you'd like seamless operation, I can add permission rules to your project's .claude/settings.json so PyMOL commands run without prompts."
Ask if they want this. If yes, add to the project's .claude/settings.json:
{
"permissions": {
"allow": [
"Bash(*/.pymol-agent-bridge/bin/pymol-agent-bridge*)",
"Bash(pymol*)"
]
}
}
If the file already exists, merge the allow entries — do not overwrite existing permissions.
Summarize what was done:
pymol-agent-bridge was installed (which environment)~/.pymolrc was configured with the socket plugin~/.pymol-agent-bridge/bin/pymol-agent-bridgeTell the user:
~/.pymol-agent-bridge/bin/pymol-agent-bridge execPyMOL isn't running or the socket plugin didn't load:
~/.pymol-agent-bridge/bin/pymol-agent-bridge launchbridge_statusThe pymol-open-source-whl package doesn't install a pymol CLI command. Solutions:
python -m pymol (or python3 -m pymol)~/.bashrc or ~/.zshrc:
alias pymol='python3 -m pymol'
python3 -m pip install pymol-open-source-whl~/.pymolrc is absolute, not relativepymol-agent-bridge setup to auto-configureIf PyMOL launches but the GUI is broken:
pip install pyqt5
If using conda, ensure the environment is active:
conda activate <your-pymol-env>
pymol