一键导入
pre-push-format-guard
Set up a git pre-push hook that rejects pushes when code isn't formatted. Detects the repo's formatter and writes a check-only hook.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Set up a git pre-push hook that rejects pushes when code isn't formatted. Detects the repo's formatter and writes a check-only hook.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Set up a git pre-commit hook that rejects commits when staged files aren't formatted. Detects the repo's formatter and writes a check-only hook.
Verify README code blocks still work using readme-assert — extracts fenced blocks and runs them with assertion comments.
Convert existing README code examples into testable readme-assert blocks by adding test tags and assertion comments.
| name | pre-push-format-guard |
| description | Set up a git pre-push hook that rejects pushes when code isn't formatted. Detects the repo's formatter and writes a check-only hook. |
| user-invocable | true |
| allowed-tools | Bash Glob Grep Read Write |
Set up a git pre-push hook that runs the project's code formatter in check-only mode, rejecting the push if any file is not properly formatted.
Detect the formatter. Inspect the repo for formatter config files, dependency manifests, and tool configs (e.g. .prettierrc, biome.json, pyproject.toml, Cargo.toml, go.mod, deno.json, etc.). Use your knowledge of the ecosystem to determine which formatter the project uses and what the correct check-only command is.
If no formatter is detected, tell the user you couldn't find one and stop. Don't guess.
Check for an existing pre-push hook. If .git/hooks/pre-push already exists, show the user its contents and ask how to proceed — don't overwrite silently.
Write the hook. Create .git/hooks/pre-push as a shell script that:
Make it executable. chmod +x .git/hooks/pre-push
Report. Tell the user what formatter was detected, what check command the hook runs, and how to bypass it (git push --no-verify) if needed.