Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问clear审计通过

env-sync环境同步

Agent Skill

env-sync 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

245

周安装

10

GitHub Stars

1

下载量

78
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/qiaoshouqing/skills --skill env-sync

简介

env-sync 用于将根仓库的 .env 文件同步至 git worktree,确保分支间环境一致性。

  • 仅允许从合法 git 仓库根目录操作,禁止任意路径写入,防止 secrets 意外扩散。
  • 适用于多工作树并行开发场景,自动检测目标是否存在并询问覆盖确认。
  • 绝不显示 .env 内容,所有操作需用户显式授权后方可执行。
  • env-sync 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Env Sync - Git Worktree Environment File Synchronization

This skill syncs .env files from a git root repository to git worktrees.

When to Use

  • User asks to sync env or copy env
  • User mentions missing environment variables or.env file
  • Working in a git worktree that lacks a.env file
  • User asks to set up environment for a worktree

Security Rules

  1. NEVER display.env file contents - they contain secrets
  2. ALWAYS ask before overwriting - if.env already exists, confirm with user first
  3. Validate paths - ensure the root path exists and is a valid git repository
  4. No arbitrary paths - only sync from the actual git root repository

Instructions for Agent

Step 1: Check if in a Git Worktree

# Check if .git is a file (worktree) or directory (regular repo)
[ -f .git ] && echo "worktree" || echo "not-worktree"

If not a worktree, inform user this skill is for git worktrees only.

Step 2: Find and Validate Root Repository

# Read gitdir and extract root path
GITDIR=$(cat .git | grep "^gitdir:" | sed 's/gitdir: //')
ROOT_REPO=$(echo "$GITDIR" | sed 's/\.git\/worktrees\/.*//')

# Validate: must be a real git repository
if [ -d "${ROOT_REPO}/.git" ]; then
  echo "Valid root: $ROOT_REPO"
else
  echo "Invalid root path - not a git repository"
  exit 1
fi

Step 3: Check for Existing.env

# IMPORTANT: Always check before copying
if [ -f ./.env ]; then
  echo "WARNING: .env already exists in this worktree"
  # ASK USER before proceeding
fi

If.env exists: STOP and ask user "Do you want to overwrite the existing.env file?"

Step 4: Copy.env (only after user confirmation if needed)

if [ -f "${ROOT_REPO}/.env" ]; then
  cp "${ROOT_REPO}/.env" ./.env
  echo "Synced .env from $ROOT_REPO"
else
  echo "No .env found in root repository: $ROOT_REPO"
fi

Complete Safe Script

# Safe env sync with validation
if [ ! -f .git ]; then
  echo "Not a git worktree"
  exit 1
fi

GITDIR=$(cat .git | grep "^gitdir:" | sed 's/gitdir: //')
ROOT=$(echo "$GITDIR" | sed 's/\.git\/worktrees\/.*//')

# Validate root is a git repo
if [ ! -d "${ROOT}/.git" ]; then
  echo "Invalid: $ROOT is not a git repository"
  exit 1
fi

# Check if .env exists at root
if [ ! -f "${ROOT}/.env" ]; then
  echo "No .env in root: $ROOT"
  exit 1
fi

# Check if local .env exists - MUST ASK USER
if [ -f ./.env ]; then
  echo "WARNING: .env already exists here. Ask user before overwriting."
  exit 0
fi

# Safe to copy
cp "${ROOT}/.env" ./.env
echo "Synced .env from $ROOT"

Response Guidelines

  • Always inform user what was done
  • If.env already exists: MUST ask user before overwriting
  • If root.env doesn't exist: tell user the path checked
  • Never display.env file contents
  • Report only: file exists/copied, line count, file size

Error Handling

SituationAction
Not a worktreeInform user, no action
Invalid root pathWarn user, no action
No root.envTell user path, suggest checking
.env existsAsk user before overwrite
Permission deniedSuggest checking permissions

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

Gemini CLI

28.1%
按下载量换算22

Claude Code

24.44%
按下载量换算19

Codex

15.78%
按下载量换算12

OpenCode

11.63%
按下载量换算9

trae

7.67%
按下载量换算6

Cursor

3.64%
按下载量换算3

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills