npx skills add github/awesome-copilot --skill game-engine
seanchiuai/teachify · Archived
game-engine
Game state machine, lobby system, question flow, scoring, and real-time game coordination
Installation
npx skills add seanchiuai/teachify --skill game-engine
Stronger alternatives
This repository is archived — consider an actively maintained alternative.
shadcn/ui patterns, game UI components, responsive layouts for classroom use
1 installsExpert skill for building web-based game engines and games using HTML5, Canvas, WebGL, and Java…
12.6K installsPragmatic patterns for building multiplayer games: matchmaking, tick loops, realtime state, int…
7.2K installsUse when Codex is building or iterating on a web game (HTML/JS) and needs a reliable developmen…
1.1K installsSimilar popular skills
Related neighbors and high-traction skills in the same topics — useful to compare before installing.
Comprehensive AI prompt engineering safety review and improvement prompt. Analyzes prompts for …
10.2K installsAdd real-time voice conversations to a custom agent runtime with ElevenLabs Speech Engine.
3.2K installsInspect an agent repository and optional traces, interview the user, write reviewed Task Specs,…
2.4K installsIteratively inspect traces, interview the user, and create LangSmith online evaluators one at a…
1.7K installsBuilds and modifies dbt models, writes SQL transformations using ref() and source(), creates te…
902 installsUse this skill when wiring the DOCA SHA Offload Engine (an OpenSSL ENGINE) into an existing Ope…
117 installsAlso in this package
Other skills from seanchiuai/teachify.
npx skills add seanchiuai/teachify
More details
Agent compatibility
Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.
Also listed on
Alternate registries and mirrors of this skill.
npx skills add https://modelscope.cn/skills/@github/game-engine
Repository health
main
Package contents
Files included with this skill beyond the listing page.
-
skill md
SKILL.md3,595 B -
docs
SUMMARY.md108 B
History
- First seen on skills.sh
- First recorded snapshot · 2 installs
SKILL.md
Game Engine
Manages the game lifecycle from lobby to completion — state transitions, question progression, answer tracking, scoring, iframe communication, and real-time coordination between host and players.
Overview
- State Machine: lobby → playing → question → results → complete
- Host Controls: Start game, next question, show results
- Player Flow: Join lobby, play AI-generated game in sandboxed iframe, see feedback, view leaderboard
- Iframe Architecture: Parent owns game state, iframe is a dumb renderer, communication via MessageChannel
- Scoring: Points based on correctness + speed (validated server-side, not in iframe)
- Real-time: All state changes sync instantly via Convex
When to Use This Skill
- Building or modifying the game state machine
- Implementing host controls (start, next, results)
- Building the iframe sandbox and MessageChannel communication
- Building the player answer flow (iframe → parent → Convex)
- Implementing scoring logic (server-side validation)
- Handling edge cases (disconnects, late joins, timeouts, iframe errors)
Key Concepts
State Machine
lobby → playing → question ←→ results → complete
↑ |
└──────────────┘ (next question)
- lobby: Players joining, host waiting to start
- playing: Transitional state when game starts
- question: Active question, players submitting answers
- results: Showing answer results + leaderboard for current question
- complete: All questions done, final results displayed
State Transitions
| From | To | Trigger |
|---|---|---|
| lobby | question | Host clicks "Start Game" |
| question | results | Host clicks "Show Results" OR timer expires |
| results | question | Host clicks "Next Question" (if questions remain) |
| results | complete | Host clicks "Next Question" on last question |
Scoring Formula
Points = correctness_points + speed_bonus
correctness_points = correct ? 1000 : 0
speed_bonus = correct ? max(0, 500 * (1 - timeMs / timerDuration)) : 0
Max points per question: 1500 (correct + fastest possible)
Timer
- Default: 30 seconds per question
- Timer runs in the parent app (authoritative), not in the iframe
- iframe can display a visual countdown, but parent enforces the actual limit
- When timer expires, parent sends
TIME_UPto iframe via MessageChannel
Iframe Communication
Parent and iframe communicate via a private MessageChannel:
- Parent creates
MessageChannel, transfers one port to iframe via initialpostMessage - All subsequent communication flows through the private channel port
- Never combine
allow-scripts+allow-same-originin sandbox
Parent as Source of Truth
- Parent owns game state — iframe is a rendering engine
- Scoring happens server-side (Convex), not in the iframe
- If iframe crashes, parent still has game state and can recover
- iframe cannot be trusted for authoritative state (it runs AI-generated code)
Related Files
convex/games.ts— Game state mutationsconvex/answers.ts— Answer submission and scoringconvex/players.ts— Player management and scorescomponents/GameIframe.tsx— Sandboxed iframe wrapper with MessageChannel
Reference Files
- [reference.md](reference.md) — Code patterns for state management and iframe communication