wechat-weekly-leaderboard

WeChat 每周排行榜:用于在微信小游戏原生 Canvas JavaScript 中新增或修复每周好友高分榜。适用于需要开放数据域好友榜、使用 wx.setUserCloudStorage 上报、wx.getFriendCloudStorage 渲染、每周重置/筛选、sharedCanvas 绘制、本地回退分数、榜单面板或处理好友排行闪烁后退回仅本地分数问题的场景。

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "wechat-weekly-leaderboard":https://skillpi.com/zh/skills/deepskill-36b1b8e411deea94c6846d33319d55d9c8d2cbde4ab14cfc204361e92250041c。安装前核对上游来源和版本:https://skillhub.cn/skills/user_c830ad09/wechat-weekly-leaderboard。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

skillhub.cn

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

WeChat 每周排行榜:用于在微信小游戏原生 Canvas JavaScript 中新增或修复每周好友高分榜。适用于需要开放数据域好友榜、使用 wx.setUserCloudStorage 上报、wx.getFriendCloudStorage 渲染、每周重置/筛选、sharedCanvas 绘制、本地回退分数、榜单面板或处理好友排行闪烁后退回仅本地分数问题的场景。

0 下载

介绍来源: third_party · user_c830ad09 · 1.0.0 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: wechat-weekly-leaderboard
description: Add or fix a weekly high-score friend leaderboard in a WeChat mini game. Use when working on native Canvas JavaScript mini games that need open data domain leaderboards, wx.setUserCloudStorage reporting, wx.getFriendCloudStorage rendering, weekly reset/filtering, sharedCanvas drawing, local fallback scores, ranking panels, or bugs where the friend ranking flashes then falls back to only local/self score.

WeChat Weekly Leaderboard

Overview

Implement WeChat mini game weekly friend leaderboards through the open data domain. Keep the main domain responsible for game state, score submission, panel layout, and sharedCanvas compositing; keep the open data domain responsible only for relationship-chain data reads and leaderboard drawing.

Read references/wechat-open-data-weekly.md before editing leaderboard code. It contains the implementation contract, message schema, async rendering guardrails, and validation checklist.

Workflow

  1. Read the project rules first, especially AGENTS.md and any existing directory conventions.
  2. Locate existing entry points: game.js, game.json, score/state logic, renderer/panel logic, storage helpers, and any open-data/ directory.
  3. If the project lacks leaderboard structure, add or document these roles before coding:
    • Main domain bridge, usually js/leaderboard.js.
    • Open data domain entry, usually open-data/index.js and open-data/game.js.
    • game.json openDataContext configuration.
    • README or project notes for backend configuration of the leaderboard key.
  4. Implement main-domain score submission:
    • Keep a local weekly best record keyed by week id.
    • Submit only the best weekly score through wx.setUserCloudStorage.
    • Store the value as JSON with wxgame.score, wxgame.update_time, weekId, and optional metadata such as bestLevel.
  5. Implement main-domain panel drawing:
    • Send showWeeklyLeaderboard messages with content size, pixel ratio, key, week id, local/self score, and current run metadata.
    • Resize and draw sharedCanvas inside the existing panel rectangle.
    • Provide a short loading fallback when open data is unavailable.
  6. Implement open-data rendering:
    • Read friends with wx.getFriendCloudStorage({ keyList: [key] }).
    • Read self with wx.getUserCloudStorage when available.
    • Normalize both WeChat ranking JSON and plain numeric values.
    • Filter out scores from other weeks.
    • Merge local self fallback only when cloud self data is missing or stale.
    • Sort descending, dedupe self, and render rows to sharedCanvas.
  7. Protect async rendering:
    • Use monotonically increasing request ids to ignore stale callbacks.
    • Cache the latest valid friend-inclusive rows for the current key + weekId.
    • Do not let a later retry or failed request overwrite a displayed friend list with a self-only fallback.
  8. Validate with syntax checks and a mocked open-data scenario where possible.

Implementation Rules

  • Do not put main game logic in open-data/.
  • Do not use a backend, cloud database, or third-party game engine unless the project explicitly already uses one.
  • Do not report every score change if a local weekly best has already been uploaded.
  • Do not display stale cross-week scores.
  • Do not use hard-coded panel coordinates if the renderer already exposes a content rectangle.
  • Do not rely on ctx.roundRect; use a manual path helper for WeChat Canvas compatibility unless the project already wraps it safely.

Validation

Run the project's declared validation commands. For simple native JavaScript projects, also run:

node --check game.js
Get-ChildItem js -Filter *.js | ForEach-Object { node --check $_.FullName }
node --check open-data\index.js
node --check open-data\game.js

When fixing flicker or fallback bugs, add or run a lightweight mocked test that simulates:

  1. First showWeeklyLeaderboard request returns friend rows.
  2. Later duplicate showWeeklyLeaderboard request fails or returns only self.
  3. Final rendered rows still include the previously displayed friends.

当前收录版本

1.0.0

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值78/100

亮点

  • 针对微信小游戏开发者提供周榜功能实现方案,属于明确场景的通用工具
  • 覆盖微信小游戏开发生态中的常见需求,具有实用价值
触发精准92/100

亮点

  • description 详细列出了适用场景,覆盖合理且边界清晰
  • 包含多种变体关键词,如 open data domain、wx.setUserCloudStorage、sharedCanvas 等
结构规范95/100

亮点

  • 文档结构完整,包含 Overview、Workflow、Implementation Rules、Validation 等章节
  • Workflow 提供 8 个清晰步骤,有端到端实现流程,frontmatter 完整
执行可靠90/100

待提升项

  • 引用文件缺失 原报告严重程度:轻微

    SKILL.md 引用了 references/wechat-open-data-weekly.md 文件,但该文件未在传入内容中提供

    改进建议:请确保所有被引用的文件都包含在 Skill 包中,或移除对缺失文件的引用

亮点

  • 工具来源明确(微信官方 API),参数使用正确
  • 覆盖了主要异常处理(异步渲染保护、请求 ID 防过期、缓存最新有效数据、防闪烁逻辑)
  • 不可逆操作(score submission)有本地最佳记录保护机制
证据可验 (前四项均值)89/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。