Govern X (Twitter) account work through three lanes: evidence reads, typed act plans for posting and account hygiene, and gated execution with per-act provider evidence. Nothing reaches a live timeline or mutates an account without an explicit approval recorded in the receipt.
- License 许可
- MIT
- 所属仓库
- ZachDreamZ/runx
- 最近更新
- 2026-07-17
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- runx
- { "category": "growth" }
- description
- Govern X (Twitter) account work through three lanes: evidence reads, typed act plans for posting and account hygiene, and gated execution with per-act provider evidence. Nothing reaches a live timeline or mutates an account without an explicit approval recorded in the receipt.
02 资源文件 12
- 脚本fixtures/data/archive-tweets.js859 B
- 参考文档fixtures/execute-digest-mismatch-refuses.yaml774 B
- 参考文档fixtures/execute-replay-skips.yaml923 B
- 参考文档fixtures/plan-missing-evidence-needs-input.yaml1.0 KB
- 参考文档fixtures/plan-prune-ready.yaml2.1 KB
- 参考文档fixtures/read-archive-audit.yaml305 B
- 参考文档tools/twitter/act/manifest.json1.5 KB
- 脚本tools/twitter/act/run.mjs10.2 KB
- 脚本tools/twitter/lib/client.mjs6.8 KB
- 参考文档tools/twitter/read/manifest.json1.8 KB
- 脚本tools/twitter/read/run.mjs8.6 KB
- 参考文档X.yaml4.6 KB
03 SKILL.md 正文
One account, three lanes: read evidence, plan typed acts, execute an approved plan.
This is the public branded X (Twitter) catalog skill for the send-as action
family. Its core invariant: the agent may read, audit, draft, and plan freely,
but every act that publishes to a public timeline or mutates the account stops
at a human approval gate, and the sealed receipt proves which acts ran, against
which plan digest, with which provider evidence.
Write for the operator who owns the account, the reviewer who approves a live act, and downstream skills that consume the resulting packets. Keep each plan to the smallest evidence-backed act set that satisfies the objective. Existing post and user ids must come from supplied evidence, never memory or guesswork; name missing evidence as a blocker.
What this skill does
Three runners:
read: collect account evidence from the live API or, preferred for bulk history, an X archive export file (tweets.js,following.js). Queries:snapshot,posts,mentions,search,following,followers. Emitstwitter.evidence.v1. Read-only; no gate.plan: turn one bounded objective plus evidence intotwitter.plan.v1, an explicit list of typed acts with rationale. A plan is a draft; it delivers nothing.execute: run an approved plan through the X API behind an approval gate, act by act, sealing per-act provider evidence intotwitter.execution.v1. Rate-limit stops are clean: the packet names the remaining act ids and a re-run withalready_executed_act_idsskips completed work.
Each runner emits exactly one packet for its lane: typed evidence with provenance and a content digest, a bounded act plan with rationales and gates, or provider outcomes bound to the executed plan digest.
The act vocabulary, with its consequence class:
| kind | consequence | params |
|---|---|---|
post |
public_send | text |
reply |
public_send | text, in_reply_to |
quote |
public_send | text, quote_of |
thread |
public_send | texts (ordered, max 25) |
repost |
public_send | post_id |
delete_post |
live_mutation | post_id |
unfollow |
live_mutation | target_user_id |
mute |
live_mutation | target_user_id |
block |
live_mutation | target_user_id |
follow |
live_mutation | target_user_id |
like |
live_mutation | post_id |
Every kind is consequential, so every plan sets
gates.human_approval_required: true. follow, like, and repost are
engagement acts and share a hard cap of 10 per execution. Direct messages are
outside this skill.
When to use this skill
- Promote a release, publish a thread, or reply to a mention on behalf of a named principal, with content bound verbatim in the plan.
- Audit an account's own post history or following list and prune it: bulk delete old posts, unfollow low-value accounts, against operator-stated criteria.
- Gather timeline, mention, or search evidence for downstream research,
triage, or lead skills that consume
twitter.evidence.v1. - Route a
send-asplan onto X as its provider delivery lane.
When not to use this skill
- To send direct messages or manage DM conversations.
- To farm engagement: follow-churn, mass liking, coordinated reposting, or any volume pattern designed to game visibility. The engagement cap is not a budget to fill.
- To mention, reply to, or dogpile users who have not engaged with the principal, at volume.
- To operate an account the operator does not control, or to automate consumer account creation.
- To bypass the approval gate, the act caps, or the operator's spending limit on the pay-per-use API.
Procedure
For the plan runner, build twitter_plan this way:
- Hold one bounded objective. If the ask bundles unrelated jobs (a promo
thread plus a follow purge), return
needs_inputwith the split. - Ground every reference. Ids for
delete_post,unfollow,reply,quote,like,mute, andblockmust come fromevidence_jsonor an explicit operator-supplied id. If the evidence is missing or stale, name it as a blocker; never invent or approximate an id. - Write public content into the act params verbatim: the exact
textortextsto publish, shaped bybrand_contextwhen supplied. Do not plan a summary of what will be written; approval binds the exact words. - Give every act a stable
act_id(act-001onward), itskind,params, itsconsequencefrom the table, and a one-linerationaletied to the objective or the operator's stated criteria. - Apply
operator_policynarrowly. A prune criterion like "no engagement and older than 2023" selects only posts the evidence shows meet it; borderline items go toopen_questions, not into the act list. - Keep the plan small: at most 50 acts, at most 10 engagement acts, threads at most 25 segments. A larger job becomes staged plans.
- Set
decision:readywhen acts are grounded and complete;needs_inputfor missing objective, principal, evidence, or content;rejectfor asks outside the vocabulary or inside the abuse boundaries. - Never place credentials, bearer tokens, raw API dumps, or third-party personal data beyond public ids and handles in the plan.
Edge cases and stop conditions
- Mixed objective: return
needs_inputwith the runner or plan split. - Id not in evidence: blocker; the plan stays
needs_input. - Prune criteria ambiguous: select the unambiguous items, list the rest in
open_questions. - Rate limit during read: the evidence packet returns what it collected
with
stop_conditions: ["rate_limited"]and the reset time. - Rate limit during execute: the execution packet lists
remaining_act_ids; re-run withalready_executed_act_idsafter the reset. - Plan digest mismatch on execute: the execution refuses with a named blocker; nothing runs, and the sealed receipt proves the refusal.
- Approval missing or denied: the execute graph stops at the gate.
- Credentials missing: clean
needs_inputstop naming the environment variables; never a half-configured call. - Fully autonomous live posting requested:
reject; the gate is the contract.
Output schema
twitter.evidence.v1:decision,source(liveorarchive),query,account,items[](typed post or user records with metrics),item_count,truncated,provenance(retrieved_via,request_count,content_digest),rate,blockers[],stop_conditions[].twitter.plan.v1:decision(ready,needs_input,reject),objective,principal,acts[](act_id,kind,params,consequence,rationale),gates(human_approval_required,approval_ref),evidence_refs[],open_questions[],blockers[],success_checkpoint.twitter.execution.v1:decision(executed,partial,stopped,refused),plan_digest,principal,results[](act_id,kind,consequence,status,provider_ref,detail),remaining_act_ids[],rate,blockers[],success_checkpoint.
Worked example
Input: objective "delete my zero-engagement posts from before 2024",
principal account:@example, evidence from
read(query: posts, archive_file: data/tweets.js) showing three matching
posts, operator_policy "keep anything with replies".
Output: decision: ready; three delete_post acts, each carrying the post id
from the evidence and a rationale quoting its age and zero metrics;
gates.human_approval_required: true; one borderline post with two replies
listed in open_questions. Execution then stops at the approval gate, and the
sealed receipt binds the approved digest to the three deletions the provider
confirmed.
Inputs
read:query(required),params,archive_file,max_items,auth.plan:objective(required),principal(required),evidence_json,operator_policy,brand_context,operator_context.execute:plan_json(required),plan_digest,already_executed_act_ids,max_acts.
Credentials and cost
Credentials are delivered per run through the runx credential envelope, never as inputs and never as receipt material. Two materials exist:
TWITTER_USER_AUTH: one JSON object holdingconsumer_key,consumer_secret,access_token,access_secret(OAuth 1.0a user context). Required for every mutation and for own-account reads. Store it withrunx credential set twitter --profile twitter-user --auth-mode oauth1_user --from-stdin.TWITTER_BEARER_TOKEN: the app-context bearer token, enough forsearchand public reads. Store it withrunx credential set twitter --profile twitter-app --auth-mode bearer --from-stdin. Read-only app runs should use only this profile.
Use --profile twitter-user with read --auth user and every execute run;
use --profile twitter-app with read --auth app. The runner contract maps the
selected profile's auth mode to exactly one delivery variable. Tool sandbox
allowlists do not carry credentials. For local development, the same declared
variable can come from the process or workspace .env; if both Twitter
variables are set, Runx refuses the ambiguous selection.
The X API bills per request on current plans and a post containing a link
costs a large multiple of a plain one, so prefer archive exports for bulk
history, set a spending cap in the developer portal, and let max_items and
the act caps bound each run.
04 同仓库更多 Skills
zapier-handoff
Validate a runx execution context and hand off a governed payload to a Zapier Catch Hook with scoped auth, idempotency, and receipt expectations.
x402-pay
Execute a governed x402 payment by delegating to the canonical spend flow with the x402 runtime path selected.
work-plan
Decompose a build objective into governed runx execution steps.
web-fetch
Fetch and extract one web source within an explicit allowlist, returning the content by digest with full provenance.
weather-forecast
Normalize provider weather evidence into an action-safe forecast packet with provenance, uncertainty, and stop conditions for downstream agents.
vuln-triage
Triage dependency or ecosystem vulnerability risk into remediation and advisory packets, grounding on verified CVE evidence when it is supplied.