npm package: @gala-chain/claude-plugin
Description: Claude Code plugin for Gala Launchpad development - provides AI-assisted commands, hooks, and utilities for SDK, MCP server, and frontend development
Author: Gala Launchpad Team
Latest version: 1.0.0

# GalaChain OmniTool - Claude Plugin

Transform Claude into a **GalaChain Expert Developer Agent** with 247 MCP tools, 41 teaching topics, and autonomous building capabilities.

## What is GalaChain OmniTool?

A comprehensive Claude Code plugin that packages the entire Gala Launchpad ecosystem:

- **247 MCP Tools** - Execute any GalaChain operation programmatically
- **41 Teaching Topics** - Learn GalaChain development systematically
- **254+ SDK Methods** - Complete API coverage with examples
- **Autonomous Agent** - `galachain-builder` helps you build applications
- **Smart Commands** - `/galachain:ask`, `/galachain:topics`, `/galachain:setup`
- **Auto Error Handling** - Hooks automatically explain MCP tool failures
- **Configurable Personality** - Tutor, Expert, Pragmatist, or Socratic modes

## Key Features

### 🤖 The GalaChain Builder Agent

Ask for help and get expert guidance:

```
You: "Help me build a trading bot"
Agent:
  1. Explains trading concepts
  2. Shows complete code examples
  3. Offers to set up operations using MCP tools
  4. Guides through complete workflows
  5. Explains trade-offs and best practices
```

### 🎓 41 Teaching Topics

Comprehensive coverage of everything you can do:

```
Trading: buy-tokens, sell-tokens, dex-swaps, graduations
Liquidity: pool discovery, adding positions, fees, advanced
Tokens: creation, metadata, supply, transfers, locks
Bridging: Ethereum, Solana, fees, status tracking
Streaming: RTMP, chat, recordings, simulcast, moderation
Social: community management, moderator invites, governance
Advanced: NFTs, API keys, monitoring, overseer system
```

### 💬 Smart Commands

#### `/galachain:ask` - Ask Anything
```bash
/galachain:ask how do I buy tokens?
/galachain:ask dex-pool-discovery
/galachain:ask I want to bridge GALA to Ethereum
```

Accepts natural language and topic names. Returns comprehensive teaching content with code examples.

#### `/galachain:topics` - Browse All Topics
```bash
/galachain:topics              # List all 41 topics
/galachain:topics trading      # Filter by category
/galachain:topics --format=detailed
```

Organized by category with difficulty levels and prerequisites.

#### `/galachain:setup` - Configure Plugin
```bash
/galachain:setup
```

Interactive wizard to configure:
- Agent personality (tutor/expert/pragmatist/socratic)
- Wallet mode (read-only or full-access)
- Environment (production/staging/development)
- Learning preferences

## Installation

### Option 1: From Package Registry (Recommended)

```bash
claude plugins add "@gala-chain/launchpad-claude-plugin"
```

### Option 2: From Source

```bash
# From SDK repository root
claude plugins add ./packages/claude-plugin

# Or clone and install
git clone https://gitlab.com/gala-games/defi/launchpad/sdk.git
cd launchpad-sdk/packages/claude-plugin
npm install
npm run build
claude plugins add .
```

## Quick Start

### 1. Run Setup
```bash
/galachain:setup
```

Choose your personality, wallet mode, and environment. Creates `.claude/galachain-omnitool.local.md`.

### 2. Explore Topics
```bash
/galachain:topics
```

Browse all 41 teaching topics. Pick one that interests you.

### 3. Ask a Question
```bash
/galachain:ask buy-tokens
# or
/galachain:ask how do I provide liquidity?
```

Get comprehensive teaching with examples.

### 4. Build Something
```
You: "Help me create a token"
Agent: [Uses galachain-builder to guide you through token creation]
```

## Configuration

After first run, configure via `.claude/galachain-omnitool.local.md`:

```yaml
---
# Agent personality: tutor, expert, pragmatist, socratic
agent_personality: tutor

# Wallet mode: read-only or full-access
wallet_mode: read-only

# Environment: production, staging, development
environment: production

# Learning preferences
show_advanced_topics: true
include_best_practices: true
include_error_handling: true
code_style: typescript

# Auto features
auto_explain_errors: true
auto_suggest_examples: true
---
```

### Environment Variables

For full-access mode (trading, creating tokens, etc.):

```bash
# Production/Staging
export GALACHAIN_PRIVATE_KEY=0x...your_hex_key
export GALACHAIN_ENVIRONMENT=staging  # optional

# Development (localhost)
export LAUNCHPAD_API_URL=http://localhost:4000
```

## Use Cases

### 👨‍💼 For Traders
```bash
/galachain:ask buy-tokens
/galachain:ask dex-swap-exact-input
/galachain:ask liquidity-add-by-price
# Start trading with confidence
```

### 👨‍💻 For Developers
```bash
/galachain:ask token-creation
/galachain:ask bridge-to-ethereum
# Build complete applications
```

### 📡 For Community Builders
```bash
/galachain:ask stream-start-stop
/galachain:ask stream-chat
/galachain:ask chat-moderation
# Build streaming communities
```

### 🎓 For Learners
```bash
/galachain:topics                    # See all topics
/galachain:ask buy-tokens            # Learn a topic
/galachain:setup --personality=tutor # Get patient teaching
# Build foundational knowledge
```

## The 41 Teaching Topics

### Trading (8 topics)
- buy-tokens
- sell-tokens
- token-graduation
- dex-swap-exact-input
- dex-swap-exact-output
- price-impact
- token-holders
- token-metadata

### Liquidity & DEX (8 topics)
- dex-pool-discovery
- liquidity-add-by-price
- liquidity-add-by-tick
- liquidity-remove
- liquidity-fee-collection
- dex-leaderboard
- dex-volume-summary
- dex-token-discovery

### Token Management (7 topics)
- token-creation
- token-supply
- token-price-history
- token-transfers
- token-locks
- token-unlocks
- wrapped-tokens

### Bridging (6 topics)
- bridge-to-ethereum
- bridge-from-ethereum
- bridge-to-solana
- bridge-from-solana
- bridge-fees
- bridge-status

### Streaming & Social (8 topics)
- stream-start-stop
- stream-key-management
- stream-recordings
- simulcast-management
- stream-chat
- chat-moderation
- content-moderation
- moderator-management

### Advanced (4 topics)
- nft-collections
- overseer-system
- api-keys
- monitoring-events

## Personality Modes

### 🎓 Tutor
Patient and thorough. Perfect for beginners.
- Explains everything in detail
- Includes best practices
- Suggests related topics
- Multiple examples

### ⚡ Expert
Fast and direct. Perfect for experienced traders/developers.
- Assumes DeFi knowledge
- Focuses on optimization
- Advanced patterns
- Minimal explanation

### ⚙️ Pragmatist
Balanced approach. Perfect for getting things done.
- Explains key concepts
- Shows working code immediately
- Practical examples
- Results-focused

### ❓ Socratic
Questions first. Perfect for deep learning.
- Asks clarifying questions
- Guides discovery
- Builds understanding gradually
- Encourages experimentation

## Learning Paths

### 🏪 Trading Path (3-4 hours)
1. Token Basics → 2. Buying → 3. Selling → 4. Distribution → 5. Graduation

### 💰 Liquidity Path (4-5 hours)
1. Pool Discovery → 2. Add Positions → 3. Collect Fees → 4. Remove Positions → 5. Advanced

### 🔄 DEX Swap Path (2-3 hours)
1. Token Discovery → 2. Input Swaps → 3. Output Swaps → 4. Slippage

### 🌉 Bridging Path (3-4 hours)
1. Fees → 2. To Ethereum → 3. From Ethereum → 4. To Solana → 5. From Solana → 6. Monitoring

### 📡 Streaming Path (4-5 hours)
1. Start Streaming → 2. Chat → 3. Recordings → 4. Simulcast → 5. Moderation

### 🎫 Token Creation Path (3-4 hours)
1. Create → 2. Metadata → 3. Supply → 4. History → 5. Graduation

### ⚡ Advanced Path (2-3 hours)
1. NFTs → 2. Wrapping → 3. API → 4. Monitoring → 5. Governance

## Architecture

```
galachain-omnitool/
├── plugin.json                 # Plugin manifest (commands, agents, skills, hooks)
├── agents/
│   └── galachain-builder.md    # Expert developer agent
├── commands/
│   ├── ask.md                  # /galachain:ask command
│   ├── topics.md               # /galachain:topics command
│   └── setup.md                # /galachain:setup command
├── skills/
│   └── learning-galachain/     # Comprehensive learning skill
│       └── SKILL.md
├── hooks/
│   └── hooks.json              # Auto-explain errors hook
├── examples/
│   └── settings-template.md    # Configuration template
└── README.md                   # This file
```

## MCP Integration

The plugin wraps `@gala-chain/launchpad-mcp-server` with 247 tools:

- **Trading**: 20+ tools for buying, selling, swaps
- **Liquidity**: 15+ tools for LP management
- **Tokens**: 25+ tools for creation, metadata, supply
- **Bridge**: 18+ tools for cross-chain operations
- **Streaming**: 12+ tools for RTMP and simulcast
- **Chat**: 8+ tools for messaging and moderation
- **NFTs**: 6+ tools for collections and minting
- **Discovery**: 20+ tools for querying pools, tokens, prices
- **Analytics**: 15+ tools for volume, leaderboards, history
- **Admin**: 12+ tools for platform management

## Error Handling

When MCP tools fail, the plugin automatically:

1. Detects the error
2. Identifies the relevant topic
3. Calls `gala_launchpad_explain_sdk_usage` with teaching content
4. Shows you how to fix it

This happens automatically via the PostToolUse hook.

## Development

### Building
```bash
npm run build --workspace=@gala-chain/launchpad-claude-plugin
```

### Testing
```bash
npm test --workspace=@gala-chain/launchpad-claude-plugin
```

### Linting
```bash
npm run lint --workspace=@gala-chain/launchpad-claude-plugin
npm run typecheck --workspace=@gala-chain/launchpad-claude-plugin
```

## Integration with SDK

This plugin is part of the Gala Launchpad monorepo:

| Component | Path | Purpose |
|-----------|------|---------|
| **SDK** | `/packages/sdk` | TypeScript SDK for backend API |
| **MCP Server** | `/packages/mcp-server` | Model Context Protocol server (247 tools) |
| **Claude Plugin** | `/packages/claude-plugin` | This plugin |
| **Frontend** | `/launchpad-frontend` | React 18 frontend |
| **Backend** | `/launchpad-backend-service` | NestJS backend |

### Cross-Cutting Scenarios

**New API Endpoint**:
1. Backend defines route
2. SDK adds method
3. Plugin teaches it via `/galachain:ask`
4. MCP server exposes as tool

**New Feature**:
1. Backend implements
2. SDK wraps functionality
3. MCP server creates tools
4. Plugin adds teaching topic

## Troubleshooting

### "MCP tools not found"
- Verify `@gala-chain/launchpad-mcp-server@latest` is in plugin.json
- Check npm package cache: `npm cache clean --force`
- Restart Claude Code

### "Private key not working"
- Check `GALACHAIN_PRIVATE_KEY` environment variable
- Verify it's a valid hex string (0x... or just hex)
- Set before launching Claude Code

### "Staging seems broken"
- Verify `GALACHAIN_ENVIRONMENT=staging` is set correctly
- Check if backend service is running
- Try production environment

### "I can't find the config file"
- Setup creates `.claude/galachain-omnitool.local.md`
- Check if `.claude/` directory exists
- Run `/galachain:setup` to recreate

### "Agent not responding"
- Check MCP connection: `/galachain:topics`
- Verify environment variables are set
- Try simpler commands first: `/galachain:ask token-metadata`

## Examples

### Example 1: Learn to Trade
```bash
$ /galachain:topics trading
$ /galachain:ask buy-tokens
# Understand trading
$ /galachain:ask dex-swap-exact-input
# Learn swaps
```

### Example 2: Build a Trading Bot
```
User: "Help me build a trading bot"
Agent:
1. Explains GalaChain trading concepts
2. Shows complete bot code structure
3. Offers to set up first trade
4. Guides through error handling
5. Helps you build it step by step
```

### Example 3: Provide Liquidity
```bash
$ /galachain:ask dex-pool-discovery
# Find a pool
$ /galachain:ask liquidity-add-by-price
# Add liquidity
$ /galachain:ask liquidity-fee-collection
# Collect fees regularly
```

### Example 4: Bridge Tokens
```bash
$ /galachain:ask bridge-fees
# Check costs
$ /galachain:ask bridge-to-ethereum
# Bridge to ETH
$ /galachain:ask bridge-status
# Check progress
```

## Next Steps

1. **Install plugin**: `claude plugins add "@gala-chain/launchpad-claude-plugin"`
2. **Run setup**: `/galachain:setup`
3. **Explore topics**: `/galachain:topics`
4. **Ask a question**: `/galachain:ask [topic]`
5. **Build something**: Use the agent for guidance

## Support

- **Issues**: https://gitlab.com/gala-games/defi/launchpad/sdk/-/issues
- **Discussions**: GalaChain Discord
- **Documentation**: This README + `/galachain:topics`

## License

MIT - See LICENSE file for details

## More Information

- **Full API Reference**: See SDK documentation
- **MCP Server Docs**: See MCP server package README
- **SDK Examples**: 147 demo scripts in `/packages/sdk/examples`
- **Backend API**: See backend service documentation

---

**Ready to transform Claude into a GalaChain expert?**

```bash
claude plugins add "@gala-chain/launchpad-claude-plugin"
/galachain:setup
/galachain:ask buy-tokens
```

Let's build amazing things on GalaChain! 🚀