AgentSkillsCN

gamification-sim

ChoreWars 中用于模拟游戏化场景的工具。通过此工具重置数据库,并注入特定的测试数据(积分、连续打卡记录、家务任务),以验证排行榜、数据分析或用户界面的行为表现。

SKILL.md
--- frontmatter
name: gamification-sim
description: Tools for simulating gamification scenarios in ChoreWars. Use this to reset the database and inject specific test data (points, streaks, chores) to verify leaderboard, analytics, or UI behavior.

Gamification Simulator

This skill helps you test gamification features by injecting specific data states into the database.

Quick Start

To inject a specific scenario (e.g., competitive-family):

bash
node gamification-sim/scripts/run_scenario.cjs competitive-family

To reset to a clean state:

bash
node gamification-sim/scripts/run_scenario.cjs clean-slate

Available Scenarios

See scenarios.md for details on:

  • clean-slate: Wipes all data and creates a single Admin ("Dad").
  • competitive-family: Adds multiple members with high points and streaks.
  • overdue-crisis: Injects several overdue chores for a specific member.
  • analytics-rich: Creates 30 days of historical logs for chart testing.

Workflows

Testing Leaderboard

  1. Run: node gamification-sim/scripts/run_scenario.cjs competitive-family
  2. Open the frontend and navigate to /leaderboard.
  3. Verify members are ranked correctly by XP.

Testing Analytics

  1. Run: node gamification-sim/scripts/run_scenario.cjs analytics-rich
  2. Navigate to /admin/reports.
  3. Verify charts show data trends over the last month.

Customization

To add new scenarios, edit gamification-sim/scripts/inject_scenario.ts. The run_scenario.cjs wrapper will automatically pick up your changes.