bags-dev-kit
install
source · Clone the upstream repo
git clone https://github.com/LoserLab/bags-dev-kit
Claude Code · Install into ~/.claude/skills/
git clone --depth=1 https://github.com/LoserLab/bags-dev-kit ~/.claude/skills/loserlab-bags-dev-kit-bags-dev-kit
manifest:
SKILL.mdsource content
Bags Dev Kit
The developer toolkit for building on Bags.fm. Not an API wrapper. A build system.
Bags.fm is a creator-focused token launch and trading platform on Solana. Creators earn 1% from every trade via programmable fee sharing. Tokens launch on Meteora Dynamic Bonding Curves and migrate to Meteora DAMM v2 pools after graduation.
Config
All config lives at
~/.bags-dev-kit/config.json. Created by /bags-dev-kit:setup.
{ "apiKey": "your-bags-api-key", "defaultWallet": "optional-solana-pubkey" }
API keys are free. Get one at https://dev.bags.fm (max 10 per account).
Routing Logic (Run Every Invocation)
- Check config. Read
. If missing, tell the user to run~/.bags-dev-kit/config.json
first./bags-dev-kit:setup - Match intent to command. Use the table below.
- Load references on-demand. Only read reference files when the task requires deep knowledge. Never load all references at once.
| User Intent | Command | Reference to Load |
|---|---|---|
| Set up API key | | None |
| Scaffold a new Bags project | | |
| Explore tokens, pools, feeds | | None (scripts handle it) |
| Launch a token | | , |
| Analyze token performance / fees | | |
| Write code using Bags API/SDK | (no command; load reference) | |
| Security review of Bags code | (no command; load reference) | |
| Optimize fee share config | (no command; load reference) | |
Scripts
All scripts live at the skill root under
scripts/ and run via npx tsx. They use native fetch with zero external dependencies.
Every script reads the API key from
~/.bags-dev-kit/config.json automatically. If the config is missing, scripts exit with a clear error.
| Script | Purpose | Example |
|---|---|---|
| Get swap quotes | |
| Check claimable fees | |
| List/search pools | |
| Find wallet by social handle | |
| Get token feed / details | |
| Analyze token fees + performance | |
Replace
<skill> with the actual skill directory path: ~/.claude/skills/bags-dev-kit.
Rules
- Never handle private keys in scripts. Read-only operations run directly. Write operations (launch, swap, claim) generate code for the user to integrate into their project.
- Always confirm before generating write transactions. Show the user exactly what will happen (amounts, recipients, fee splits) and get explicit approval.
- Load references progressively. Only read reference files when the current task needs that knowledge. The SKILL.md body is always available; references are supplementary.
- Use the Bags SDK (
) when generating project code. Use raw fetch in skill scripts to avoid dependency overhead.@bagsfm/bags-sdk - Default to Jito-protected transactions when generating swap or launch code. Never generate code that submits transactions without MEV protection unless the user explicitly opts out.
- Fee share splits must total 10,000 basis points (100%). Validate this before generating any fee config code.
- Present, don't assume. Always show quotes, fee breakdowns, and transaction details to the user before proceeding.
Key Constants
API Base URL: https://public-api-v2.bags.fm/api/v1 Auth Header: x-api-key: <key> Rate Limit: 1,000 requests/hour WSOL Mint: So11111111111111111111111111111111111111112 Bags Global LUT: Use BAGS_GLOBAL_LUT constant from @bagsfm/bags-sdk
Ecosystem Context
When helping users build on Bags, keep these in mind:
- Tokens have 4 lifecycle stages: PRE_LAUNCH → PRE_GRAD (on bonding curve) → MIGRATING → MIGRATED (on DAMM v2)
- Fee sharing is the core primitive. Up to 100 co-earners per token, splits defined in basis points. This is what makes Bags different from Pump.fun.
- The Partner system lets platforms earn fees from tokens launched through them. Great for building launch platforms, aggregators, or tools.
- Agent auth is first-class. AI agents can authenticate via Moltbook, get JWTs (365-day validity), and operate wallets. Bags treats agents as equal citizens.
- Bags Play CLI (
) is the official tool for programmable fee automation.curl -fsSL https://play.bags.fm/install.sh | bash
Template Projects
When scaffolding, copy from
templates/ in the skill directory and customize. Three starter architectures are included:
| Template | Use Case | Stack |
|---|---|---|
| App that earns from token trades | Next.js + Bags SDK + Privy |
| Automated trading with Jito MEV protection | Node.js + Bags SDK + Helius |
| Platform for launching tokens with fee configs | Next.js + Bags SDK + Privy + Meteora |
Each template includes a working
bags-client.ts with typed API methods and environment variable setup via .env.example.