skills/acurioustractor/local-dev-server/SKILL.md
Zero-friction local development server management for Empathy Ledger using PM2
npx skillsauth add aiskillstore/marketplace local-dev-serverInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Purpose: Zero-friction local development server management for Empathy Ledger using PM2
Trigger: When user needs to start/stop/restart local dev server, or when "address already in use" errors occur
# Single project (Empathy Ledger only)
pm2 start empathy-ledger # Start server
pm2 restart empathy-ledger # Restart server
pm2 stop empathy-ledger # Stop server
pm2 logs empathy-ledger # View logs
# Full ACT ecosystem (all projects)
/Users/benknight/act-global-infrastructure/deployment/scripts/deploy-act-ecosystem.sh start
/Users/benknight/act-global-infrastructure/deployment/scripts/deploy-act-ecosystem.sh restart
/Users/benknight/act-global-infrastructure/deployment/scripts/deploy-act-ecosystem.sh stop
/Users/benknight/act-global-infrastructure/deployment/scripts/deploy-act-ecosystem.sh logs
Pain Points:
npm run dev is fragile and doesn't persistSolution:
npm run dev When:npm install -g pm2
The global ecosystem config already has Empathy Ledger configured at:
/Users/benknight/act-global-infrastructure/deployment/ecosystem.config.cjs
Empathy Ledger Config:
{
name: 'empathy-ledger',
script: '/Users/benknight/.nvm/versions/node/v20.19.3/bin/npm',
args: 'run dev',
cwd: '/Users/benknight/Code/empathy-ledger-v2',
env: {
PORT: 3001, // Note: Different from standalone (3030)
NODE_ENV: 'development',
},
autorestart: true,
max_restarts: 10,
min_uptime: '10s',
}
Start Server:
cd /Users/benknight/Code/empathy-ledger-v2
pm2 start npm --name "empathy-ledger-solo" -- run dev
Check Status:
pm2 list
View Logs:
pm2 logs empathy-ledger-solo
Restart After Code Changes:
pm2 restart empathy-ledger-solo
Stop Server:
pm2 stop empathy-ledger-solo
pm2 delete empathy-ledger-solo # Remove from PM2
Start All Projects (Recommended):
/Users/benknight/act-global-infrastructure/deployment/scripts/deploy-act-ecosystem.sh start
This starts:
Restart All:
/Users/benknight/act-global-infrastructure/deployment/scripts/deploy-act-ecosystem.sh restart
Stop All:
/Users/benknight/act-global-infrastructure/deployment/scripts/deploy-act-ecosystem.sh stop
View All Logs:
pm2 logs
Monitor All Projects:
pm2 monit
Problem: Port 3030 (or any port) is occupied
Solution 1: Kill Process and Restart with PM2
# Find and kill process on port
lsof -ti :3030 | xargs kill -9
# Start with PM2 for auto-recovery
pm2 start npm --name "empathy-ledger-solo" -- run dev
Solution 2: Use PM2 Restart (Handles Cleanup)
pm2 restart empathy-ledger
Solution 3: Use Ecosystem Script
/Users/benknight/act-global-infrastructure/deployment/scripts/deploy-act-ecosystem.sh restart
Check PM2 Status:
pm2 list
pm2 logs empathy-ledger --lines 50
Check Port Availability:
lsof -i :3030
lsof -i :3001 # If using ecosystem config
Force Kill and Restart:
pm2 delete empathy-ledger
lsof -ti :3030 | xargs kill -9
pm2 start npm --name "empathy-ledger-solo" -- run dev
Check Max Restarts:
pm2 logs empathy-ledger --err --lines 100
If you see "max restarts reached", there's likely a code error. Check the error logs:
cat /Users/benknight/act-global-infrastructure/deployment/logs/empathy-ledger-error.log
Increase Max Restarts (if needed):
Edit ecosystem config and increase max_restarts: 10 → max_restarts: 20
PM2 Doesn't Auto-Reload by Default
Option 1: Restart manually after changes:
pm2 restart empathy-ledger
Option 2: Enable watch mode (not recommended for Next.js):
pm2 start npm --name "empathy-ledger-solo" --watch -- run dev
Option 3: Use npm run dev directly for active development
Morning Startup:
/Users/benknight/act-global-infrastructure/deployment/scripts/deploy-act-ecosystem.sh start
Check All Running:
pm2 list
Work on Code (Auto-Restart Handles Crashes)
View Logs When Needed:
pm2 logs empathy-ledger
End of Day:
/Users/benknight/act-global-infrastructure/deployment/scripts/deploy-act-ecosystem.sh stop
Make Code Changes
Restart Server:
pm2 restart empathy-ledger
Wait 3-5 Seconds for Startup
Test API/Feature
Check Logs for Errors:
pm2 logs empathy-ledger --lines 20
# Start Supabase
npx supabase start
# Start Empathy Ledger with PM2
pm2 start npm --name "empathy-ledger-solo" -- run dev
# Both run together
pm2 list
# Run migration
npx supabase db push
# Restart server to load new schema
pm2 restart empathy-ledger
# Server already running via PM2
pm2 list
# Run test script
bash test-syndication.sh
# Logs show the requests
pm2 logs empathy-ledger --lines 30
| Command | Purpose |
|---------|---------|
| pm2 start <script> | Start a process |
| pm2 list | Show all processes |
| pm2 logs | View all logs (live) |
| pm2 logs <name> | View specific process logs |
| pm2 restart <name> | Restart process |
| pm2 stop <name> | Stop process |
| pm2 delete <name> | Remove from PM2 |
| pm2 monit | Open monitoring dashboard |
| pm2 flush | Clear all logs |
| pm2 save | Save current process list |
| pm2 startup | Enable PM2 on system boot |
Add to package.json:
{
"scripts": {
"dev": "next dev -p 3030",
"dev:pm2": "pm2 start npm --name empathy-ledger-solo -- run dev",
"dev:restart": "pm2 restart empathy-ledger-solo",
"dev:stop": "pm2 stop empathy-ledger-solo && pm2 delete empathy-ledger-solo",
"dev:logs": "pm2 logs empathy-ledger-solo"
}
}
Usage:
npm run dev:pm2 # Start with PM2
npm run dev:restart # Restart
npm run dev:logs # View logs
npm run dev:stop # Stop and remove
# Empathy Ledger shortcuts
alias el-start='pm2 start npm --name empathy-ledger-solo -- run dev'
alias el-restart='pm2 restart empathy-ledger-solo'
alias el-stop='pm2 stop empathy-ledger-solo && pm2 delete empathy-ledger-solo'
alias el-logs='pm2 logs empathy-ledger-solo'
alias el-status='pm2 list | grep empathy'
# ACT Ecosystem shortcuts
alias act-start='/Users/benknight/act-global-infrastructure/deployment/scripts/deploy-act-ecosystem.sh start'
alias act-restart='/Users/benknight/act-global-infrastructure/deployment/scripts/deploy-act-ecosystem.sh restart'
alias act-stop='/Users/benknight/act-global-infrastructure/deployment/scripts/deploy-act-ecosystem.sh stop'
alias act-logs='pm2 logs'
alias act-status='pm2 list'
Reload shell:
source ~/.zshrc # or source ~/.bashrc
Usage:
el-start # Start Empathy Ledger
el-restart # Restart
el-logs # View logs
el-stop # Stop
Location: /Users/benknight/act-global-infrastructure/deployment/scripts/deploy-act-ecosystem.sh
Commands:
./deploy-act-ecosystem.sh start # Start all projects
./deploy-act-ecosystem.sh stop # Stop all projects
./deploy-act-ecosystem.sh restart # Restart all projects
./deploy-act-ecosystem.sh status # Show status
./deploy-act-ecosystem.sh logs # Show all logs
./deploy-act-ecosystem.sh monitor # Open PM2 dashboard
Features:
/Users/benknight/act-global-infrastructure/deployment/logs/Ports:
Note: All projects use consistent ports across standalone and ecosystem modes
User sees:
Error: listen EADDRINUSE: address already in use :::3030
Claude Response:
# Kill existing process
lsof -ti :3030 | xargs kill -9
# Start with PM2 for reliability
pm2 start npm --name "empathy-ledger-solo" -- run dev
# Verify running
pm2 list
User says: "I fixed the schema, now restart the server"
Claude Response:
# If using PM2
pm2 restart empathy-ledger
# If using ecosystem
/Users/benknight/act-global-infrastructure/deployment/scripts/deploy-act-ecosystem.sh restart
# Wait for startup
sleep 5
# Test
curl http://localhost:3030
User says: "Test the syndication API"
Claude Response:
# Ensure server is running
pm2 list | grep empathy || pm2 start npm --name "empathy-ledger-solo" -- run dev
# Wait for startup
sleep 5
# Run test
bash test-syndication.sh
# Check logs if errors
pm2 logs empathy-ledger-solo --lines 50
Sprint Start:
act-start # Start all ACT projects
During Development:
# Make code changes
# ...
# Restart to test
pm2 restart empathy-ledger
# View logs
pm2 logs empathy-ledger
End of Sprint:
# Stop all projects
act-stop
# Or keep running if continuing tomorrow
pm2 save # Save current state
View Live Logs:
pm2 logs empathy-ledger
View Last N Lines:
pm2 logs empathy-ledger --lines 100
View Error Logs Only:
pm2 logs empathy-ledger --err
Clear All Logs:
pm2 flush
Log File Locations (Ecosystem):
/Users/benknight/act-global-infrastructure/deployment/logs/empathy-ledger-out.log
/Users/benknight/act-global-infrastructure/deployment/logs/empathy-ledger-error.log
Trigger Phrases:
Actions Claude Should Take:
Check if server is running:
pm2 list | grep empathy
If not running, start it:
pm2 start npm --name "empathy-ledger-solo" -- run dev
If running but needs restart:
pm2 restart empathy-ledger-solo
Wait for startup:
sleep 5
Verify responsive:
curl -s http://localhost:3030 > /dev/null && echo "✅ Server running" || echo "❌ Server not responding"
Proceed with testing/development
After following this skill, user should:
This skill eliminates the "local deployment shit fight" by providing a consistent, reliable, PM2-based workflow that aligns with the ACT ecosystem deployment strategy.
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.