cc-safe-setup 23.0.0 → 24.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 = **210 hooks**. 45 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)
9
+ 8 built-in + 124 examples = **220 hooks**. 45 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,4 @@
1
+ CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
2
+ [ -z "$CONTENT" ] && exit 0
3
+ echo "$CONTENT" | grep -qE "<img[^>]+(?!alt=)" && echo "NOTE: img without alt attribute" >&2
4
+ exit 0
@@ -0,0 +1,5 @@
1
+ FILE=$(cat | jq -r '.tool_input.file_path // empty' 2>/dev/null)
2
+ case "$FILE" in *Dockerfile*) ;; *) exit 0;; esac
3
+ CONTENT=$(cat | jq -r '.tool_input.new_string // empty' 2>/dev/null)
4
+ echo "$CONTENT" | grep -qE "^RUN.*apt-get.*install" && echo "NOTE: Clean apt cache in Dockerfile" >&2
5
+ exit 0
@@ -0,0 +1,6 @@
1
+ FILE=$(cat | jq -r '.tool_input.file_path // empty' 2>/dev/null)
2
+ case "$FILE" in *package.json) ;; *) exit 0;; esac
3
+ CONTENT=$(cat | jq -r '.tool_input.new_string // empty' 2>/dev/null)
4
+ DEPS=$(echo "$CONTENT" | grep -c '":' || echo 0)
5
+ [ "$DEPS" -gt 50 ] && echo "NOTE: $DEPS deps — consider reducing" >&2
6
+ exit 0
@@ -0,0 +1,5 @@
1
+ FILE=$(cat | jq -r '.tool_input.file_path // empty' 2>/dev/null)
2
+ case "$FILE" in *package.json) ;; *) exit 0;; esac
3
+ CONTENT=$(cat | jq -r '.tool_input.new_string // empty' 2>/dev/null)
4
+ echo "$CONTENT" | grep -q "peerDependencies" && echo "NOTE: Check for circular peer deps" >&2
5
+ exit 0
@@ -0,0 +1,4 @@
1
+ COMMAND=$(cat | jq -r '.tool_input.command // empty' 2>/dev/null)
2
+ echo "$COMMAND" | grep -qE 'git\s+commit' || exit 0
3
+ git diff --cached 2>/dev/null | grep -qE '^\+.*(debugger|pdb\.set_trace)' && echo "WARNING: Debug in staged" >&2
4
+ exit 0
@@ -0,0 +1,4 @@
1
+ CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
2
+ [ -z "$CONTENT" ] && exit 0
3
+ echo "$CONTENT" | grep -qE "\$\{.*eval|new Function" && echo "WARNING: eval in template" >&2
4
+ exit 0
@@ -0,0 +1,4 @@
1
+ CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
2
+ [ -z "$CONTENT" ] && exit 0
3
+ echo "$CONTENT" | grep -qE "^\s+\w+\.\w+\(" && echo "$CONTENT" | grep -q "await\|\.then\|\.catch" || echo "$CONTENT" | grep -qE "async" && echo "NOTE: Check for unhandled promises" >&2
4
+ exit 0
@@ -0,0 +1,4 @@
1
+ CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
2
+ [ -z "$CONTENT" ] && exit 0
3
+ echo "$CONTENT" | grep -qE "(state\.\w+\s*=|\.push\(|\.splice\()" && echo "$CONTENT" | grep -q "reducer\|Reducer" && echo "WARNING: Direct state mutation in reducer" >&2
4
+ exit 0
@@ -0,0 +1,4 @@
1
+ OUTPUT=$(cat | jq -r '.tool_result // empty' 2>/dev/null)
2
+ [ -z "$OUTPUT" ] && exit 0
3
+ echo "$OUTPUT" | grep -qiE 'password|api.key|secret.key|bearer\s+[a-zA-Z0-9]' && echo "WARNING: Secret in output" >&2
4
+ exit 0
@@ -0,0 +1,4 @@
1
+ CONTENT=$(cat | jq -r '.tool_input.new_string // .tool_input.content // empty' 2>/dev/null)
2
+ [ -z "$CONTENT" ] && exit 0
3
+ echo "$CONTENT" | grep -qE "\w+\s*&&\s*\w+\.\w+" && echo "NOTE: Consider optional chaining (?.) instead" >&2
4
+ exit 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-safe-setup",
3
- "version": "23.0.0",
3
+ "version": "24.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": {