farhanhidayatulhaq-max/GAMUKIS / .agents/skills/gamukis-prd-guard
gamukis-prd-guard
VerifiedUse before modifying inGame features, score history, profile and role selection, auth tokens, membership, or Gamukis admin endpoints, providing a checklist of non-negotiable PRD invariants and their source files.
Gamukis PRD Guard
Full specifications are detailed in .agents/docs/prd-standard.md (§1 structure, §2 inGame, §3 profiles). Inspect this checklist before and after editing.
Structure
- API clients, Firebase SDK, and Socket.IO client instances reside exclusively in
Frontend/src/database/. It is strictly prohibited to createFrontend/src/apiorFrontend/src/services. - Backend architecture:
routes/<feature>Route.js,services/<feature>Service.js,models/<feature>Model.js. MySQL connection pool must useutf8mb4.
inGame and Score History
- Realtime events:
game:join,player:move,player:updated,coin:claimed,leaderboard:updated; session state stored in Redis. - Game completion or game over triggers
saveGameHistory()→POST /api/players/history→historyService.js→ MySQLhistorytable. POST /historyMUST NOT be blocked by role-basedrequirePermissionmiddleware. Guests and users without an assigned role must still be permitted to persist scores.- Guests use the default sprite; registered users with customization load color, hair, and clothing preferences from their profile.
Profiles and Roles
- Manual accounts:
personalInfo.js→POST /api/auth/manual/profile→ tablesusers+users_detail(linked viauser_id). - Google accounts:
completeProfile.js/personalInfo.js→POST /api/auth/profileorPUT /api/auth/complete-profile→google_user_profiles(PKfirebase_uid), mirrored to Firebase RTDB. getEffectiveTokenmust prioritize the Firebase ID token when logged in via Firebase, avoiding stale manual tokens inlocalStorage(preventing 401 Unauthorized errors).- Student role is activated immediately. Teacher role creates a record in
teacher_applicationswith statuspending; administrators approve or reject viaPOST /api/admin/teacher-applications/:id/approve|reject; upon approval, role becomesteacher. - An unset role must not be treated as confirmed, and permissions must not be broadened merely to make requests succeed.
Admin and Security
- All administrative actions require:
authenticateAny+requirePermission(...); server-side input validation; destructive operations must have guards (409) and audit logging. - Do not delete existing routes or response keys.
JWT_SECRETmust be configured in production; do not introduce static fallback secrets.- Never read or write credentials (
.env,firebase-service-account.json,id_rsa*, database passwords).
Discrepancies Between Documentation and Code
Running code represents ground truth. Report discrepancies in the handoff log and request an Architect/Lead decision; do not align them silently.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |