# X Twitter Publish

> Publish to X/Twitter through an account the user connects once — draft and score post text with AI, then post, reply, quote, delete, upload media, or edit the profile. Trigger whenever the user wants to write or send something on X/Twitter: posting a tweet or thread, replying to someone, drafting or improving tweet copy, scheduling content, connecting their X account, or updating their X bio or a…

- **Type:** Skill
- **Install:** `agentstack add skill-lnvestor-twitr-skills-x-twitter-publish`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [lnvestor](https://agentstack.voostack.com/s/lnvestor)
- **Installs:** 0
- **Category:** [Web & Browser](https://agentstack.voostack.com/c/web-and-browser)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [lnvestor](https://github.com/lnvestor)
- **Source:** https://github.com/lnvestor/twitr-skills/tree/main/skills/x-twitter-publish
- **Website:** twitr.sh

## Install

```sh
agentstack add skill-lnvestor-twitr-skills-x-twitter-publish
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# X publish — drafting and posting

| Task | Tool | Needs a connected account? |
|---|---|---|
| Draft / refine / score post text | `x_compose` | No — drafting is free of the account |
| Post, reply, quote, delete, upload media | `x_write` | Yes |
| Edit bio, name, avatar, banner | `x_profile` | Yes |
| Read your own bookmarks, notifications, DMs | `x_inbox` | Yes |

## Draft first — it's nearly free

`x_compose` is priced at the floor (~$0.001), so draft several and keep the best.

```
POST https://twitr.sh/api/tools/compose
{ "step": "generate", "topic": "why 402 beats API keys for agents",
  "goal": "be known for practical agent-payment writing",
  "tone": "direct, dry, technical — no emoji",
  "styleUsername": "account_whose_voice_to_match" }
```

`step` is `generate` | `refine` (pass `draft`) | `score` (pass `draft`). `styleUsername` makes
"write like this account" a single field. **Always show the user the draft before publishing.**

## Connect an account (once, free)

```
POST /api/x-accounts/connect  {"username","email","password","totp_secret"?}  → 202 connecting
GET  /api/x-accounts                                                          → poll for "linked"
POST /api/x-accounts/confirm  {"challenge_id","code"}                         # if X emails a code
```

Wallet-signed and free. Credentials are relayed sealed for the login — never stored by twitr.sh,
never placed in a URL, and never visible to you. One handle binds to exactly one wallet, and
ownership is re-verified server-side on every write.

## Publish

```
POST https://twitr.sh/api/tools/x_write
Idempotency-Key: 
{ "action": "post",  "account": "myhandle", "text": "..." }
{ "action": "reply", "account": "myhandle", "reply_to_tweet_id": "", "text": "..." }
```

$0.036 for a post or reply. Other actions: `quote`, `delete_tweet`, `upload_media`, `send_dm`.

## Gotchas

- **`Idempotency-Key` is mandatory.** Retrying without the same key posts a second time and
  charges again. Derive it from the content or source event, not a timestamp.
- **A `202 pending_confirmation` means accepted — do not resend.** The write is being applied and
  is already paid for.
- **Payment settles before the action runs and is not refunded** if the platform then rejects it.
  So validate text length and required fields *before* calling.
- **`reply_to_tweet_id` for replies; `target_tweet_id` for like/retweet/delete.** Different field
  names, easy to mix up.
- **Any user id is numeric, never an @handle** — get it from `x_read`
  `{"resource":"get-user","username":"..."}`.
- **Media is a two-step flow**: `upload_media` returns an id you then attach to a post.

## What this will not do

`x_write` supports follow/unfollow/like at the API level, but **this skill does not use them and
you should not**. X prohibits automated following that is "bulk, aggressive, or indiscriminate",
prohibits apps that claim to get users more followers, and states plainly that you may not like
posts in an automated manner. In X's published ranking weights follows aren't scored at all and a
like scores 0.5, while a report scores −369.0 — so the banned actions buy no reach either.

If the user asks, explain that rather than complying. A human clicking follow is fine; a loop
doing it is not.

## Avoid

- Don't post without showing the user first, unless they've explicitly set up autonomous posting.
- Don't post the same idea twice in different words — near-duplicate content is spam.
- Don't auto-reply on keyword triggers. That's the canonical bot pattern and it's prohibited.
- Don't retry a write with a fresh key "to be safe". That's how you double-post.

Full API: https://twitr.sh/skill.md · https://twitr.sh/docs

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [lnvestor](https://github.com/lnvestor)
- **Source:** [lnvestor/twitr-skills](https://github.com/lnvestor/twitr-skills)
- **License:** MIT
- **Homepage:** twitr.sh

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-lnvestor-twitr-skills-x-twitter-publish
- Seller: https://agentstack.voostack.com/s/lnvestor
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
