summaryrefslogtreecommitdiff
path: root/frameworks/nextjs-15/.claude/settings.json
blob: fe4a7d1e37f0b0306b39193616f374a7b1036310 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
{
  "permissions": {
    "allow": [
      "Bash(npm run dev:*)",
      "Bash(npm run build:*)",
      "Bash(npm run lint:*)",
      "Bash(npm run test:*)",
      "Bash(npm run type-check:*)",
      "Bash(npx next:*)",
      "Write(app/**/*)",
      "Write(src/**/*)",
      "Write(components/**/*)",
      "Write(lib/**/*)",
      "Write(public/**/*)",
      "Read(next.config.js)",
      "Read(package.json)",
      "Read(tsconfig.json)",
      "Edit(tailwind.config.js)"
    ],
    "deny": [
      "Read(.env.production)",
      "Read(.env.local)",
      "Write(.env)",
      "Bash(rm -rf:*)",
      "Bash(npm publish:*)"
    ],
    "additionalDirectories": [
      "../components",
      "../lib"
    ]
  },
  "env": {
    "NODE_ENV": "development",
    "NEXT_PUBLIC_APP_ENV": "development"
  },
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Edit|MultiEdit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "sh -c 'file=\"$(echo \"$STDIN\" | jq -r .tool_input.file_path)\"; if [[ \"$file\" == *.tsx ]] || [[ \"$file\" == *.jsx ]]; then ext=\"${file##*.}\"; if grep -q \"useState\\|useEffect\\|useReducer\\|useCallback\\|useMemo\" \"$file\" 2>/dev/null; then if ! grep -q \"^['\\\"]use client['\\\"]\" \"$file\" 2>/dev/null; then echo \"⚠️  Warning: Client hooks detected. Add \\'use client\\' directive if needed.\"; fi; fi; fi'"
          }
        ]
      },
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "sh -c 'cmd=\"$(echo \"$STDIN\" | jq -r .tool_input.command)\"; if echo \"$cmd\" | grep -q \"^npm install\\|^yarn add\\|^pnpm add\"; then echo \"📦 Installing dependencies - checking for Next.js compatibility...\"; fi'"
          }
        ]
      }
    ],
    "PostToolUse": [
      {
        "matcher": "Write|MultiEdit",
        "hooks": [
          {
            "type": "command",
            "command": "sh -c 'file=\"$(echo \"$STDIN\" | jq -r .tool_input.file_path)\"; if [[ \"$file\" == app/**/page.tsx ]] || [[ \"$file\" == app/**/page.jsx ]]; then dir=\"$(dirname \"$file\")\"; if [ ! -f \"$dir/loading.tsx\" ] && [ ! -f \"$dir/loading.jsx\" ]; then echo \"💡 Tip: Consider adding a loading.tsx for better UX\"; fi; if [ ! -f \"$dir/error.tsx\" ] && [ ! -f \"$dir/error.jsx\" ]; then echo \"💡 Tip: Consider adding an error.tsx for error handling\"; fi; fi'"
          }
        ]
      },
      {
        "matcher": "Write|MultiEdit",
        "hooks": [
          {
            "type": "command",
            "command": "sh -c 'file=\"$(echo \"$STDIN\" | jq -r .tool_input.file_path)\"; if [[ \"$file\" == *.ts ]] || [[ \"$file\" == *.tsx ]]; then if which prettier >/dev/null 2>&1; then prettier --write \"$file\" 2>/dev/null || true; fi; fi'"
          }
        ]
      }
    ],
    "Stop": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "sh -c 'if [ -f \"package.json\" ] && [ -d \"app\" ]; then echo \"🚀 Next.js Tip: Run \\`npm run dev\\` to start the development server\"; if [ -f \"tsconfig.json\" ]; then echo \"📝 Run \\`npm run type-check\\` to verify TypeScript types\"; fi; fi'"
          }
        ]
      }
    ]
  },
  "statusLine": {
    "type": "command",
    "command": "echo '[Next.js 15] $(basename $(pwd))'"
  },
  "_metadata": {
    "name": "Next.js 15",
    "version": "1.0.0",
    "category": "framework",
    "generated": "2025-08-20T13:36:56.329Z",
    "generator": "manual",
    "note": "Official Claude Code configuration"
  }
}