Static visual content across 20+ formats — diagrams, mermaid, infographics, D3 dashboards, comics, icons, wallpaper — via Nano Banana Pro (default), Nano Banana
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-art-71351ccb8c9c ,按照其中的说明把「Art」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Before executing, check for user customizations at:
~/.claude/LIFEOS/USER/CUSTOMIZATIONS/SKILLS/Art/
If this directory exists, load and apply:
PREFERENCES.md - Aesthetic preferences, default model, output locationCharacterSpecs.md - Character design specificationsSceneConstruction.md - Scene composition guidelinesThese override default behavior. If the directory does not exist, proceed with skill defaults.
You MUST send this notification BEFORE doing anything else when this skill is invoked.
Send voice notification:
curl -s -X POST http://localhost:31337/notify \
-H "Content-Type: application/json" \
-d '{"message": "Running the WORKFLOWNAME workflow in the Art skill to ACTION"}' \
> /dev/null 2>&1 &
Output text notification:
Running the **WorkflowName** workflow in the **Art** skill to ACTION...
This is not optional. Execute this curl command immediately upon skill invocation.
Generates static visual content across 20+ formats — blog headers, technical and architecture diagrams, frameworks, taxonomies, timelines, comparisons, stat cards, comics, icons, wallpapers, D3 charts, Mermaid diagrams — using Flux, Nano Banana Pro (Gemini 3 Pro), and GPT-Image-2. Every request routes through a named workflow that encodes the technique and palette, output stages to $LIFEOS_DOWNLOADS_DIR (default ~/Downloads/ when unset) for review first, and blog headers ship both a transparent inline version and an opaque social thumbnail.
The bare image model produces inconsistent, off-style output when handed a freeform prompt — one session shipped 12 rejected diagrams because the prompt skipped the workflow that holds the composition rules. Different formats need different models (text-heavy cards want GPT-Image-2; editorial headers want Nano Banana Pro), different size formats, and different transparency handling. Without a fixed routing-and-staging discipline, you get wrong sizes, opaque headers that bleed over the page background, and images pushed straight to a repo before anyone looked at them. This skill makes the workflow, the model choice, and the Downloads-first review mandatory in code, not just in markdown.
A complete visual content system for illustrations, diagrams, and other static visuals. Each request picks a matching workflow file first, follows its prompt template, then calls Generate.ts with --workflow=<name> plus model/size/output flags. Generate.ts itself enforces that the workflow was followed, output always lands in $LIFEOS_DOWNLOADS_DIR (default ~/Downloads/ when unset) for preview, and blog headers run with --thumbnail to produce both the transparent PNG and the sepia-backed social thumbnail.
--workflow=<name> IS REQUIREDThis rule used to be markdown-only and was silently ignored, producing 12 rejected diagrams in one session (incident 2026-04-30). It now lives in code.
Generate.ts itself refuses to run unless you pass --workflow=<name> (or the explicit --freeform-confirmed opt-out). It exits non-zero with the workflow lookup table.
The flow that works: read the matching workflow file → follow its prompt template → invoke Generate.ts with --workflow=<that-workflow-name> plus your model/prompt/size flags. The --workflow=<name> flag is your explicit assertion "I read the workflow and followed it."
The flow that's blocked: composing a freeform prompt and shipping it directly to Generate.ts. Generate.ts will refuse.
Reading the workflow's caps-warning, mentally noting "do the workflow," then composing a Bash command with your own prompt anyway because it feels faster. Stop. The workflow templates encode the technique, palette, composition rules, and validation gate the bare model fails to honor. Skipping them produced — verbatim — "absolute fucking ass" diagrams. Read the workflow file FIRST. Compose the prompt FROM the template. Pass --workflow=<name> so the gate can see you did it.
bun ~/.claude/skills/Art/Tools/Generate.ts \
--workflow=<WorkflowName> \
--model nano-banana-pro \
--prompt "..." \
--size 2K \
--aspect-ratio 16:9 \
--output "${LIFEOS_DOWNLOADS_DIR:-$HOME/Downloads}"/<filename>.png
<WorkflowName> MUST match a file under Workflows/ (without .md):
Routing rules — pick a workflow FIRST, before writing any prompt:
| Request shape | Required workflow |
|---|---|
| Blog header / editorial essay illustration | Workflows/Essay.md — Steps 1–8 in order, no skipping |
| Mermaid diagram | Workflows/Mermaid.md |
| Technical / architecture diagram | Workflows/TechnicalDiagrams.md |
| Framework / 2x2 / matrix | Workflows/Frameworks.md |
| D3 dashboard / chart | Workflows/D3Dashboards.md |
| Taxonomy / hierarchy | Workflows/Taxonomies.md |
| Timeline | Workflows/Timelines.md |
| Comparison | Workflows/Comparisons.md |
| Stat card | Workflows/Stats.md |
| Aphorism / quote card | Workflows/Aphorisms.md |
| Comic panel | Workflows/Comics.md |
| Locked house-style YouTube / channel thumbnail | Use a dedicated locked-house-style thumbnail skill — it owns the locked style and orchestrates the Art tools below. Don't drive these workflows directly for channel thumbnails. |
| YouTube thumbnail (generic mechanism, orchestrated by the thumbnail skill) | Workflows/StyleMatchedThumbnail.md — deterministic text + real-photo face |
| YouTube thumbnail (legacy / validation) | Workflows/AdHocYouTubeThumbnail.md or Workflows/YouTubeThumbnailChecklist.md |
| LifeOS pack icon | Workflows/CreateLifeosPackIcon.md |
| brand-logo wallpaper | Workflows/LogoWallpaper.md |
| Recipe card | Workflows/RecipeCards.md |
| Map / conceptual map | Workflows/Maps.md |
| Annotated screenshot | Workflows/AnnotatedScreenshots.md |
| Background removal only | Workflows/RemoveBackground.md |
| Embossed logo wallpaper | Workflows/EmbossedLogoWallpaper.md |
The ONLY exception: the user explicitly says "freeform" / "skip the workflow" / "just run Generate.ts directly with this prompt: ...". In that case, pass --freeform-confirmed to Generate.ts (which logs the explicit opt-out to stderr for audit). Without that explicit instruction from the user, ALWAYS pick the matching workflow and pass --workflow=<name> — Generate.ts will refuse the call otherwise.
If no workflow matches the request, stop and surface to the user before generating — propose either (a) the closest existing workflow, (b) using Visualize.md as the generic catch-all, or (c) creating a new workflow first via the CreateSkill skill. Do not improvise.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ ALL GENERATED IMAGES GO TO $LIFEOS_DOWNLOADS_DIR (default ~/Downloads/ when unset) FIRST ⚠️
⚠️ NEVER output directly to project directories ⚠️
⚠️ User MUST preview in Finder/Preview before use ⚠️
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This applies to ALL workflows in this skill.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ INLINE (body) image → TRANSPARENT (PNG with alpha) ⚠️
⚠️ SOCIAL THUMBNAIL (frontmatter) → SEPIA #EAE9DF (opaque) ⚠️
⚠️ EVERY blog header MUST use --thumbnail (produces both) ⚠️
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The blog page background is sepia #EAE9DF. Inline images MUST be transparent PNG so they composite cleanly over the page. Social platforms (X, LinkedIn, RSS readers) do NOT honor transparency — they show white/black bleed-through — so the thumbnail: frontmatter MUST point to the sepia-backed version.
Enforcement when calling Generate.ts:
--thumbnail is the ONLY correct flag for blog headers — it implicitly enables --remove-bg and produces BOTH output.png (transparent) AND output-thumb.png (#EAE9DF background).rembg (no external API). If the model returns JPEG (Nano Banana Pro often does), Generate.ts automatically renames the output from .jpg → .png after rembg processing so the final transparent file is a real PNG with a real alpha channel. If you ever see a .jpg labeled "transparent", that is NOT transparent.rembg isn't installed at ~/.local/bin/rembg, the tool fails loudly with install instructions rather than silently producing an opaque image. Install: pipx install rembg (or set REMBG_BIN env var to override the path).Verification step before declaring an image done (REQUIRED):
file "${LIFEOS_DOWNLOADS_DIR:-$HOME/Downloads}"/[name].png → must report PNG image data, ... RGBA (8-bit/color RGBA). If it says JPEG or 8-bit colormap without alpha, transparency failed.file "${LIFEOS_DOWNLOADS_DIR:-$HOME/Downloads}"/[name]-thumb.png → must report PNG image data. The thumb is intentionally opaque with sepia background.Wiring into the blog post:
[](/images/blog/[slug]/header.webp) — use the transparent WebP converted from the .png.thumbnail: https://example.com/images/blog/[slug]/header-thumb.png — always the -thumb.png (opaque sepia).Never reuse the opaque thumbnail for the inline slot. Never reuse the transparent file for the social thumbnail. These are two distinct outputs from one --thumbnail run.
Sanctioned exception (this section is the canonical home; the blog-authoring skill defers here): transparent inline is the DEFAULT for every blog header. The one exception is thin-linework/charcoal pieces where rembg strips the artwork itself (see Gotchas) — those may ship an opaque sepia #EAE9DF inline image, which composites seamlessly on the matching page background. Opaque inline is a documented fallback for that failure mode, never a second default.
Route to the appropriate workflow based on the request.
| Workflow | Trigger | File |
|---|---|---|
| Essay | Blog header or editorial illustration | Workflows/Essay.md |
| RemoveBackground | Remove background from image | Workflows/RemoveBackground.md |
| LogoWallpaper | brand-logo wallpaper with logo integration | Workflows/LogoWallpaper.md |
| EmbossedLogoWallpaper | Embossed logo wallpaper | Workflows/EmbossedLogoWallpaper.md |
| D3Dashboards | D3.js interactive chart or dashboard | Workflows/D3Dashboards.md |
| Visualize | Visualization or unsure which format | Workflows/Visualize.md |
| Mermaid | Mermaid flowchart or sequence diagram | Workflows/Mermaid.md |
| TechnicalDiagrams | Technical or architecture diagram | Workflows/TechnicalDiagrams.md |
| Taxonomies | Taxonomy or classification grid | Workflows/Taxonomies.md |
| Timelines | Timeline or chronological progression | Workflows/Timelines.md |
| Frameworks | Framework or 2x2 matrix | Workflows/Frameworks.md |
| Comparisons | Comparison or X vs Y | Workflows/Comparisons.md |
| AnnotatedScreenshots | Annotated screenshot | Workflows/AnnotatedScreenshots.md |
| RecipeCards | Recipe card or step-by-step | Workflows/RecipeCards.md |
| Aphorisms | Aphorism or quote card | Workflows/Aphorisms.md |
| Maps | Conceptual map or territory | Workflows/Maps.md |
| Stats | Stat card or big number visual | Workflows/Stats.md |
| Comics | Comic or sequential panels | Workflows/Comics.md |
| YouTubeThumbnailChecklist | YouTube thumbnail checklist; YouTube thumbnail (with existing assets) |
Default: Production-quality concept art style appropriate for editorial and technical content.
User customization defines specific aesthetic preferences including:
Load from: ~/.claude/LIFEOS/USER/CUSTOMIZATIONS/SKILLS/Art/PREFERENCES.md
User customization may include reference images for consistent style.
Check ~/.claude/LIFEOS/USER/CUSTOMIZATIONS/SKILLS/Art/PREFERENCES.md for:
Usage: Before generating images, load relevant user-provided references to match their preferred style.
Default model: Check user customization at CUSTOMIZATIONS/SKILLS/Art/PREFERENCES.md
Fallback: nano-banana-pro (Gemini 3 Pro)
Each model accepts different --size formats. Using the wrong format causes validation errors.
| Model | --size format | Valid values | Default |
|---|---|---|---|
flux | Aspect ratio | 1:1, 16:9, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 21:9 | 16:9 |
nano-banana | Aspect ratio | 1:1, 16:9, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 21:9 | 16:9 |
nano-banana-pro | Resolution tier | 1K, 2K, 4K (also accepts --aspect-ratio separately) | 2K |
OpenAI image models are REMOVED (2026-07-30, principal's direction). gpt-image-1, gpt-image-2, and the dual-provider compare mode are gone from Generate.ts — passing any of them exits with an error pointing at nano-banana-pro. Do not reintroduce an OpenAI image path, and do not add a different vendor as a substitute; adding a new vendor to any lane is an identity/doctrine-class decision requiring the principal's explicit approval.
Three models are wired into Generate.ts, and nano-banana-pro is the DEFAULT for everything. PREFERENCES.md (if present) pins the user's default:
| Job | Model | Why |
|---|---|---|
| Everything by default — editorial illustration, blog headers, text-heavy stat cards, frameworks, taxonomies, timelines, aphorism cards | nano-banana-pro | Best composition fidelity for the user's editorial aesthetic, and strong enough on labels and numbers to carry the text-heavy workflows too. |
| Stylistic variety / non-photoreal / crisper technical linework | flux | Different aesthetic register. |
| Faster iteration once the composition is settled | nano-banana | Quicker, slightly lower fidelity. |
Note: nano-banana-pro uses --size for resolution quality and a separate --aspect-ratio flag for aspect ratio (defaults to 16:9).
ALL generated images MUST go to $LIFEOS_DOWNLOADS_DIR (default ~/Downloads/ when unset) first for preview and selection.
Never output directly to a project's public/images/ directory. User needs to review images in Preview before they're used.
Workflow:
"${LIFEOS_DOWNLOADS_DIR:-$HOME/Downloads}"/[descriptive-name].pngcms/public/images/)# CORRECT - Output to Downloads for preview
bun run ${LIFEOS_SKILL_DIR}/Tools/Generate.ts \
--model nano-banana-pro \
--prompt "[PROMPT]" \
--size 2K \
--aspect-ratio 1:1 \
--thumbnail \
--output "${LIFEOS_DOWNLOADS_DIR:-$HOME/Downloads}"/blog-header-concept.png
# After approval, copy to final location (substitute your blog/site path)
cp "${LIFEOS_DOWNLOADS_DIR:-$HOME/Downloads}"/blog-header-concept.png ~/your-site/public/images/
cp "${LIFEOS_DOWNLOADS_DIR:-$HOME/Downloads}"/blog-header-concept-thumb.png ~/your-site/public/images/
For improved character or style consistency, use multiple --reference-image flags:
# Multiple reference images for better likeness
bun run ${LIFEOS_SKILL_DIR}/Tools/Generate.ts \
--model nano-banana-pro \
--prompt "Person from references at a party..." \
--reference-image face1.jpg \
--reference-image face2.jpg \
--reference-image face3.jpg \
--size 2K \
--aspect-ratio 16:9 \
--output "${LIFEOS_DOWNLOADS_DIR:-$HOME/Downloads}"/character-scene.png
API Limits (Gemini):
API keys in: ${LIFEOS_DIR}/.env
Example 1: Blog header image
User: "create a header for my AI agents post"
→ Invokes ESSAY workflow
→ Generates charcoal sketch prompt
→ Creates image with architectural aesthetic
→ Saves to $LIFEOS_DOWNLOADS_DIR (default ~/Downloads/ when unset) for preview
→ After approval, copies to public/images/
Example 2: Technical architecture diagram
User: "make a diagram showing the SPQA pattern"
→ Invokes TECHNICALDIAGRAMS workflow
→ Creates structured architecture visual
→ Outputs PNG with consistent styling
Example 3: Comparison visualization
User: "visualize humans vs AI decision-making"
→ Invokes COMPARISONS workflow
→ Creates side-by-side visual
→ Charcoal sketch with labeled elements
Example 4: LifeOS pack icon
User: "create icon for the skill system pack"
→ Invokes CREATEPAIPACKICON workflow
→ Reads workflow from Workflows/CreateLifeosPackIcon.md
→ Generates 1K image with --remove-bg for transparency
→ Resizes to 256x256 RGBA PNG
→ Outputs to $LIFEOS_DOWNLOADS_DIR (default ~/Downloads/ when unset) for preview
→ After approval, copies to ${PROJECTS_DIR}/LIFEOS/Packs/icons/
--size for resolution (1K/2K/4K) and SEPARATE --aspect-ratio flag. Don't pass aspect ratio values to --size.--remove-bg may produce black backgrounds instead of transparency. Always verify transparent PNG output visually before deploying.--remove-bg is unsafe for thin-linework technical diagrams. rembg classifies thin black ink on a light field as "background" and strips it, leaving a near-empty ghost. Documented 2026-05-11 on the free-will flowchart. Mitigations: (a) prompt for thick saturated linework first so rembg has a strong signal, or (b) skip --remove-bg entirely when the destination background matches the image's background (blog page is sepia #EAE9DF — opaque sepia diagram on sepia page composites with zero visible seam, no alpha needed).--reference-image, and vision-verify the topology specifically.--output says .png. Disclose the native ratio when the spec says 16:9, and probe the real filename before Read/delivery.After completing any workflow, append a single JSONL entry:
echo '{"ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","skill":"Art","workflow":"WORKFLOW_USED","input":"8_WORD_SUMMARY","status":"ok|error","duration_s":SECONDS}' >> ~/.claude/LIFEOS/MEMORY/SKILLS/execution.jsonl
Replace WORKFLOW_USED with the workflow executed, 8_WORD_SUMMARY with a brief input description, and SECONDS with approximate wall-clock time. Log status: "error" if the workflow failed.
| Generic visualization (none of the above fit) | Workflows/Visualize.md |
Workflows/YouTubeThumbnailChecklist.md |
| AdHocYouTubeThumbnail | Ad-hoc YouTube thumbnail (generate from content) | Workflows/AdHocYouTubeThumbnail.md |
| CreateLifeosPackIcon | LifeOS pack icon | Workflows/CreateLifeosPackIcon.md |
#EAE9DFmagick -background "#EAE9DF" -flattenbun ~/.claude/LIFEOS/TOOLS/RemoveBg.tsidentify -format "%[channels]" inline.webpsrgbamagick -fuzz 4% -trim + sepia border).--reference-image for the remaining variations; compliance jumped to 7/7. Editing the reference beats describing the edit.SignPainter-HouseScript, ~3% of image width, semi-transparent charcoal, slight rotation, tucked into the composition's bottom-right); never prompt the signature into the model (it garbles). Formal calligraphy faces (Snell-Roundhand / Apple-Chancery / Savoye) remain rejected; oversized print-letter Bradley Hand was replaced 2026-07-09 ("more cursive looking and smaller, more part of the image").