Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

feat(skills): generate animated bot avatars

skygunner2f1c8275d708
diff --git a/server/routes/image-tools.test.ts b/server/routes/image-tools.test.ts
index f9717a2a0e..6ae01d5376 100644
--- a/server/routes/image-tools.test.ts
+++ b/server/routes/image-tools.test.ts
@@ -49,6 +49,17 @@ describe("generate_image for a turn", () => {
expect(attached).toEqual([{ bytes: PNG, mime: "image/png" }]);
});
+ it("attaches a square GIF for an animated avatar request", async () => {
+ const gif = Buffer.from("R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", "base64");
+ const fetchImpl = vi.fn<typeof fetch>(async () => new Response(JSON.stringify({ data: [{ b64_json: gif.toString("base64") }] })));
+ const cfg = { imageGen: { ...CFG.imageGen, primary: { provider: "openai" as const, model: "gpt-image-2.6-flare" } } };
+ const { deps: d, attached } = deps({ cfg, fetchImpl });
+ const result = await generateImageForTurn({ prompt: "A looping owl avatar", aspect: "1:1", format: "gif" }, d);
+ expect(result).toEqual({ status: 201, body: { text: expect.stringContaining("attached to this turn's reply") } });
+ expect(JSON.parse(String(fetchImpl.mock.calls[0]?.[1]?.body))).toMatchObject({ output_format: "gif" });
+ expect(attached).toEqual([{ bytes: gif, mime: "image/gif" }]);
+ });
+
it("says so when the backup made the image, and why the base did not", async () => {
const { deps: d } = deps({ cfg: { ...CFG, imageGen: { ...CFG.imageGen, key: "" } } });
const result = await generateImageForTurn({ prompt: "owl" }, d);
diff --git a/server/skill-library.test.ts b/server/skill-library.test.ts
index bd64946faa..0ddb725b3d 100644
--- a/server/skill-library.test.ts
+++ b/server/skill-library.test.ts
@@ -201,3 +201,21 @@ describe("bundled phone-connection skill", () => {
expect(guide.split("\n").length).toBeLessThanOrEqual(60);
});
});
+
+describe("bundled animated-avatar skill", () => {
+ const skills = loadBundledSkills(join(process.cwd(), "skills"));
+ it("loads GIF generation instructions for animated avatar requests", () => {
+ for (const request of ["Make my avatar a GIF", "Create an animated avatar for Juniper", "Animate your avatar"]) {
+ const prompt = instructionsFor(request, [], skills);
+ expect(prompt, request).toContain('id="animated-avatar"');
+ expect(prompt).toContain('"format": "gif"');
+ expect(prompt).toContain("attached to the reply");
+ }
+ });
+
+ it("stays out of static avatar and other image requests", () => {
+ for (const request of ["Set bot avatar to this PNG", "Draw a logo for the team", "Make a GIF of a dancing cat"]) {
+ expect(instructionsFor(request, [], skills)).not.toContain('id="animated-avatar"');
+ }
+ });
+});
diff --git a/skills/animated-avatar/SKILL.md b/skills/animated-avatar/SKILL.md
new file mode 100644
index 0000000000..061ec22482
--- /dev/null
+++ b/skills/animated-avatar/SKILL.md
@@ -0,0 +1,20 @@
+---
+name: animated-avatar
+description: Generate a looping mascot-style GIF for a bot's avatar when the person asks for one.
+---
+
+# Animated avatar
+
+For an explicit animated-avatar request, call `generate_image` with a square GIF and an English prompt. Use the person's visual direction to design an original mascot. Keep the face centered and readable at sidebar size. Ask for a small looping motion, such as a blink or a wave, with stable framing, no flashing, and no text.
+
+```json
+{
+ "prompt": "Square avatar of a friendly teal owl mascot. Simple background, clear silhouette, centered in a fixed frame with room for a circle crop. Make a seamless loop with a slow blink and a small head tilt. Keep the colors and shape stable throughout.",
+ "aspect": "1:1",
+ "format": "gif"
+}
+```
+
+The GIF is attached to the reply when the turn ends. To use it as the bot's picture, tell the person to download the GIF and choose **Upload image** in the bot's **Identity** settings. A GIF uses its own loop across the bot's activity states.
+
+GIF generation requires an OpenAI GPT-Image-2.6 model (Sunburst or Flare). If the tool is missing or reports an unsupported model, explain that requirement. Offer a still image if the person wants one.
diff --git a/skills/animated-avatar/manifest.json b/skills/animated-avatar/manifest.json
new file mode 100644
index 0000000000..2cb48a8a26
--- /dev/null
+++ b/skills/animated-avatar/manifest.json
@@ -0,0 +1,18 @@
+{
+ "id": "animated-avatar",
+ "name": "Animated avatar",
+ "version": "1.0.0",
+ "description": "Generate a looping mascot-style GIF for a bot's avatar.",
+ "defaultEnabled": true,
+ "triggerTerms": [
+ "animated-avatar",
+ "animated avatar",
+ "gif avatar",
+ "avatar a gif",
+ "avatar gif",
+ "animate my avatar",
+ "animate your avatar",
+ "make my avatar animated"
+ ],
+ "requiredCapabilities": []
+}