$npx -y skills add meshy-dev/meshy-3d-agent --skill meshy-openclawGenerate 3D models, textures, images, rig characters, animate them, and prepare for 3D printing using the Meshy AI API. Handles API key detection, task creation, polling, downloading, and full 3D print pipeline with slicer integration. Use when the user asks to create 3D models,
| 1 | # Meshy 3D — Generation + Printing |
| 2 | |
| 3 | Directly communicate with the Meshy AI API to generate and print 3D assets. Covers the complete lifecycle: API key setup, task creation, exponential backoff polling, downloading, multi-step pipelines, and 3D print preparation with slicer integration. |
| 4 | |
| 5 | --- |
| 6 | |
| 7 | ## SECURITY MANIFEST |
| 8 | |
| 9 | **Environment variables accessed:** |
| 10 | - `MESHY_API_KEY` — API authentication token sent in HTTP `Authorization: Bearer` header only. Never logged, never written to any file except `.env` in the current working directory when explicitly requested by the user. |
| 11 | |
| 12 | **External network endpoints:** |
| 13 | - `https://api.meshy.ai` — Meshy AI API (task creation, status polling, model/image downloads) |
| 14 | |
| 15 | **File system access:** |
| 16 | - Read: `.env` in the current working directory only (API key lookup) |
| 17 | - Write: `.env` in the current working directory only (API key storage, only on user request) |
| 18 | - Write: `./meshy_output/` in the current working directory (downloaded model files, metadata) |
| 19 | - Read: files explicitly provided by the user (e.g., local images passed for image-to-3D conversion), accessed only at the exact path the user specifies |
| 20 | - No access to home directories, shell profiles, or any path outside the above |
| 21 | |
| 22 | **Data leaving this machine:** |
| 23 | - API requests to `api.meshy.ai` include the `MESHY_API_KEY` in the Authorization header and user-provided text prompts or image URLs. No other local data is transmitted. Downloaded model files are saved locally only. |
| 24 | |
| 25 | --- |
| 26 | |
| 27 | ## IMPORTANT: First-Use Session Notice |
| 28 | |
| 29 | When this skill is first activated in a session, inform the user: |
| 30 | |
| 31 | > All generated files will be saved to `meshy_output/` in the current working directory. Each project gets its own folder (`{YYYYMMDD_HHmmss}_{prompt}_{id}/`) with model files, textures, thumbnails, and metadata. History is tracked in `meshy_output/history.json`. |
| 32 | |
| 33 | This only needs to be said **once per session**. |
| 34 | |
| 35 | --- |
| 36 | |
| 37 | ## IMPORTANT: File Organization |
| 38 | |
| 39 | All downloaded files MUST go into a structured `meshy_output/` directory in the current working directory. **Do NOT scatter files randomly.** |
| 40 | |
| 41 | - Each project: `meshy_output/{YYYYMMDD_HHmmss}_{prompt_slug}_{task_id_prefix}/` |
| 42 | - Chained tasks (preview → refine → rig) reuse the same `project_dir` |
| 43 | - Track tasks in `metadata.json` per project, and global `history.json` |
| 44 | - Auto-download thumbnails alongside models |
| 45 | |
| 46 | --- |
| 47 | |
| 48 | ## IMPORTANT: Shell Command Rules |
| 49 | |
| 50 | Use only standard POSIX tools. Do NOT use `rg`, `fd`, `bat`, `exa`/`eza`. |
| 51 | |
| 52 | --- |
| 53 | |
| 54 | ## IMPORTANT: Run Long Tasks Properly |
| 55 | |
| 56 | Meshy generation takes 1–5 minutes. Write the entire create → poll → download flow as **ONE Python script** and execute in a single Bash call. Use `python3 -u script.py` for unbuffered output. Tasks sitting at 99% for 30–120s is normal finalization — do NOT interrupt. |
| 57 | |
| 58 | --- |
| 59 | |
| 60 | ## Step 0: API Key Detection (ALWAYS RUN FIRST) |
| 61 | |
| 62 | **Only check the current session environment and the `.env` file in the current working directory. Do NOT scan home directories or shell profile files.** |
| 63 | |
| 64 | ```bash |
| 65 | echo "=== Meshy API Key Detection ===" |
| 66 | |
| 67 | # 1. Check current env var |
| 68 | if [ -n "$MESHY_API_KEY" ]; then |
| 69 | echo "ENV_VAR: FOUND (${MESHY_API_KEY:0:8}...)" |
| 70 | else |
| 71 | echo "ENV_VAR: NOT_FOUND" |
| 72 | fi |
| 73 | |
| 74 | # 2. Check .env in current working directory only |
| 75 | if [ -f ".env" ] && grep -q "MESHY_API_KEY" ".env" 2>/dev/null; then |
| 76 | echo "DOTENV(.env): FOUND" |
| 77 | export MESHY_API_KEY=$(grep "^MESHY_API_KEY=" ".env" | head -1 | cut -d'=' -f2- | tr -d '"'"'" ) |
| 78 | fi |
| 79 | |
| 80 | # 3. Final status |
| 81 | if [ -n "$MESHY_API_KEY" ]; then |
| 82 | echo "READY: key=${MESHY_API_KEY:0:8}..." |
| 83 | else |
| 84 | echo "READY: NO_KEY_FOUND" |
| 85 | fi |
| 86 | |
| 87 | # 4. Python requests check |
| 88 | python3 -c "import requests; print('PYTHON_REQUESTS: OK')" 2>/dev/null || echo "PYTHON_REQUESTS: MISSING (run: pip install requests)" |
| 89 | |
| 90 | echo "=== Detection Complete ===" |
| 91 | ``` |
| 92 | |
| 93 | ### Decision After Detection |
| 94 | |
| 95 | - **Key found** → Proceed to Step 1. |
| 96 | - **Key NOT found** → Go to Step 0a. |
| 97 | - **Python requests missing** → Run `pip install requests`. |
| 98 | |
| 99 | --- |
| 100 | |
| 101 | ## Step 0a: API Key Setup (Only If No Key Found) |
| 102 | |
| 103 | Tell the user: |
| 104 | |
| 105 | > To use the Meshy API, you need an API key: |
| 106 | > |
| 107 | > 1. Go to **https://www.meshy.ai/settings/api** |
| 108 | > 2. Click **"Create API Key"**, name it, and copy the key (starts with `msy_`) |
| 109 | > 3. The key is shown **only on |