# Skill: Post to Instagram

Generate and post content to Instagram using Playwright automation.

## When to Use
Use when the user wants to create an Instagram post, or when a scheduled `instagram_post` task triggers.

## Limitations
Instagram web has limited posting capabilities:
- Photo posts: Supported via web upload
- Stories/Reels: NOT supported via web (requires mobile app)
- Text-only posts: NOT supported (Instagram requires an image)

## Instructions

### Step 1: Read Context
1. Read `business_profile.md` for posting guidelines, tone, and topics
2. If a specific topic was requested, use that; otherwise choose from configured topics
3. **An image file is required** — check if one was provided or needs to be selected

### Step 2: Draft the Post
1. Generate caption content following the business profile guidelines
2. Save draft to `Pending_Approval/`:
   ```markdown
   ---
   type: instagram_post
   action: post_instagram
   created: {timestamp}
   send_after_approval: true
   image_path: {path to image file, if available}
   ---
   # Pending Approval: Instagram Post

   ## Caption
   {the caption text with hashtags}

   ## Image
   {image_path or "User must provide an image before approving"}

   ## Instructions
   Move this file to `Approved/` to post, or `Rejected/` to cancel.
   Ensure an image is specified in the `image_path` field before approving.
   ```
3. Log the draft creation

### Step 3: Post (After Approval)
When the approved action comes back via `Needs_Action/`:

1. Ensure Playwright MCP server is running
2. Navigate to Instagram:
   ```bash
   python .claude/skills/browsing-with-playwright/scripts/mcp-client.py call \
     -u http://localhost:8808 -t browser_navigate -p '{"url": "https://www.instagram.com/"}'
   ```
3. Click the "+" (create) button
4. Upload the image file
5. Add the caption text
6. Click "Share"
7. Verify the post was created
8. Log the result and move to `Done/`

### Important
- **NEVER post without approval** — always draft to `Pending_Approval/` first
- Instagram requires an image — text-only posts are not possible
- Use relevant hashtags (up to 30, but 5-15 is optimal)
- Keep captions engaging but concise
