$npx -y skills add tkellogg/open-strix --skill view-attachmentView image or file attachments that you can't directly see. Use this skill when you receive a message with attachments listed as file paths and you need to understand their contents. Especially useful for text-only models that cannot process images natively.
| 1 | # view-attachment |
| 2 | |
| 3 | When a message includes attachments, you see file paths like: |
| 4 | ``` |
| 5 | attachments: |
| 6 | - state/attachments/12345-screenshot.png |
| 7 | ``` |
| 8 | |
| 9 | These are real files on disk. You can't see them inline, but you have several ways |
| 10 | to inspect them depending on the file type. |
| 11 | |
| 12 | ## Step 1: Identify the File Type |
| 13 | |
| 14 | Check the extension: |
| 15 | - **Images:** `.png`, `.jpg`, `.jpeg`, `.gif`, `.webp`, `.svg`, `.bmp` |
| 16 | - **Text/code:** `.txt`, `.md`, `.py`, `.js`, `.json`, `.csv`, `.log`, `.yaml`, `.toml` |
| 17 | - **Documents:** `.pdf` |
| 18 | - **Other:** anything else |
| 19 | |
| 20 | ## Step 2: Choose a Viewing Strategy |
| 21 | |
| 22 | ### For Text-Based Files |
| 23 | Read them directly — these are just text: |
| 24 | ```bash |
| 25 | cat state/attachments/12345-notes.txt |
| 26 | ``` |
| 27 | |
| 28 | ### For Images (When You Can't View Them Natively) |
| 29 | |
| 30 | Try these approaches in order of usefulness: |
| 31 | |
| 32 | **Option A: Describe from context** |
| 33 | Often the surrounding message gives enough context. If someone says "look at this error" |
| 34 | and attaches a screenshot, the error is probably in their message text too. Ask if unclear. |
| 35 | |
| 36 | **Option B: File metadata** |
| 37 | Get dimensions, format, and size to understand what you're looking at: |
| 38 | ```bash |
| 39 | file state/attachments/12345-image.png |
| 40 | identify state/attachments/12345-image.png 2>/dev/null # if ImageMagick available |
| 41 | ``` |
| 42 | |
| 43 | **Option C: OCR with Tesseract** |
| 44 | Extract text content from screenshots, documents, or photos of text: |
| 45 | ```bash |
| 46 | tesseract state/attachments/12345-screenshot.png stdout 2>/dev/null |
| 47 | ``` |
| 48 | |
| 49 | **Option D: Convert to SVG (for simple graphics/charts)** |
| 50 | Trace bitmap images into vector format you can reason about: |
| 51 | ```bash |
| 52 | # Install if needed: apt-get install -y potrace |
| 53 | convert state/attachments/12345-chart.png pbm:- | potrace --svg -o - 2>/dev/null |
| 54 | ``` |
| 55 | SVG output is XML text — you can read the paths and shapes. |
| 56 | |
| 57 | **Option E: Base64 encode** |
| 58 | If another tool or API accepts base64 images, encode it: |
| 59 | ```bash |
| 60 | base64 -w0 state/attachments/12345-image.png |
| 61 | ``` |
| 62 | Warning: base64 output is large. Only use this if you're passing it to a vision-capable |
| 63 | API or tool, not for your own comprehension. |
| 64 | |
| 65 | **Option F: Pixel sampling (last resort)** |
| 66 | For very simple images, sample pixel values at key coordinates: |
| 67 | ```bash |
| 68 | # Get the color at specific pixel coordinates (requires ImageMagick) |
| 69 | convert state/attachments/12345-image.png -format '%[pixel:p{100,100}]' info: 2>/dev/null |
| 70 | ``` |
| 71 | |
| 72 | ### For PDFs |
| 73 | ```bash |
| 74 | # Extract text |
| 75 | pdftotext state/attachments/12345-document.pdf - 2>/dev/null |
| 76 | ``` |
| 77 | |
| 78 | ## Step 3: Be Honest About Limitations |
| 79 | |
| 80 | If none of these approaches give you useful information: |
| 81 | 1. Say what you tried |
| 82 | 2. Describe what you CAN tell (file size, type, metadata) |
| 83 | 3. Ask the human to describe what's in the attachment |
| 84 | |
| 85 | Never pretend you can see an image when you can't. Never hallucinate image contents. |