← 返回 Skills 市场
Git Hooks Generator
作者
Sunshine-del-ux
· GitHub ↗
· v1.0.0
453
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install git-hooks-generator
功能描述
生成 Git hooks 脚本,自动格式化代码、检查 lint、运行测试等。
使用说明 (SKILL.md)
Git Hooks Generator
自动生成 Git hooks,提升开发效率。
功能
- ✅ pre-commit 格式化
- ✅ commit-msg 规范检查
- ✅ pre-push 测试检查
- ✅ 多种语言支持
使用方法
git-hooks-generator init
git-hooks-generator add --hook pre-commit --type lint
安全使用建议
This skill does not appear malicious, but it is inconsistent and incomplete. Before installing or running it: 1) Inspect git-hooks-generator.sh — it writes a .git/hooks/pre-commit that runs 'npm run lint' and 'npm test'. 2) Ensure you're in a git repository and back up any existing hooks (.git/hooks) so you don't overwrite them unintentionally. 3) Verify npm is available and review your repository's package.json scripts; those scripts will run with whatever commands they contain and could be destructive if they were malicious. 4) Note that the SKILL.md promises other hooks and a CLI ('git-hooks-generator add ...') but those are not implemented; ask the author for clarification or updated code. 5) If you want to proceed, test this in a safe or disposable repo first. If you need the additional advertised features (commit-msg, pre-push, multi-language), request an updated implementation that matches the documentation.
功能分析
Type: OpenClaw Skill
Name: git-hooks-generator
Version: 1.0.0
The skill `git-hooks-generator` creates a Git pre-commit hook (`.git/hooks/pre-commit`) that executes `npm run lint` and `npm test`. While this aligns with the stated purpose of automating code quality checks, it introduces a vulnerability. The `npm run` commands execute arbitrary scripts defined in the project's `package.json`. If the `package.json` is compromised or contains malicious scripts, this skill would facilitate their execution without explicit sanitization or validation, leading to potential arbitrary code execution. This is a risky capability without clear malicious intent from the skill itself, classifying it as suspicious rather than malicious.
能力评估
Purpose & Capability
The SKILL.md and description claim multiple hooks (pre-commit, commit-msg, pre-push) and a CLI interface (git-hooks-generator init / add), but the included git-hooks-generator.sh only creates a .git/hooks/pre-commit that runs 'npm run lint' and 'npm test'. The skill declares no required binaries, yet the script uses npm — an undeclared dependency and minor incoherence.
Instruction Scope
Instructions advertise interactive CLI usage and broader functionality, but runtime behavior is limited to creating a single pre-commit hook and making it executable. The hook runs npm scripts, which will execute whatever commands are defined in the repository's package.json (this is expected for a JS-based project but should be documented). The SKILL.md gives agent-level commands that are not provided by the bundle (no installed CLI wrapper).
Install Mechanism
No install spec; this is an instruction-only skill with a small included shell script. Nothing is downloaded or installed from external sources.
Credentials
The skill requests no environment variables or credentials (appropriate), but the hook it writes depends on 'npm' being available and on project-specific package.json scripts. The lack of a declared npm requirement is a minor mismatch but not a credential risk.
Persistence & Privilege
The skill does not request persistent platform privileges (always:false). It writes a file into the repository's .git/hooks directory (expected for a hooks generator) and does not modify other skills or system-wide configuration.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install git-hooks-generator - 安装完成后,直接呼叫该 Skill 的名称或使用
/git-hooks-generator触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
git-hooks-generator 1.0.0 初始版本
- 支持自动生成 pre-commit、commit-msg、pre-push 等常用 Git hooks
- 集成代码格式化、lint 规范检查、测试检查
- 支持多种语言项目
- 提供简单 CLI 初始化与配置方式
元数据
常见问题
Git Hooks Generator 是什么?
生成 Git hooks 脚本,自动格式化代码、检查 lint、运行测试等。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 453 次。
如何安装 Git Hooks Generator?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install git-hooks-generator」即可一键安装,无需额外配置。
Git Hooks Generator 是免费的吗?
是的,Git Hooks Generator 完全免费(开源免费),可自由下载、安装和使用。
Git Hooks Generator 支持哪些平台?
Git Hooks Generator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Git Hooks Generator?
由 Sunshine-del-ux(@sunshine-del-ux)开发并维护,当前版本 v1.0.0。
推荐 Skills