All Prompts

Add a "Check for updates" button

by Yard

Let your app find, show and download its newest release using the user's license key.

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 "Check for updates" action to my app that finds the newest release on Yard and downloads it with the user's license key.

1. Find where the app stores the user's Yard license key and where its current version number lives. If the app doesn't store a license key yet, stop and tell me, because the update server authenticates with that key.
2. Call GET https://api.yard.sh/v1/updates/latest?license_key=<key>. No API key is needed. The response matches GitHub's Releases API: compare its tag_name with the running version (ignore a leading "v").
3. If it's newer, show the release name and notes (body), pick the asset that matches this OS and CPU, and download it from its browser_download_url. That URL redirects to a short-lived link, so follow redirects and start the download right away.
4. Turn errors into friendly messages: 404 "No releases found" means nothing is published yet, 403 means the purchase was refunded or the trial has expired (offer a link to buy again), and network failures should never block the app.

Don't auto-install anything. Download it and tell the user where it is, unless the app already has an installer flow I point you to.