Skip to content

JimLiu/baoyu-skills / skills/baoyu-image-gen

baoyu-image-gen

Verified

AI image generation with OpenAI GPT Image 2.5, Azure OpenAI, Google, OpenRouter, DashScope, Z.AI GLM-Image, MiniMax, Jimeng, Seedream, Replicate and Agnes APIs. Supports text-to-image, reference images, aspect ratios, and batch generation from saved prompt files. Sequential by default; use batch parallel generation when the user already has multiple prompts or wants stable multi-image throughput. Use when user asks to generate, create, or draw images.

FileKindSize
SKILL.mdskill md16.2 KB
references/codex-image2-fallback.mdmarkdown1.6 KB
references/codex-oauth-vs-openai-api-key.mdmarkdown1.4 KB
references/config/first-time-setup.mdmarkdown8.8 KB
references/config/preferences-schema.mdmarkdown2.5 KB
references/providers/agnes.mdmarkdown1.9 KB
references/providers/codex-cli.mdmarkdown5.0 KB
references/providers/dashscope.mdmarkdown4.2 KB
references/providers/minimax.mdmarkdown1.1 KB
references/providers/openrouter.mdmarkdown707 B
references/providers/replicate.mdmarkdown1.4 KB
references/providers/zai.mdmarkdown953 B
references/usage-examples.mdmarkdown4.9 KB
scripts/build-batch.test.tsscript4.5 KB
scripts/build-batch.tsscript7.4 KB
scripts/codex-imagegen/cache.tsscript2.2 KB
scripts/codex-imagegen/logger.tsscript1.3 KB
scripts/codex-imagegen/main.tsexecutablescript11.9 KB
scripts/codex-imagegen/parser.tsscript2.0 KB
scripts/codex-imagegen/spawn.tsscript6.5 KB
scripts/codex-imagegen/types.tsscript1.6 KB
scripts/codex-imagegen/validator.tsscript2.3 KB
scripts/main.test.tsscript18.4 KB
scripts/main.tsscript45.5 KB
scripts/providers/agnes.test.tsscript6.7 KB
scripts/providers/agnes.tsscript4.9 KB
scripts/providers/azure.test.tsscript5.3 KB
scripts/providers/azure.tsscript5.7 KB
scripts/providers/codex-cli.test.tsscript1.6 KB
scripts/providers/codex-cli.tsscript5.8 KB
scripts/providers/dashscope.test.tsscript11.4 KB
scripts/providers/dashscope.tsscript18.1 KB
scripts/providers/google.test.tsscript4.1 KB
scripts/providers/google.tsscript10.5 KB
scripts/providers/jimeng.test.tsscript2.7 KB
scripts/providers/jimeng.tsscript12.5 KB
scripts/providers/minimax.test.tsscript5.1 KB
scripts/providers/minimax.tsscript6.2 KB
scripts/providers/openai.test.tsscript6.0 KB
scripts/providers/openai.tsscript12.4 KB
scripts/providers/openrouter.test.tsscript5.3 KB
scripts/providers/openrouter.tsscript9.7 KB
scripts/providers/replicate.test.tsscript7.0 KB
scripts/providers/replicate.tsscript17.4 KB
scripts/providers/seedream.test.tsscript6.4 KB
scripts/providers/seedream.tsscript9.6 KB
scripts/providers/zai.test.tsscript5.2 KB
scripts/providers/zai.tsscript8.7 KB
scripts/types.tsscript2.3 KB

scripts/providers/jimeng.test.ts

View on GitHub
import assert from "node:assert/strict";
import test, { type TestContext } from "node:test";

import type { CliArgs } from "../types.ts";
import { generateImage } from "./jimeng.ts";

function makeArgs(overrides: Partial<CliArgs> = {}): CliArgs {
  return {
    prompt: null,
    promptFiles: [],
    imagePath: null,
    provider: null,
    model: null,
    aspectRatio: null,
    size: null,
    quality: null,
    imageSize: null,
    imageApiDialect: null,
    referenceImages: [],
    n: 1,
    batchFile: null,
    jobs: null,
    json: false,
    help: false,
    ...overrides,
  };
}

function useEnv(
  t: TestContext,
  values: Record<string, string | null>,
): void {
  const previous = new Map<string, string | undefined>();
  for (const [key, value] of Object.entries(values)) {
    previous.set(key, process.env[key]);
    if (value == null) {
      delete process.env[key];
    } else {
      process.env[key] = value;
    }
  }

  t.after(() => {
    for (const [key, value] of previous.entries()) {
      if (value == null) {
        delete process.env[key];
      } else {
        process.env[key] = value;
      }
    }
  });
}

test("Jimeng submit request uses prompt field expected by current API", async (t) => {
  useEnv(t, {
    JIMENG_ACCESS_KEY_ID: "test-access-key",
    JIMENG_SECRET_ACCESS_KEY: "test-secret-key",
    JIMENG_BASE_URL: null,
    JIMENG_REGION: null,
  });

  const originalFetch = globalThis.fetch;
  t.after(() => {
    globalThis.fetch = originalFetch;
  });

  const calls: Array<{
    input: string;
    init?: RequestInit;
  }> = [];

  globalThis.fetch = async (input, init) => {
    calls.push({
      input: String(input),
      init,
    });

    if (calls.length === 1) {
      return Response.json({
        code: 10000,
        data: {
          task_id: "task-123",
        },
      });
    }

    return Response.json({
      code: 10000,
      data: {
        status: "done",
        binary_data_base64: [Buffer.from("jimeng-image").toString("base64")],
      },
    });
  };

  const image = await generateImage(
    "A quiet bamboo forest",
    "jimeng_t2i_v40",
    makeArgs({ quality: "normal" }),
  );

  assert.equal(Buffer.from(image).toString("utf8"), "jimeng-image");
  assert.equal(calls.length, 2);
  assert.equal(
    calls[0]?.input,
    "https://visual.volcengineapi.com/?Action=CVSync2AsyncSubmitTask&Version=2022-08-31",
  );

  const submitBody = JSON.parse(String(calls[0]?.init?.body)) as Record<string, unknown>;
  assert.equal(submitBody.req_key, "jimeng_t2i_v40");
  assert.equal(submitBody.prompt, "A quiet bamboo forest");
  assert.ok(!("prompt_text" in submitBody));
  assert.equal(submitBody.width, 1024);
  assert.equal(submitBody.height, 1024);
});
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall