Claude-skill-registry fixture-image

install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/fixture-image" ~/.claude/skills/majiayu000-claude-skill-registry-fixture-image && rm -rf "$T"
manifest: skills/data/fixture-image/SKILL.md
source content

Fixture Image Skill

Generate images for PDF extraction test fixtures using FREE AI image generation.

Features

  • Ollama (local) - Z-Image Turbo or FLUX2-Klein via Ollama (FREE, no internet)
  • FLUX.1-schnell - AI-generated images via HuggingFace (FREE remote)
  • Mermaid diagrams - Flowcharts and architecture diagrams (FREE)
  • Placeholder images - Random grayscale from picsum.photos (FREE)
  • Solid color - Gray box with text label (always works)
  • Size control - Specify dimensions for PDF embedding (auto-resized)

Quick Start

cd .pi/skills/fixture-image

# Generate an AI image (uses FLUX.1-schnell)
uv run --script generate.py "hardware verification flowchart for microprocessor" \
  --output test_figure.png \
  --size 400x600

# Generate with specific backend
uv run --script generate.py "network security architecture" \
  --output security_arch.png \
  --size 800x600 \
  --backend flux

# Use placeholder fallback
uv run --script generate.py "placeholder" \
  --output placeholder.png \
  --size 400x300 \
  --backend placeholder

Commands

generate
- Create an image

uv run --script generate.py "<prompt>" [options]

Arguments:

ArgumentDescription
prompt
Description of the image to generate

Options:

OptionShortDescriptionDefault
--output
-o
Output file path
fixture_image.png
--size
-s
Image dimensions (WxH)
512x512
--backend
-b
Generation backend
auto

Backends

BackendDescriptionRequiresCost
ollama
Z-Image/FLUX2 local generationOllama + modelFREE (local)
flux
FLUX.1-schnell AI generation
HF_TOKEN
FREE (remote)
mermaid
Flowchart/diagram generation
mmdc
CLI
FREE
placeholder
picsum.photos (grayscale)NothingFREE
solid
Gray box with text labelPillowFREE
auto
Try backends in orderAny available-

Setup

Option 1: Ollama (macOS only - MLX framework)

Note: Ollama image generation currently only works on macOS (Apple Silicon). Linux/NVIDIA support is "coming soon" per Ollama docs.

# macOS only
ollama pull x/z-image-turbo
# or
ollama pull x/flux2-klein

Option 2: HuggingFace Token (FREE Remote)

Get a FREE HuggingFace token from huggingface.co/settings/tokens:

export HF_TOKEN="hf_your_token_here"

Option 3: Mermaid (for Diagrams)

npm install -g @mermaid-js/mermaid-cli

Example Prompts for Test Fixtures

Security Documents

"APT attack kill chain diagram with reconnaissance, weaponization, delivery, exploitation phases"
"network intrusion detection system architecture"
"malware analysis workflow flowchart"

Engineering Documents

"hardware verification flow for microprocessor with RTL, synthesis, and timing analysis"
"FPGA design pipeline from HDL to bitstream"
"embedded systems boot sequence diagram"

Scientific Documents

"machine learning pipeline with data preprocessing, training, and inference stages"
"experimental methodology flowchart"
"system architecture diagram with numbered components"

Cached Images (Reuse Before Generating)

Pre-generated images are available in

cached_images/
- use these first to avoid unnecessary API calls:

FileDescriptionSize
decorative.png
Abstract cover/decorative illustration512x512
flowchart.png
Technical workflow/process diagram512x512
network_arch.png
Network/system architecture diagram512x512
test_fixture.pdf
12-page PDF with all image types embedded1.8MB
# Copy cached image instead of generating
cp cached_images/flowchart.png /path/to/output.png

# Use pre-built test fixture for extractor testing
cp cached_images/test_fixture.pdf /path/to/test.pdf

Integration with PDF Generation

After generating images, embed them in synthetic PDFs:

import fitz  # PyMuPDF

doc = fitz.open()
page = doc.new_page()

# Insert generated image
img_rect = fitz.Rect(50, 200, 450, 500)  # x0, y0, x1, y1
page.insert_image(img_rect, filename="test_figure.png")

doc.save("fixture_with_figure.pdf")

Dependencies

dependencies = [
    "huggingface_hub>=0.26.0",
    "httpx",
    "typer",
    "pillow",
]