mirror of
https://github.com/duthaho/claudekit.git
synced 2026-07-20 14:31:00 +03:00
feat: add hooks and rules
This commit is contained in:
+35
-8
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/claude-code-settings.json",
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(git:*)",
|
||||
@@ -16,21 +17,47 @@
|
||||
"Bash(prettier:*)",
|
||||
"Bash(tsc:*)",
|
||||
"Bash(docker:*)",
|
||||
"Bash(gh:*)",
|
||||
"Read(*)",
|
||||
"Write(*)",
|
||||
"Edit(*)"
|
||||
"Bash(gh:*)"
|
||||
],
|
||||
"deny": []
|
||||
"deny": [
|
||||
"Read(.env*)",
|
||||
"Write(.env*)",
|
||||
"Edit(.env*)",
|
||||
"Read(**/secrets/**)",
|
||||
"Write(**/secrets/**)",
|
||||
"Edit(**/secrets/**)"
|
||||
]
|
||||
},
|
||||
"hooks": {
|
||||
"PostToolUse": [
|
||||
"PreToolUse": [
|
||||
{
|
||||
"matcher": "Write",
|
||||
"matcher": "Bash",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "if [[ \"$FILE\" == *.py ]]; then ruff check --fix \"$FILE\" 2>/dev/null || true; elif [[ \"$FILE\" == *.ts || \"$FILE\" == *.tsx ]]; then npx eslint --fix \"$FILE\" 2>/dev/null || true; fi"
|
||||
"command": "node .claude/hooks/block-dangerous-commands.cjs"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"PostToolUse": [
|
||||
{
|
||||
"matcher": "Write|Edit",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node .claude/hooks/auto-format.cjs"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"Notification": [
|
||||
{
|
||||
"matcher": "",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node .claude/hooks/notify.cjs"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user