From 39d2af998185fc4d206d9ac58c03c06ce79ff3fb Mon Sep 17 00:00:00 2001 From: gavrielc Date: Thu, 16 Apr 2026 12:58:40 +0300 Subject: [PATCH] feat(v2): track unregistered senders + setup improvements - Add unregistered_senders table to capture dropped message origins (one row per sender, upserted with message_count and last_seen) - Add inbound DM logging to chat-sdk-bridge for debugging - Add vercel CLI to base container image - Install vercel-cli and frontend-engineer container skills - Default requiresTrigger to false in register step Co-Authored-By: Claude Opus 4.6 (1M context) --- container/Dockerfile | 2 +- container/skills/frontend-engineer/SKILL.md | 157 ++++++++++++++++++++ container/skills/vercel-cli/SKILL.md | 134 +++++++++++++++++ setup/register.ts | 2 +- src/channels/chat-sdk-bridge.ts | 1 + src/db/dropped-messages.ts | 44 ++++++ src/db/migrations/008-dropped-messages.ts | 27 ++++ src/db/migrations/index.ts | 3 +- src/router.ts | 48 +++++- 9 files changed, 412 insertions(+), 6 deletions(-) create mode 100644 container/skills/frontend-engineer/SKILL.md create mode 100644 container/skills/vercel-cli/SKILL.md create mode 100644 src/db/dropped-messages.ts create mode 100644 src/db/migrations/008-dropped-messages.ts diff --git a/container/Dockerfile b/container/Dockerfile index 32ae1a0..32ce0b9 100644 --- a/container/Dockerfile +++ b/container/Dockerfile @@ -31,7 +31,7 @@ ENV AGENT_BROWSER_EXECUTABLE_PATH=/usr/bin/chromium ENV PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/chromium # Install agent-browser and claude-code globally -RUN npm install -g agent-browser @anthropic-ai/claude-code +RUN npm install -g agent-browser @anthropic-ai/claude-code vercel # Create app directory WORKDIR /app diff --git a/container/skills/frontend-engineer/SKILL.md b/container/skills/frontend-engineer/SKILL.md new file mode 100644 index 0000000..5289ad7 --- /dev/null +++ b/container/skills/frontend-engineer/SKILL.md @@ -0,0 +1,157 @@ +--- +name: frontend-engineer +description: Pro frontend engineering discipline. Enforces build-test-verify workflow for every web project. Never declare done until the site is built, tested, responsive, accessible, and visually verified in a real browser. Use alongside vercel-cli for production-quality deployments. +--- + +# Frontend Engineer + +You are a senior frontend engineer. You build production-quality websites and web applications. You do not cut corners. You do not declare work done until everything is tested and working. + +## Core Rule + +**Never say "done" until you have visually verified the result in a real browser.** Screenshots are your proof. If you can't take a screenshot, you're not done. + +## Build Workflow + +Every frontend task follows this sequence. Do not skip steps. + +### 1. Understand Before Coding + +- For existing projects: read `package.json`, check existing patterns, components, and design tokens before changing anything +- For new projects: pick the right tool (Next.js for full apps, Vite for SPAs, plain HTML/CSS for simple pages) +- **Search the codebase before creating any new component.** If an existing component does 80% of what you need, extend it with props. If two components share the same pattern, extract a shared component. + +### 2. Write Quality Code + +**TypeScript:** +- Use TypeScript for all code +- Avoid `any` — prefer `unknown` with type guards. If `any` is genuinely the simplest correct approach (e.g. third-party lib interop), use it sparingly +- Annotate return types; explicit interfaces for all props and API responses + +**React / Next.js (when using App Router):** +- Server Components by default — minimize `use client`, `useEffect`, `setState` +- Never define components inside other components (causes remounts, lost focus, broken state) +- Use `Suspense` with fallback for client components +- Dynamic import for non-critical components: `const Heavy = dynamic(() => import('./Heavy'))` +- Wrap only small leaf components with `use client`, not entire page trees +- Use `Promise.all()` for independent async operations — never create waterfalls + +**Imports / Bundle Size:** +- Import directly from source files, never from barrel/index files (saves 200-800ms per import) +- Use `optimizePackageImports` in next.config for icon/UI libraries (lucide-react, @mui/material, etc.) +- Defer third-party scripts; lazy load below-the-fold content + +**HTML:** +- Semantic tags: `
`, `