Repository navigation
Expand file tree
/
Copy pathsettings.json
More file actions
151 lines (151 loc) · 5 KB
/
Copy pathsettings.json
File metadata and controls
151 lines (151 loc) · 5 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
{
"respectGitignore": false,
"permissions": {
"allow": [
"Bash(curl -s* https://*batuda.localhost/*)",
"Bash(curl -s* http://*batuda.localhost/*)",
"Bash(curl -s* http://localhost:3001/*)",
"Bash(pnpm --filter * check-types)",
"Bash(pnpm --filter * build)",
"Bash(pnpm cli *)",
"Bash(pnpm check-types)",
"Bash(npm view *)",
"Bash(agent-browser open *)",
"Bash(agent-browser close *)",
"Bash(agent-browser snapshot *)",
"Bash(agent-browser network *)",
"Bash(agent-browser screenshot *)",
"Bash(agent-browser console *)",
"Bash(agent-browser --help)",
"Edit(.claude/skills/**)"
]
},
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/worktree-up.sh"
}
]
}
],
"PreToolUse": [
{
"matcher": "Edit",
"hooks": [
{
"type": "command",
"command": "f=$(jq -r '.tool_input.file_path'); if [[ \"$f\" == *apps/server/src/db/migrations/0* ]]; then echo '{\"permissionDecision\": \"ask\", \"reason\": \"Modifying an existing Effect SQL migration can break deployments\"}'; else echo '{\"decision\": \"approve\"}'; fi"
}
]
},
{
"matcher": "Write",
"hooks": [
{
"type": "command",
"command": "f=$(jq -r '.tool_input.file_path'); if [[ \"$f\" == *apps/server/src/db/migrations/* ]]; then if [[ \"$f\" =~ [0-9]{4}_[a-z_]+\\.ts$ ]]; then echo '{\"decision\": \"approve\"}'; else echo '{\"decision\": \"block\", \"reason\": \"Migration must match NNNN_description.ts (e.g. 0002_add_contacts.ts)\"}'; fi; else echo '{\"decision\": \"approve\"}'; fi"
}
]
},
{
"matcher": "Read",
"hooks": [
{
"type": "command",
"command": "f=$(jq -r '.tool_input.file_path'); if [[ \"$f\" == *.env ]] && [[ \"$f\" != *.env.example ]]; then echo '{\"decision\": \"block\", \"reason\": \"Never read .env or credentials. Use Config.string() in Effect code.\"}'; else echo '{\"decision\": \"approve\"}'; fi"
}
]
},
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "cmd=$(jq -r '.tool_input.command'); if echo \"$cmd\" | grep -qE 'git push.*(--force-with-lease)'; then echo '{\"decision\": \"approve\"}'; elif echo \"$cmd\" | grep -qE 'git push.*([[:space:]]--force([[:space:]]|$)|[[:space:]]-f([[:space:]]|$))'; then echo '{\"decision\": \"block\", \"reason\": \"Force push is destructive. Use --force-with-lease or ask the user first.\"}'; else echo '{\"decision\": \"approve\"}'; fi",
"if": "Bash(git push*)"
}
]
},
{
"matcher": "Agent",
"hooks": [
{
"type": "command",
"command": "jq -r '[.tool_input.subagent_type // \"general\", .tool_input.description // \"no description\"] | @tsv' | while read -r type desc; do echo \"[$(date +'%Y-%m-%d %H:%M:%S')] Agent: $type | $desc\" >> /Users/guillem/programacio/codi/autonom/batuda/.claude/agent-audit.log; done; echo '{\"decision\": \"approve\"}'",
"async": true
}
]
}
],
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "f=$(jq -r '.tool_input.file_path'); if [[ \"$f\" == *.ts || \"$f\" == *.tsx || \"$f\" == *.json ]]; then biome check --write --no-errors-on-unmatched \"$f\" 2>/dev/null; elif [[ \"$f\" == *.md ]]; then dprint fmt \"$f\" 2>/dev/null; fi; true",
"timeout": 10
}
]
},
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "f=$(jq -r '.tool_input.file_path'); if [[ \"$f\" == *packages/domain/src/schema/*.ts ]] && [[ \"$f\" != *.test.ts ]]; then echo '{\"systemMessage\": \"Domain schema changed. Check if an Effect SQL migration is needed in apps/server/src/db/migrations/\"}'; fi; true"
}
]
},
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/lingui-remind.sh"
}
]
},
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "f=$(jq -r '.tool_input.file_path'); if [[ \"$f\" == *apps/server/src/db/migrations/* ]]; then echo \"[$(date +'%Y-%m-%d %H:%M:%S')] $f\" >> /Users/guillem/programacio/codi/autonom/batuda/.claude/migration-audit.log; fi; true",
"async": true
}
]
}
],
"SubagentStop": [
{
"hooks": [
{
"type": "command",
"command": "cd /Users/guillem/programacio/codi/autonom/batuda && git diff --name-only HEAD 2>/dev/null | grep -qE '\\.(ts|tsx)$' && echo '{\"systemMessage\": \"TypeScript files changed. Run: pnpm check-types\"}' || true"
}
]
}
],
"WorktreeRemove": [
{
"hooks": [
{
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/worktree-down.sh"
}
]
}
]
},
"enabledPlugins": {
"frontend-design@claude-plugins-official": true,
"readability-improver@ai-standards": true,
"test-bdd@ai-standards": true,
"unikraft@ai-standards": true,
"a11y-accessibility-reviewer@ai-standards": true
}
}