Skip to content

guanyang/open-agent-hub / skills/baoyu-imagine

baoyu-imagine

Verified

AI image generation with OpenAI GPT Image 2, Azure OpenAI, Google, OpenRouter, DashScope, Z.AI GLM-Image, MiniMax, Jimeng, Seedream and Replicate 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 md18.0 KB
references/codex-image2-fallback.mdmarkdown1.8 KB
references/codex-oauth-vs-openai-api-key.mdmarkdown1.9 KB
references/config/first-time-setup.mdmarkdown12.9 KB
references/config/preferences-schema.mdmarkdown4.1 KB
references/providers/dashscope.mdmarkdown4.5 KB
references/providers/minimax.mdmarkdown1.2 KB
references/providers/openrouter.mdmarkdown776 B
references/providers/replicate.mdmarkdown1.8 KB
references/providers/zai.mdmarkdown1.1 KB
references/usage-examples.mdmarkdown4.6 KB
scripts/build-batch.test.tsscript4.5 KB
scripts/build-batch.tsscript7.3 KB
scripts/main.test.tsscript17.4 KB
scripts/main.tsscript42.4 KB
scripts/providers/azure.test.tsscript5.3 KB
scripts/providers/azure.tsscript5.7 KB
scripts/providers/dashscope.test.tsscript11.3 KB
scripts/providers/dashscope.tsscript18.0 KB
scripts/providers/google.test.tsscript3.3 KB
scripts/providers/google.tsscript9.6 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.tsscript5.4 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.1 KB

scripts/build-batch.test.ts

View on GitHub
import assert from "node:assert/strict";
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { execFile } from "node:child_process";
import { promisify } from "node:util";
import test from "node:test";

const execFileAsync = promisify(execFile);
const repoRoot = path.resolve(import.meta.dirname, "..", "..", "..");
const scriptPath = path.join(repoRoot, "skills", "baoyu-imagine", "scripts", "build-batch.ts");

async function makeFixture(): Promise<{
  root: string;
  outlinePath: string;
  promptsDir: string;
  outputPath: string;
}> {
  const root = await fs.mkdtemp(path.join(os.tmpdir(), "baoyu-imagine-build-batch-"));
  const outlinePath = path.join(root, "outline.md");
  const promptsDir = path.join(root, "prompts");
  const outputPath = path.join(root, "batch.json");

  await fs.mkdir(promptsDir, { recursive: true });
  await fs.writeFile(
    outlinePath,
    `## Illustration 1
**Position**: demo
**Purpose**: demo
**Visual Content**: demo
**Filename**: 01-demo.png
`,
  );
  await fs.writeFile(path.join(promptsDir, "01-demo.md"), "A demo prompt\n");

  return { root, outlinePath, promptsDir, outputPath };
}

async function runBuildBatch(args: string[]): Promise<void> {
  await execFileAsync(process.execPath, ["--import", "tsx", scriptPath, ...args], {
    cwd: repoRoot,
  });
}

test("build-batch omits default model so baoyu-imagine can resolve env or EXTEND defaults", async () => {
  const fixture = await makeFixture();

  await runBuildBatch([
    "--outline",
    fixture.outlinePath,
    "--prompts",
    fixture.promptsDir,
    "--output",
    fixture.outputPath,
  ]);

  const batch = JSON.parse(await fs.readFile(fixture.outputPath, "utf8")) as {
    tasks: Array<Record<string, unknown>>;
  };

  assert.equal(batch.tasks.length, 1);
  assert.equal(batch.tasks[0]?.provider, "replicate");
  assert.equal(Object.hasOwn(batch.tasks[0]!, "model"), false);
});

test("build-batch preserves explicit model overrides", async () => {
  const fixture = await makeFixture();

  await runBuildBatch([
    "--outline",
    fixture.outlinePath,
    "--prompts",
    fixture.promptsDir,
    "--output",
    fixture.outputPath,
    "--model",
    "acme/custom-model",
  ]);

  const batch = JSON.parse(await fs.readFile(fixture.outputPath, "utf8")) as {
    tasks: Array<Record<string, unknown>>;
  };

  assert.equal(batch.tasks[0]?.model, "acme/custom-model");
});

test("build-batch propagates direct-usage references from prompt frontmatter", async () => {
  const fixture = await makeFixture();

  await fs.writeFile(
    path.join(fixture.promptsDir, "01-demo.md"),
    `---
illustration_id: 01
type: infographic
references:
  - ref_id: 01
    filename: 01-ref-brand.png
    usage: direct
  - ref_id: 02
    filename: 02-ref-style.png
    usage: style
---

A demo prompt
`,
  );

  await runBuildBatch([
    "--outline",
    fixture.outlinePath,
    "--prompts",
    fixture.promptsDir,
    "--output",
    fixture.outputPath,
  ]);

  const batch = JSON.parse(await fs.readFile(fixture.outputPath, "utf8")) as {
    tasks: Array<Record<string, unknown>>;
  };

  assert.deepEqual(batch.tasks[0]?.ref, ["references/01-ref-brand.png"]);
});

test("build-batch omits ref field when no direct references exist", async () => {
  const fixture = await makeFixture();

  await fs.writeFile(
    path.join(fixture.promptsDir, "01-demo.md"),
    `---
illustration_id: 01
references:
  - ref_id: 01
    filename: 01-ref-palette.png
    usage: palette
---

A demo prompt
`,
  );

  await runBuildBatch([
    "--outline",
    fixture.outlinePath,
    "--prompts",
    fixture.promptsDir,
    "--output",
    fixture.outputPath,
  ]);

  const batch = JSON.parse(await fs.readFile(fixture.outputPath, "utf8")) as {
    tasks: Array<Record<string, unknown>>;
  };

  assert.equal(Object.hasOwn(batch.tasks[0]!, "ref"), false);
});

test("build-batch honors --refs-dir override", async () => {
  const fixture = await makeFixture();

  await fs.writeFile(
    path.join(fixture.promptsDir, "01-demo.md"),
    `---
illustration_id: 01
references:
  - ref_id: 01
    filename: brand.png
    usage: direct
---

A demo prompt
`,
  );

  await runBuildBatch([
    "--outline",
    fixture.outlinePath,
    "--prompts",
    fixture.promptsDir,
    "--output",
    fixture.outputPath,
    "--refs-dir",
    "refs",
  ]);

  const batch = JSON.parse(await fs.readFile(fixture.outputPath, "utf8")) as {
    tasks: Array<Record<string, unknown>>;
  };

  assert.deepEqual(batch.tasks[0]?.ref, ["refs/brand.png"]);
});
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