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

git-safetygit 安全

Agent Skill

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

总安装

212

周安装

9

GitHub Stars

1

下载量

74
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/yzlin/supaviber --skill git-safety

简介

保障 Git 操作安全与合规性检查。

  • 防止误删分支、强制推送等危险操作。
  • 自动识别敏感信息与密钥泄露风险。
  • 需配置白名单排除合法变更场景。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。
  • 审计日志应保留足够追溯周期。git-safety 属于运维和基础设施类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Git Safety Skill

Apply rigorous git safety protocols to prevent data loss and conflicts in collaborative development environments, particularly when multiple agents or developers work concurrently.

Core Safety Principles

File Management Rules

Deleting Files:

  • ⚠️ STOP before deleting any file to resolve type/lint failures - Ask the user first
  • Only remove obsolete files when changes make them genuinely irrelevant
  • Only revert your own work or changes explicitly requested by the user
  • Coordinate with teammates before removing in-progress edits
  • Never assume a file is safe to delete without confirmation

File Modifications:

  • Always verify file ownership and recent changes before modifying
  • Check git log <file> to see who last edited
  • Communicate before making sweeping changes to shared files

Environment & Configuration Safety

Critical: Environment Files

  • 🚫 NEVER edit .env or any environment variable files
  • Only the user may change environment configurations
  • This includes .env, .env.local, .env.production, etc.
  • If environment changes are needed, inform the user - never make them yourself

Git Configuration:

  • Never modify .gitconfig or repository git settings
  • Never amend commits without explicit written approval
  • Preserve existing git hooks and configurations

Destructive Operations - Extreme Caution Required

Absolutely Forbidden Without Explicit Permission

🚨 ABSOLUTELY NEVER run these operations unless the user gives explicit, written instruction:

  • git reset --hard - Destroys uncommitted work permanently
  • git checkout <old-commit> - Can lose current work
  • git restore --source=<old-commit> - Reverts to old state, losing changes
  • rm -rf - Irreversible file deletion
  • git push --force - Overwrites remote history
  • git rebase without safeguards - Can lose commits
  • git clean -fd - Deletes untracked files permanently

What Requires User Approval

Before running these commands, STOP and ask the user explicitly:

  1. Any command that can lose uncommitted changes
  2. Force pushing to remote repositories
  3. Rebasing published branches
  4. Amending pushed commits
  5. Deleting branches (local or remote)
  6. Hard resets of any kind
  7. File deletions to fix build errors

Safe Workflow Standards

Before Any Commit

Pre-commit Checklist:

  1. Run git status to verify exactly what's being committed
  2. Use explicit file paths - never git add. or git add -A blindly
  3. Ensure only modified/intended files are staged
  4. Review diffs with git diff --staged
  5. Keep commits atomic (focused on one logical change)

Example - Safe Commit:

# Good: Explicit, verified, atomic
git status
git add src/components/Button.tsx src/components/Button.test.tsx
git diff --staged
git commit -m "feat: add disabled state to Button component"

Example - Unsafe Commit:

# Bad: No verification, adds everything
git add .
git commit -m "fixes"

Path Handling

Quote Special Characters:

  • Always quote paths with brackets, parentheses, or spaces
  • Use double quotes to prevent shell interpretation
# Good
git add "src/utils/parse(data).ts"
git add "src/components/[id].tsx"

# Bad - shell may misinterpret
git add src/utils/parse(data).ts
git add src/components/[id].tsx

Rebase Safety

When rebasing is necessary:

# Suppress editor prompts
GIT_SEQUENCE_EDITOR=true git rebase <branch>

# Or set environment variable
export GIT_SEQUENCE_EDITOR=true
git rebase main

Coordination in Collaborative Environments

Before Major Changes

Communication First:

  1. Check who else is working on related files: git log --since="1 day ago" --oneline
  2. Announce intention to make sweeping changes
  3. Wait for confirmation before proceeding
  4. Coordinate timing of force pushes or rebases

Conflict Prevention

Proactive Coordination:

  • Pull frequently: git pull --rebase
  • Communicate when working on shared files
  • Use feature branches to isolate work
  • Merge main frequently to stay current

Decision Tree for Destructive Operations

Are you about to run a destructive git command?
├─ YES → Is there explicit written user approval?
│   ├─ YES → Proceed carefully, verify twice
│   └─ NO → STOP. Ask user for permission first.
└─ NO → Proceed with normal safety checks

Common Scenarios

Scenario 1: Type Error in File

Wrong Approach:

# ❌ Delete file to fix error
rm src/components/BrokenComponent.tsx

Right Approach:

# ✅ Stop and ask user
# "I see a type error in BrokenComponent.tsx.
# Should I fix the error or is this file obsolete?"

Scenario 2: Need to Reset Changes

Wrong Approach:

# ❌ Hard reset without asking
git reset --hard HEAD

Right Approach:

# ✅ Ask first, then use safer methods
git stash  # Preserves work
# OR
git checkout -b backup-branch  # Creates backup

Scenario 3: Multiple Agents Working

Wrong Approach:

# ❌ Force push over teammate's work
git push --force

Right Approach:

# ✅ Coordinate first
# "I need to force push to fix history.
# Is anyone else working on this branch?"

Safety Verification Commands

Before Destructive Operations:

# Check what will be affected
git status
git log --oneline -n 10
git diff HEAD

# See who's been working recently
git log --since="1 day ago" --all --oneline

# Check remote status
git fetch
git status

Environment File Protection

Files to NEVER modify:

  • .env
  • .env.local
  • .env.development
  • .env.production
  • .env.test
  • Any file matching .env.*

If environment changes are needed:

  1. Stop immediately
  2. Inform the user exactly what needs to change
  3. Let the user make the modification
  4. Never assume or guess environment values

Summary - The Golden Rules

  1. 🛑 STOP before deleting files to fix build errors
  2. 🚫 NEVER touch environment files - user only
  3. ⚠️ Get explicit permission for destructive git operations
  4. Verify with git status before every commit
  5. 📝 Use explicit paths - never blindly add all files
  6. 🔒 Quote special characters in file paths
  7. 🤝 Coordinate with teammates before major changes
  8. 💾 When in doubt, ask - communication over assumption

When This Skill Applies

Invoke this skill when:

  • About to run any git command
  • Considering deleting a file
  • Planning to modify shared files
  • Encountering build/type errors that might be "fixed" by deletion
  • Working in an environment where others might be active
  • Unsure if an operation is safe

Default stance: Cautious and communicative. Preserve work, ask questions, coordinate changes.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

OpenCode

29.5%
按下载量换算22

Claude Code

21.44%
按下载量换算16

amp

15.38%
按下载量换算11

trae

12.6%
按下载量换算9

roo

6.85%
按下载量换算5

Antigravity

3.33%
按下载量换算2

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

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

安装前确认

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

来源信息

继续浏览同类 Skills