Environment Setup Guide
Overview
Help developers set up complete development environments from scratch. This skill provides step-by-step guidance for installing tools, configuring dependencies, setting up environment variables, and verifying the setup works correctly.
When to Use This Skill
- Use when starting a new project and need to set up the development environment
- Use when onboarding new team members to a project
- Use when switching to a new machine or operating system
- Use when troubleshooting environment-related issues
- Use when documenting setup instructions for a project
- Use when creating development environment documentation
How It Works
Step 1: Identify Requirements
I'll help you determine what needs to be installed:
- Programming language and version (Node.js, Python, Go, etc.)
- Package managers (npm, pip, cargo, etc.)
- Database systems (PostgreSQL, MongoDB, Redis, etc.)
- Development tools (Git, Docker, IDE extensions, etc.)
- Environment variables and configuration files
Step 2: Check Current Setup
Before installing anything, I'll help you check what's already installed:
# Check versions of installed tools
node --version
python --version
git --version
docker --version
Step 3: Provide Installation Instructions
I'll give platform-specific installation commands:
- macOS: Using Homebrew
- Linux: Using apt, yum, or package manager
- Windows: Using Chocolatey, Scoop, or direct installers
Step 4: Configure the Environment
Help set up:
- Environment variables (.env files)
- Configuration files (.gitconfig, .npmrc, etc.)
- IDE settings (VS Code, IntelliJ, etc.)
- Shell configuration (.bashrc, .zshrc, etc.)
Step 5: Verify Installation
Provide verification steps to ensure everything works:
- Run version checks
- Test basic commands
- Verify database connections
- Check environment variables are loaded
Examples
Example 1: Node.js Project Setup
## Setting Up Node.js Development Environment
### Prerequisites
- macOS, Linux, or Windows
- Terminal/Command Prompt access
- Internet connection
### Step 1: Install Node.js
**macOS (using Homebrew):**
\`\`\`bash
# Install Homebrew if not installed
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
curl -fsSLo "$tmpdir/homebrew-install.sh" https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh
cat "$tmpdir/homebrew-install.sh" # review the full installer before executing
/bin/bash "$tmpdir/homebrew-install.sh"
# Install Node.js
brew install node
\`\`\`
**Linux (Ubuntu/Debian):**
\`\`\`bash
# Update package list
sudo apt update
# Install Node.js and npm
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
curl -fsSLo "$tmpdir/nodesource-setup.sh" https://deb.nodesource.com/setup_20.x
cat "$tmpdir/nodesource-setup.sh" # review the full installer before sudo
sudo -E bash "$tmpdir/nodesource-setup.sh"
sudo apt install -y nodejs
\`\`\`
**Windows (using winget):**
\`\`\`powershell
# Install Node.js
winget install OpenJS.NodeJS.LTS
\`\`\`
### Step 2: Verify Installation
\`\`\`bash
node --version # Should show v20.x.x or higher
npm --version # Should show 10.x.x or higher
\`\`\`
### Step 3: Install Project Dependencies
\`\`\`bash
# Clone the repository
git clone https://github.com/your-repo/project.git
cd project
# Install dependencies
npm install
\`\`\`
### Step 4: Set Up Environment Variables
Create a \`.env\` file:
\`\`\`bash
# Copy example environment file
cp .env.example .env
# Edit with your values
nano .env
\`\`\`
Example \`.env\` content:
\`\`\`
NODE_ENV=development
PORT=3000
DATABASE_URL=postgresql://localhost:5432/mydb
API_KEY=your-api-key-here
\`\`\`
### Step 5: Run the Project
\`\`\`bash
# Start development server
npm run dev
# Should see: Server running on http://localhost:3000
\`\`\`
### Troubleshooting
**Problem:** "node: command not found"
**Solution:** Restart your terminal or run \`source ~/.bashrc\` (Linux) or \`source ~/.zshrc\` (macOS)
**Problem:** "Permission denied" errors
**Solution:** Don't use sudo with npm. Fix permissions:
\`\`\`bash
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
\`\`\`
Example 2: Python Project Setup
## Setting Up Python Development Environment
### Step 1: Install Python
**macOS:**
\`\`\`bash
brew install python@3.11
\`\`\`
**Linux:**
\`\`\`bash
sudo apt update
sudo apt install python3.11 python3.11-venv python3-pip
\`\`\`
**Windows:**
\`\`\`powershell
choco install python --version=3.11
\`\`\`
### Step 2: Verify Installation
\`\`\`bash
python3 --version # Should show Python 3.11.x
pip3 --version # Should show pip 23.x.x
\`\`\`
### Step 3: Create Virtual Environment
\`\`\`bash
# Navigate to project directory
cd my-project
# Create virtual environment
python3 -m venv venv
# Activate virtual environment
# macOS/Linux:
source venv/bin/activate
# Windows:
venv\Scripts\activat
1---2name: environment-setup-guide3description: Guide developers through setting up development environments with proper tools, dependencies, and configurations4---567# Environment Setup Guide89## Overview1011Help developers set up complete development environments from scratch. This skill provides step-by-step guidance for installing tools, configuring dependencies, setting up environment variables, and verifying the setup works correctly.1213## When to Use This Skill1415- Use when starting a new project and need to set up the development environment16- Use when onboarding new team members to a project17- Use when switching to a new machine or operating system18- Use when troubleshooting environment-related issues19- Use when documenting setup instructions for a project20- Use when creating development environment documentation2122## How It Works2324### Step 1: Identify Requirements2526I'll help you determine what needs to be installed:27- Programming language and version (Node.js, Python, Go, etc.)28- Package managers (npm, pip, cargo, etc.)29- Database systems (PostgreSQL, MongoDB, Redis, etc.)30- Development tools (Git, Docker, IDE extensions, etc.)31- Environment variables and configuration files3233### Step 2: Check Current Setup3435Before installing anything, I'll help you check what's already installed:36```bash37# Check versions of installed tools38node --version39python --version40git --version41docker --version42```4344### Step 3: Provide Installation Instructions4546I'll give platform-specific installation commands:47- **macOS:** Using Homebrew48- **Linux:** Using apt, yum, or package manager49- **Windows:** Using Chocolatey, Scoop, or direct installers5051### Step 4: Configure the Environment5253Help set up:54- Environment variables (.env files)55- Configuration files (.gitconfig, .npmrc, etc.)56- IDE settings (VS Code, IntelliJ, etc.)57- Shell configuration (.bashrc, .zshrc, etc.)5859### Step 5: Verify Installation6061Provide verification steps to ensure everything works:62- Run version checks63- Test basic commands64- Verify database connections65- Check environment variables are loaded6667## Examples6869### Example 1: Node.js Project Setup7071```markdown72## Setting Up Node.js Development Environment7374### Prerequisites75- macOS, Linux, or Windows76- Terminal/Command Prompt access77- Internet connection7879### Step 1: Install Node.js8081**macOS (using Homebrew):**82\`\`\`bash83# Install Homebrew if not installed84tmpdir="$(mktemp -d)"85trap 'rm -rf "$tmpdir"' EXIT86curl -fsSLo "$tmpdir/homebrew-install.sh" https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh87cat "$tmpdir/homebrew-install.sh" # review the full installer before executing88/bin/bash "$tmpdir/homebrew-install.sh"8990# Install Node.js91brew install node92\`\`\`9394**Linux (Ubuntu/Debian):**95\`\`\`bash96# Update package list97sudo apt update9899# Install Node.js and npm100tmpdir="$(mktemp -d)"101trap 'rm -rf "$tmpdir"' EXIT102curl -fsSLo "$tmpdir/nodesource-setup.sh" https://deb.nodesource.com/setup_20.x103cat "$tmpdir/nodesource-setup.sh" # review the full installer before sudo104sudo -E bash "$tmpdir/nodesource-setup.sh"105sudo apt install -y nodejs106\`\`\`107108**Windows (using winget):**109\`\`\`powershell110# Install Node.js111winget install OpenJS.NodeJS.LTS112\`\`\`113114### Step 2: Verify Installation115116\`\`\`bash117node --version # Should show v20.x.x or higher118npm --version # Should show 10.x.x or higher119\`\`\`120121### Step 3: Install Project Dependencies122123\`\`\`bash124# Clone the repository125git clone https://github.com/your-repo/project.git126cd project127128# Install dependencies129npm install130\`\`\`131132### Step 4: Set Up Environment Variables133134Create a \`.env\` file:135\`\`\`bash136# Copy example environment file137cp .env.example .env138139# Edit with your values140nano .env141\`\`\`142143Example \`.env\` content:144\`\`\`145NODE_ENV=development146PORT=3000147DATABASE_URL=postgresql://localhost:5432/mydb148API_KEY=your-api-key-here149\`\`\`150151### Step 5: Run the Project152153\`\`\`bash154# Start development server155npm run dev156157# Should see: Server running on http://localhost:3000158\`\`\`159160### Troubleshooting161162**Problem:** "node: command not found"163**Solution:** Restart your terminal or run \`source ~/.bashrc\` (Linux) or \`source ~/.zshrc\` (macOS)164165**Problem:** "Permission denied" errors166**Solution:** Don't use sudo with npm. Fix permissions:167\`\`\`bash168mkdir ~/.npm-global169npm config set prefix '~/.npm-global'170echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc171source ~/.bashrc172\`\`\`173```174175### Example 2: Python Project Setup176177```markdown178## Setting Up Python Development Environment179180### Step 1: Install Python181182**macOS:**183\`\`\`bash184brew install python@3.11185\`\`\`186187**Linux:**188\`\`\`bash189sudo apt update190sudo apt install python3.11 python3.11-venv python3-pip191\`\`\`192193**Windows:**194\`\`\`powershell195choco install python --version=3.11196\`\`\`197198### Step 2: Verify Installation199200\`\`\`bash201python3 --version # Should show Python 3.11.x202pip3 --version # Should show pip 23.x.x203\`\`\`204205### Step 3: Create Virtual Environment206207\`\`\`bash208# Navigate to project directory209cd my-project210211# Create virtual environment212python3 -m venv venv213214# Activate virtual environment215# macOS/Linux:216source venv/bin/activate217218# Windows:219venv\Scripts\activat