From 860dd36bb69486d038b5bf55e782d56cc966ce0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jim=20Liu=20=E5=AE=9D=E7=8E=89?= Date: Tue, 26 May 2026 00:52:51 -0500 Subject: [PATCH] docs(baoyu-image-gen): surface build-batch.ts in Usage and clarify {baseDir} script paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the outline.md + prompts/ → batch.json one-liner to SKILL.md's Usage section so the build-batch helper is discoverable next to --batchfile, and update build-batch.ts --help to print the bun / npx-y bun invocations with the {baseDir}/scripts/... layout used by the rest of the skill. --- skills/baoyu-image-gen/SKILL.md | 8 ++++++-- skills/baoyu-image-gen/scripts/build-batch.ts | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/skills/baoyu-image-gen/SKILL.md b/skills/baoyu-image-gen/SKILL.md index 8acc071..dacc280 100644 --- a/skills/baoyu-image-gen/SKILL.md +++ b/skills/baoyu-image-gen/SKILL.md @@ -27,7 +27,7 @@ Concrete `AskUserQuestion` references below are examples — substitute the loca ## Script Directory -`{baseDir}` = this SKILL.md's directory. Main script: `{baseDir}/scripts/main.ts`. Resolve `${BUN_X}`: prefer `bun`; else `npx -y bun`; else suggest `brew install oven-sh/bun/bun`. +`{baseDir}` = this SKILL.md's directory. All `scripts/...` paths below are relative to `{baseDir}`. Main script: `{baseDir}/scripts/main.ts`. Batch payload helper: `{baseDir}/scripts/build-batch.ts`. Resolve `${BUN_X}`: prefer `bun`; else `npx -y bun`; else suggest `brew install oven-sh/bun/bun`. ## Step 0: Load Preferences ⛔ BLOCKING @@ -86,6 +86,10 @@ ${BUN_X} {baseDir}/scripts/main.ts --prompt "A cat" --image out.png --provider c # Batch mode ${BUN_X} {baseDir}/scripts/main.ts --batchfile batch.json --jobs 4 + +# Build a batch file from outline.md + prompts/ (e.g. baoyu-article-illustrator output) +${BUN_X} {baseDir}/scripts/build-batch.ts --outline outline.md --prompts prompts --output batch.json --images-dir attachments +${BUN_X} {baseDir}/scripts/main.ts --batchfile batch.json --jobs 4 ``` ## Reference-Image Identity Preservation @@ -242,7 +246,7 @@ Supported: `1:1`, `16:9`, `9:16`, `4:3`, `3:4`, `2.35:1`. | One image, or 1-2 simple images | Sequential | Lower coordination overhead, easier debugging | | Multiple images with saved prompt files | Batch (`--batchfile`) | Reuses finalized prompts, applies shared throttling/retries, predictable throughput | | Each image still needs its own reasoning / prompt writing / style exploration | Subagents | Work is still exploratory, each needs independent analysis | -| Input is `outline.md` + `prompts/` (e.g. from `baoyu-article-illustrator`) | Batch — use `scripts/build-batch.ts` to assemble the payload | The outline + prompt files already contain everything needed | +| Input is `outline.md` + `prompts/` (e.g. from `baoyu-article-illustrator`) | Batch — use `{baseDir}/scripts/build-batch.ts` to assemble the payload | The outline + prompt files already contain everything needed | Rule of thumb: once prompt files are saved and the task is "generate all of these", prefer batch over subagents. Use subagents only when generation is coupled with per-image thinking or divergent creative exploration. diff --git a/skills/baoyu-image-gen/scripts/build-batch.ts b/skills/baoyu-image-gen/scripts/build-batch.ts index c5d2be5..a8b0ba8 100644 --- a/skills/baoyu-image-gen/scripts/build-batch.ts +++ b/skills/baoyu-image-gen/scripts/build-batch.ts @@ -28,7 +28,8 @@ type PromptReference = { function printUsage(): void { console.log(`Usage: - npx -y tsx scripts/build-batch.ts --outline outline.md --prompts prompts --output batch.json --images-dir attachments + bun /scripts/build-batch.ts --outline outline.md --prompts prompts --output batch.json --images-dir attachments + npx -y tsx /scripts/build-batch.ts --outline outline.md --prompts prompts --output batch.json --images-dir attachments Options: --outline Path to outline.md