cc-safe-setup 24.0.0 → 25.1.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/check-csrf-protection.sh +4 -0
- package/examples/check-error-boundaries.sh +4 -0
- package/examples/check-error-message.sh +4 -0
- package/examples/check-input-validation.sh +4 -0
- package/examples/check-rate-limiting.sh +4 -0
- package/examples/check-semantic-versioning.sh +4 -0
- package/examples/no-cleartext-storage.sh +4 -0
- package/examples/no-console-time.sh +4 -0
- package/examples/no-dangerouslySetInnerHTML.sh +4 -0
- package/examples/no-mixed-line-endings.sh +4 -0
- package/examples/no-open-redirect.sh +4 -0
- package/examples/no-path-join-user-input.sh +4 -0
- package/examples/no-prototype-pollution.sh +4 -0
- package/examples/no-todo-without-issue.sh +4 -0
- package/examples/no-xml-external-entity.sh +4 -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 + 124 examples = **
|
|
9
|
+
8 built-in + 124 examples = **235 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 "<form.*method.*POST" && ! echo "$CONTENT" | grep -qE "csrf|_token|csrfmiddleware" && echo "NOTE: Form without CSRF protection" >&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 "class.*extends.*Component|function.*\(\)" && echo "$CONTENT" | grep -q "render" && ! echo "$CONTENT" | grep -q "ErrorBoundary" && echo "NOTE: Consider adding ErrorBoundary" >&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 "throw new Error\(['\"](error|Error|something went wrong)" && echo "NOTE: Generic error message — be specific" >&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 "req\.(body|query|params)\.\w+" && ! echo "$CONTENT" | grep -qE "validate|sanitize|Joi|zod|yup" && echo "NOTE: User input without validation" >&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 "app\.(get|post|put|delete)\(" && ! echo "$CONTENT" | grep -q "rateLimit" && echo "NOTE: API endpoint without rate limiting" >&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 "TODO[^(]|FIXME[^(]" && ! echo "$CONTENT" | grep -qE "TODO\(#|FIXME\(#" && echo "NOTE: TODO without issue reference" >&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 "parseXML|xml2js|DOMParser|libxml" && echo "$CONTENT" | grep -q "ENTITY" && echo "WARNING: Possible XXE in XML parsing" >&2
|
|
4
|
+
exit 0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-safe-setup",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.1.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": {
|