Grok Skill banner
mikedemarais mikedemarais

Grok Skill

Communication community

Description

Claude Code Skill that routes Twitter/X prompts to Grok-4 Live Search.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

grok-skill

[![Built with Bun](https://img.shields.io/badge/runtime-bun-000000.svg?logo=bun)](https://bun.sh) [![TypeScript](https://img.shields.io/badge/language-typescript-3178C6.svg?logo=typescript)](https://www.typescriptlang.org/) [![OpenRouter](https://img.shields.io/badge/api-OpenRouter-4B8BBE.svg)](https://openrouter.ai) [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)

A Claude Code Skill that routes X/Twitter queries to xAI **Grok 4** via **OpenRouter** with **Live Search** turned on and scoped to the **X** source.

Features

  • Live Search - Real-time X/Twitter data via Grok 4's Live Search
  • Handle Filtering - Multi-value --include / --exclude for targeted searches
  • Date Range Queries - Time-bounded searches with calendar validation
  • Engagement Filters - Filter by favorites and views
  • Network Resilience - Automatic retries with exponential backoff
  • Citation Extraction - Tweet URLs with fallback parsing
  • Production Ready - Comprehensive error handling and validation

Quick Start

# 1. Set your OpenRouter API key
export OPENROUTER_API_KEY="sk-or-..."

# 2. Run a query (assumes Bun is installed)
bun scripts/grok.ts --q "what's trending on X about AI?"

That's it! The script returns JSON with summary, citations, and usage stats.

Install

1. Get an OpenRouter API Key

Sign up at [openrouter.ai](https://openrouter.ai) and create an API key.

2. Set Environment Variable

# Set your OpenRouter key
export OPENROUTER_API_KEY="sk-or-..."

# Verify it's set
echo "$OPENROUTER_API_KEY"

# To persist across sessions, add to your shell profile:
echo 'export OPENROUTER_API_KEY="sk-or-..."' >> ~/.zshrc
source ~/.zshrc

3. Install Bun (if needed)

# macOS/Linux
brew install bun || curl -fsSL https://bun.sh/install | bash

# Windows
powershell -c "irm bun.sh/install.ps1|iex"

4. Clone and Setup

# Clone to Claude Code skills directory
git