From claude-commands
Copies Firebase campaigns between users for testing via Admin SDK. Finds source user automatically by campaign ID or title, then duplicates the campaign and its subcollections to a destination user.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-commands:firebase-campaign-copyThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Copy production campaigns across users for testing without auth bypass, using Firebase Admin SDK.
Copy production campaigns across users for testing without auth bypass, using Firebase Admin SDK.
export WORLDAI_DEV_MODE=true
export WORLDAI_GOOGLE_APPLICATION_CREDENTIALS=~/serviceAccountKey.json
Location: scripts/copy_campaign.py
Features:
# Auto-finds source user, copies to destination user
WORLDAI_DEV_MODE=true \
WORLDAI_GOOGLE_APPLICATION_CREDENTIALS=~/serviceAccountKey.json \
python scripts/copy_campaign.py \
--find-by-id JXXNfJpdqNtH60HN942q \
--dest-user-id 0wf6sCREyLcgynidU5LjyZEfm7D2 \
--suffix "(test copy)"
# Searches all users for matching title
WORLDAI_DEV_MODE=true \
WORLDAI_GOOGLE_APPLICATION_CREDENTIALS=~/serviceAccountKey.json \
python scripts/copy_campaign.py \
--find-by-title "gaia julia v2" \
--dest-user-id 0wf6sCREyLcgynidU5LjyZEfm7D2
WORLDAI_DEV_MODE=true \
WORLDAI_GOOGLE_APPLICATION_CREDENTIALS=~/serviceAccountKey.json \
python scripts/copy_campaign.py \
SOURCE_UID \
SOURCE_CAMPAIGN_ID \
--dest-user-id DEST_UID
Use campaign_manager.py:
WORLDAI_DEV_MODE=true \
WORLDAI_GOOGLE_APPLICATION_CREDENTIALS=~/serviceAccountKey.json \
python scripts/campaign_manager.py find-user <[email protected]>
Output:
✅ Found user: <[email protected]>
🆔 Firebase UID: 0wf6sCREyLcgynidU5LjyZEfm7D2
Scenario: Copy campaign JXXNfJpdqNtH60HN942q from $[email protected] to [email protected]
Steps:
# 1. Find destination user UID
WORLDAI_DEV_MODE=true python scripts/campaign_manager.py find-user <[email protected]>
# Output: 0wf6sCREyLcgynidU5LjyZEfm7D2
# 2. Copy campaign (auto-finds source user)
WORLDAI_DEV_MODE=true python scripts/copy_campaign.py \
--find-by-id JXXNfJpdqNtH60HN942q \
--dest-user-id 0wf6sCREyLcgynidU5LjyZEfm7D2 \
--suffix "(test copy)"
# Output:
# ✅ Created new campaign: qwN7EwNqbJXnl5y3Npjj
# 📝 Name: gaia julia v2 (test copy)
# ✅ Copied 362 documents from story
# ✅ Copied 1 documents from game_states
Success:
✅ Created new campaign: qwN7EwNqbJXnl5y3Npjj
📝 Name: gaia julia v2 (test copy)
✅ Copied 362 documents from story
✅ Copied 1 documents from game_states
✅ Campaign copied successfully!
📋 Campaign ID: qwN7EwNqbJXnl5y3Npjj
💡 To access: Use your environment's base URL + /game/qwN7EwNqbJXnl5y3Npjj
When a bug is reported, copy the campaign immediately so the reproduction uses the exact state at the time of report (not a later mutated state).
# 1) Copy the campaign immediately (preserves all fields + subcollections).
# Use a timestamped suffix so we can trace the report state later.
WORLDAI_DEV_MODE=true \
WORLDAI_GOOGLE_APPLICATION_CREDENTIALS=~/serviceAccountKey.json \
python scripts/copy_campaign.py \
--find-by-id <CAMPAIGN_ID> \
--dest-user-id <DEST_UID> \
--suffix "(bug report 2026-02-02T02:03Z)"
# Output includes the new campaign ID:
# ✅ Created new campaign: <NEW_CAMPAIGN_ID>
# 2) Capture the copied game state for reproducibility.
WORLDAI_DEV_MODE=true \
WORLDAI_GOOGLE_APPLICATION_CREDENTIALS=~/serviceAccountKey.json \
python scripts/fetch_campaign_gamestate.py <NEW_CAMPAIGN_ID>
# 3) Export the story log for context (optional but recommended).
WORLDAI_DEV_MODE=true \
WORLDAI_GOOGLE_APPLICATION_CREDENTIALS=~/serviceAccountKey.json \
python scripts/download_campaign.py --uid <DEST_UID> \
--campaign-id <NEW_CAMPAIGN_ID> --output-dir /tmp/your-project.com/bug_repros
Testing with Production Data
User Data Migration
Campaign Duplication
See also:
scripts/campaign_manager.py - Query campaigns, analytics, deletionscripts/CLAUDE.md - Full Firebase operations documentation.claude/skills/firebase-prod-campaigns.md - Production campaign queriesnpx claudepluginhub jleechanorg/claude-commands --plugin claude-commandsQueries production Firestore for user-campaign data, with correct nested path under users/{uid}/campaigns/{id} and game state in subcollections.
Guides Firebase usage including Auth, Firestore, Realtime DB, Cloud Functions, Storage, and Hosting. Covers security rules, data modeling for query patterns, and denormalization.
Guides setup and management of Firebase Remote Config, including SDK integration (Android/iOS), template management via CLI, and best practices for feature flags.