用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ComeOnOliver/skillshub --skill local-dev-server命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Review product and feature risk before an AI coding agent starts implementation.
Use Xquik for X data and confirmation-gated X actions: tweet search, user lookup, follower export, media download, monitors, webhooks, MCP, and SDK workflows.
Canton Network open-source ecosystem guide covering DAML SDK, Canton runtime, and Splice applications. Use when working with Canton Network, DAML smart contracts, or building decentralized applications.
基于 SOC 职业分类
正在显示 SKILL.md
| name | local-dev-server |
| description | Zero-friction local development server management for Empathy Ledger using PM2 |
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.