4049efe186
- Fix bot card header overflow by replacing "Sync with Telegram" text button with icon button, add flex-wrap - Rename sync button label to "Sync Commands" - Remove decorative dashes from selector placeholders (— X — → X) - Show selected provider name/icon in dashboard stat card when global provider filter is active - Add selector placeholder convention to frontend-architecture.md
3.1 KiB
3.1 KiB
Project Guidelines
Detailed context is split into focused documents under .claude/docs/. Read the relevant file when working in that area.
| Area | File | Key rules |
|---|---|---|
| Dev servers & credentials | dev-servers.md | MUST restart backend after code changes; frontend restart on request |
| Frontend architecture | frontend-architecture.md | Svelte 5 runes, overlays, entity cache system, i18n, auth flow |
| Backend architecture | backend-architecture.md | SQLAlchemy async constraints, Jinja2 sandbox, route ordering |
| Entity relationships | entity-relationships.md | Full entity graph and DB conventions |
| Template system | template-system.md | 6-file sync rule for template variables |
Critical Rules (always apply)
- Restart backend after ANY change to
packages/server/orpackages/core/— see dev-servers.md for the one-liner. - Overlays MUST use
position: fixedwith inline styles andz-index: 9999— see frontend-architecture.md. - Template variables must be updated in 6 files simultaneously — see template-system.md.
- Entity cache — shared entities use
$state-based caches infrontend/src/lib/stores/caches.svelte.ts. Always use cache for cross-page data; invalidate after mutations — see frontend-architecture.md. - Selector placeholders — use plain text without decorative dashes.
Select provider...not— Select provider —— see frontend-architecture.md. - Telegram API — ALL Telegram Bot API calls (sendMessage, sendPhoto, sendMediaGroup, etc.) MUST go through
TelegramClientinpackages/core/src/notify_bridge_core/notifications/telegram/client.py. NEVER duplicate sending logic in command handlers, API routes, or services. IfTelegramClientlacks a method you need, add it there. - Service provider defaults — when implementing a new service provider, ALWAYS create default notification and command templates and configs. This requires changes across all of these locations:
- Jinja2 notification templates for each locale in
packages/core/src/notify_bridge_core/templates/defaults/{en,ru}/ - Jinja2 command templates for each locale in
packages/core/src/notify_bridge_core/templates/command_defaults/{en,ru}/{provider}/ - Notification slot mapping in
packages/core/src/notify_bridge_core/templates/defaults/loader.py(PROVIDER_SLOT_FILE_MAP) - Command slot mapping in
packages/core/src/notify_bridge_core/templates/command_defaults/loader.py(PROVIDER_COMMAND_SLOTS) - Provider capabilities in
packages/core/src/notify_bridge_core/providers/capabilities.py - Seed functions in
packages/server/src/notify_bridge_server/database/seeds.py(notification templates, command templates, tracking configs, command configs)
- Jinja2 notification templates for each locale in