-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhooks.json
More file actions
19 lines (19 loc) · 1.13 KB
/
Copy pathhooks.json
File metadata and controls
19 lines (19 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "bash \"$HOME/.claude/plugins/flutter-ddd-builder/hooks/dart-analyze.sh\"",
"timeout": 30,
"statusMessage": "Analyzing Dart file..."
},
{
"type": "prompt",
"prompt": "Check ONLY the Dart file just modified for these anti-patterns. If found, fix immediately:\n- `ref.watch(` outside `build()` → `ref.read(`\n- `Dio().fetch(` without interceptors → add ResponseInterceptor + ErrorInterceptor\n- Model file/class with `Dto` suffix → rename to `Model`\n- `@freezed` class with `factory` missing `const` → `const factory`\n- `@riverpod` function with `FooRef ref` → `Ref ref`\n- `await ref.read(notifier).action(); ref.read(provider).when(` → use ref.listen in build()\n- `.when(data:` inline in page body → use `AsyncValueWidget` widget\n- `EdgeInsets.all(16)` or similar hardcoded values → consider `AppSpacing.spacing4` tokens\n- Inline form validation logic → use `Validators.compose([...])` from validators.dart"
}
]
}
]
}