cc-safe-setup 14.0.0 → 15.0.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
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 + 124 examples = **
|
|
9
|
+
8 built-in + 124 examples = **144 hooks**. 44 CLI commands. 561 tests. 5 languages. [**Hub**](https://yurukusa.github.io/cc-safe-setup/hub.html) · [Wizard](https://yurukusa.github.io/cc-safe-setup/wizard.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,7 @@
|
|
|
1
|
+
COMMAND=$(cat | jq -r '.tool_input.command // empty' 2>/dev/null)
|
|
2
|
+
[ -z "$COMMAND" ] && exit 0
|
|
3
|
+
if echo "$COMMAND" | grep -qE '\bdocker\s+volume\s+(rm|prune)\b'; then
|
|
4
|
+
echo "WARNING: Docker volume deletion detected." >&2
|
|
5
|
+
echo "Volumes may contain persistent data." >&2
|
|
6
|
+
fi
|
|
7
|
+
exit 0
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# max-edit-size-guard.sh — Warn on very large single edits
|
|
3
|
+
# TRIGGER: PreToolUse MATCHER: "Edit"
|
|
4
|
+
# CONFIG: CC_MAX_EDIT_LINES=50
|
|
5
|
+
INPUT=$(cat)
|
|
6
|
+
OLD=$(echo "$INPUT" | jq -r '.tool_input.old_string // empty' 2>/dev/null)
|
|
7
|
+
NEW=$(echo "$INPUT" | jq -r '.tool_input.new_string // empty' 2>/dev/null)
|
|
8
|
+
[ -z "$OLD" ] && exit 0
|
|
9
|
+
MAX="${CC_MAX_EDIT_LINES:-50}"
|
|
10
|
+
OLD_LINES=$(echo "$OLD" | wc -l)
|
|
11
|
+
NEW_LINES=$(echo "$NEW" | wc -l)
|
|
12
|
+
TOTAL=$((OLD_LINES + NEW_LINES))
|
|
13
|
+
if [ "$TOTAL" -gt "$MAX" ]; then
|
|
14
|
+
FILE=$(echo "$INPUT" | jq -r '.tool_input.file_path // "?"' 2>/dev/null)
|
|
15
|
+
echo "WARNING: Large edit ($TOTAL lines) in $FILE." >&2
|
|
16
|
+
echo "Consider breaking into smaller changes for easier review." >&2
|
|
17
|
+
fi
|
|
18
|
+
exit 0
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
CONTENT=$(cat | jq -r '.tool_input.new_string // empty' 2>/dev/null)
|
|
2
|
+
FILE=$(cat | jq -r '.tool_input.file_path // empty' 2>/dev/null)
|
|
3
|
+
[ -z "$CONTENT" ] && exit 0
|
|
4
|
+
case "$FILE" in */package.json|package.json) ;; *) exit 0 ;; esac
|
|
5
|
+
if echo "$CONTENT" | grep -qE '"(pre|post)?(install|publish|prepare|version)".*[;&|`$]'; then
|
|
6
|
+
echo "WARNING: package.json script may contain shell injection." >&2
|
|
7
|
+
fi
|
|
8
|
+
exit 0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-safe-setup",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.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": {
|