| name | local-dev-setup |
| description | Setup local development environment from scratch for this project |
| auto-activates | ["dev setup","local environment","install dependencies","setup development","getting started"] |
Skill: Local Development Setup
When to Use This Skill
This skill activates when you need to:
- Set up the project for local development from scratch
- Install all dependencies
- Configure environment variables
- Verify the setup works
Prerequisites
- Git installed
- Basic development tools for the tech stack (Python/Node/Go/etc.)
- Text editor or IDE
Step-by-Step Workflow
Step 1: Clone Repository (if needed)
git clone <repository-url>
cd <project-directory>
Step 2: Detect Tech Stack
Look for indicators:
package.json → Node.js/JavaScript
requirements.txt or pyproject.toml → Python
go.mod → Go
Cargo.toml → Rust
Gemfile → Ruby
pom.xml or build.gradle → Java
Step 3: Install Dependencies by Tech Stack
Python
Check Python version:
python --version
python3 --version
Option A: pip + virtualenv
python -m venv venv
source venv/bin/activate
venv\Scripts\activate
pip install -r requirements.txt
pip install -r requirements-dev.txt
Option B: Poetry
curl -sSL https://install.python-poetry.org | python3 -
poetry install
poetry shell
Option C: Pipenv
pip install pipenv
pipenv install --dev
pipenv shell
Option D: conda
conda create -n projectname python=3.10
conda activate projectname
conda install --file requirements.txt
pip install -r requirements.txt
JavaScript/TypeScript (Node.js)
Check Node version:
node --version
npm --version
Install Node.js if needed:
Install dependencies:
Option A: npm
npm install
Option B: yarn
npm install -g yarn
yarn install
Option C: pnpm
npm install -g pnpm
pnpm install
Go
Check Go version:
go version
Install dependencies:
go mod download
go mod verify
go mod tidy
Rust
Check Rust version:
rustc --version
cargo --version
Install Rust if needed:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Install dependencies:
cargo build
Ruby
Check Ruby version:
ruby --version
Install dependencies:
gem install bundler
bundle install
Java (Maven)
Check Java version:
java -version
mvn --version
Install dependencies:
mvn clean install
Java (Gradle)
Install dependencies:
./gradlew build
Step 4: Configure Environment Variables
Check for environment variable requirements:
- Look for
.env.example, .env.template, or .env.sample
- Check README for required variables
- Look for config files mentioning environment variables
Create .env file:
cp .env.example .env
nano .env
Common environment variables to set:
DATABASE_URL=postgresql://localhost:5432/dbname
DB_HOST=localhost
DB_PORT=5432
DB_NAME=mydb
DB_USER=user
DB_PASSWORD=password
API_KEY=your_api_key_here
SECRET_KEY=your_secret_key_here
ENVIRONMENT=development
DEBUG=true
LOG_LEVEL=debug
PORT=3000
API_PORT=8000
Step 5: Initialize Database (if applicable)
Check for database setup scripts:
- db/schema.sql
- migrations/
- init.sql
- seeds/
Common database setup:
Python (Django):
python manage.py migrate
python manage.py createsuperuser
python manage.py loaddata initial_data
Python (Flask/SQLAlchemy):
flask db upgrade
flask seed
Node.js (Prisma):
npx prisma migrate dev
npx prisma db seed
Node.js (Sequelize):
npx sequelize-cli db:migrate
npx sequelize-cli db:seed:all
Ruby on Rails:
rails db:create
rails db:migrate
rails db:seed
Step 6: Build Project (if applicable)
JavaScript/TypeScript:
npm run build
Go:
go build
Rust:
cargo build --release
Java (Maven):
mvn package
Step 7: Run Development Server
Check {{dev_command}} or look for:
- README instructions
package.json scripts
- Makefile targets
- Documentation
Common dev commands:
Python (Django):
python manage.py runserver
Python (Flask):
flask run
python app.py
Python (FastAPI):
uvicorn main:app --reload
Node.js:
npm run dev
npm start
Go:
go run main.go
air
Rust:
cargo run
cargo watch -x run
Ruby on Rails:
rails server
Step 8: Verify Setup
Run tests:
{{test_command}}
pytest
npm test
go test ./...
cargo test
Access the application:
- Check README for default port
- Common ports: 3000, 8000, 8080, 5000
- Visit:
http://localhost:PORT
Check logs:
- Ensure no error messages
- Verify database connections work
- Check API endpoints respond
Common Issues and Solutions
Issue: Dependencies fail to install
Solutions:
- Clear package cache
- npm:
npm cache clean --force
- pip:
pip cache purge
- go:
go clean -modcache
- Update package manager:
npm install -g npm@latest
- Check for system dependencies (build tools, libraries)
- Try with
--legacy-peer-deps (npm) or --force
Issue: Database connection fails
Solutions:
- Verify database is running:
docker ps or systemctl status postgresql
- Check connection string format
- Verify credentials
- Check firewall/port access
- Try connecting with database client first
Issue: Environment variables not loading
Solutions:
- Check .env file exists and is in root directory
- Verify .env not in .gitignore (it should be!)
- Check framework-specific env loading (dotenv, etc.)
- Try explicit export:
export $(cat .env | xargs)
Issue: Port already in use
Solutions:
- Find process using port:
lsof -i :3000
- Kill process:
kill -9 <PID>
- Change port in configuration
- Check for other dev servers running
Issue: Module/import not found
Solutions:
- Reinstall dependencies
- Check package is in package.json/requirements.txt
- Activate virtual environment
- Clear and reinstall node_modules or venv
- Check import path spelling
Success Criteria
- ✅ All dependencies installed without errors
- ✅ Environment variables configured
- ✅ Database initialized (if applicable)
- ✅ Development server starts successfully
- ✅ Tests run and pass
- ✅ Application accessible in browser/API works
Quick Checklist
git clone <url> && cd <project>
[npm install | pip install -r requirements.txt | go mod download]
cp .env.example .env && nano .env
[migration commands]
[npm run dev | flask run | go run main.go]
[npm test | pytest | go test ./...]
Related Skills
- pytest-setup - Configure testing
- code-formatting - Setup formatters/linters
- git-workflow - Git branch and commit workflow
- ci-pipeline - CI/CD setup
Documentation References