/issue-driven-development:environment-bootstrapfrom issue-driven-development
Creates and runs init scripts to set up consistent development environments across sessions, including dependency installation, environment file setup, builds, and smoke tests.
Ships in issue-driven-development. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Set up and maintain consistent development environments.
Core principle: Every session should start with a known-good environment.
Announce at start: "I'm using environment-bootstrap to set up the development environment."
| Situation | Action |
|---|---|
| First clone of repository | Create init script |
| Starting new session | Run init script |
| After pulling changes | Re-run init if deps changed |
| Environment seems broken | Run init to reset |
project/
├── scripts/
│ └── init.sh ← Standard location
├── package.json
└── ...
#!/usr/bin/env bash
set -euo pipefail
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo "=== Development Environment Bootstrap ==="
echo ""
# Step 1: Check prerequisites
echo "Checking prerequisites..."
check_command() {
if ! command -v "$1" &> /dev/null; then
echo -e "${RED}ERROR: $1 is required but not installed${NC}"
exit 1
fi
echo -e " ${GREEN}✓${NC} $1 found"
}
check_command node
check_command pnpm
check_command git
check_command gh
# Check Node version
REQUIRED_NODE="18"
CURRENT_NODE=$(node -v | cut -d'v' -f2 | cut -d'.' -f1)
if [ "$CURRENT_NODE" -lt "$REQUIRED_NODE" ]; then
echo -e "${RED}ERROR: Node $REQUIRED_NODE+ required, found $CURRENT_NODE${NC}"
exit 1
fi
echo -e " ${GREEN}✓${NC} Node version OK ($CURRENT_NODE)"
# Check gh authentication
if ! gh auth status &> /dev/null; then
echo -e "${RED}ERROR: gh CLI not authenticated. Run 'gh auth login'${NC}"
exit 1
fi
echo -e " ${GREEN}✓${NC} GitHub CLI authenticated"
echo ""
# Step 2: Install dependencies
echo "Installing dependencies..."
pnpm install --frozen-lockfile --silent
echo -e "${GREEN}✓${NC} Dependencies installed"
echo ""
# Step 3: Environment setup
echo "Setting up environment..."
if [ ! -f .env ]; then
if [ -f .env.example ]; then
cp .env.example .env
echo -e "${YELLOW}!${NC} Created .env from .env.example - review and update values"
else
echo -e "${YELLOW}!${NC} No .env file and no .env.example found"
fi
else
echo -e " ${GREEN}✓${NC} .env exists"
fi
echo ""
# Step 4: Build
echo "Building project..."
pnpm build --silent
echo -e "${GREEN}✓${NC} Build successful"
echo ""
# Step 5: Run tests
echo "Running tests..."
if pnpm test --silent; then
echo -e "${GREEN}✓${NC} Tests passed"
else
echo -e "${RED}✗${NC} Tests failed - environment may have issues"
exit 1
fi
echo ""
# Step 6: Start development services (if docker-compose exists)
if [ -f "docker-compose.yml" ] || [ -f "docker-compose.yaml" ]; then
echo "Starting development services..."
docker-compose up -d
echo "Waiting for services to be ready..."
sleep 5
# Verify postgres (if defined)
if docker-compose config --services 2>/dev/null | grep -q "postgres"; then
if docker-compose ps postgres 2>/dev/null | grep -q "Up"; then
echo -e "${GREEN}✓${NC} postgres ready"
else
echo -e "${RED}✗${NC} postgres failed to start"
fi
fi
# Verify redis (if defined)
if docker-compose config --services 2>/dev/null | grep -q "redis"; then
if docker-compose ps redis 2>/dev/null | grep -q "Up"; then
echo -e "${GREEN}✓${NC} redis ready"
else
echo -e "${RED}✗${NC} redis failed to start"
fi
fi
echo ""
fi
# Step 7: Start development server (optional)
if [ "${START_DEV_SERVER:-false}" = "true" ]; then
echo "Starting development server..."
pnpm dev &
DEV_PID=$!
# Wait for server to be ready
sleep 5
# Smoke test (IPv6-first: try [::1] before falling back to 127.0.0.1)
if curl -sf http://[::1]:3000/health > /dev/null; then
echo -e "${GREEN}✓${NC} Development server running on IPv6 (PID: $DEV_PID)"
elif curl -sf http://127.0.0.1:3000/health > /dev/null; then
echo -e "${YELLOW}!${NC} Development server running on IPv4 legacy (PID: $DEV_PID)"
else
echo -e "${RED}✗${NC} Development server not responding"
kill $DEV_PID 2>/dev/null
exit 1
fi
fi
echo ""
echo -e "${GREEN}=== Environment Ready ===${NC}"
echo ""
echo "Next steps:"
echo " pnpm dev - Start development server"
echo " pnpm test - Run tests"
echo " pnpm build - Build for production"
chmod +x scripts/init.sh
./scripts/init.sh
START_DEV_SERVER=true ./scripts/init.sh
git pull origin main
./scripts/init.sh
After environment setup, verify basic functionality:
| Test | How | Pass Criteria |
|---|---|---|
| Build | pnpm build | No errors |
| Tests | pnpm test | All pass |
| Dev server | pnpm dev | Server starts |
| Health check | curl http://[::1]:3000/health | 200 OK (IPv6-first) |
| Basic flow | Run E2E test | Passes |
#!/usr/bin/env bash
# scripts/smoke-test.sh
set -euo pipefail
echo "Running smoke tests..."
# Start dev server
pnpm dev &
DEV_PID=$!
sleep 10
# Health check (IPv6-first, fallback to IPv4 legacy)
if curl -sf http://[::1]:3000/health > /dev/null; then
echo "Health check passed (IPv6)"
elif curl -sf http://127.0.0.1:3000/health > /dev/null; then
echo "Health check passed (IPv4 legacy)"
else
echo "Health check failed"
kill $DEV_PID
exit 1
fi
# Basic E2E (if available)
if [ -f "tests/smoke.test.ts" ]; then
pnpm test:e2e tests/smoke.test.ts
fi
# Clean up
kill $DEV_PID
echo "Smoke tests passed"
## Development Setup
### Prerequisites
- Node.js 18+
- pnpm 8+
- GitHub CLI (`gh`) authenticated
### Quick Start
```bash
# Clone repository
git clone https://github.com/owner/repo.git
cd repo
# Run setup
./scripts/init.sh
# Start development
pnpm dev
Copy .env.example to .env and update:
| Variable | Description | Required |
|---|---|---|
| DATABASE_URL | PostgreSQL connection string | Yes |
| JWT_SECRET | Secret for signing tokens | Yes |
| API_KEY | External API key | No |
## Maintaining Init Scripts
### When to Update
Update the init script when:
- New prerequisite added
- New environment variable needed
- Build process changes
- New verification step needed
### Version in Commit
When updating init script:
```bash
git add scripts/init.sh
git commit -m "chore: Update init script for [change]"
| Issue | Solution |
|---|---|
| "command not found" | Install missing prerequisite |
| "permission denied" | chmod +x scripts/init.sh |
| "node version" | Use nvm: nvm use 18 |
| "pnpm install failed" | Delete node_modules, try again |
| "build failed" | Check for type errors, missing deps |
When environment is in unknown state:
# Nuclear option
rm -rf node_modules dist .cache .next
pnpm store prune
./scripts/init.sh
Init script should:
Environment documentation should:
This skill is called by:
session-start - Beginning of each sessionerror-recovery - Resetting environmentThis skill ensures:
What SKILL.md sets; muted values are Claude Code's defaults
opusThree short reads, in order
61 skills in this plugin
/acceptance-criteria-verificationUse after implementing features - verifies each acceptance criterion with structured testing and posts verification reports to the GitHub issue/agent-developmentAgent DevelopmentThis skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins./api-documentationUse when API code changes (routes, endpoints, schemas). Enforces Swagger/OpenAPI sync. Pauses work if documentation has drifted, triggering documentation-audit skill./apply-all-findingsUse after code review - implement ALL findings; any finding not fixed MUST have tracking issue created; no finding disappears without trace/autonomous-operationUse when starting any work session - establishes autonomous operation mode, overriding token limits and time pressure to work until goal is achieved/autonomous-orchestrationUse when user requests autonomous operation across multiple issues. Orchestrates parallel workers using Task tool, monitors with TaskOutput, handles SLEEP/WAKE cycles, and works until scope is complete without user intervention.npx claudepluginhub troykelly/claude-skills --plugin issue-driven-developmentOther plugins' skills for the same job