[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ECM0XA96BSCBTAJ7JM63E8":3,"skill-same:01M7ECM0XA96BSCBTAJ7JM63E8":49},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":13,"repositoryHtmlUrl":25,"repositoryHomepageUrl":6,"ownerHtmlUrl":26,"ownerBlogUrl":6,"ownerDescription":27,"updatedAt":28,"install":29,"resources":42},"01M7ECM0XA96BSCBTAJ7JM63E8","x-api-account-ops",null,"jonahthan433\u002FCortexOS","jonahthan433","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F211465495?v=4","01M7ECH9HPHGA89DCXHHJBTS3C","jonah.ai","01M7ECH9JCEM45DZMWPT7148S1",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjonahthan433\u002FCortexOS\u002Fblob\u002Fmain\u002Fskills\u002Fimported\u002F.archive\u002Fx-api-account-ops\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"# x-api-account-ops\n\n# X API Account Operations\n\nOperating an X account programmatically with `xurl` (the official CLI, see the\nbundled `xurl` skill for command reference). This skill carries the hard-won\npitfalls that the bundled skill does not: fresh-account filters, auth\nbootstrap when the browser flow is blocked, and the home-feed trap.\n\n## Auth bootstrap (when the browser OAuth flow is blocked)\n\n1. User creates an X developer app (developer.x.com → console.x.com) for the\n   account; app type **\"Web App, Automated App or Bot\"** (confidential client)\n   — Native App breaks PKCE.\n2. **Callback URI must EXACTLY match the authorize URL's redirect_uri**:\n   `http:\u002F\u002Flocalhost:8080\u002Fcallback` (http, WITH `\u002Fcallback`). The console\n   rejects `http:\u002F\u002F` sometimes — keep retrying the exact form; an https\n   variant saves but then every authorize attempt fails with \"Something went\n   wrong\" on the x.com page.\n3. **App must be in Production, not Sandbox** — sandbox apps refuse OAuth\n   authorize with the same generic \"Something went wrong\" page. Check the app\n   page banner; click \"Move to Production\".\n4. User buys API credits (pay-per-use; min $5) — posting costs money.\n5. Register + auth:\n   ```bash\n   xurl auth apps add \u003Cname> --client-id \u003CID> --client-secret \u003CSECRET>\n   xurl auth oauth2 --app \u003Cname> --headless \u003Chandle>\n   xurl auth default \u003Cname>\n   ```\n   Headless mode prints an authorize URL and waits on stdin for the pasted\n   redirect code → run it as a **background PTY process**, poll for the URL,\n   send it to the user, then `process(action=submit)` the pasted\n   `localhost:8080\u002Fcallback?...code=...` URL. Non-interactive runs exit with\n   EOF immediately.\n6. **Manual token import** (user already has access+refresh tokens, e.g. from\n   another tool, and the browser flow is broken): write `~\u002F.xurl\u002Fauth.yml`\n   (chmod 600) — schema from xurl source `store\u002Ftokens.go`:\n   ```yaml\n   apps:\n     \u003Cname>:\n       client_id: \u003Cid>\n       client_secret: \u003Csecret>\n       redirect_uri: http:\u002F\u002Flocalhost:8080\u002Fcallback\n       default_user: \u003Chandle>\n       oauth2_tokens:\n         \u003Chandle>:\n           type: oauth2\n           oauth2:\n             access_token: \u003Cat>\n             refresh_token: \u003Crt>\n             expiration_time: 0   # 0 -> refresh via client creds on first use\n   default_app: \u003Cname>\n   ```\n   Verify: `xurl auth status` shows `▸ oauth2: \u003Chandle>`, then `xurl whoami`.\n   The first write may 403 once and succeed after the auto-refresh re-mints a\n   full-scope token.\n7. X console quirks: Client ID ends in `MTpjaQ`; regenerating the secret\n   invalidates the old one (re-register the app: `xurl auth apps remove\n   \u003Cname>` + add again).\n\n## New-account posting constraints (anti-spam)\n\nFresh profiles (days old) fail writes with a generic\n`403 \"You are not permitted to perform this action\"` — same error as a scope\nproblem, so diagnose before assuming scope:\n- **Non-ASCII (emoji 🚀, arrows →, en-dashes –) → 403.** Pure-ASCII versions\n  of the same text post fine.\n- **Text near 280 chars → 403** while a ~180-char version succeeds.\n- `$` signs and bare domains (`api.example.com`, no scheme) are fine.\n- **Rapid post+delete cycles trigger temporary write blocks** (same 403) —\n  space out cleanup deletes.\n- Repeated attempts of identical blocked text stay blocked — change the text.\n\nMethodical diagnosis: `xurl post \"test\"` (tiny ASCII) proves writes work; then\nbisect the failing text (length → symbols → links).\n\n## Listing an account's own posts\n\n`xurl timeline` = HOME feed (accounts the profile follows) — NOT the profile.\nDeleting from it can target other accounts' posts (deletes fail harmlessly\nwith 403, but don't rely on that). Use the raw endpoint instead:\n```\nxurl \"\u002F2\u002Fusers\u002F\u003Cuser_id>\u002Ftweets?max_results=20&tweet.fields=created_at\"\n```\n`\u003Cuser_id>` comes from `xurl whoami` → `data.id`.\n\n## Profile editing (OAuth1.0a ONLY)\n\nv2 `PATCH \u002F2\u002Fusers\u002F:id` returns 403 **\"You are not permitted to use OAuth2 on\nthis endpoint\"** — profile writes (name, bio, location, url, avatar, banner)\nreject OAuth2 tokens entirely, even with `users.write`. The v1.1 endpoints\n(`\u002F1.1\u002Faccount\u002Fupdate_profile.json`, `update_profile_image.json`,\n`update_profile_banner.json`) require **OAuth 1.0a**:\n\n- Console → Keys and tokens → **OAuth 1.0 Keys**: API Key (consumer key), API\n  Key Secret (consumer secret), Access Token, Access Token Secret.\n- Store alongside OAuth2 in `~\u002F.xurl\u002Fauth.yml`:\n  ```yaml\n  apps:\n    \u003Cname>:\n      ...\n      oauth1_token:\n        type: oauth1\n        oauth1:\n          access_token: \u003Cat>\n          token_secret: \u003Cats>\n          consumer_key: \u003Cck>\n          consumer_secret: \u003Ccs>\n  ```\n- **xurl raw mode cannot sign v1.1 form-encoded bodies** (401 `code 32`\n  \"Could not authenticate you\"); JSON bodies pass auth but v1.1 ignores them.\n  Use `scripts\u002Fxprofile.py` (requests-oauthlib, creds read from auth.yml —\n  never print them):\n  ```\n  scripts\u002Fxprofile.py show\n  scripts\u002Fxprofile.py profile '{\"name\":\"...\",\"description\":\"...\",\"location\":\"...\",\"url\":\"...\"}'\n  scripts\u002Fxprofile.py avatar \u002Fpath\u002Fimg.png     # \u003C= 2MB\n  scripts\u002Fxprofile.py banner \u002Fpath\u002Fimg.png\n  ```\n- Verify writes via v2 read (`\u002F2\u002Fusers\u002Fme?user.fields=location,url,...`) —\n  v1.1 read endpoints (`users\u002Fshow.json`) 403 for standard tokens.\n\n## Costs (2026 pay-per-use)\n\n$0.015\u002Fplain post, $0.20\u002Fpost with URL, $0.005\u002Fread, $0.001\u002Fowned read.\n$5 ≈ 25 link-posts ≈ 3–4 months of a light channel (2 link posts\u002Fweek).\n\n## Verification\n\nEvery write must be confirmed by the xurl JSON response (`data.id` \u002F\n`data.deleted`), then by listing the account's own posts — never by the tool\nexit code alone.\n",{},"main","38b32c99e7ed0b8e215d638e92cfa452c1ec3079","skills\u002Fimported\u002F.archive\u002Fx-api-account-ops","https:\u002F\u002Fgithub.com\u002Fjonahthan433\u002FCortexOS","https:\u002F\u002Fgithub.com\u002Fjonahthan433","AI Consultant","2026-10-24 05:13:39",{"source":7,"skillName":5,"commands":30,"prompt":40,"zipAvailable":41},[31,34,37],{"tool":32,"command":33},"npx","npx skills add jonahthan433\u002FCortexOS --skill x-api-account-ops",{"tool":35,"command":36},"bunx","bunx skills add jonahthan433\u002FCortexOS --skill x-api-account-ops",{"tool":38,"command":39},"pnpm","pnpm dlx skills add jonahthan433\u002FCortexOS --skill x-api-account-ops","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjonahthan433\u002FCortexOS\u002Fblob\u002Fmain\u002Fskills\u002Fimported\u002F.archive\u002Fx-api-account-ops\u002FSKILL.md",true,[43],{"path":44,"resourceType":45,"resourceTypeDesc":46,"sizeBytes":47,"sourceHtmlUrl":48},"skill.json","REFERENCE","参考文档",354,"https:\u002F\u002Fgithub.com\u002Fjonahthan433\u002FCortexOS\u002Fblob\u002Fmain\u002Fskills\u002Fimported\u002F.archive\u002Fx-api-account-ops\u002Fskill.json",[50,56,62,68,74,80],{"skillNo":51,"name":52,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":18},"01M7EDQZDQX3Q8Y7GCQX6KN9V7","opportunity-brief","https:\u002F\u002Fgithub.com\u002Fjonahthan433\u002FCortexOS\u002Fblob\u002Fmain\u002Fskills\u002Fsales\u002Fopportunity-brief\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":18},"01M7EDQYA0V9Y99VKBREJJ3MRT","morning-intel","https:\u002F\u002Fgithub.com\u002Fjonahthan433\u002FCortexOS\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fmorning-intel\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":18},"01M7EDQVX1JVY0B6PDHKKGM19G","decision-brief","https:\u002F\u002Fgithub.com\u002Fjonahthan433\u002FCortexOS\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fdecision-brief\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":18},"01M7EDQV1GENZAC2SZSD8KZ3GM","weekly-review","https:\u002F\u002Fgithub.com\u002Fjonahthan433\u002FCortexOS\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fweekly-review\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M7EDQT2KETJ1Y3CGVN9EKW2J","system-health","https:\u002F\u002Fgithub.com\u002Fjonahthan433\u002FCortexOS\u002Fblob\u002Fmain\u002Fskills\u002Fops\u002Fsystem-health\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M7EDQQN2JK3XPWMS1M4T0F3K","backup-restore","https:\u002F\u002Fgithub.com\u002Fjonahthan433\u002FCortexOS\u002Fblob\u002Fmain\u002Fskills\u002Fops\u002Fbackup-restore\u002FSKILL.md",[],[]]