PlugWiki

connector-x Skill (Caffeine): Post to X From Motoko

Gives Claude Caffeine's recipe for posting to X (Twitter) from a Motoko canister with the x-client package.

Installs
8.7K
on skills.sh
Stars
2
on GitHub
Updated
Oct 2026
last repo commit

connector-x is a recipe that tells Claude to post to X through the x-client mops package, not hand-written HTTPS calls to api.x.com. It gives a minimal Motoko canister that calls createPosts, the X developer portal setup for OAuth 2.0 with PKCE (no client secret), the four scopes to request, token refresh and rate limits.

It loads when a Caffeine build mentions tweeting, X or Twitter. It is useful only if you build on Caffeine AI or write Motoko canisters. Posting needs an X developer app and a per-user OAuth token.

Good for

  • Developers building apps on Caffeine AI that post tweets
  • Motoko canister authors who need X API v2 posting
  • Anyone setting up per-user X sign-in for an Internet Computer app

Install connector-x

Claude Code

  1. 1

    Copy this prompt.

    Install the connector-x skill in Claude Code. Run this command:
    
    npx skills add https://github.com/caffeinelabs/skills --skill connector-x --skill extension-posting-to-x
    
    Then check that it loaded and tell me how to use it.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

This skill is for building on Caffeine AI, the app builder from Caffeine Labs, or for writing Motoko code for the Internet Computer. It is not a general X (Twitter) tool. SKILL.md points to the posting-to-x extension for the canonical token-refresh code, which the repo holds as extension-posting-to-x, so the commands below install both. The skill is one file and bundles no scripts. It has you write Motoko code into a project, so there is no Claude app upload route.

From its listing on skills.sh. Source.

What's in the skill

When it loads

MANDATORY recipe for every Caffeine build that posts to X (Twitter) from a canister. The supported path is the `x-client` mops package (X API v2) over outbound HTTPS, with per-user OAuth 2.0 (PKCE, no client secret). Hand-rolling `ic.http_request` calls to `api.x.com` is a FORBIDDEN anti-pattern — it bypasses bearer auth, the non-replicated-outcall safeguard, and the package's null-field JSON handling. Load this skill whenever the user, spec, or any prior task mentions posting a tweet, "tweet this", X/Twitter, sharing to X, or any equivalent phrasing — and BEFORE writing any code that touches an X endpoint.

Sections in SKILL.md

  1. OAuth 2.0 setup — PKCE, no client secret
  2. Calls are non-replicated by default
  3. Optional fields: leave them null
  4. Sub-object rules for the non-null optionals
  5. Token refresh
  6. Rate limits

Key facts

Installs on skills.sh
8,694 (Nov 2, 2026)
GitHub stars
2 (Nov 2, 2026)
Last repo commit
Oct 30, 2026

What it includes

  • Minimal Motoko canister that posts a tweet with createPosts

    It builds a TweetCreateRequest with text set and every other optional field null.

    Write · Backend snippet

  • Steps in the X Developer Portal: app type, callback URI, scopes, Client ID

    App type is Web App, Automated App or Bot. SKILL.md says not to pick Native App or a confidential client.

    Read · OAuth 2.0 PKCE setup

  • tweet.write, tweet.read, users.read and offline.access

    tweet.write is required for posting; offline.access gives a refresh token.

    Read · Scopes

  • The package defaults to non-replicated outcalls so posts are not duplicated

    Read · Non-replicated calls

  • Leave unused TweetCreateRequest fields null; the package strips them

    Read · Optional fields

  • poll, reply, media and geo need their own required fields if set

    Read · Sub-object rules

  • Refresh before expiry and store the new access and refresh tokens

    X rotates the refresh token on every refresh, per SKILL.md.

    Write · Token refresh

  • Free tier numbers and the rule never to silently retry a post

    Read · Rate limits

From the official docs

Permissions

Medium risk

connector-x has no scripts, but the code it has Claude write posts to X and handles OAuth tokens. Our advice: use a throwaway X account while you test.

What it can do

  • Read your data
  • Create and change things
  • Delete things
  • Read-only mode

Watch out for

  • The code you build posts to X for real

    The example calls createPosts with a user's OAuth bearer token, and SKILL.md warns that a retried post may duplicate the tweet. Test with a throwaway account before you ship. github.com

  • It handles access and refresh tokens

    SKILL.md has the canister store a rotated access_token and refresh_token and POST grant_type=refresh_token to api.x.com. Decide where those are kept and who can read them. github.com

  • It sets the scopes your users approve

    The skill asks for tweet.write, tweet.read, users.read and offline.access. Drop any scope your app does not need. github.com

Technical details
Turning on read-onlyNo read-only switch.
Talks toapi.x.com. developer.x.com
Sign-in and keysOAuth 2.0 PKCE with a public Client ID and per-user tokens held canister-side, per SKILL.md. The skill itself stores nothing.
Scopes
  • Claude writes Motoko code for your project (src/backend/main.mo in the example)

  • The code you ship posts to X on a user's behalf

Questions

What does connector-x do?

It tells Claude how to post to X (Twitter) from a Motoko canister in a Caffeine build. It uses the x-client package and per-user OAuth 2.0 with PKCE.

Can I use it outside Caffeine?

Only if you write Motoko for the Internet Computer. The skill is built around Caffeine builds, canisters and mops packages, and its code is Motoko.

How do I install it?

Use the install box at the top. The README documents npx skills add for the whole repo and fetching a single SKILL.md. The box installs this skill plus extension-posting-to-x, which SKILL.md points to for token-refresh code.

Do I need an X developer account?

Yes. The setup steps use the X Developer Portal to create a Project and an App, enable OAuth 2.0 and copy the Client ID. SKILL.md says the Free tier allows 1500 posts a month.

Does it need a client secret?

No. SKILL.md says x-client is built for the PKCE flow, so there is no client secret and the Client ID is a public string.

Why do I get "Insufficient OAuth scope"?

SKILL.md says that error on createPosts almost always means tweet.write was not ticked, because unticked scopes are silently missing from the issued token.

Is it official?

Yes. It sits in the caffeinelabs/skills repo, under the Caffeine Labs GitHub organization, whose description reads "Create brilliant apps and websites through chat!".

Is it safe?

The skill bundles no scripts, but it has Claude write code that posts to X and handles OAuth tokens. Our advice: review the token storage the code uses, and test with a throwaway X account first.

Information

updated Nov 2, 2026

Folder
skills/connector-x

caffeinelabs/skillsskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 5
  1. connector-x SKILL.md · github.com
  2. README · github.com
  3. extension-posting-to-x SKILL.md · github.com
  4. LICENSE · github.com
  5. skills.sh listing · skills.sh

Updated Nov 2, 2026.