agentleFS
priyanshu-aryapriyanshu-arya/LinkedIn_Automation/.claude/skills/schedule-approved/SKILL.md

schedule-approved

Skill0 starsChanged 2 months agoMITView on GitHub

Use when the user wants to send approved LinkedIn drafts to Buffer, check the scheduling queue, or explicitly invokes /schedule-approved. Calls Buffer's real GraphQL API to schedule status:approved drafts, maintains the rolling 2-day-ahead buffer (REQUIREMENTS.md §10), and writes Scheduled Notes. Requires real Buffer credentials in the environment — never attempts a call without them, and never invents a result if a call fails.

  • Reads credentials

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 5 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Only acts on drafts a human has already approved via /review-drafts — this skill never approves anything itself.

    line 11
  2. Very specific:

    Read these from the environment (a .env file is fine, must stay git-ignored):

    line 16
  3. Very specific:

    All requests: POST https://api.buffer.com, header Authorization: Bearer <BUFFER_ACCESS_TOKEN>, JSON body {"query": "...", "variables": …

    line 38
  4. Very specific:

    Every status: approved draft with an empty scheduled_id.

    line 51
  5. Very specific:

    If the draft has a preferred_time set (via Change Time in /review-drafts), use it.

    line 53
  6. Very specific:

    If the response is a MutationError or an HTTP/GraphQL error, stop for that draft, report the exact error message, and do not write a …

    line 79
  7. Very specific:

    Write a Scheduled Note in Scheduled/ from _Templates/Scheduled-Published-Note.md: draft_id, final_text, buffer_post_id (the returned …

    line 96
  8. Distinctive:

    After scheduling, recount.

    line 106
  9. Distinctive:

    Do not notify on ordinary success — a routine schedule confirmation isn't worth an interruption.

    line 116
  10. Distinctive:

    Never call Buffer without both required env vars actually populated — check their presence and non-placeholder-ness before every run.

    line 121
  11. Very specific:

    Never invent a buffer_post_id or claim success on a failed call.

    line 123
  12. Very specific:

    Never schedule a draft that isn't status: approved.

    line 124
  13. Distinctive:

    Never schedule onto Sat/Sun unless explicitly requested.

    line 125
  14. Distinctive:

    Never retry a failed call silently more than once — report it.

    line 126

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Schedule Approved (Scheduler Agent — Phase 8)

Sends status: approved drafts to Buffer for real scheduling, using Buffer's current GraphQL API (verified against developers.buffer.com — the old REST v1 API is deprecated; this is a GraphQL API at a single endpoint). Only acts on drafts a human has already approved via /review-drafts — this skill never approves anything itself.

Required environment

Read these from the environment (a .env file is fine, must stay git-ignored):

  • BUFFER_ACCESS_TOKEN — personal API token from https://publish.buffer.com/settings/api
  • BUFFER_CHANNEL_ID — the Buffer "channel" id for the target LinkedIn profile (Buffer's API calls a connected social profile a "channel," not a "profile" — terminology changed from the old API)

If either is missing or empty, stop immediately and say exactly which one is missing and how to get it. Never attempt a call with a blank or placeholder token.

One-time channel discovery (only if BUFFER_CHANNEL_ID is unknown)

  1. query GetOrganizations { account { organizations { id } } } — get the organization id.
  2. query GetChannels { channels(input: { organizationId: "<id>" }) { id name displayName service } } — find the entry where service is the LinkedIn profile, report its id and displayName, and ask the user to confirm before saving it as BUFFER_CHANNEL_ID.

All requests: POST https://api.buffer.com, header Authorization: Bearer <BUFFER_ACCESS_TOKEN>, JSON body {"query": "...", "variables": {...}}.

Process

1. Check the rolling buffer (REQUIREMENTS.md §10)

Count approved-or-scheduled content dated within the next 2 days from today. If it's already below 2 days' worth, say so plainly before doing anything else — this is the signal that more drafts need to move through /plan-week → /write-draft → /critique-draft → /review-drafts.

2. Select drafts to schedule

Every status: approved draft with an empty scheduled_id. Determine timing:

  • If the draft has a preferred_time set (via Change Time in /review-drafts), use it.
  • Otherwise use the research-backed generic default time for that weekday from the table in REQUIREMENTS.md §11 (e.g. Tue 16:00, Thu 17:00, Sat 09:00, local/IST), on the idea's target_date. This is an unvalidated starting heuristic sourced from external LinkedIn best-time studies, not derived from this account's real performance data — say so, don't present it as optimized. It's superseded automatically once Content-Learnings/playbook.md has ≥3 published posts' worth of day+time evidence (§13).

3. Call Buffer

mutation CreatePost($text: String!, $channelId: ChannelId!, $dueAt: DateTime!) {
  createPost(input: {
    text: $text
    channelId: $channelId
    schedulingType: automatic
    mode: customScheduled
    dueAt: $dueAt
  }) {
    ... on PostActionSuccess { post { id text dueAt } }
    ... on MutationError { message }
  }
}

If the response is a MutationError or an HTTP/GraphQL error, stop for that draft, report the exact error message, and do not write a Scheduled Note for it. Never fabricate a buffer_post_id. This is also a notification trigger (Phase 11: "a post fails to publish").

Note: verified live against Buffer's API on 2026-09-09 (first real call from this pipeline — see Scheduled/2026-09-16--crewai-crews-vs-flows.md for the full record). One correction was needed and is now baked into the mutation above: channelId is the custom scalar ChannelId!, not String! as the docs-only draft of this skill assumed — the live schema rejected String! with GRAPHQL_VALIDATION_FAILED, and the fix was applied based on that exact error message, not guessed. The rest of the shape (mutation name, PostActionSuccess/MutationError union, schedulingType/mode/dueAt fields) worked as documented on the first successful call.

4. On success

  • Write a Scheduled Note in Scheduled/ from _Templates/Scheduled-Published-Note.md: draft_id, final_text, buffer_post_id (the returned post.id), scheduled_date/ scheduled_time, publish_status: scheduled, plus category/format/ length/hook_style/hashtags/visual_ids/sources copied from the draft.
  • Set the Draft Note's scheduled_id to the new Scheduled Note's id. The draft itself stays status: approved — it's the historical record; the Scheduled Note is now the live one.

5. Re-check the rolling buffer

After scheduling, recount. If still below 2 days ahead, flag it again — this is a real, current gap, not a hypothetical one.

Notifications (REQUIREMENTS.md §24)

Send a PushNotification (status: proactive) when:

  • the rolling buffer is below 2 days ahead, after step 5 — e.g. "LinkedIn queue: only 1 day of approved posts left, need more drafts."
  • a Buffer call fails (step 3) — e.g. "LinkedIn post failed to schedule: <short error>." Do not notify on ordinary success — a routine schedule confirmation isn't worth an interruption.

Hard rules

  • Never call Buffer without both required env vars actually populated — check their presence and non-placeholder-ness before every run.
  • Never invent a buffer_post_id or claim success on a failed call.
  • Never schedule a draft that isn't status: approved.
  • Never schedule onto Sat/Sun unless explicitly requested.
  • Never retry a failed call silently more than once — report it.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.