--- name: plan-week description: Plans the coming week of social posts in Mark from the brand strategy, calendar gaps and recent performance, then writes the drafts and sends them to review. Use when the user asks to plan next week's posts, fill the content calendar, draft a week of LinkedIn, Instagram or X posts, or "what should we post next week?". Requires the Mark connection (MCP tools such as get_workspace). metadata: { mark-summary: "Draft the week's posts from your pillars and calendar." } --- # Plan the week You turn Mark's strategy (pillars, angles, personas), the open calendar slots, and what worked recently into a week of post drafts that the team reviews in Mark. **Review is part of the job.** Drafts go to review, and nothing is approved unless the user explicitly says so. ## Before you start - If Mark tools (`get_workspace` and the others) aren't available, stop and tell the user: "Connect Mark first: https://docs.use-mark.com/docs/use-mark-from-ai-agents". - If more than one Mark connection is available (one per workspace, often named like `mark-acme`), use the one for the workspace the user named and stick with it for the whole run. If they didn't name one, ask which workspace. - Call `get_workspace`. Tell the user which workspace you're working in (for example "Working in **Verdella**"). If it's the wrong one, switch to that workspace's Mark connection if there is one. Otherwise they need to reconnect Mark and pick the right workspace. There is no workspace argument. - Ask only for what you can't infer. Defaults: next Monday through Sunday in the workspace timezone, every connected channel, and one post per open slot. ## Setup Call `get_setup_status` and read `rows` for the steps this skill needs: "market", "social", "posting_times". A row in state "todo" or "skipped" is missing. `ready` and `gaps` leave out skipped rows, so don't rely on them. For a "skipped" row, tell the user they skipped it and ask before you set it up. For each missing row: - "market": ask the user for the place and language (never guess). If the place is unclear, `list_market_locations`, then `set_up_market`. - "social": `get_connect_link` with provider `zernio` (or the channel), give the user the link (connecting stays in the Mark app), then `sync_connections` after they say they're done. - "posting_times": ask which weekdays and how many posts each day, then `update_posting_slots`. If they name a time, set it as the channel's posting time with `update_channel_settings`. ## Procedure 1. **Gather context** (read-only): - `get_brand_context`: voice, pillars, angles, personas, KPI targets. - `get_calendar` for the week: scheduled posts and open slots. - `get_content_performance` for the last 30 days: which pillars and posts gained the most impressions and engagement, and which gained little. - `get_search_performance`: rising queries and striking-distance topics worth a post. - `list_saved_keywords`: tagged topics the team already cares about. 2. **Draft the plan.** Call `get_drafting_guide` once for each channel in the plan (`surface` is the channel) and keep each guide and its `guideVersion` for step 4. Each guide says which formats suit that channel and what each is for. For each open slot, give: day and time, channel, pillar, angle, format (for example carousel, reel, thread or text post), a one-line hook, and why it's there (for example "angle X drove 2× engagement last month"). Balance the pillars across the week, mix formats instead of repeating one, keep promotional posts a small share, don't repeat an angle on the same channel, and respect existing scheduled posts. 3. **✋ Checkpoint 1: plan approval.** Show the plan as a table and ask: **"Here's the plan for ‹week›. Shall I write these ‹N› drafts? Tell me what to change first."** Don't create anything until the user says yes. 4. **Write each draft:** - Follow each channel's guide from step 2 exactly. If the user changed the plan or a brand rule since then, call `get_drafting_guide` again for that channel. - For media, `search_assets` then `get_asset` to pick existing images or video. Use `add_asset` only when the user provides a URL or file: a public URL imports in one call; a local file takes three (`add_asset` with `fileName` returns a signed link, PUT the file to it with curl, then `add_asset` with the returned `pathname`). Pass the new asset id to `save_post`. - Call `save_post` (omit `postId`; set `channel`, `body`, media, angle, pillar, `scheduledAt` as ISO 8601, and `guideVersion` from that channel's guide). It creates a draft and never publishes. Keep the returned `postId` and `rev`. 5. **✋ Checkpoint 2: before review.** Show every draft (channel, time, full text, media). Ask: **"Send these ‹N› drafts to review in Mark?"** Before asking, check each channel's approval mode with `list_channels`. **If any channel auto-approves, say so plainly:** "‹Channel› auto-approves: submitting will schedule it to publish at ‹time› without review." Then call `submit_post` for each confirmed draft and report what each result says (in review, or auto-approved and scheduled). 6. **Approval is the user's call.** Never call `approve_posts` unless the user explicitly says "approve" for specific posts. Then pass each post's current `rev` from `get_post`. **Approved posts publish automatically at their scheduled time.** If the server says a post changed since you read it, call `get_post` again and show the change before retrying. 7. **Finish** with a summary: a table of drafts with status and links (`appUrl`), anything skipped and why, and the next step ("Review them in Mark → Review queue"). ## Output format - The plan and draft lists are Markdown tables: Day, Time, Channel, Format, Pillar/Angle, Hook/Text, Status. - Use Mark's words for state: draft, in review, approved, scheduled, published, changes requested. ## When things go wrong - **No open slots:** offer to plan into specific days the user names. To change recurring slots, ask first, then `update_posting_slots`. - **No performance data yet** (new workspace): plan from pillars and angles only, and say so. - **A channel is disconnected** (`list_channels` shows `connected: false`): skip it, call `get_connect_link` with that channel, give the user the link, then call `sync_connections` and `list_channels` to confirm after they say they're done. `list_connections` shows integrations, not individual social accounts. - **A post is locked or already published:** report the error text and move on. Never work around it. - **Cleanup a draft:** only after an explicit yes. Prefer `archive_post` if they might want it back. `delete_post` is permanent; it works on any post that has not published and cancels a scheduled one. - **Don't invent** metrics, testimonials, prices or claims. If a draft needs a fact you don't have, leave a clear `[confirm: …]` placeholder and flag it at Checkpoint 2.