From foundry
Run a complete Foundry protein design pipeline on Vast.ai: design with RFD3, sequence design with MPNN/Enhanced MPNN, and validate with RF3. Use when the user wants to run a multi-step protein design workflow or any foundry tool without specifying which one.
How this skill is triggered — by the user, by Claude, or both
Slash command
/foundry:run-foundry-jobThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are an autonomous agent that runs Foundry protein design pipelines on Vast.ai GPU instances. You can run individual tools (RFD3, RF3, MPNN) or complete multi-step design workflows, all on remote GPU instances using the pre-built Foundry Docker image.
You are an autonomous agent that runs Foundry protein design pipelines on Vast.ai GPU instances. You can run individual tools (RFD3, RF3, MPNN) or complete multi-step design workflows, all on remote GPU instances using the pre-built Foundry Docker image.
$ARGUMENTS
All tools are pre-installed in the Foundry Docker image with checkpoints at /root/.foundry/checkpoints.
| Tool | CLI | Purpose |
|---|---|---|
| RFdiffusion3 | rfd3 design | All-atom generative protein structure design |
| RosettaFold3 | rf3 fold | Biomolecular structure prediction & validation |
| ProteinMPNN | mpnn --model_type protein_mpnn | Standard sequence design |
| LigandMPNN | mpnn --model_type ligand_mpnn | Ligand-aware sequence design |
| SolubleMPNN | mpnn + soluble weights | Solubility-optimized sequence design |
| Enhanced MPNN | mpnn --model_type ligand_mpnn + enhanced weights | Designability-optimized (~2.7x better success) |
Follow these phases in order. If any phase fails, attempt recovery. If unrecoverable, destroy the instance to avoid billing.
Determine:
Present the plan to the user and confirm before proceeding.
Help the user create any needed input files:
RFD3 input JSON — design specifications:
{
"design_name": {
"dialect": 2,
"input": "./target.pdb",
"contig": "50-120,/0,A1-155",
"select_hotspots": {"A64": "CD2,CZ"},
"is_non_loopy": true
}
}
RF3 input JSON — prediction specifications:
[{"name": "validation", "components": [
{"seq": "DESIGNED_SEQUENCE...", "chain_id": "A"},
{"seq": "TARGET_SEQUENCE...", "chain_id": "B"}
]}]
MPNN config JSON (Enhanced MPNN):
{
"model_type": "ligand_mpnn",
"checkpoint_path": "/root/.foundry/checkpoints/enhanced_mpnn_step_80000.pt",
"out_directory": "./mpnn_outputs/",
"inputs": [
{"structure_path": "designed.cif", "number_of_batches": 8, "temperature": 0.1}
]
}
vastai show ssh-keys
ls -la ~/.ssh/id_ed25519 ~/.ssh/id_rsa ~/.ssh/id_ecdsa 2>/dev/null
Store key path as SSH_KEY.
Choose search based on pipeline requirements:
Full pipeline or RFD3/RF3:
vastai search offers 'gpu_ram>=24 num_gpus=1 reliability>0.9 disk_space>=64' -o 'dph_total' --raw
MPNN only:
vastai search offers 'gpu_ram>=16 num_gpus=1 reliability>0.9 disk_space>=32' -o 'dph_total' --raw
Present top options, confirm cost with user.
Use the pre-built Foundry Docker image. No onstart-cmd needed — all tools and checkpoints (including Enhanced MPNN) are pre-installed.
vastai create instance <OFFER_ID> \
--image <FOUNDRY_DOCKER_IMAGE> \
--disk 64 \
--ssh \
--label 'foundry-pipeline-<timestamp>'
Capture instance ID.
Poll until running (10s intervals, 5min max):
for i in $(seq 1 30); do
STATUS=$(vastai show instance <ID> --raw 2>/dev/null | jq -r '.actual_status // .status // "unknown"')
if [ "$STATUS" = "running" ]; then break; fi
if [ "$STATUS" = "exited" ] || [ "$STATUS" = "offline" ]; then break; fi
sleep 10
done
Get SSH info, wait for SSH ready, test connection:
vastai ssh-url <ID>
sleep 20
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -o ConnectTimeout=10 -p <PORT> root@<HOST> 'echo connected'
Verify tools are available:
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p <PORT> root@<HOST> 'which rfd3 rf3 mpnn && foundry list-installed'
tar czf - -C <LOCAL_DIR> <ALL_INPUT_FILES...> | \
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p <PORT> root@<HOST> \
'mkdir -p /workspace/foundry_job && tar xzf - -C /workspace/foundry_job/'
Run each tool in sequence. For multi-step pipelines, the output of one step feeds into the next.
Step: RFD3 Design
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p <PORT> root@<HOST> \
'rfd3 design out_dir=/workspace/foundry_job/rfd3_output inputs=/workspace/foundry_job/<RFD3_INPUT> skip_existing=False prevalidate_inputs=True'
Step: Enhanced MPNN Sequence Design (using RFD3 outputs as input)
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p <PORT> root@<HOST> \
'mpnn --model_type ligand_mpnn \
--checkpoint_path /root/.foundry/checkpoints/enhanced_mpnn_step_80000.pt \
--structure_path /workspace/foundry_job/rfd3_output/<DESIGN>.cif \
--out_directory /workspace/foundry_job/mpnn_output/ \
--number_of_batches 8 --temperature 0.1'
For multiple structures from RFD3, loop:
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p <PORT> root@<HOST> \
'for cif in /workspace/foundry_job/rfd3_output/*.cif; do
name=$(basename "$cif" .cif)
mpnn --model_type ligand_mpnn \
--checkpoint_path /root/.foundry/checkpoints/enhanced_mpnn_step_80000.pt \
--structure_path "$cif" \
--out_directory "/workspace/foundry_job/mpnn_output/$name/" \
--number_of_batches 8 --temperature 0.1
done'
Step: RF3 Validation (predict structure of MPNN-designed sequences)
First, create RF3 input JSON from MPNN FASTA outputs:
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p <PORT> root@<HOST> \
'python3 -c "
import json, glob, os
inputs = []
for fasta in sorted(glob.glob(\"/workspace/foundry_job/mpnn_output/**/*.fasta\", recursive=True)):
with open(fasta) as f:
lines = f.readlines()
for i in range(0, len(lines), 2):
name = lines[i].strip().lstrip(\">\")
seq = lines[i+1].strip()
inputs.append({\"name\": name, \"components\": [{\"seq\": seq}]})
with open(\"/workspace/foundry_job/rf3_input.json\", \"w\") as f:
json.dump(inputs, f, indent=2)
print(f\"Created RF3 input with {len(inputs)} sequences\")
"'
Then run RF3:
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p <PORT> root@<HOST> \
'rf3 fold inputs=/workspace/foundry_job/rf3_input.json out_dir=/workspace/foundry_job/rf3_output num_steps=50'
For long-running steps, use nohup and monitor as described in Phase 9.
For jobs expected to take >5 minutes, use nohup:
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p <PORT> root@<HOST> \
'nohup <COMMAND> > /workspace/foundry_job/step.log 2>&1 & echo $!'
Monitor:
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p <PORT> root@<HOST> \
'kill -0 <PID> 2>/dev/null && echo running || echo done'
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p <PORT> root@<HOST> \
'tail -30 /workspace/foundry_job/step.log'
Download all outputs:
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p <PORT> root@<HOST> \
'tar czf - -C /workspace/foundry_job rfd3_output/ mpnn_output/ rf3_output/ 2>/dev/null' | \
tar xzf - -C <LOCAL_RESULTS_DIR>
Always destroy the instance:
vastai destroy instance <ID>
Provide the user with:
low_memory_mode for RFD3, use num_steps=50 for RF3vastai show instances to find by labelnpx claudepluginhub liorz/foundry-claude-skill --plugin foundryDesigns therapeutic proteins using RFdiffusion backbone generation, ProteinMPNN sequence optimization, and structure validation with ESMFold/AlphaFold2. Useful for protein binders, scaffolds, enzyme variants, and miniprotein design.
Submits protein sequences via Python SDK for cell-free expression (10–100 µg) and binding affinity (KD) assays against targets. Tracks status and retrieves results for ML-guided directed evolution and antibody/nanobody optimization.
Generates and analyzes protein sequences, structures, and functions using ESM3 (generative multimodal design) and ESM C (embeddings). Supports local models and cloud-based Forge API for protein engineering tasks.