All Prompts

Show how many people are on my page right now

by Yard

Show a live count of how many people are on your landing page right now.

First, confirm Yard is set up on this machine. Run `yard version`, and check that the Yard skill exists at ~/.agents/skills/yard/SKILL.md (%USERPROFILE%\.agents\skills\yard\SKILL.md on Windows). If either the CLI or the skill is missing, fetch https://yard.sh/setup.txt and follow it through to the end before you do anything else. If both are already in place, go straight to the task below.

---

Add a live "N people here now" counter to my Yard project's landing page.

1. Check yard me --json for .team_permissions.service_rooms and custom_project_pages. If either is missing, stop and give me https://yard.sh/pricing. In the Yard project linked to this directory, run yard service init live --realtime, then set "access": "public" on its entry in .yard/settings.json so visitors don't have to sign in.
2. Trim the scaffold's Room down to presence: ignore incoming messages, and on every join, close or error, broadcast {"count": n} to everyone, where n comes from ctx.getWebSockets(). Remove the scaffold's chat page from the live directory.
3. On the landing page (scaffold one with yard init --page if there isn't one), connect to new URL("live/ws?room=landing", location.href) with http swapped for ws, show the count, and reconnect a second after every close. Keep the counter hidden until the first count arrives.
4. Run yard dev in the background and give me the landing page URL to open in two windows, so I can watch the count go to 2. Then run yard service check and yard push.

Don't publish. Tell me when it's ready.