跳转到正文
报告库
用途分类 / 开发辅助

Git Workflow And Versioning Skill 安全审计

作者说它能做什么(原文)

Structures git workflow practices. Use when making any code change. Use when committing, branching, resolving conflicts, opening or reviewing a pull request (PR), pushing to a remote, or when you need to organize work across multiple parallel streams. Use when cutting a release, choosing a semantic version bump, tagging, or writing a changelog.

第三方安全检查结论

先别安装或运行

已检查文件
1
发现的风险
5
会不会运行危险命令?检查是否下载程序后直接运行、让他人远程控制电脑,或藏起要运行的命令。发现 1 项风险
中风险

强制运行仓库定义的 npm 命令会以用户权限执行项目代码

原文依据:2 处
发现了什么

`npm test` 和 `npm run lint` 执行由当前仓库 `package.json` 定义的脚本;这些脚本并非由此 Skill 展示或约束。`npx tsc` 还可能解析或取得可执行包。因此,把这些命令规定为“每次提交前”运行,会执行来自未审查项目的代码。

为什么需要注意

恶意或被篡改的项目脚本可读取或修改用户可访问的文件和凭据,并在环境允许时访问网络或启动其他程序。

“每次提交前”的指令会运行 `npm test` 和 `npm run lint`,它们执行当前仓库在 package.json 中定义的脚本,而这些脚本未包含在证据中;恶意或受损仓库可借此以代理的用户权限读写文件或访问环境中的凭据。`npx` 在缺少本地命令时还可能取得并执行包。用户可仅允许经过审查、锁定且在受限环境中运行的脚本。

SKILL.md:211来自说明文档打开原文件
## Pre-Commit HygieneBefore every commit:```bash# 1. Check what you're about to commitgit diff --staged# 2. Ensure no secretsgit diff --staged | grep -i "password\|secret\|api_key\|token"# 3. Run testsnpm test# 4. Run lintingnpm run lint# 5. Run type checkingnpx tsc --noEmit```
查看另外 1 个位置
SKILL.md:222来自说明文档打开原文件
# 3. Run testsnpm test# 4. Run lintingnpm run lint# 5. Run type checkingnpx tsc --noEmit```
会不会泄露文件和密钥?检查是否发送含密码或密钥的文件,以及代码里是否直接写了密钥。发现 1 项风险
中风险

简单关键词搜索被描述为“确保没有秘密”,可能让凭据被错误批准提交

原文依据:2 处
发现了什么

检查只搜索暂存差异中的四类英文名称。它不会识别名称不同、无标签、编码或多行的密钥,也不会检查未暂存文件;但后面的核对表仍要求确认“差异中没有秘密”,容易造成过度信任。

为什么需要注意

未被匹配的 API 密钥、令牌、私钥或密码可能进入提交;如果之后推送,拥有仓库访问权的人或公开访问者可能获得这些凭据。

源码把一次仅匹配 `password|secret|api_key|token` 的 grep 标为“Ensure no secrets”,随后核对表又要求确认差异中没有秘密。该检查只看已暂存文本,并会漏掉其他命名、无标签、编码、二进制或拆分形式的凭据,因此可能造成错误确信。用户可要求使用专门的密钥扫描器,并在提交前人工检查完整 staged diff。

SKILL.md:216来自说明文档打开原文件
```bash# 1. Check what you're about to commitgit diff --staged# 2. Ensure no secretsgit diff --staged | grep -i "password\|secret\|api_key\|token"
查看另外 1 个位置
SKILL.md:342来自说明文档打开原文件
For every commit:- [ ] Commit does one logical thing- [ ] Message explains the why, follows type conventions- [ ] Tests pass before committing- [ ] No secrets in the diff- [ ] No formatting-only changes mixed with behavior changes
会不会删除文件或一直在后台运行?检查是否大范围删除文件、改写磁盘,或设置自动启动。发现 2 项风险
高风险

失败测试后建议 hard reset,可能永久丢弃用户尚未提交的修改

原文依据:2 处
发现了什么

流程把测试失败后的动作写成回退,并明确推荐 `git reset --hard HEAD`。该命令会覆盖暂存区和已跟踪工作树,使当前提交之后尚未提交的修改消失;这些修改可能来自用户或其他工具,而不只是本 Skill 刚做的增量。

为什么需要注意

用户未提交的已跟踪文件修改可能无法通过普通 Git 操作恢复,正在进行的工作也可能被误删。

这是生效的流程建议:测试失败时回退,随后明确给出 `git reset --hard HEAD`。若工作树或暂存区含有用户、其他工具或并行任务尚未提交的已跟踪文件修改,该命令会丢弃它们;源码没有要求先确认归属或备份。用户应限制 Skill 不得执行 hard reset,除非先展示将丢失的差异并取得明确同意。

SKILL.md:178来自说明文档打开原文件
    ├── Makes a change    │   ├── Test passes? → Commit → Continue    │   └── Test fails? → Revert to last commit → Investigate    ├── Makes another change    │   ├── Test passes? → Commit → Continue    │   └── Test fails? → Revert to last commit → Investigate
查看另外 1 个位置
SKILL.md:189来自说明文档打开原文件
This pattern means you never lose more than one increment of work. If an agent goes off the rails, `git reset --hard HEAD` takes you back to the last successful state.
中风险

宽泛的自动提交规则可能在未经用户授权时改写仓库历史

原文依据:4 处
发现了什么

Skill 声称对任何代码改动都应使用,并要求每个成功增量立即提交。普通的代码修改请求并不必然授权创建 Git 提交;提交会永久记录文件内容、作者信息和提交消息,并可能包含用户同时暂存的改动。

为什么需要注意

仓库会出现用户未要求的提交,错误归属或无关暂存内容可能进入历史,之后的审查、rebase 和发布也会受影响。

Skill 将自身声明为适用于所有代码修改,并要求每个成功增量都提交;普通编辑请求未必授权创建提交。提交可能纳入用户已经暂存的其他改动,并写入作者身份和消息。虽然本地提交通常可以撤销,但仍会改变仓库历史。用户可要求作者把提交设为需明确同意的操作,并在提交前展示完整 staged diff。

SKILL.md:14来自说明文档打开原文件
Always. Every code change flows through git.
查看另外 3 个位置
SKILL.md:34来自说明文档打开原文件
### 1. Commit Early, Commit OftenEach successful increment gets its own commit. Don't accumulate large uncommitted changes.```Work pattern:  Implement slice → Test → Verify → Commit → Next slice
SKILL.md:12来自说明文档打开原文件
## When to UseAlways. Every code change flows through git.
SKILL.md:38来自说明文档打开原文件
```Work pattern:  Implement slice → Test → Verify → Commit → Next slice
会不会绕过安全保护?检查是否跳过网站安全验证、开放过多文件权限,或取消操作前的确认。发现 1 项风险
低风险

安装命令没有固定依赖版本

原文依据:3 处
发现了什么

安装命令没有指定依赖版本。同样的命令以后可能下载不同代码,你实际安装的内容可能与这次检查时不同。

为什么需要注意

即使命令和报告没变,以后安装时也可能下载到另一份代码。

这段证据能说明什么

`npx tsc --noEmit` 没有固定版本;若项目中没有可用的本地二进制,某些 npm/npx 配置可能从注册表取得并执行包。但所给源码未显示依赖清单、npm 版本或实际安装行为,因此不能确定它会下载代码。用户可要求作者使用已锁定的本地 TypeScript,并禁止 npx 自动获取缺失包。

这项判断针对展示的代码和适用条件,不表示风险已经实际发生。
SKILL.md:229来自说明文档打开原文件
# 5. Run type checkingnpx tsc --noEmit```
查看另外 2 个位置
SKILL.md:213来自说明文档打开原文件
Before every commit:
SKILL.md:228来自说明文档打开原文件
# 5. Run type checkingnpx tsc --noEmit```
会不会误导 AI 或隐藏内容?检查工作说明是否要求 AI 忽略你的指令、干扰检查结果,或夹带看不见的文字。未发现风险
会不会偷偷改推广链接或收款方?检查是否强制替换推广链接或收款对象,同时要求隐瞒更改。未发现风险

Skill 逻辑拆解

8 个说明模块

该 Skill 宣称对任何代码改动都适用,并把“修改、测试、验证、提交”规定为循环流程,而不只是在用户明确要求提交时使用。

查看原文
SKILL.md:3来自说明文档打开原文件
name: git-workflow-and-versioningdescription: Structures git workflow practices. Use when making any code change. Use when committing, branching, resolving conflicts, opening or reviewing a pull request (PR), pushing to a remote, or when you need to organize work across multiple parallel streams. Use when cutting a release, choosing a semantic version bump, tagging, or writing a changelog.---
SKILL.md:14来自说明文档打开原文件
Always. Every code change flows through git.
SKILL.md:36来自说明文档打开原文件
Each successful increment gets its own commit. Don't accumulate large uncommitted changes.
SKILL.md:39来自说明文档打开原文件
```Work pattern:  Implement slice → Test → Verify → Commit → Next slice

它建议用短期分支和相邻目录中的 Git worktree 隔离并行工作,完成后移除 worktree。

查看原文
SKILL.md:149来自说明文档打开原文件
For parallel AI agent work, use git worktrees to run multiple branches simultaneously:```bash# Create a worktree for a feature branchgit worktree add ../project-feature-a feature/task-creationgit worktree add ../project-feature-b feature/user-settings
SKILL.md:163来自说明文档打开原文件
# When done, merge and clean upgit worktree remove ../project-feature-a```

每次提交前,它要求查看暂存差异、用简单文本匹配检查秘密,并运行项目测试、lint 和 TypeScript 命令。

查看原文
SKILL.md:213来自说明文档打开原文件
Before every commit:```bash# 1. Check what you're about to commitgit diff --staged# 2. Ensure no secretsgit diff --staged | grep -i "password\|secret\|api_key\|token"# 3. Run testsnpm test# 4. Run lintingnpm run lint# 5. Run type checkingnpx tsc --noEmit```

发布流程包含创建带注释的 Git 标签并将该标签推送到 origin,这会改变远程仓库状态。

查看原文
SKILL.md:286来自说明文档打开原文件
### Tag the release, and let the tag be the source of truthA release is an immutable point in history, not a moving branch. Tag it so it can always be reproduced:```bashgit tag -a v1.4.0 -m "Release 1.4.0"git push origin v1.4.0```
从这里开始 · 工作说明SKILL.md
git-workflow-and-versioning
连线表示工作说明包含的模块,不是实际运行顺序。点击模块可查看原文。 另有 6 个章节,可在原文件中查看。
文件与检查记录1 个文件

检查范围与遗漏

逐文件查看涉及的内容

下方列出本次涉及的原文范围;纳入检查不代表已查清所有问题。

  • SKILL.md已纳入全文

这份报告只针对上方版本。我们看了拿到的代码和说明文件,没有实际运行 Skill,也没有检查它另外安装的软件包。因此,这不是“保证安全”的承诺;换了版本或使用环境,结果也可能不同。

  • SKILL.md工作说明

代码和说明中提到的操作

运行命令
SKILL.md:151来自说明文档打开原文件
```bash# Create a worktree for a feature branch
SKILL.md:215来自说明文档打开原文件
```bash# 1. Check what you're about to commit
SKILL.md:252来自说明文档打开原文件
```bash# Find which commit introduced a bug
读取密钥或账号配置
SKILL.md:220来自说明文档打开原文件
# 2. Ensure no secretsgit diff --staged | grep -i "password\|secret\|api_key\|token"
SKILL.md:247来自说明文档打开原文件
- **Commit generated files** only if the project expects them (e.g., `package-lock.json`, Prisma migrations)- **Don't commit** build output (`dist/`, `.next/`), environment files (`.env`), or IDE config (`.vscode/settings.json` unless shared)- **Have a `.gitignore`** that covers: `node_modules/`, `dist/`, `.env`, `.env.local`, `*.pem`
SKILL.md:248来自说明文档打开原文件
- **Don't commit** build output (`dist/`, `.next/`), environment files (`.env`), or IDE config (`.vscode/settings.json` unless shared)- **Have a `.gitignore`** that covers: `node_modules/`, `dist/`, `.env`, `.env.local`, `*.pem`
安装其他软件包
SKILL.md:229来自说明文档打开原文件
# 5. Run type checkingnpx tsc --noEmit```
读取了多少行
356
文件校验值(用于核对版本)
9777c444d65ec50adb4727cdbd8bdc32fda0a53b082469e35eb2bdc71f355afc