[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M69A5XTS0ZHYVE42H6GMT32B":3,"skill-same:01M69A5XTS0ZHYVE42H6GMT32B":104},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":42,"repositoryHtmlUrl":43,"repositoryHomepageUrl":17,"ownerHtmlUrl":44,"ownerBlogUrl":45,"ownerDescription":46,"updatedAt":47,"install":48,"resources":61},"01M69A5XTS0ZHYVE42H6GMT32B","x-integration","X（Twitter）平台集成","X (Twitter) integration for NanoClaw. Post tweets, like, reply, retweet, and quote. Use for setup, testing, or troubleshooting X functionality. Triggers on \"setup x\", \"x integration\", \"twitter\", \"post tweet\", \"tweet\".","为 NanoClaw 提供 X（Twitter）集成。可发布推文、点赞、回复、转发和引用。用于 X 功能的设置、测试或故障排查。在用户提到\"设置 X\"、\"X 集成\"、\"twitter\"、\"发布推文\"、\"tweet\"时触发。","microsoft\u002Famplifier-app-nanoclaw","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M69A31J3GTKVZDZZVPRQWWR5",5,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-app-nanoclaw\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD6C0J544QTJ9R38Z7ZG","营销专员","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQV98WRP4APE9VKKKKJ6FV","社交媒体与内容平台管理","SCENARIO","使用场景",[31,32,33],"x integration","testing","setup","2026-11-10 10:12:30",false,"---\nname: x-integration\ndescription: X (Twitter) integration for NanoClaw. Post tweets, like, reply, retweet, and quote. Use for setup, testing, or troubleshooting X functionality. Triggers on \"setup x\", \"x integration\", \"twitter\", \"post tweet\", \"tweet\".\n---\n\n# X (Twitter) Integration\n\nBrowser automation for X interactions via WhatsApp.\n\n> **Compatibility:** NanoClaw v1.0.0. Directory structure may change in future versions.\n\n## Features\n\n| Action | Tool | Description |\n|--------|------|-------------|\n| Post | `x_post` | Publish new tweets |\n| Like | `x_like` | Like any tweet |\n| Reply | `x_reply` | Reply to tweets |\n| Retweet | `x_retweet` | Retweet without comment |\n| Quote | `x_quote` | Quote tweet with comment |\n\n## Prerequisites\n\nBefore using this skill, ensure:\n\n1. **NanoClaw is installed and running** - WhatsApp connected, service active\n2. **Dependencies installed**:\n   ```bash\n   pnpm ls playwright dotenv-cli || pnpm install playwright dotenv-cli\n   ```\n3. **CHROME_PATH configured** in `.env` (if Chrome is not at default location):\n   ```bash\n   # Find your Chrome path\n   mdfind \"kMDItemCFBundleIdentifier == 'com.google.Chrome'\" 2>\u002Fdev\u002Fnull | head -1\n   # Add to .env\n   CHROME_PATH=\u002Fpath\u002Fto\u002FGoogle Chrome.app\u002FContents\u002FMacOS\u002FGoogle Chrome\n   ```\n\n## Quick Start\n\nRun from your NanoClaw project root:\n\n```bash\n# 1. Setup authentication (interactive)\npnpm exec dotenv -e .env -- pnpm exec tsx .claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fsetup.ts\n# Verify: data\u002Fx-auth.json should exist after successful login\n\n# 2. Rebuild container to include skill\n.\u002Fcontainer\u002Fbuild.sh\n# Verify: Output shows \"COPY .claude\u002Fskills\u002Fx-integration\u002Fagent.ts\"\n\n# 3. Rebuild host and restart service\npnpm run build\nsource setup\u002Flib\u002Finstall-slug.sh\nlaunchctl kickstart -k gui\u002F$(id -u)\u002F$(launchd_label)  # macOS\n# Linux: systemctl --user restart $(systemd_unit)\n# Verify: launchctl list | grep \"$(launchd_label)\" (macOS) or systemctl --user status $(systemd_unit) (Linux)\n```\n\n## Configuration\n\n### Environment Variables\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `CHROME_PATH` | `\u002FApplications\u002FGoogle Chrome.app\u002FContents\u002FMacOS\u002FGoogle Chrome` | Chrome executable path |\n| `NANOCLAW_ROOT` | `process.cwd()` | Project root directory |\n| `LOG_LEVEL` | `info` | Logging level (debug, info, warn, error) |\n\nSet in `.env` file (loaded via `dotenv-cli` at runtime):\n\n```bash\n# .env\nCHROME_PATH=\u002FApplications\u002FGoogle Chrome.app\u002FContents\u002FMacOS\u002FGoogle Chrome\n```\n\n### Configuration File\n\nEdit `lib\u002Fconfig.ts` to modify defaults:\n\n```typescript\nexport const config = {\n    \u002F\u002F Browser viewport\n    viewport: { width: 1280, height: 800 },\n\n    \u002F\u002F Timeouts (milliseconds)\n    timeouts: {\n        navigation: 30000,    \u002F\u002F Page navigation\n        elementWait: 5000,    \u002F\u002F Wait for element\n        afterClick: 1000,     \u002F\u002F Delay after click\n        afterFill: 1000,      \u002F\u002F Delay after form fill\n        afterSubmit: 3000,    \u002F\u002F Delay after submit\n        pageLoad: 3000,       \u002F\u002F Initial page load\n    },\n\n    \u002F\u002F Tweet limits\n    limits: {\n        tweetMaxLength: 280,\n    },\n};\n```\n\n### Data Directories\n\nPaths relative to project root:\n\n| Path | Purpose | Git |\n|------|---------|-----|\n| `data\u002Fx-browser-profile\u002F` | Chrome profile with X session | Ignored |\n| `data\u002Fx-auth.json` | Auth state marker | Ignored |\n| `logs\u002Fnanoclaw.log` | Service logs (contains X operation logs) | Ignored |\n\n## Architecture\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│  Container (Linux VM)                                       │\n│  └── agent.ts → MCP tool definitions (x_post, etc.)    │\n│      └── Writes IPC request to \u002Fworkspace\u002Fipc\u002Ftasks\u002F       │\n└──────────────────────┬──────────────────────────────────────┘\n                       │ IPC (file system)\n                       ▼\n┌─────────────────────────────────────────────────────────────┐\n│  Host (macOS)                                               │\n│  └── src\u002Fipc.ts → processTaskIpc()                         │\n│      └── host.ts → handleXIpc()                         │\n│          └── spawn subprocess → scripts\u002F*.ts               │\n│              └── Playwright → Chrome → X Website           │\n└─────────────────────────────────────────────────────────────┘\n```\n\n### Why This Design?\n\n- **API is expensive** - X official API requires paid subscription ($100+\u002Fmonth) for posting\n- **Bot browsers get blocked** - X detects and bans headless browsers and common automation fingerprints\n- **Must use user's real browser** - Reuses the user's actual Chrome on Host with real browser fingerprint to avoid detection\n- **One-time authorization** - User logs in manually once, session persists in Chrome profile for future use\n\n### File Structure\n\n```\n.claude\u002Fskills\u002Fx-integration\u002F\n├── SKILL.md          # This documentation\n├── host.ts           # Host-side IPC handler\n├── agent.ts          # Container-side MCP tool definitions\n├── lib\u002F\n│   ├── config.ts     # Centralized configuration\n│   └── browser.ts    # Playwright utilities\n└── scripts\u002F\n    ├── setup.ts      # Interactive login\n    ├── post.ts       # Post tweet\n    ├── like.ts       # Like tweet\n    ├── reply.ts      # Reply to tweet\n    ├── retweet.ts    # Retweet\n    └── quote.ts      # Quote tweet\n```\n\n### Integration Points\n\nTo integrate this skill into NanoClaw, make the following modifications:\n\n---\n\n**1. Host side: `src\u002Fipc.ts`**\n\nAdd import after other local imports:\n```typescript\nimport { handleXIpc } from '..\u002F.claude\u002Fskills\u002Fx-integration\u002Fhost.js';\n```\n\nModify `processTaskIpc` function's switch statement default case:\n```typescript\n\u002F\u002F Find:\ndefault:\nlogger.warn({ type: data.type }, 'Unknown IPC task type');\n\n\u002F\u002F Replace with:\ndefault:\nconst handled = await handleXIpc(data, sourceGroup, isMain, DATA_DIR);\nif (!handled) {\n    logger.warn({ type: data.type }, 'Unknown IPC task type');\n}\n```\n\n---\n\n**2. Container side: `container\u002Fagent-runner\u002Fsrc\u002Fipc-mcp.ts`**\n\nAdd import after `cron-parser` import:\n```typescript\n\u002F\u002F @ts-ignore - Copied during Docker build from .claude\u002Fskills\u002Fx-integration\u002F\nimport { createXTools } from '.\u002Fskills\u002Fx-integration\u002Fagent.js';\n```\n\nAdd to the end of tools array (before the closing `]`):\n```typescript\n    ...createXTools({ groupFolder, isMain })\n```\n\n---\n\n**3. Build script: `container\u002Fbuild.sh`**\n\nChange build context from `container\u002F` to project root (required to access `.claude\u002Fskills\u002F`):\n```bash\n# Find:\ndocker build -t \"${IMAGE_NAME}:${TAG}\" .\n\n# Replace with:\ncd \"$SCRIPT_DIR\u002F..\"\ndocker build -t \"${IMAGE_NAME}:${TAG}\" -f container\u002FDockerfile .\n```\n\n---\n\n**4. Dockerfile: `container\u002FDockerfile`**\n\nFirst, update the build context paths (required to access `.claude\u002Fskills\u002F` from project root):\n```dockerfile\n# Find:\nCOPY agent-runner\u002Fpackage*.json .\u002F\n...\nCOPY agent-runner\u002F .\u002F\n\n# Replace with:\nCOPY container\u002Fagent-runner\u002Fpackage*.json .\u002F\n...\nCOPY container\u002Fagent-runner\u002F .\u002F\n```\n\nThen add COPY line after `COPY container\u002Fagent-runner\u002F .\u002F` and before `RUN pnpm run build`:\n```dockerfile\n# Copy skill MCP tools\nCOPY .claude\u002Fskills\u002Fx-integration\u002Fagent.ts .\u002Fsrc\u002Fskills\u002Fx-integration\u002F\n```\n\n## Setup\n\nAll paths below are relative to project root (`NANOCLAW_ROOT`).\n\n### 1. Check Chrome Path\n\n```bash\n# Check if Chrome exists at configured path\ncat .env | grep CHROME_PATH\nls -la \"$(grep CHROME_PATH .env | cut -d= -f2)\" 2>\u002Fdev\u002Fnull || \\\necho \"Chrome not found - update CHROME_PATH in .env\"\n```\n\n### 2. Run Authentication\n\n```bash\npnpm exec dotenv -e .env -- pnpm exec tsx .claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fsetup.ts\n```\n\nThis opens Chrome for manual X login. Session saved to `data\u002Fx-browser-profile\u002F`.\n\n**Verify success:**\n```bash\ncat data\u002Fx-auth.json  # Should show {\"authenticated\": true, ...}\n```\n\n### 3. Rebuild Container\n\n```bash\n.\u002Fcontainer\u002Fbuild.sh\n```\n\n**Verify success:**\n```bash\n.\u002Fcontainer\u002Fbuild.sh 2>&1 | grep -i \"agent.ts\"  # Should show COPY line\n```\n\n### 4. Restart Service\n\nRun from your NanoClaw project root:\n\n```bash\npnpm run build\nsource setup\u002Flib\u002Finstall-slug.sh\nlaunchctl kickstart -k gui\u002F$(id -u)\u002F$(launchd_label)  # macOS\n# Linux: systemctl --user restart $(systemd_unit)\n```\n\n**Verify success.**\n\nRun from your NanoClaw project root:\n\n```bash\nsource setup\u002Flib\u002Finstall-slug.sh\nlaunchctl list | grep \"$(launchd_label)\"  # macOS — should show PID and exit code 0 or -\n# Linux: systemctl --user status $(systemd_unit)\n```\n\n## Usage via WhatsApp\n\nReplace `@Assistant` with your configured trigger name (`ASSISTANT_NAME` in `.env`):\n\n```\n@Assistant post a tweet: Hello world!\n\n@Assistant like this tweet https:\u002F\u002Fx.com\u002Fuser\u002Fstatus\u002F123\n\n@Assistant reply to https:\u002F\u002Fx.com\u002Fuser\u002Fstatus\u002F123 with: Great post!\n\n@Assistant retweet https:\u002F\u002Fx.com\u002Fuser\u002Fstatus\u002F123\n\n@Assistant quote https:\u002F\u002Fx.com\u002Fuser\u002Fstatus\u002F123 with comment: Interesting\n```\n\n**Note:** Only the main group can use X tools. Other groups will receive an error.\n\n## Testing\n\nScripts require environment variables from `.env`. Use `dotenv-cli` to load them:\n\n### Check Authentication Status\n\n```bash\n# Check if auth file exists and is valid\ncat data\u002Fx-auth.json 2>\u002Fdev\u002Fnull && echo \"Auth configured\" || echo \"Auth not configured\"\n\n# Check if browser profile exists\nls -la data\u002Fx-browser-profile\u002F 2>\u002Fdev\u002Fnull | head -5\n```\n\n### Re-authenticate (if expired)\n\n```bash\npnpm exec dotenv -e .env -- pnpm exec tsx .claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fsetup.ts\n```\n\n### Test Post (will actually post)\n\n```bash\necho '{\"content\":\"Test tweet - please ignore\"}' | pnpm exec dotenv -e .env -- pnpm exec tsx .claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fpost.ts\n```\n\n### Test Like\n\n```bash\necho '{\"tweetUrl\":\"https:\u002F\u002Fx.com\u002Fuser\u002Fstatus\u002F123\"}' | pnpm exec dotenv -e .env -- pnpm exec tsx .claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Flike.ts\n```\n\nOr export `CHROME_PATH` manually before running:\n\n```bash\nexport CHROME_PATH=\"\u002Fpath\u002Fto\u002Fchrome\"\necho '{\"content\":\"Test\"}' | pnpm exec tsx .claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fpost.ts\n```\n\n## Troubleshooting\n\n### Authentication Expired\n\nRun from your NanoClaw project root:\n\n```bash\npnpm exec dotenv -e .env -- pnpm exec tsx .claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fsetup.ts\nsource setup\u002Flib\u002Finstall-slug.sh\nlaunchctl kickstart -k gui\u002F$(id -u)\u002F$(launchd_label)  # macOS\n# Linux: systemctl --user restart $(systemd_unit)\n```\n\n### Browser Lock Files\n\nIf Chrome fails to launch:\n\n```bash\nrm -f data\u002Fx-browser-profile\u002FSingletonLock\nrm -f data\u002Fx-browser-profile\u002FSingletonSocket\nrm -f data\u002Fx-browser-profile\u002FSingletonCookie\n```\n\n### Check Logs\n\n```bash\n# Host logs (relative to project root)\ngrep -i \"x_post\\|x_like\\|x_reply\\|handleXIpc\" logs\u002Fnanoclaw.log | tail -20\n\n# Script errors\ngrep -i \"error\\|failed\" logs\u002Fnanoclaw.log | tail -20\n```\n\n### Script Timeout\n\nDefault timeout is 2 minutes (120s). Increase in `host.ts`:\n\n```typescript\nconst timer = setTimeout(() => {\n  proc.kill('SIGTERM');\n  resolve({ success: false, message: 'Script timed out (120s)' });\n}, 120000);  \u002F\u002F ← Increase this value\n```\n\n### X UI Selector Changes\n\nIf X updates their UI, selectors in scripts may break. Current selectors:\n\n| Element | Selector |\n|---------|----------|\n| Tweet input | `[data-testid=\"tweetTextarea_0\"]` |\n| Post button | `[data-testid=\"tweetButtonInline\"]` |\n| Reply button | `[data-testid=\"reply\"]` |\n| Like | `[data-testid=\"like\"]` |\n| Unlike | `[data-testid=\"unlike\"]` |\n| Retweet | `[data-testid=\"retweet\"]` |\n| Unretweet | `[data-testid=\"unretweet\"]` |\n| Confirm retweet | `[data-testid=\"retweetConfirm\"]` |\n| Modal dialog | `[role=\"dialog\"][aria-modal=\"true\"]` |\n| Modal submit | `[data-testid=\"tweetButton\"]` |\n\n### Container Build Issues\n\nIf MCP tools not found in container:\n\n```bash\n# Verify build copies skill\n.\u002Fcontainer\u002Fbuild.sh 2>&1 | grep -i skill\n\n# Check container has the file\ndocker run nanoclaw-agent ls -la \u002Fapp\u002Fsrc\u002Fskills\u002F\n```\n\n## Security\n\n- `data\u002Fx-browser-profile\u002F` - Contains X session cookies (in `.gitignore`)\n- `data\u002Fx-auth.json` - Auth state marker (in `.gitignore`)\n- Only main group can use X tools (enforced in `agent.ts` and `host.ts`)\n- Scripts run as subprocesses with limited environment","# X (Twitter) Integration\n\nBrowser automation for X interactions via WhatsApp.\n\n> **Compatibility:** NanoClaw v1.0.0. Directory structure may change in future versions.\n\n## Features\n\n| Action | Tool | Description |\n|--------|------|-------------|\n| Post | `x_post` | Publish new tweets |\n| Like | `x_like` | Like any tweet |\n| Reply | `x_reply` | Reply to tweets |\n| Retweet | `x_retweet` | Retweet without comment |\n| Quote | `x_quote` | Quote tweet with comment |\n\n## Prerequisites\n\nBefore using this skill, ensure:\n\n1. **NanoClaw is installed and running** - WhatsApp connected, service active\n2. **Dependencies installed**:\n   ```bash\n   pnpm ls playwright dotenv-cli || pnpm install playwright dotenv-cli\n   ```\n3. **CHROME_PATH configured** in `.env` (if Chrome is not at default location):\n   ```bash\n   # Find your Chrome path\n   mdfind \"kMDItemCFBundleIdentifier == 'com.google.Chrome'\" 2>\u002Fdev\u002Fnull | head -1\n   # Add to .env\n   CHROME_PATH=\u002Fpath\u002Fto\u002FGoogle Chrome.app\u002FContents\u002FMacOS\u002FGoogle Chrome\n   ```\n\n## Quick Start\n\nRun from your NanoClaw project root:\n\n```bash\n# 1. Setup authentication (interactive)\npnpm exec dotenv -e .env -- pnpm exec tsx .claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fsetup.ts\n# Verify: data\u002Fx-auth.json should exist after successful login\n\n# 2. Rebuild container to include skill\n.\u002Fcontainer\u002Fbuild.sh\n# Verify: Output shows \"COPY .claude\u002Fskills\u002Fx-integration\u002Fagent.ts\"\n\n# 3. Rebuild host and restart service\npnpm run build\nsource setup\u002Flib\u002Finstall-slug.sh\nlaunchctl kickstart -k gui\u002F$(id -u)\u002F$(launchd_label)  # macOS\n# Linux: systemctl --user restart $(systemd_unit)\n# Verify: launchctl list | grep \"$(launchd_label)\" (macOS) or systemctl --user status $(systemd_unit) (Linux)\n```\n\n## Configuration\n\n### Environment Variables\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `CHROME_PATH` | `\u002FApplications\u002FGoogle Chrome.app\u002FContents\u002FMacOS\u002FGoogle Chrome` | Chrome executable path |\n| `NANOCLAW_ROOT` | `process.cwd()` | Project root directory |\n| `LOG_LEVEL` | `info` | Logging level (debug, info, warn, error) |\n\nSet in `.env` file (loaded via `dotenv-cli` at runtime):\n\n```bash\n# .env\nCHROME_PATH=\u002FApplications\u002FGoogle Chrome.app\u002FContents\u002FMacOS\u002FGoogle Chrome\n```\n\n### Configuration File\n\nEdit `lib\u002Fconfig.ts` to modify defaults:\n\n```typescript\nexport const config = {\n    \u002F\u002F Browser viewport\n    viewport: { width: 1280, height: 800 },\n\n    \u002F\u002F Timeouts (milliseconds)\n    timeouts: {\n        navigation: 30000,    \u002F\u002F Page navigation\n        elementWait: 5000,    \u002F\u002F Wait for element\n        afterClick: 1000,     \u002F\u002F Delay after click\n        afterFill: 1000,      \u002F\u002F Delay after form fill\n        afterSubmit: 3000,    \u002F\u002F Delay after submit\n        pageLoad: 3000,       \u002F\u002F Initial page load\n    },\n\n    \u002F\u002F Tweet limits\n    limits: {\n        tweetMaxLength: 280,\n    },\n};\n```\n\n### Data Directories\n\nPaths relative to project root:\n\n| Path | Purpose | Git |\n|------|---------|-----|\n| `data\u002Fx-browser-profile\u002F` | Chrome profile with X session | Ignored |\n| `data\u002Fx-auth.json` | Auth state marker | Ignored |\n| `logs\u002Fnanoclaw.log` | Service logs (contains X operation logs) | Ignored |\n\n## Architecture\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│  Container (Linux VM)                                       │\n│  └── agent.ts → MCP tool definitions (x_post, etc.)    │\n│      └── Writes IPC request to \u002Fworkspace\u002Fipc\u002Ftasks\u002F       │\n└──────────────────────┬──────────────────────────────────────┘\n                       │ IPC (file system)\n                       ▼\n┌─────────────────────────────────────────────────────────────┐\n│  Host (macOS)                                               │\n│  └── src\u002Fipc.ts → processTaskIpc()                         │\n│      └── host.ts → handleXIpc()                         │\n│          └── spawn subprocess → scripts\u002F*.ts               │\n│              └── Playwright → Chrome → X Website           │\n└─────────────────────────────────────────────────────────────┘\n```\n\n### Why This Design?\n\n- **API is expensive** - X official API requires paid subscription ($100+\u002Fmonth) for posting\n- **Bot browsers get blocked** - X detects and bans headless browsers and common automation fingerprints\n- **Must use user's real browser** - Reuses the user's actual Chrome on Host with real browser fingerprint to avoid detection\n- **One-time authorization** - User logs in manually once, session persists in Chrome profile for future use\n\n### File Structure\n\n```\n.claude\u002Fskills\u002Fx-integration\u002F\n├── SKILL.md          # This documentation\n├── host.ts           # Host-side IPC handler\n├── agent.ts          # Container-side MCP tool definitions\n├── lib\u002F\n│   ├── config.ts     # Centralized configuration\n│   └── browser.ts    # Playwright utilities\n└── scripts\u002F\n    ├── setup.ts      # Interactive login\n    ├── post.ts       # Post tweet\n    ├── like.ts       # Like tweet\n    ├── reply.ts      # Reply to tweet\n    ├── retweet.ts    # Retweet\n    └── quote.ts      # Quote tweet\n```\n\n### Integration Points\n\nTo integrate this skill into NanoClaw, make the following modifications:\n\n---\n\n**1. Host side: `src\u002Fipc.ts`**\n\nAdd import after other local imports:\n```typescript\nimport { handleXIpc } from '..\u002F.claude\u002Fskills\u002Fx-integration\u002Fhost.js';\n```\n\nModify `processTaskIpc` function's switch statement default case:\n```typescript\n\u002F\u002F Find:\ndefault:\nlogger.warn({ type: data.type }, 'Unknown IPC task type');\n\n\u002F\u002F Replace with:\ndefault:\nconst handled = await handleXIpc(data, sourceGroup, isMain, DATA_DIR);\nif (!handled) {\n    logger.warn({ type: data.type }, 'Unknown IPC task type');\n}\n```\n\n---\n\n**2. Container side: `container\u002Fagent-runner\u002Fsrc\u002Fipc-mcp.ts`**\n\nAdd import after `cron-parser` import:\n```typescript\n\u002F\u002F @ts-ignore - Copied during Docker build from .claude\u002Fskills\u002Fx-integration\u002F\nimport { createXTools } from '.\u002Fskills\u002Fx-integration\u002Fagent.js';\n```\n\nAdd to the end of tools array (before the closing `]`):\n```typescript\n    ...createXTools({ groupFolder, isMain })\n```\n\n---\n\n**3. Build script: `container\u002Fbuild.sh`**\n\nChange build context from `container\u002F` to project root (required to access `.claude\u002Fskills\u002F`):\n```bash\n# Find:\ndocker build -t \"${IMAGE_NAME}:${TAG}\" .\n\n# Replace with:\ncd \"$SCRIPT_DIR\u002F..\"\ndocker build -t \"${IMAGE_NAME}:${TAG}\" -f container\u002FDockerfile .\n```\n\n---\n\n**4. Dockerfile: `container\u002FDockerfile`**\n\nFirst, update the build context paths (required to access `.claude\u002Fskills\u002F` from project root):\n```dockerfile\n# Find:\nCOPY agent-runner\u002Fpackage*.json .\u002F\n...\nCOPY agent-runner\u002F .\u002F\n\n# Replace with:\nCOPY container\u002Fagent-runner\u002Fpackage*.json .\u002F\n...\nCOPY container\u002Fagent-runner\u002F .\u002F\n```\n\nThen add COPY line after `COPY container\u002Fagent-runner\u002F .\u002F` and before `RUN pnpm run build`:\n```dockerfile\n# Copy skill MCP tools\nCOPY .claude\u002Fskills\u002Fx-integration\u002Fagent.ts .\u002Fsrc\u002Fskills\u002Fx-integration\u002F\n```\n\n## Setup\n\nAll paths below are relative to project root (`NANOCLAW_ROOT`).\n\n### 1. Check Chrome Path\n\n```bash\n# Check if Chrome exists at configured path\ncat .env | grep CHROME_PATH\nls -la \"$(grep CHROME_PATH .env | cut -d= -f2)\" 2>\u002Fdev\u002Fnull || \\\necho \"Chrome not found - update CHROME_PATH in .env\"\n```\n\n### 2. Run Authentication\n\n```bash\npnpm exec dotenv -e .env -- pnpm exec tsx .claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fsetup.ts\n```\n\nThis opens Chrome for manual X login. Session saved to `data\u002Fx-browser-profile\u002F`.\n\n**Verify success:**\n```bash\ncat data\u002Fx-auth.json  # Should show {\"authenticated\": true, ...}\n```\n\n### 3. Rebuild Container\n\n```bash\n.\u002Fcontainer\u002Fbuild.sh\n```\n\n**Verify success:**\n```bash\n.\u002Fcontainer\u002Fbuild.sh 2>&1 | grep -i \"agent.ts\"  # Should show COPY line\n```\n\n### 4. Restart Service\n\nRun from your NanoClaw project root:\n\n```bash\npnpm run build\nsource setup\u002Flib\u002Finstall-slug.sh\nlaunchctl kickstart -k gui\u002F$(id -u)\u002F$(launchd_label)  # macOS\n# Linux: systemctl --user restart $(systemd_unit)\n```\n\n**Verify success.**\n\nRun from your NanoClaw project root:\n\n```bash\nsource setup\u002Flib\u002Finstall-slug.sh\nlaunchctl list | grep \"$(launchd_label)\"  # macOS — should show PID and exit code 0 or -\n# Linux: systemctl --user status $(systemd_unit)\n```\n\n## Usage via WhatsApp\n\nReplace `@Assistant` with your configured trigger name (`ASSISTANT_NAME` in `.env`):\n\n```\n@Assistant post a tweet: Hello world!\n\n@Assistant like this tweet https:\u002F\u002Fx.com\u002Fuser\u002Fstatus\u002F123\n\n@Assistant reply to https:\u002F\u002Fx.com\u002Fuser\u002Fstatus\u002F123 with: Great post!\n\n@Assistant retweet https:\u002F\u002Fx.com\u002Fuser\u002Fstatus\u002F123\n\n@Assistant quote https:\u002F\u002Fx.com\u002Fuser\u002Fstatus\u002F123 with comment: Interesting\n```\n\n**Note:** Only the main group can use X tools. Other groups will receive an error.\n\n## Testing\n\nScripts require environment variables from `.env`. Use `dotenv-cli` to load them:\n\n### Check Authentication Status\n\n```bash\n# Check if auth file exists and is valid\ncat data\u002Fx-auth.json 2>\u002Fdev\u002Fnull && echo \"Auth configured\" || echo \"Auth not configured\"\n\n# Check if browser profile exists\nls -la data\u002Fx-browser-profile\u002F 2>\u002Fdev\u002Fnull | head -5\n```\n\n### Re-authenticate (if expired)\n\n```bash\npnpm exec dotenv -e .env -- pnpm exec tsx .claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fsetup.ts\n```\n\n### Test Post (will actually post)\n\n```bash\necho '{\"content\":\"Test tweet - please ignore\"}' | pnpm exec dotenv -e .env -- pnpm exec tsx .claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fpost.ts\n```\n\n### Test Like\n\n```bash\necho '{\"tweetUrl\":\"https:\u002F\u002Fx.com\u002Fuser\u002Fstatus\u002F123\"}' | pnpm exec dotenv -e .env -- pnpm exec tsx .claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Flike.ts\n```\n\nOr export `CHROME_PATH` manually before running:\n\n```bash\nexport CHROME_PATH=\"\u002Fpath\u002Fto\u002Fchrome\"\necho '{\"content\":\"Test\"}' | pnpm exec tsx .claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fpost.ts\n```\n\n## Troubleshooting\n\n### Authentication Expired\n\nRun from your NanoClaw project root:\n\n```bash\npnpm exec dotenv -e .env -- pnpm exec tsx .claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fsetup.ts\nsource setup\u002Flib\u002Finstall-slug.sh\nlaunchctl kickstart -k gui\u002F$(id -u)\u002F$(launchd_label)  # macOS\n# Linux: systemctl --user restart $(systemd_unit)\n```\n\n### Browser Lock Files\n\nIf Chrome fails to launch:\n\n```bash\nrm -f data\u002Fx-browser-profile\u002FSingletonLock\nrm -f data\u002Fx-browser-profile\u002FSingletonSocket\nrm -f data\u002Fx-browser-profile\u002FSingletonCookie\n```\n\n### Check Logs\n\n```bash\n# Host logs (relative to project root)\ngrep -i \"x_post\\|x_like\\|x_reply\\|handleXIpc\" logs\u002Fnanoclaw.log | tail -20\n\n# Script errors\ngrep -i \"error\\|failed\" logs\u002Fnanoclaw.log | tail -20\n```\n\n### Script Timeout\n\nDefault timeout is 2 minutes (120s). Increase in `host.ts`:\n\n```typescript\nconst timer = setTimeout(() => {\n  proc.kill('SIGTERM');\n  resolve({ success: false, message: 'Script timed out (120s)' });\n}, 120000);  \u002F\u002F ← Increase this value\n```\n\n### X UI Selector Changes\n\nIf X updates their UI, selectors in scripts may break. Current selectors:\n\n| Element | Selector |\n|---------|----------|\n| Tweet input | `[data-testid=\"tweetTextarea_0\"]` |\n| Post button | `[data-testid=\"tweetButtonInline\"]` |\n| Reply button | `[data-testid=\"reply\"]` |\n| Like | `[data-testid=\"like\"]` |\n| Unlike | `[data-testid=\"unlike\"]` |\n| Retweet | `[data-testid=\"retweet\"]` |\n| Unretweet | `[data-testid=\"unretweet\"]` |\n| Confirm retweet | `[data-testid=\"retweetConfirm\"]` |\n| Modal dialog | `[role=\"dialog\"][aria-modal=\"true\"]` |\n| Modal submit | `[data-testid=\"tweetButton\"]` |\n\n### Container Build Issues\n\nIf MCP tools not found in container:\n\n```bash\n# Verify build copies skill\n.\u002Fcontainer\u002Fbuild.sh 2>&1 | grep -i skill\n\n# Check container has the file\ndocker run nanoclaw-agent ls -la \u002Fapp\u002Fsrc\u002Fskills\u002F\n```\n\n## Security\n\n- `data\u002Fx-browser-profile\u002F` - Contains X session cookies (in `.gitignore`)\n- `data\u002Fx-auth.json` - Auth state marker (in `.gitignore`)\n- Only main group can use X tools (enforced in `agent.ts` and `host.ts`)\n- Scripts run as subprocesses with limited environment",{"name":5,"description":7},"main","85a2d934766d21e4696ac1b00157179f28bca9e3",".claude\u002Fskills\u002Fx-integration",2,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-app-nanoclaw","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-10-30 04:24:16",{"source":9,"skillName":5,"commands":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add microsoft\u002Famplifier-app-nanoclaw --skill x-integration",{"tool":54,"command":55},"bunx","bunx skills add microsoft\u002Famplifier-app-nanoclaw --skill x-integration",{"tool":57,"command":58},"pnpm","pnpm dlx skills add microsoft\u002Famplifier-app-nanoclaw --skill x-integration","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-app-nanoclaw\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002FSKILL.md",true,[62,68,72,76,80,84,88,92,96,100],{"path":63,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":67},"agent.ts","SCRIPT","脚本",7495,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-app-nanoclaw\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002Fagent.ts",{"path":69,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":70,"sourceHtmlUrl":71},"host.ts",4416,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-app-nanoclaw\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002Fhost.ts",{"path":73,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":74,"sourceHtmlUrl":75},"lib\u002Fbrowser.ts",4066,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-app-nanoclaw\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002Flib\u002Fbrowser.ts",{"path":77,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":78,"sourceHtmlUrl":79},"lib\u002Fconfig.ts",1505,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-app-nanoclaw\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002Flib\u002Fconfig.ts",{"path":81,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":82,"sourceHtmlUrl":83},"scripts\u002Flike.ts",1674,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-app-nanoclaw\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Flike.ts",{"path":85,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":86,"sourceHtmlUrl":87},"scripts\u002Fpost.ts",2312,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-app-nanoclaw\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fpost.ts",{"path":89,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":90,"sourceHtmlUrl":91},"scripts\u002Fquote.ts",2827,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-app-nanoclaw\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fquote.ts",{"path":93,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":94,"sourceHtmlUrl":95},"scripts\u002Freply.ts",2569,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-app-nanoclaw\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Freply.ts",{"path":97,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":98,"sourceHtmlUrl":99},"scripts\u002Fretweet.ts",2018,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-app-nanoclaw\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fretweet.ts",{"path":101,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":102,"sourceHtmlUrl":103},"scripts\u002Fsetup.ts",2794,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-app-nanoclaw\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fsetup.ts",[105,122,135,154,167,185],{"skillNo":106,"name":107,"nameZh":108,"description":109,"descriptionZh":110,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":111,"categories":112,"keywords":119,"publishedAt":34},"01M69A6E27JZN10H82TZ2GMC3A","whatsapp-formatting","WhatsApp 消息格式化","Format messages for WhatsApp, including mentions that render as real WhatsApp tags. Use when responding in a WhatsApp conversation (platform_id \u002F chatJid ends with @s.whatsapp.net or @g.us).","为 WhatsApp 格式化消息，包括可渲染为真实 WhatsApp 标签的提及（mention）。在 WhatsApp 对话中回复时使用（platform_id \u002F chatJid 以 @s.whatsapp.net 或 @g.us 结尾）。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-app-nanoclaw\u002Fblob\u002Fmain\u002Fcontainer\u002Fskills\u002Fwhatsapp-formatting\u002FSKILL.md",[113,116],{"categoryNo":114,"categoryName":115,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BREN0B06CC08183RHQ4ETG","即时通讯与消息处理",{"categoryNo":117,"categoryName":118,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BS5011KJDVSRXG1DC4P666","普通用户",[120,121],"whatsapp","whatsapp formatting",{"skillNo":123,"name":124,"nameZh":125,"description":126,"descriptionZh":127,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":128,"categories":129,"keywords":134,"publishedAt":34},"01M69A6CGJ968RNVGYTRSWZKWB","welcome","新频道欢迎引导","Introduce yourself to a newly connected channel. Triggered automatically when a channel is first wired. Send a friendly greeting and brief overview of what you can do.","向新连接的频道介绍自己。当频道首次接入时自动触发。发送友好的问候和简要的功能概述。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-app-nanoclaw\u002Fblob\u002Fmain\u002Fcontainer\u002Fskills\u002Fwelcome\u002FSKILL.md",[130,133],{"categoryNo":131,"categoryName":132,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TPX3VFVPP2WMQ6F0159","内部沟通专员",{"categoryNo":114,"categoryName":115,"taxonomyType":28,"taxonomyTypeDesc":29},[124],{"skillNo":136,"name":137,"nameZh":138,"description":139,"descriptionZh":140,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":141,"categories":142,"keywords":149,"publishedAt":34},"01M69A6ADX690STSN63WKRD37K","vercel-cli","Vercel 应用部署","Deploy apps to Vercel. Use when asked to deploy, ship, or publish a web application, or manage Vercel projects, domains, and environment variables.","将应用部署到 Vercel。当用户要求部署、发布 Web 应用，或管理 Vercel 项目、域名和环境变量时使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-app-nanoclaw\u002Fblob\u002Fmain\u002Fcontainer\u002Fskills\u002Fvercel-cli\u002FSKILL.md",[143,146],{"categoryNo":144,"categoryName":145,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师",{"categoryNo":147,"categoryName":148,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQNXPY1AV6BSR5VKHDMWRH","部署与发布管理",[150,151,152,153],"cli","vercel cli","web","deploy",{"skillNo":155,"name":156,"nameZh":157,"description":158,"descriptionZh":159,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":160,"categories":161,"keywords":164,"publishedAt":34},"01M69A68WJ94V4MXGXGK9T0QG7","slack-formatting","Slack 消息格式化","Format messages for Slack using mrkdwn syntax. Use when responding to Slack channels (folder starts with \"slack_\" or JID contains slack identifiers).","使用 mrkdwn 语法为 Slack 格式化消息。当回复 Slack 频道时使用（文件夹以“slack_”开头，或 JID 包含 slack 标识符）。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-app-nanoclaw\u002Fblob\u002Fmain\u002Fcontainer\u002Fskills\u002Fslack-formatting\u002FSKILL.md",[162,163],{"categoryNo":131,"categoryName":132,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":114,"categoryName":115,"taxonomyType":28,"taxonomyTypeDesc":29},[165,166],"slack","slack formatting",{"skillNo":168,"name":169,"nameZh":170,"description":171,"descriptionZh":172,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":173,"categories":174,"keywords":181,"publishedAt":34},"01M69A673Z17TDXK3DBC5YJFM7","self-customize","智能体自我定制","Customize your own agent — add capabilities, install packages, add MCP servers, edit code or CLAUDE.md. Use when the user asks you to add a feature, install a tool, or modify how you work. For non-trivial code changes, delegate to a builder agent via create_agent.","定制你自己的智能体——添加能力、安装包、添加 MCP 服务器、编辑代码或 CLAUDE.md。当用户要求你添加功能、安装工具或修改工作方式时使用。对于非平凡的代码改动，请通过 create_agent 委派给构建智能体处理。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-app-nanoclaw\u002Fblob\u002Fmain\u002Fcontainer\u002Fskills\u002Fself-customize\u002FSKILL.md",[175,178],{"categoryNo":176,"categoryName":177,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BRZZF9D7PVFN5MXSPWWD61","AI 工程师",{"categoryNo":179,"categoryName":180,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSAA4FBTWZP6X98STEHG99","智能体开发",[182,183,184],"customize","self customize","MCP",{"skillNo":186,"name":187,"nameZh":188,"description":189,"descriptionZh":190,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":191,"categories":192,"keywords":199,"publishedAt":34},"01M69A657JFNEG45Z1Y05BVK5R","onecli-gateway","OneCLI 网关凭证代理","OneCLI Gateway: transparent HTTPS proxy that injects stored credentials into outbound calls. You MUST use this skill when the user asks you to read emails, check calendar, access GitHub repos, create issues, check Stripe payments, or interact with ANY external service or API. Do NOT use browser extensions or OAuth CLI tools. Make HTTP requests directly; the gateway injects credentials automatically.","OneCLI 网关：一种透明的 HTTPS 代理，可将存储的凭证注入到对外调用中。当用户要求读取电子邮件、查看日历、访问 GitHub 仓库、创建 issue、检查 Stripe 付款，或与任何外部服务或 API 交互时，你必须使用本技能。不要使用浏览器扩展或 OAuth CLI 工具。直接发起 HTTP 请求；网关会自动注入凭证。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-app-nanoclaw\u002Fblob\u002Fmain\u002Fcontainer\u002Fskills\u002Fonecli-gateway\u002FSKILL.md",[193,196],{"categoryNo":194,"categoryName":195,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BR4MYFKGCC4WCWVJ50KJ2C","安全工程师",{"categoryNo":197,"categoryName":198,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BS1P5QP54ZNEBFHBTV293T","API 网关配置与管理",[200,150,201,202],"onecli gateway","github","repos"]