一键导入
repo-guard
Automatically detect and prevent dangerous operations, secret exposure, and main branch modifications.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Automatically detect and prevent dangerous operations, secret exposure, and main branch modifications.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | repo-guard |
| description | Automatically detect and prevent dangerous operations, secret exposure, and main branch modifications. |
| allowed-tools | ["Read","Grep","Glob","Bash(git:*)","Bash(rg:*)","Bash(ls:*)"] |
| context | inline |
Proactively protect the repository from common mistakes and security issues.
This skill activates automatically when:
Detect and block commits containing:
Patterns to watch:
- .env files
- *_KEY, *_SECRET, *_TOKEN patterns
- BEGIN PRIVATE KEY
- password=, passwd=, pwd=
- Bearer tokens
- AWS credentials
Action: Block and suggest using environment variables or secret managers.
Block or require confirmation for:
rm -rf /
rm -rf *
rm -rf .
mkfs.*
dd if=
> /dev/sd*
chmod -R 777
Action: Block immediately with warning, suggest safer alternatives.
Prevent direct modifications to:
Action: Suggest creating feature branch first.
Warn about:
Action: Warn and suggest .gitignore or Git LFS.
**Repo Guard Alert**
**Issue Detected**: [Type of issue]
**Location**: [File or command]
**Severity**: [Critical/Warning/Info]
**Details**:
[Explanation of the issue]
**Recommended Action**:
[What to do instead]
**To proceed anyway** (not recommended):
[Explicit override instructions]
No output - allow operation to proceed silently.
Automatically invoked before:
Referenced in rules for file modification warnings.
Included in system prompt for command validation.