Skip to content

feat(#585): interactive LLM game on the site with social score-sharing#586

Merged
atlas-apex merged 3 commits into
devfrom
feature/GH-585-site-llm-game
Jun 8, 2026
Merged

feat(#585): interactive LLM game on the site with social score-sharing#586
atlas-apex merged 3 commits into
devfrom
feature/GH-585-site-llm-game

Conversation

@atlas-apex

Copy link
Copy Markdown
Collaborator

Summary

Adds an interactive LLM Field Guide game to the marketing site at /game, with social score-sharing — a fun, low-friction top-of-funnel surface that teaches LLM/agent concepts and pulls players' networks back to the site.

  • site/game.html — the self-contained game (no build step; inline JS + Google Fonts, which the site's header policy already allows). Multi-level scored walkthrough of tokens, embeddings, temperature, prompting, knowledge cutoff, RAG, hallucination, prompt injection, the agent loop, and cost.
  • End-of-game "Share your score" — the results screen (renderOutro) now offers Post on X, LinkedIn, WhatsApp, and Copy link. Each carries the player's score and a link back to https://yard.apexscript.com/game, plus "via @me2resh" — X uses its native via=me2resh intent param; the others embed the credit in the message text. A quiet "← back to ApexYard" link closes the loop.
  • Social/SEO meta in the game's <head> — title, description, canonical, Open Graph, and Twitter Card (twitter:card=summary_large_image, twitter:site=@me2resh) so a shared link renders as a rich preview. (Reuses /og/index.png for now; a bespoke og/game.png is a nice follow-up.)
  • Discovery — "play the game" added to the primary nav and footer across index / how-it-works / architecture / skills, the 404 quick-links, and a homepage CTA (a button in the final section + a one-line teaser).
  • Routing/indexing/game clean URL via _redirects (matches the /skills, /architecture pattern); /game added to sitemap.xml.

Testing

  1. Open site/game.html locally → play through to the end → the "Share your score" row appears with X / LinkedIn / WhatsApp / Copy.
  2. Each share button opens the correct intent URL with the score, the game link, and "via @me2resh" (X via the native param). "Copy link" writes the full line to the clipboard.
  3. Inline JS validated with node --check (single script block, clean).
  4. bash .claude/hooks/tests/test_site_counts.sh — passes (index.html payload-size meta still within tolerance after the nav/CTA additions).
  5. Netlify will serve the page at the clean /game URL via the new _redirects rule.

Refs #585

Glossary

Term Definition
renderOutro The game's end-screen render function — where the total score, per-level breakdown, and the new share UI are built.
Intent URL A platform share endpoint (e.g. twitter.com/intent/tweet?..., wa.me/?text=...) that pre-fills a post; opened in a popup window.
via=me2resh X's intent-URL parameter that appends "via @me2resh" to the shared post, crediting the account.
OG / Twitter Card og:* / twitter:* meta tags that control the rich preview card a URL renders as when shared. summary_large_image shows a large image.
Clean URL A Netlify _redirects 200-rewrite serving /game.html at /game (no .html) — the site's canonical form.

…aring

Ships the 'LLM Field Guide' interactive game (self-contained, no build)
at /game, with an end-of-game 'Share your score' block.

- site/game.html: the game + SEO/OG/Twitter meta (twitter:site=@me2resh,
  canonical, summary_large_image). renderOutro now offers Post on X
  (via=me2resh), LinkedIn, WhatsApp, and Copy link — each carrying the
  score, a link back to the game, and 'via @me2resh' (X uses its native
  via param). Plus a quiet back-to-ApexYard link.
- Discovery: 'play the game' added to the primary nav + footer across
  index / how-it-works / architecture / skills, the 404 quick-links, and
  a homepage CTA (button + line in the final section).
- /game clean URL via _redirects; /game added to sitemap.xml.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@atlas-apex atlas-apex left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review: PR #586

Commit: f5c65dc47bec9645b9a7234adf90510787336b10

Summary

Adds a self-contained interactive "LLM Field Guide" game at /game on the marketing site, with end-of-game social score-sharing (X / LinkedIn / WhatsApp / Copy link), SEO/social <head> meta, nav + footer + 404 + homepage-CTA discovery links, a _redirects clean-URL rule, and a sitemap entry. Review focused on the author's two additions to game.html (head meta + the renderOutro share block) plus the nav/redirect/sitemap consistency — the bulk of game.html is provided third-party content.

Checklist Results

  • ✅ Architecture & Design: Pass — static-site content; no layering concerns
  • ✅ Code Quality: Pass
  • ✅ Testing: Pass (N/A for coverage — static HTML; node --check clean, confirmed locally)
  • ✅ Security: Pass — no secrets; share URLs properly encoded; noopener,noreferrer on popups
  • ✅ Performance: Pass — no new network deps beyond the existing Google Fonts
  • ✅ PR Description & Glossary: Pass — Summary narrative + Glossary present
  • ⚠ Summary Bullet Narrative: Pass (advisory) — bullets are narrative, not label-only
  • ✅ Technical Decisions (AgDR):N/A — content/marketing feature, no new architecture decision
  • ✅ Adopter Handbooks: N/A — no language handbooks triggered (no ts/py/go/rs); architecture/general/migration/commit handbooks don't apply to a static-site change; no private handbooks present

Issues Found

Verified correct (the author's additions):

  • Share-URL construction is correct and safe (game.html:1113-1120). msg and GAME_URL are passed through encodeURIComponent for the X intent URL (text + url params) and LinkedIn (url); WhatsApp encodes the full fullLine. The X via=me2resh native param is appended unencoded as a bare query value (correct — it's a literal handle, no special chars). No injection surface: all interpolated values are app-controlled (state.score, fixed strings).
  • Injected JS is sound — reuses the file's existing el() helper, which routes onClickaddEventListener('click', …) (game.html:884) and handles style objects + null children. window.open(u, '_blank', 'noopener,noreferrer,…') is the right safe popup shape.
  • Clipboard fallback is reasonable (game.html:1140-1145) — guards on navigator.clipboard && navigator.clipboard.writeText, .then(done).catch(done) so the "Copied ✓" affirmation fires on both success and rejection, and an else { done() } branch keeps the button responsive on browsers without the API. Minor caveat noted below.
  • Meta correctness — title/description/canonical, OG (og:type/site_name/url/title/description/image), and Twitter Card (summary_large_image, twitter:site/creator=@me2resh) are all well-formed with absolute https://yard.apexscript.com/game URLs. og:image/og/index.png exists on disk (51 KB). 12 og/twitter tags, single <script> block, balanced tags.
  • Nav / redirect / sitemap consistency — all discovery links use the clean /game form; _redirects appends /game /game.html 200 matching the existing /skills /architecture pattern (last-rule, no preceding catch-all to swallow it); sitemap <url> is well-formed (loc/lastmod/priority consistent with siblings).

Suggestions

  • suggestion (game.html:1141-1144): the no-clipboard-API path and the rejection path both call done(), which flips the label to "Copied ✓" even though nothing was copied. On a browser without navigator.clipboard (e.g. non-secure context / older mobile), the user sees "Copied ✓" but the clipboard is untouched. Low impact for a marketing game, but a prompt()-with-the-text fallback (or leaving the label unchanged) would avoid the false affirmation. Non-blocking.
  • nit: PR body already flags it — og:image reuses /og/index.png rather than a bespoke og/game.png. Fine to ship; a game-specific card is a nice follow-up for share preview punch.

Verdict

APPROVED

The two authored edits are correct, safe, and consistent with the site's established patterns. The one suggestion (clipboard false-positive label) is cosmetic and non-blocking.


🤖 Reviewed by Rex (Code Reviewer Agent)
📌 Reviewed commit: f5c65dc47bec9645b9a7234adf90510787336b10

me2resh and others added 2 commits June 8, 2026 21:12
Make the game catchier and clearly ApexYard-branded:
- Header now leads with the AY ApexYard mark + 'ApexYard · You vs. the
  LLM' (was an unbranded 'Field Guide · LLMs & Agents'); logo links home.
- Intro hero: 'You vs. the LLM' + a challenge hook ('Think you understand
  how AI actually works? Prove it.'); start button 'Take the challenge'.
- End screen + page title + OG/Twitter + share copy all renamed to
  'You vs. the LLM — an ApexYard game'; share line is now a beat-my-score
  hook. Homepage CTA/teaser + 404 updated to match.
- Folded in the two review a11y nits: share-label var(--faint) to
  var(--dim) for AA contrast; underline the back-to-ApexYard link.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Nour's editorial nit on PR #586: 'play: You vs. the LLM' reads awkward;
use an en-dash. 'play — You vs. the LLM'.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@atlas-apex atlas-apex merged commit fe743f9 into dev Jun 8, 2026
7 checks passed
@atlas-apex atlas-apex deleted the feature/GH-585-site-llm-game branch June 8, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants