Token导航 LogoToken导航TokenDH.com
运维和基础设施敏感数据github未标认证来源可访问clear审计提醒

environment-bootstrap环境引导

Agent Skill

environment-bootstrap 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

384

周安装

16

GitHub Stars

6

下载量

128
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:environment-bootstrap(环境引导)
来源仓库:https://github.com/troykelly/claude-skills
仓库路径:skills/environment-bootstrap
安装命令:
npx skills add https://github.com/troykelly/claude-skills --skill environment-bootstrap
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/troykelly/claude-skills --skill environment-bootstrap

简介

environment-bootstrap 确保每次开发会话都从一个已知良好的环境中启动,维护一致性。

  • 适用于 Codex、Claude、Cursor、Gemini CLI 中需要初始化新项目或重置混乱开发环境的场景。
  • 通过项目内 scripts/init.sh 脚本标准化 setup 流程,自动安装依赖、配置变量并验证基础功能。
  • 建议在版本控制中包含 init 脚本模板,新成员加入或切换机器后立即运行以对齐工具链状态。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Environment Bootstrap

Overview

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."

When to Use

SituationAction
First clone of repositoryCreate init script
Starting new sessionRun init script
After pulling changesRe-run init if deps changed
Environment seems brokenRun init to reset

The Init Script

Location

project/
├── scripts/
│   └── init.sh    ← Standard location
├── package.json
└── ...

Template

#!/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"

Making Executable

chmod +x scripts/init.sh

Running the Init Script

Standard Run

./scripts/init.sh

With Dev Server

START_DEV_SERVER=true ./scripts/init.sh

After Pulling Changes

git pull origin main
./scripts/init.sh

Smoke Test

After environment setup, verify basic functionality:

What to Test

TestHowPass Criteria
Buildpnpm buildNo errors
Testspnpm testAll pass
Dev serverpnpm devServer starts
Health checkcurl http://[::1]:3000/health200 OK (IPv6-first)
Basic flowRun E2E testPasses

Smoke Test Script

#!/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"

Environment Documentation

README Section

## Development Setup

### Prerequisites

- Node.js 18+
- pnpm 8+
- GitHub CLI (`gh`) authenticated

### Quick Start

Clone repository

git clone https://github.com/owner/repo.git cd repo

Run setup

./scripts/init.sh

Start development

pnpm dev


### Environment Variables

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:

git add scripts/init.sh
git commit -m "chore: Update init script for [change]"

Troubleshooting

Common Issues

IssueSolution
"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

Reset Environment

When environment is in unknown state:

# Nuclear option
rm -rf node_modules dist .cache .next
pnpm store prune
./scripts/init.sh

Checklist

Init script should:

  • Check all prerequisites
  • Verify correct versions
  • Install dependencies
  • Set up environment files
  • Run build
  • Run tests
  • Start development services (if docker-compose exists)
  • Verify services are ready (postgres, redis, etc.)
  • Optionally start dev server
  • Verify server responds (if started)
  • Print clear success/failure

Environment documentation should:

  • List prerequisites
  • Explain quick start
  • Document env variables
  • Explain common issues

Integration

This skill is called by:

  • session-start - Beginning of each session
  • error-recovery - Resetting environment

This skill ensures:

  • Consistent development environment
  • Quick session startup
  • Early detection of environment issues

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

29.13%
按下载量换算37

Antigravity

23.84%
按下载量换算31

Gemini CLI

17.29%
按下载量换算22

Cursor

11.29%
按下载量换算14

kiro-cli

7.15%
按下载量换算9

windsurf

3%
按下载量换算4

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills