Env setup

From weisser-dev/awesome-opencode · View interactive version

Env setup is an AI agent skill from the GitHub repository weisser-dev/awesome-opencode. Bootstrap developer environment by detecting project type, listing prerequisites, generating .env.example, and producing a Getting Started guide

How to use this skill

Skill file

What I do

When to use me

Use this skill when you need to:

Process

  1. Detect project type: Scan repository for configuration files
  1. Identify prerequisites: List everything needed
  1. Generate .env.example: Extract all environment variables
  1. Produce Getting Started guide: Write step-by-step instructions
  1. Verify setup: Provide verification commands

`.env.example` Format

# =============================================================================
# Application
# =============================================================================
NODE_ENV=development
PORT=3000
LOG_LEVEL=debug

# =============================================================================
# Database
# =============================================================================
# Required: PostgreSQL connection string
DATABASE_URL=postgresql://user:password@localhost:5432/myapp_dev

# =============================================================================
# Authentication
# =============================================================================
# Required: Generate with `openssl rand -base64 32`
JWT_SECRET=replace-with-generated-secret
JWT_EXPIRY=3600

# =============================================================================
# External Services (optional in development)
# =============================================================================
# SMTP_HOST=smtp.example.com
# SMTP_PORT=587
# SMTP_USER=
# SMTP_PASSWORD=

# =============================================================================
# Feature Flags
# =============================================================================
ENABLE_CACHE=false
ENABLE_RATE_LIMIT=false

Getting Started Template

# Getting Started

## Prerequisites

- [Node.js](https://nodejs.org/) v20+ (check with `node --version`)
- [Docker](https://www.docker.com/) v24+ (check with `docker --version`)
- [Git](https://git-scm.com/) v2.40+

## Setup

1. Clone the repository:
   \`\`\`bash
   git clone <repo-url>
   cd <project-name>
   \`\`\`

2. Install dependencies:
   \`\`\`bash
   npm install
   \`\`\`

3. Set up environment variables:
   \`\`\`bash
   cp .env.example .env
   # Edit .env with your local values
   \`\`\`

4. Start infrastructure services:
   \`\`\`bash
   docker compose up -d
   \`\`\`

5. Run database migrations:
   \`\`\`bash
   npm run db:migrate
   \`\`\`

6. Seed development data (optional):
   \`\`\`bash
   npm run db:seed
   \`\`\`

7. Start the development server:
   \`\`\`bash
   npm run dev
   \`\`\`

## Verify

- Application: http://localhost:3000
- API docs: http://localhost:3000/api-docs
- Health check: `curl http://localhost:3000/health`

## Common Issues

| Problem | Solution |
|---------|----------|
| Port already in use | Change `PORT` in `.env` or kill the process on that port |
| Database connection refused | Ensure Docker is running: `docker compose ps` |
| Missing environment variable | Compare `.env` with `.env.example` |

Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.