cc-safe-setup 13.3.0 → 14.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 = **138 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)
9
+ 8 built-in + 124 examples = **140 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,12 @@
1
+ #!/bin/bash
2
+ # migration-safety.sh — Require backup before database migrations
3
+ # TRIGGER: PreToolUse MATCHER: "Bash"
4
+ COMMAND=$(cat | jq -r '.tool_input.command // empty' 2>/dev/null)
5
+ [ -z "$COMMAND" ] && exit 0
6
+ if echo "$COMMAND" | grep -qiE '\b(migrate|migration|alembic|knex|sequelize.*migrate|flyway)\b'; then
7
+ if ! echo "$COMMAND" | grep -qiE '(status|list|pending|--dry-run|--check)'; then
8
+ echo "WARNING: Database migration detected." >&2
9
+ echo "Ensure you have a backup before running migrations." >&2
10
+ fi
11
+ fi
12
+ exit 0
@@ -0,0 +1,9 @@
1
+ #!/bin/bash
2
+ # no-hardlink.sh — Warn on hard link creation
3
+ # TRIGGER: PreToolUse MATCHER: "Bash"
4
+ COMMAND=$(cat | jq -r '.tool_input.command // empty' 2>/dev/null)
5
+ [ -z "$COMMAND" ] && exit 0
6
+ if echo "$COMMAND" | grep -qE '\bln\b' && ! echo "$COMMAND" | grep -q '\-s'; then
7
+ echo "WARNING: Hard link creation detected. Use symbolic links (ln -s) instead." >&2
8
+ fi
9
+ exit 0
package/index.mjs CHANGED
@@ -539,8 +539,28 @@ function examples() {
539
539
  console.log();
540
540
  }
541
541
 
542
- console.log();
543
- console.log(c.dim + ' Copy any example to ~/.claude/hooks/ and add to settings.json.' + c.reset);
542
+ // Show batch install command if filtered
543
+ const allFiltered = [];
544
+ for (const [cat, hooks] of Object.entries(CATEGORIES)) {
545
+ const fh = filter
546
+ ? Object.entries(hooks).filter(([file, desc]) =>
547
+ cat.toLowerCase().includes(filter) ||
548
+ file.toLowerCase().includes(filter) ||
549
+ desc.toLowerCase().includes(filter))
550
+ : Object.entries(hooks);
551
+ for (const [file] of fh) allFiltered.push(file.replace('.sh', ''));
552
+ }
553
+
554
+ if (filter && allFiltered.length > 0 && allFiltered.length <= 20) {
555
+ console.log(c.dim + ' Install all filtered hooks:' + c.reset);
556
+ for (const h of allFiltered) {
557
+ console.log(c.dim + ` npx cc-safe-setup --install-example ${h}` + c.reset);
558
+ }
559
+ console.log();
560
+ }
561
+
562
+ console.log(c.dim + ' Or install any single hook:' + c.reset);
563
+ console.log(c.dim + ' npx cc-safe-setup --install-example <name>' + c.reset);
544
564
  console.log(c.dim + ' Source: ' + c.blue + 'https://github.com/yurukusa/cc-safe-setup/tree/main/examples' + c.reset);
545
565
  console.log();
546
566
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-safe-setup",
3
- "version": "13.3.0",
3
+ "version": "14.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": {