add-notification-center
Skill50 starsChanged 21 days agoApache-2.0View on GitHub
Adds an in-app notification center to a Next.js app: a bell in the navigation bar, with a badge showing the number of unread notifications, a dropdown panel that lists the notifications, and read/unread state. Creates the `notification` table, the `notifyUser` server helper, the tRPC router, and the bell component. Independent of /add-push-notification (no required order): if push is present, the `notifyUser` helper also sends a system notification. Depends on /add-db and /add-auth (users mode).
1 other project uses a version of this.
Adopted by
Most recently taken up by
- flavien-ia/hypervibe-craftword for word, first seen Oct 25, 2026
Other versions1 project uses a version of this.
Word for word · 1
- flavien-ia/hypervibe-craft★ 50100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository89 other files it gives its agents.
- accessibilitySkill
- add-2faSkill
- add-agent-dashboardSkill
- add-aiSkill
- add-analyticsSkill
- add-authSkill
- add-automationSkill
- add-backup-dbSkill
- add-collabSkill
- add-cronSkill
- add-dark-modeSkill
- add-dbSkill
- add-domainSkill
- add-emailSkill
- add-github-authSkill
- add-google-authSkill
- add-i18nSkill
- _add-keyringSkill
- add-mapSkill
- add-push-notificationSkill
- add-pwaSkill
- add-roleSkill
- add-routineSkill
- add-storageSkill
- add-stripeSkill
- add-testSkill
- bootstrapSkill
- _check-depsSkill
- cleanSkill
- _collect-secretSkill
- _convert-to-turborepoSkill
- _create-agentSkill
- _create-cloudflare-workerSkill
- _create-contact-pageSkill
- _create-render-workerSkill
- _create-routineSkill
- _create-workflowSkill
- delete-projectSkill
- _detect-project-rootSkill
- _dns-brevoSkill
- _dns-cloudflareSkill
- _dns-gandiSkill
- _dns-godaddy-manualSkill
- _dns-hostingerSkill
- _dns-infomaniak-manualSkill
- _dns-ionos-manualSkill
- _dns-lwsSkill
- _dns-namecheapSkill
- _dns-ovhSkill
- _dns-porkbunSkill
- _dns-resendSkill
- _dns-squarespace-manualSkill
- eco-auditSkill
- _ensure-aiSkill
- _ensure-vaultSkill
- _generate-secretSkill
- geoSkill
- _get-secretSkill
- gscSkill
- _hash-passwordSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use plain, non-technical business language.
- Distinctive: line 15
When generating user-facing content for the scaffolded project (UI labels, emails, copy), write it in the user's language too.
- Very specific: line 39
Auth in users mode: read <WEB_DIR>/src/server/auth.ts, look for the // hypervibe:auth-modes marker.
- Distinctive: line 55
Push wiring (any order): check whether push is already installed:
- Very specific: line 100
Suggest push (if absent): check test -f "<WEB_DIR>/src/server/push.ts".
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add Notification Center: in-app bell (badge + list)
You add an in-app notification center: a bell with a badge showing the number of unread notifications, a panel that lists the notifications, and read/unread marking. This is different from system push: here the notifications live inside the app and remain available to consult.
Communication
- Detect the user's language from the conversation (the user's own messages, anywhere in the session - not just this invocation: a bare slash command like
/bootstrapcarries no language signal by itself). If nothing in the conversation gives a signal, fall back to the OS locale (node -e "console.log(Intl.DateTimeFormat().resolvedOptions().locale)") before defaulting to English. ALWAYS reply in that language for every user-facing message: questions, progress, confirmations, summaries, errors - including any example text quoted in this skill, which is illustrative and must be translated, never sent verbatim. - Use plain, non-technical business language. Never expose internal script names (*.mjs) or jargon; describe actions in human terms.
- When generating user-facing content for the scaffolded project (UI labels, emails, copy), write it in the user's language too.
- Show progress as a short natural-language checklist (in-progress and done states).
Step 0: Re-run? (idempotence)
Marker hypervibe:notification-center at the top of <WEB_DIR>/src/server/notify.ts.
test -f "<WEB_DIR>/src/server/notify.ts" && grep -q "hypervibe:notification-center" "<WEB_DIR>/src/server/notify.ts" && echo present || echo absent- present → menu: (1) reinstall the bell, (2) regenerate the router, (3) re-wire the push if
/add-push-notificationhas been added since. Handle it, then jump to the summary. - absent → Step 1.
Templates/scripts path: ${CLAUDE_SKILL_DIR}/../../templates/notif-center/.
Step 1: Prerequisites
- Detect project root: invoke
_detect-project-root→WEB_DIR,IS_MONOREPO,IS_NEXTJS. Abort if not Next.js. - Database: invoke
_check-deps db. Ifdb_ok = false, suggest/add-db, then re-check. - Auth in users mode: read
<WEB_DIR>/src/server/auth.ts, look for the// hypervibe:auth-modesmarker. If it does not containusers, suggest/add-auth(users mode): notifications are attached to a logged-in user.
(No dependency on /add-pwa or /add-push-notification: the in-app center is self-contained.)
Step 2: Notifications table
- Insert
templates/notif-center/schema-snippet.tsinto the Drizzle schema (<WEB_DIR>/src/server/db/schema.ts, orpackages/db/src/schema.tsin a monorepo), after theuserstable. Check the imports (boolean,index,text,timestamp,sql,createTable,users). cd "<WEB_DIR>" && pnpm db:push.
Step 3: notifyUser server helper (+ push wiring if present)
- Copy
templates/notif-center/notify.tsto<WEB_DIR>/src/server/notify.ts(keep the// hypervibe:notification-centermarker at the top and// hypervibe:notify-pushinside the function). - Push wiring (any order): check whether push is already installed:
test -f "<WEB_DIR>/src/server/push.ts" && grep -q "hypervibe:push" "<WEB_DIR>/src/server/push.ts" && echo push-present || echo push-absent- push-present → follow
templates/notif-center/notify-push-block.ts: add thesendPushToUserimport at the top ofnotify.tsand replace the marker line// hypervibe:notify-pushwithawait sendPushToUser(db, userId, payload);. (Idempotent: do not re-inject if it is already there.) That way a notification rings the bell and pushes to the phone. - push-absent → inject nothing (the marker stays, ready for when
/add-push-notificationis run: that skill is the one that will do the injection).
- push-present → follow
Step 4: tRPC router
- Copy
templates/notif-center/notifications-router.tsto<WEB_DIR>/src/server/api/routers/notifications.ts. - Wire it into
appRouter(<WEB_DIR>/src/server/api/root.ts):import { notificationsRouter } from "~/server/api/routers/notifications"; // inside createTRPCRouter({ ... }): notifications: notificationsRouter,
Step 5: The bell (UI)
- Copy
templates/notif-center/notification-bell.tsxto<WEB_DIR>/src/components/. Adapt the colors (the badge isbg-red-500by default; tokensborder-border/bg-background/text-muted-foregroundto adjust to the palette if needed). - Mount
<NotificationBell />in the header / navigation bar of the logged-in areas. Locate the header component (src/components/layout/header.tsx,navbar.tsx, or similar) and place it near the user actions (avatar, menu). If the placement is not obvious, ask the user where they want the bell.
Freshness model (do not "improve" it by shortening the interval): the badge updates through three channels — (a) real time, via the service-worker broadcast hv:new-notification that the bell listens to (fires when /add-push-notification is installed; a no-op otherwise), (b) refetchOnWindowFocus when the user comes back to the tab, (c) a 5-minute polling safety net. Never set refetchInterval below 300_000: a shorter poll keeps the Neon database awake around the clock for every active tab (it only autosuspends after 5 min without a query), which burns the free plan's 100 monthly compute hours. If the user asks for a snappier badge, the answer is installing /add-push-notification, not shortening the poll.
Step 6: CLAUDE.md + verification
- Invoke
_update-claude-md:stack:- **Notification center**: \notification` table, in-app bell (unread badge + list), `notifyUser` helper.`conventions:- Notify a user: \notifyUser(db, userId, { title, body, url })` from `~/server/notify` (persists for the bell, and sends a push if `/add-push-notification` is installed). `url` is an internal path (`/orders/12`): the bell and the system notification ignore anything else, so a click never leads to another site.`
cd "<WEB_DIR>" && pnpm tsc --noEmit && pnpm lint.
Step 7: Summary + cross-suggestion
Summarize:
- A bell is in place with the unread counter and the list of notifications.
- To create a notification from the server:
await notifyUser(db, userId, { title, body, url }), whereurlis an internal path (/orders/12).
Suggest push (if absent): check test -f "<WEB_DIR>/src/server/push.ts". If absent, suggest via AskUserQuestion:
You now have the bell inside the app. You can also add system notifications (push): they arrive on the user's phone even when the app is closed, and appear in the OS notification center.
The difference: the bell is available inside your app (history, read/unread); push grabs attention outside the app. The two complement each other, and
notifyUserwill automatically send both.
- Yes → run
/add-push-notification(which will detect the center and wire the push sending intonotifyUser). - No → "No problem, the bell works on its own. You can add push later with
/add-push-notification."
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

