godothub/godot-minigame / skills
godot-wechat-minigame-adapter
UnverifiedApply the bundled self-contained Godot WeChat Mini Game adapter kit to an official Godot checkout. Use when the user wants to port official Godot to WeChat Mini Game, refresh a nearby 4.6-based port, or inspect the shipped patch/source bundle for WXMEMFS, `wx.request`, audio cleanup, display/input, WXGLX dual-path rendering, `.wasm.br`, and `wx.exitMiniProgram`. This skill is version-locked to the bundled upstream base and must not be described as a generic “Godot 4.x” patch dump.
tests/test_min_runtime_loader.js
View on GitHubconst assert = require("assert");
const fs = require("fs");
const vm = require("vm");
const loaderPath = process.argv[2] || "skills/assets/min-runtime/godot-loader.js";
function create2DContext() {
return {
arcTo() {},
beginPath() {},
clearRect() {},
closePath() {},
drawImage() {},
fill() {},
fillText() {},
moveTo() {},
};
}
function createWebGLContext(canvas) {
return {
ARRAY_BUFFER: 0x8892,
BLEND: 0x0be2,
COLOR_BUFFER_BIT: 0x4000,
COMPILE_STATUS: 0x8b81,
CULL_FACE: 0x0b44,
DEPTH_TEST: 0x0b71,
FLOAT: 0x1406,
FRAGMENT_SHADER: 0x8b30,
LINEAR: 0x2601,
LINK_STATUS: 0x8b82,
RGBA: 0x1908,
STATIC_DRAW: 0x88e4,
TEXTURE_2D: 0x0de1,
TEXTURE_MAG_FILTER: 0x2800,
TEXTURE_MIN_FILTER: 0x2801,
TEXTURE_WRAP_S: 0x2802,
TEXTURE_WRAP_T: 0x2803,
TRIANGLE_STRIP: 0x0005,
UNSIGNED_BYTE: 0x1401,
VERTEX_SHADER: 0x8b31,
CLAMP_TO_EDGE: 0x812f,
canvas,
attachShader() {},
bindBuffer() {},
bindTexture() {},
bufferData() {},
clear() {},
clearColor() {},
compileShader() {},
createBuffer: () => ({}),
createProgram: () => ({}),
createShader: () => ({}),
createTexture: () => ({}),
deleteBuffer() {},
deleteProgram() {},
deleteShader() {},
deleteTexture() {},
disable() {},
drawArrays() {},
enableVertexAttribArray() {},
getAttribLocation: () => 0,
getProgramInfoLog: () => "",
getProgramParameter: () => true,
getShaderInfoLog: () => "",
getShaderParameter: () => true,
linkProgram() {},
shaderSource() {},
texImage2D() {},
texParameteri() {},
useProgram() {},
vertexAttribPointer() {},
viewport() {},
};
}
function createHarness({ disabled = false, supported = true } = {}) {
const gameGlobal = {};
if (disabled) {
gameGlobal.__GODOT_DISABLE_WXGLX = true;
}
const contextRequests = [];
const screenCanvas = {
height: 0,
style: {},
width: 0,
getContext(type) {
contextRequests.push(type);
return createWebGLContext(this);
},
};
const offscreenCanvas = {
height: 0,
width: 0,
getContext: () => create2DContext(),
};
const windowObject = {
devicePixelRatio: 1,
innerHeight: 720,
innerWidth: 1280,
addEventListener() {},
removeEventListener() {},
requestAnimationFrame() {},
};
const context = {
Float32Array,
GameGlobal: gameGlobal,
Image: class {},
console,
document: {
createElement: () => offscreenCanvas,
},
window: windowObject,
wx: {
env: { isSupportEmscriptenGLX: supported },
getWindowInfo: () => ({ pixelRatio: 1, windowHeight: 720, windowWidth: 1280 }),
loadSubpackage({ success }) {
success();
return { onProgressUpdate() {} };
},
},
};
vm.createContext(context);
vm.runInContext(fs.readFileSync(loaderPath, "utf8"), context);
new context.GameGlobal.GodotLoader(screenCanvas, {
barConfig: {
style: {
backgroundColor: "#000",
borderRadius: 0,
foregroundColor: "#fff",
height: 10,
padding: 0,
width: 100,
},
},
iconConfig: {
style: { bottom: 0, height: 0, width: 0 },
visible: false,
},
materialConfig: {},
textConfig: {
downloadingText: ["loading"],
firstStartText: "start",
initText: "init",
style: { color: "#fff", fontSize: 12 },
},
});
return { contextRequests, gameGlobal };
}
{
const harness = createHarness();
assert.deepStrictEqual(harness.contextRequests, ["wxwebgl2"]);
assert.strictEqual(harness.gameGlobal.__godotMinigameWXGLXEnabled, true);
}
{
const harness = createHarness({ disabled: true });
assert.deepStrictEqual(harness.contextRequests, ["webgl2"]);
assert.strictEqual(harness.gameGlobal.__godotMinigameWXGLXEnabled, false);
}
{
const harness = createHarness({ supported: false });
assert.deepStrictEqual(harness.contextRequests, ["webgl2"]);
assert.strictEqual(harness.gameGlobal.__godotMinigameWXGLXEnabled, false);
}
console.log("Minigame loader GLX context selection tests passed");
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |