
local-dev-workflow
by imehr
SKILL.md
name: local-dev-workflow description: Standards for creating robust local development startup scripts triggers:
- start.sh
- local dev
- startup script
- run locally
- dev server
Local Development Workflow Skill
This skill guides the creation of start.sh scripts that ensure a reliable, conflict-free local development environment.
Core Philosophy
- Port Sovereignty: Every project gets unique ports (e.g., 3456, 7200) to avoid conflicts with other running projects. Never use default 3000/8000/8080.
- Idempotency: The script must be safely re-runnable. It should aggressively find and kill any process holding its ports before starting.
- Transparency: The script should output all running services, their PIDs, and their accessible URLs at the end.
- One-Click Start: A single script should handle everything: DB (Docker), Backend, Frontend, and Environment setup.
The Standard start.sh Pattern
When asked to "create a start script" or "how to run this locally", generate a start.sh that follows this structure:
- Define Configuration: Set ports and project names at the top.
- Cleanup Function: Include a robust
kill_portfunction usinglsof. - Pre-flight Checks: Check for Docker, Node versions, or
ulimit. - Environment Setup: Dynamically update
.envfiles or export vars to match the chosen ports. - Service Startup: Start dependencies (Docker) -> Backend -> Frontend.
- Dashboard Output: Print a clear summary of all services and URLs.
Common Tasks
1. Identify Services & Assign Ports
Analyze package.json, docker-compose.yml, or Cargo.toml.
Assign random-ish but memorable ports:
- Frontend: 3xxx (e.g., 3456)
- Backend: 7xxx (e.g., 7200)
- DB: 54xx (e.g., 5433 - avoid default 5432)
2. The kill_port Function
Always include this utility to ensure clean restarts:
kill_port() {
local port=$1
local pid=$(lsof -ti :$port)
if [ -n "$pid" ]; then
kill -9 $pid
fi
}
3. Handling Logs
Redirect logs to a file directory to keep stdout clean, or use a tool like concurrently if preferred by the user. For shell scripts, background processes & with log redirection is standard.
Reference
See resources/start-script-template.md for the canonical template.
Score
Total Score
Based on repository quality metrics
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
Reviews
Reviews coming soon