- Introduced backend patterns skill with guidelines on API design, database optimization, and server-side best practices. - Added coding standards skill outlining universal coding principles for TypeScript, NestJS, and Node.js development. - Implemented continuous learning skill to automatically extract reusable patterns from Cursor sessions. - Created NestJS best practices skill detailing architecture patterns, dependency injection, error handling, and security measures. - Included various rules and templates for NestJS best practices to ensure production-ready applications.
22 lines
984 B
Bash
Executable File
22 lines
984 B
Bash
Executable File
#!/bin/bash
|
|
# Cursor beforeShellExecution hook.
|
|
# Remind about tmux for long-running servers and review before git push.
|
|
|
|
input=$(cat)
|
|
command=$(echo "$input" | node -e "let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{try{const i=JSON.parse(d);process.stdout.write(i.command||i.tool_input?.command||'')}catch{}})")
|
|
|
|
if echo "$command" | grep -Eq 'npm run dev|pnpm( run)? dev|yarn dev|bun run dev'; then
|
|
if [ -z "$TMUX" ]; then
|
|
echo '{"permission":"ask","user_message":"Dev servers should run in tmux so logs stay available. Example: tmux new-session -d -s dev \"npm run dev\"","agent_message":"Dev server is not in tmux. Ask before continuing."}'
|
|
exit 0
|
|
fi
|
|
fi
|
|
|
|
if echo "$command" | grep -Eq 'git push'; then
|
|
echo '{"permission":"ask","user_message":"Review the diff before pushing. Continue only if the changes look correct.","agent_message":"git push requires a quick review before proceeding."}'
|
|
exit 0
|
|
fi
|
|
|
|
echo '{"permission":"allow"}'
|
|
exit 0
|