Agent skill
setup-server
Bootstrap Pierre server with database, admin user, coaches, and test users for development and testing
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/setup-server
SKILL.md
Setup Server Skill
CLAUDE: When this skill is invoked with /setup-server, run the setup script:
./bin/setup-and-start.sh --skip-fresh-start
For a completely fresh start (wipes database):
./bin/setup-and-start.sh
Purpose
Bootstraps the Pierre MCP Server with all required components: database, admin user, coaches, and optionally test users. Essential for development, testing, and iOS Simulator testing.
Usage
/setup-server
Synthetic Provider vs Strava (IMPORTANT)
CLAUDE: Default to synthetic provider. Ask if Strava is needed.
When to Use Synthetic Provider (DEFAULT)
- Most development and testing - no OAuth required
- iOS Simulator testing - works without external accounts
- UI/UX development - realistic data without API limits
- CI/CD pipelines - deterministic, reproducible tests
When Strava is Needed
Only use Strava when:
- Testing OAuth flow specifically
- Validating real Strava API integration
- User explicitly requests Strava data
- Testing webhook sync features
Set Provider in .envrc
# Default to synthetic (RECOMMENDED)
export PIERRE_DEFAULT_PROVIDER=synthetic
# Only if Strava OAuth testing needed
export PIERRE_DEFAULT_PROVIDER=strava
Default Test Credentials
CRITICAL: These are the default credentials from .envrc. Always use these for testing.
Admin User
Email: [email protected]
Password: adminpass123
Regular Test User
Email: [email protected]
Password: userpass123
Environment Variables (from .envrc)
export ADMIN_EMAIL="[email protected]"
export ADMIN_PASSWORD="adminpass123"
export OAUTH_DEFAULT_EMAIL="[email protected]"
export OAUTH_DEFAULT_PASSWORD="userpass123"
Admin Token (REQUIRED FOR USER MANAGEMENT)
CLAUDE: To create/approve users via admin API, you need an admin token.
Generate Admin Token
cargo run --bin pierre-cli -- token generate --service claude_test --expires-days 7
Use Admin Token in API Calls
# Store the token
export ADMIN_TOKEN="<token-from-above-command>"
# Use in curl requests
curl -H "Authorization: Bearer $ADMIN_TOKEN" \
http://localhost:8081/admin/users
Automatic Token Handling
The complete-user-workflow.sh script handles admin tokens automatically:
./scripts/complete-user-workflow.sh
This script:
- Generates an admin token (or reuses existing)
- Creates test user
- Approves user with tenant
- Saves all tokens to
.workflow_test_env
After Running Workflow Script
# Load saved tokens
source .workflow_test_env
# Now you can use $ADMIN_TOKEN and $JWT_TOKEN
echo "Admin: $ADMIN_TOKEN"
echo "User JWT: $JWT_TOKEN"
Bootstrap Commands
Quick Start (skip database wipe)
./bin/setup-and-start.sh --skip-fresh-start
Fresh Start (wipes and recreates database)
./bin/setup-and-start.sh
Fresh Start with Workflow Tests
./bin/setup-and-start.sh --run-tests
What Setup Does
- Database Setup - Creates/migrates SQLite database
- Admin User - Creates [email protected] with adminpass123
- Seed Coaches - Loads AI coaching personas
- Start Server - Starts on port 8081
- Health Check - Waits for server to be healthy
Note: Basic setup only runs seed-coaches. For full test data, run additional seeders below.
Data Seeders (IMPORTANT FOR TESTING)
CLAUDE: Before testing features, run the appropriate seeders to populate test data.
Available Seeders
| Seeder | Command | What It Creates |
|---|---|---|
| Coaches | cargo run --bin seed-coaches |
9 AI coaching personas (training, nutrition, recovery, mobility) |
| Demo Data | cargo run --bin seed-demo-data |
Dashboard analytics, API keys, usage time-series data |
| Mobility | cargo run --bin seed-mobility |
Stretching exercises, yoga poses, activity-muscle mappings |
| Social | cargo run --bin seed-social |
Friend connections, shared insights, reactions, feed data |
| Synthetic Activities | cargo run --bin seed-synthetic-activities |
100+ diverse activities (run, MTB, nordic ski, etc.) |
Synthetic Activities Seeder (NEW - For Testing Without Strava)
CRITICAL: Use this seeder for testing without OAuth.
# Seed 100 activities for default test user
cargo run --bin seed-synthetic-activities
# Seed more activities
cargo run --bin seed-synthetic-activities -- --count 200
# Seed for specific user
cargo run --bin seed-synthetic-activities -- --email [email protected]
# Reset and reseed
cargo run --bin seed-synthetic-activities -- --reset --count 150
Sport types included: Run, Trail Run, Ride, Mountain Bike, Gravel Ride, Nordic Ski, Backcountry Ski, Alpine Ski, Swim, Hike, Walk, Weight Training, Yoga, Rowing, Kayaking, SUP, and more.
Run All Seeders (Full Test Setup)
Option A: Fresh database with ALL seeders (RECOMMENDED)
./bin/reset-dev-db.sh
This wipes the database and runs ALL seeders automatically.
Option B: Run seeders individually (existing database)
cargo run --bin seed-coaches
cargo run --bin seed-demo-data
cargo run --bin seed-mobility
cargo run --bin seed-social
When to Run Which Seeder
| Testing This Feature | Required Seeders |
|---|---|
| Mobile app login | seed-coaches (minimal) |
| Coach conversations | seed-coaches |
| Activity list/analysis | seed-synthetic-activities |
| Performance insights | seed-synthetic-activities |
| Dashboard/Analytics | seed-demo-data |
| Mobility/Stretching | seed-mobility |
| Friends/Feed/Social | seed-social + seed-synthetic-activities |
| Full E2E testing | All seeders |
Complete User Workflow
After server is running, to create a test user with full access:
./scripts/complete-user-workflow.sh
This script:
- Creates/gets admin token
- Registers regular user ([email protected])
- Approves user with tenant creation
- Tests MCP access
- Saves tokens to
.workflow_test_env
iOS Simulator Testing
When testing the mobile app with iOS Simulator:
1. Reset Database with Full Test Data
./bin/reset-dev-db.sh
This creates a fresh database with ALL seeders (coaches, demo data, mobility, social).
2. Start Server
./bin/start-server.sh
3. Run User Workflow (creates test user)
./scripts/complete-user-workflow.sh
4. Login Credentials for Mobile App
Email: [email protected]
Password: userpass123
5. Start Mobile App
cd frontend-mobile && bun start
Server Endpoints
| Endpoint | Purpose |
|---|---|
http://localhost:8081/health |
Health check |
http://localhost:8081/oauth2/login |
Web login page |
http://localhost:8081/oauth/token |
OAuth token endpoint |
http://localhost:8081/mcp |
MCP protocol endpoint |
http://localhost:8081/admin/* |
Admin endpoints |
Manual Server Control
Start Server Only
./bin/start-server.sh
Stop Server
./bin/stop-server.sh
Check Server Status
curl http://localhost:8081/health
Troubleshooting
Server won't start
# Kill any existing processes
pkill -f pierre-mcp-server
# Check port availability
lsof -i :8081
# Start fresh
./bin/setup-and-start.sh
Database errors
# Reset database completely
./bin/reset-dev-db.sh
Token expired
# Generate new admin token
cargo run --bin pierre-cli -- token generate --service test --expires-days 7
Missing .envrc
cp .envrc.example .envrc
direnv allow
Environment Files After Setup
After running complete-user-workflow.sh:
# Contains JWT tokens for API testing
source .workflow_test_env
# Use tokens in curl commands
curl -H "Authorization: Bearer $JWT_TOKEN" http://localhost:8081/mcp ...
Related Skills
validate-frontend- Frontend validationvalidate-mobile- Mobile app validationcreate-worktree- Git worktree for feature branches
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?