cc-safe-setup 9.3.0 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/examples/ci-skip-guard.sh +11 -0
- package/examples/debug-leftover-guard.sh +12 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
**One command to make Claude Code safe for autonomous operation.** [日本語](docs/README.ja.md)
|
|
8
8
|
|
|
9
|
-
8 built-in + 104 examples = **112 hooks**.
|
|
9
|
+
8 built-in + 104 examples = **112 hooks**. 35 CLI commands. 457 tests. 5 languages. [**Hub**](https://yurukusa.github.io/cc-safe-setup/hub.html) · [Cheat Sheet](https://yurukusa.github.io/cc-safe-setup/hooks-cheatsheet.html) · [Builder](https://yurukusa.github.io/cc-safe-setup/builder.html) · [FAQ](https://yurukusa.github.io/cc-safe-setup/faq.html) · [Examples](https://yurukusa.github.io/cc-safe-setup/by-example.html) · [Matrix](https://yurukusa.github.io/cc-safe-setup/matrix.html) · [Playground](https://yurukusa.github.io/cc-hook-registry/playground.html)
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
npx cc-safe-setup
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# ci-skip-guard.sh — Warn when commit message skips CI
|
|
3
|
+
# TRIGGER: PreToolUse MATCHER: "Bash"
|
|
4
|
+
COMMAND=$(cat | jq -r '.tool_input.command // empty' 2>/dev/null)
|
|
5
|
+
[ -z "$COMMAND" ] && exit 0
|
|
6
|
+
echo "$COMMAND" | grep -qE '^\s*git\s+commit' || exit 0
|
|
7
|
+
if echo "$COMMAND" | grep -qiE '\[skip ci\]|\[ci skip\]|\[no ci\]|--no-verify'; then
|
|
8
|
+
echo "WARNING: Commit will skip CI checks." >&2
|
|
9
|
+
echo "Remove [skip ci] or --no-verify unless you have a good reason." >&2
|
|
10
|
+
fi
|
|
11
|
+
exit 0
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# debug-leftover-guard.sh — Detect debug code in commits
|
|
3
|
+
# TRIGGER: PreToolUse MATCHER: "Bash"
|
|
4
|
+
COMMAND=$(cat | jq -r '.tool_input.command // empty' 2>/dev/null)
|
|
5
|
+
[ -z "$COMMAND" ] && exit 0
|
|
6
|
+
echo "$COMMAND" | grep -qE '^\s*git\s+commit' || exit 0
|
|
7
|
+
LEFTOVERS=$(git diff --cached 2>/dev/null | grep -cE '^\+.*(debugger|console\.debug|pdb\.set_trace|binding\.pry|pp\s|var_dump|print_r)' || echo 0)
|
|
8
|
+
if [ "$LEFTOVERS" -gt 0 ]; then
|
|
9
|
+
echo "WARNING: $LEFTOVERS debug statement(s) in staged changes." >&2
|
|
10
|
+
echo "Remove debugger/pdb/binding.pry before committing." >&2
|
|
11
|
+
fi
|
|
12
|
+
exit 0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-safe-setup",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.4.0",
|
|
4
4
|
"description": "One command to make Claude Code safe. 59 hooks (8 built-in + 51 examples). 26 CLI commands: dashboard, create, audit, lint, diff, migrate, compare, generate-ci. 284 tests.",
|
|
5
5
|
"main": "index.mjs",
|
|
6
6
|
"bin": {
|