diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-01-17 02:51:28 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-01-17 02:51:28 +0900 |
| commit | 86fefda1bc009777ca91f5a3075f49741e419e3e (patch) | |
| tree | f1e8024bd90b2b0b5ada4e6ee71d3495eee58318 /frameworks/nextjs-15/.claude | |
| parent | 3fbb9a18372f2b6a675dd6c039ba52be76f3eeb4 (diff) | |
modified refactor/refactor-code.md, modified statuslines/statusline.sh, deleted hooks/hooks.json, modified .claude/settings.json
Diffstat (limited to 'frameworks/nextjs-15/.claude')
| -rw-r--r-- | frameworks/nextjs-15/.claude/hooks/hooks.json | 55 | ||||
| -rw-r--r-- | frameworks/nextjs-15/.claude/settings.json | 39 |
2 files changed, 33 insertions, 61 deletions
diff --git a/frameworks/nextjs-15/.claude/hooks/hooks.json b/frameworks/nextjs-15/.claude/hooks/hooks.json deleted file mode 100644 index a93954c..0000000 --- a/frameworks/nextjs-15/.claude/hooks/hooks.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "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'" - } - ] - } - ] - } -}
\ No newline at end of file diff --git a/frameworks/nextjs-15/.claude/settings.json b/frameworks/nextjs-15/.claude/settings.json index b7afb46..fe4a7d1 100644 --- a/frameworks/nextjs-15/.claude/settings.json +++ b/frameworks/nextjs-15/.claude/settings.json @@ -36,24 +36,51 @@ "hooks": { "PreToolUse": [ { - "matcher": "Write", + "matcher": "Edit|MultiEdit|Write", "hooks": [ { "type": "command", - "command": "echo 'Creating/updating file: $FILE_PATH'", - "timeout": 5 + "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|Edit", + "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": "npx prettier --write $FILE_PATH", - "timeout": 10 + "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'" } ] } |
