[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6H3YNF5Q5M3RZ4JZ6441DER":3,"skill-same:01M6H3YNF5Q5M3RZ4JZ6441DER":103},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":31,"linkOnly":32,"markdownContent":33,"markdownBody":34,"frontMatter":35,"refName":36,"commitSha":37,"skillDirectory":38,"forksCount":39,"repositoryHtmlUrl":40,"repositoryHomepageUrl":40,"ownerHtmlUrl":41,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":42,"install":43,"resources":56},"01M6H3YNF5Q5M3RZ4JZ6441DER","x-integration",null,"X (Twitter) integration for Deus. 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\".","sliamh11\u002FDeus","sliamh11","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F68326628?v=4","01M6H3PPFXQ6C98QV1RJA5W72S","Liam Steiner","01M6H3PPM81GJC6KYCNTY9A3AT",51,"MIT","https:\u002F\u002Fgithub.com\u002Fsliamh11\u002FDeus\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30],"x integration","integration","testing","setup","troubleshooting","twitter","use","reply","quote","triggers","post","for","2026-11-10 10:12:30",false,"---\nname: x-integration\ndescription: X (Twitter) integration for Deus. 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:** Deus 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. **Deus is installed and running** - WhatsApp connected, service active\n2. **Dependencies installed**:\n   ```bash\n   npm ls playwright dotenv-cli || npm 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\n```bash\n# 0. Install dependencies (always run first — idempotent)\nnpm install --save-dev playwright dotenv-cli\n\n# 1. Setup authentication (interactive)\nnpx dotenv -e .env -- npx 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\nnpm run build\nlaunchctl kickstart -k gui\u002F$(id -u)\u002Fcom.deus  # macOS\n# Linux: systemctl --user restart deus\n# Verify: launchctl list | grep deus (macOS) or systemctl --user status deus (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| `DEUS_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\u002Fdeus.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 Deus, 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 npm 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 (`DEUS_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\nnpx dotenv -e .env -- npx 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\n```bash\nnpm run build\nlaunchctl kickstart -k gui\u002F$(id -u)\u002Fcom.deus  # macOS\n# Linux: systemctl --user restart deus\n```\n\n**Verify success:**\n```bash\nlaunchctl list | grep deus  # macOS — should show PID and exit code 0 or -\n# Linux: systemctl --user status deus\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\nAlways install dependencies first (idempotent):\n```bash\nnpm install --save-dev playwright dotenv-cli\n```\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\nnpx dotenv -e .env -- npx 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\"}' | npx dotenv -e .env -- npx 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\"}' | npx dotenv -e .env -- npx 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\"}' | npx tsx .claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fpost.ts\n```\n\n## Troubleshooting\n\n### Authentication Expired\n\n```bash\nnpx dotenv -e .env -- npx tsx .claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fsetup.ts\nlaunchctl kickstart -k gui\u002F$(id -u)\u002Fcom.deus  # macOS\n# Linux: systemctl --user restart deus\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\u002Fdeus.log | tail -20\n\n# Script errors\ngrep -i \"error\\|failed\" logs\u002Fdeus.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 deus-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:** Deus 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. **Deus is installed and running** - WhatsApp connected, service active\n2. **Dependencies installed**:\n   ```bash\n   npm ls playwright dotenv-cli || npm 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\n```bash\n# 0. Install dependencies (always run first — idempotent)\nnpm install --save-dev playwright dotenv-cli\n\n# 1. Setup authentication (interactive)\nnpx dotenv -e .env -- npx 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\nnpm run build\nlaunchctl kickstart -k gui\u002F$(id -u)\u002Fcom.deus  # macOS\n# Linux: systemctl --user restart deus\n# Verify: launchctl list | grep deus (macOS) or systemctl --user status deus (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| `DEUS_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\u002Fdeus.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 Deus, 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 npm 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 (`DEUS_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\nnpx dotenv -e .env -- npx 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\n```bash\nnpm run build\nlaunchctl kickstart -k gui\u002F$(id -u)\u002Fcom.deus  # macOS\n# Linux: systemctl --user restart deus\n```\n\n**Verify success:**\n```bash\nlaunchctl list | grep deus  # macOS — should show PID and exit code 0 or -\n# Linux: systemctl --user status deus\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\nAlways install dependencies first (idempotent):\n```bash\nnpm install --save-dev playwright dotenv-cli\n```\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\nnpx dotenv -e .env -- npx 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\"}' | npx dotenv -e .env -- npx 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\"}' | npx dotenv -e .env -- npx 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\"}' | npx tsx .claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fpost.ts\n```\n\n## Troubleshooting\n\n### Authentication Expired\n\n```bash\nnpx dotenv -e .env -- npx tsx .claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fsetup.ts\nlaunchctl kickstart -k gui\u002F$(id -u)\u002Fcom.deus  # macOS\n# Linux: systemctl --user restart deus\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\u002Fdeus.log | tail -20\n\n# Script errors\ngrep -i \"error\\|failed\" logs\u002Fdeus.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 deus-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","2f24c38a2ae42d3161492f0729975b286452f4b4",".claude\u002Fskills\u002Fx-integration",7,"https:\u002F\u002Fgithub.com\u002Fsliamh11\u002FDeus","https:\u002F\u002Fgithub.com\u002Fsliamh11","2026-11-13 20:39:27",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add sliamh11\u002FDeus --skill x-integration",{"tool":49,"command":50},"bunx","bunx skills add sliamh11\u002FDeus --skill x-integration",{"tool":52,"command":53},"pnpm","pnpm dlx skills add sliamh11\u002FDeus --skill x-integration","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsliamh11\u002FDeus\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002FSKILL.md",true,[57,63,67,71,75,79,83,87,91,95,99],{"path":58,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":62},"agent.ts","SCRIPT","脚本",7495,"https:\u002F\u002Fgithub.com\u002Fsliamh11\u002FDeus\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002Fagent.ts",{"path":64,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":65,"sourceHtmlUrl":66},"host.ts",5264,"https:\u002F\u002Fgithub.com\u002Fsliamh11\u002FDeus\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002Fhost.ts",{"path":68,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":69,"sourceHtmlUrl":70},"lib\u002Fbrowser.ts",4066,"https:\u002F\u002Fgithub.com\u002Fsliamh11\u002FDeus\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002Flib\u002Fbrowser.ts",{"path":72,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":73,"sourceHtmlUrl":74},"lib\u002Fconfig.ts",1501,"https:\u002F\u002Fgithub.com\u002Fsliamh11\u002FDeus\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002Flib\u002Fconfig.ts",{"path":76,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":77,"sourceHtmlUrl":78},"scripts\u002Fdelete.ts",2023,"https:\u002F\u002Fgithub.com\u002Fsliamh11\u002FDeus\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fdelete.ts",{"path":80,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":81,"sourceHtmlUrl":82},"scripts\u002Flike.ts",1662,"https:\u002F\u002Fgithub.com\u002Fsliamh11\u002FDeus\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Flike.ts",{"path":84,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":85,"sourceHtmlUrl":86},"scripts\u002Fpost.ts",3347,"https:\u002F\u002Fgithub.com\u002Fsliamh11\u002FDeus\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fpost.ts",{"path":88,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":89,"sourceHtmlUrl":90},"scripts\u002Fquote.ts",2815,"https:\u002F\u002Fgithub.com\u002Fsliamh11\u002FDeus\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fquote.ts",{"path":92,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":93,"sourceHtmlUrl":94},"scripts\u002Freply.ts",2557,"https:\u002F\u002Fgithub.com\u002Fsliamh11\u002FDeus\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Freply.ts",{"path":96,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":97,"sourceHtmlUrl":98},"scripts\u002Fretweet.ts",2006,"https:\u002F\u002Fgithub.com\u002Fsliamh11\u002FDeus\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fretweet.ts",{"path":100,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":101,"sourceHtmlUrl":102},"scripts\u002Fsetup.ts",2782,"https:\u002F\u002Fgithub.com\u002Fsliamh11\u002FDeus\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002Fscripts\u002Fsetup.ts",[104,128,143,157,167,182],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":31},"01M6H3ZC87AJDM8566RP3CQ6BF","status","Quick read-only health check — session context, workspace mounts, tool availability, and task snapshot. Use when the user asks for system status or runs \u002Fstatus.","https:\u002F\u002Fgithub.com\u002Fsliamh11\u002FDeus\u002Fblob\u002Fmain\u002Fcontainer\u002Fskills\u002Fstatus\u002FSKILL.md",[],[106,111,112,30,113,114,115,116,117,118,119,25,120,121,122,123,124,125,126,127],"health","snapshot","read-only","quick","availability","session context","task","health check","only","session","user","context","read","check","workspace","tool","system",{"skillNo":129,"name":130,"nameZh":6,"description":131,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":134,"publishedAt":31},"01M6H3Z8SK38PVH2B0W7NBP6ZP","resume","Load context from permanent memory and recent session logs. Tiered loading — CLAUDE.md full, session logs frontmatter-only by default.","https:\u002F\u002Fgithub.com\u002Fsliamh11\u002FDeus\u002Fblob\u002Fmain\u002Fcontainer\u002Fskills\u002Fresume\u002FSKILL.md",[],[130,135,136,137,138,139,140,119,120,122,141,142],"memory","load","loading","full","session logs","default","logs","frontmatter",{"skillNo":144,"name":145,"nameZh":6,"description":146,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":147,"categories":148,"keywords":149,"publishedAt":31},"01M6H3Z56ZBPKX77THMWSSHZCW","preserve","Scan the current conversation and silently save anything worth permanent memory to CLAUDE.md. Keeps the file compact — structured key:value, no prose.","https:\u002F\u002Fgithub.com\u002Fsliamh11\u002FDeus\u002Fblob\u002Fmain\u002Fcontainer\u002Fskills\u002Fpreserve\u002FSKILL.md",[],[145,150,151,152,153,154,155,156,135],"structured","compact","scan","conversation","prose","save","file",{"skillNo":158,"name":159,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"publishedAt":31},"01M6H3Z1AKK58CWWY762YD3X9A","compress","Save the current session to the vault. Writes a compact session log with a TL;DR frontmatter (always) and full details below (when useful).","https:\u002F\u002Fgithub.com\u002Fsliamh11\u002FDeus\u002Fblob\u002Fmain\u002Fcontainer\u002Fskills\u002Fcompress\u002FSKILL.md",[],[159,164,142,138,151,165,120,155,166],"with","log","vault",{"skillNo":168,"name":169,"nameZh":6,"description":170,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":173,"publishedAt":31},"01M6H3YX6STE1ZJC06EKWMY0M6","capabilities","Show what this Deus instance can do — installed skills, available tools, and system info. Read-only. Use when the user asks what the bot can do, what's installed, or runs \u002Fcapabilities.","https:\u002F\u002Fgithub.com\u002Fsliamh11\u002FDeus\u002Fblob\u002Fmain\u002Fcontainer\u002Fskills\u002Fcapabilities\u002FSKILL.md",[],[169,174,175,127,113,176,177,178,179,180,181,119,25,121,123],"Tools","bot","can","system info","info","what the","do","show",{"skillNo":183,"name":184,"nameZh":6,"description":185,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":186,"categories":187,"keywords":188,"publishedAt":31},"01M6H3YSNXYAR7NC1TZPFCANZN","agent-browser","Browse the web for any task — research topics, read articles, interact with web apps, fill forms, take screenshots, extract data, and test web pages. Use whenever a browser would be useful, not just when the user explicitly asks.","https:\u002F\u002Fgithub.com\u002Fsliamh11\u002FDeus\u002Fblob\u002Fmain\u002Fcontainer\u002Fskills\u002Fagent-browser\u002FSKILL.md",[],[189,190,191,30,164,192,193,194,117,195,25,123,196,197,198,199,200,201,202,203],"agent browser","browser","take","apps","pages","forms","test web","just","Bash","browse","data","web","test","research","screenshots"]