CommunityImagegithub.com

coloring-book

When a user wants to create a coloring book, a low-content book, or says "make me a coloring book (on a certain theme)", and needs a full black-and-white line art book prepared for Amazon KDP listing, covering: writing N pages of scene prompts based on the theme, generating images via Gemini image models or local GPU (ComfyUI/FLUX), automatically inspecting each image with rejection and redraw, composing interior pages and cover PDFs, and guiding the user to fill in the KDP form in their logged-in browser.

What is coloring-book?

This skill is designed to assist in creating a complete coloring book from scratch, including readying it for Amazon KDP upload. It guides the AI agent through a structured five-step workflow: (1) generating a set of scene prompts based on the user's theme, (2) generating black-and-white line art images using a chosen method (Gemini API, manual Gemini app, or local GPU with ComfyUI/FLUX), (3) automatically quality-checking each image against line width, emptiness, and grayscale rules with automatic rejection and redraw, (4) composing formatted interior and cover PDFs aligned with KDP specs, and (5) guiding the user through manual KDP form filling in their own browser. The skill is built with practical constraints: it emphasizes transparency about AI-generated content, respects KDP terms (no API, weekly limits), and never automates user account actions or hides generation methods. It is platform-agnostic but favors Gemini for published books based on the creator's own experience. The skill is ideal for developers or users who want a controlled, auditable, and honest process for low-content book production on Amazon KDP.

Works with✓Claude Code~Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/Owen-gh/coloring-book-skill/tree/HEAD

Installed? Explore more Image skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

coloring-book: From Theme to a Coloring Book (Ready for KDP Upload)

Read This First (Disclaimer)

  • This is a demonstration of a personal workflow, documenting the steps one person (us) took while creating two actual books. It is not legal advice and not an officially supported KDP method.
  • Before starting, ask the user to read and confirm KDP's terms themselves: account usage, third-party tools, AI-generated content disclosure, and content guidelines. Terms change; always defer to KDP's current official documentation.
  • To the best of our knowledge, KDP does not have a public book upload API; the upload step involves filling a web form in the user's own logged-in browser, with the user present to review and confirm before submission. We do not guarantee any account outcomes.
  • All numbers in this document are "values we recorded; please verify for yourself" (or marked "we tested"). Do not state unmarked numbers as facts to the user.
  • AI Disclosure: The images in the book are AI-generated. KDP requires honest declaration. You (the AI) must not help the user conceal this, nor think of a "more favorable" answer for them.

What You Need to Do (Overview)

The user only says "Make me a coloring book (theme)." Execute steps ① through ⑤ in order, reporting progress to the user after each step. Whenever a step requires human action, pause and ask the user to do it; do not do it for them.

StepContentDetail File
① ScenesGenerate N page scene prompts and backup scenes based on the themereferences/prompt-principles.md
② Generate ImagesChoose the generation method and output each page imageThis file, "Step ②"
③ QCInspect every image, reject and redraw, swap with backup pages until all are completereferences/qc-rules.md, scripts/qc_page.py
④ Book AssemblyAssemble interior PDF and cover PDFreferences/book-spec.md, scripts/make_pdf.py
⑤ UploadGuide the user to fill out the KDP form in their logged-in browserreferences/kdp-upload-fields.md

Prerequisites

  • Requires Python 3 with Pillow, numpy, scipy (qc_page.py uses numpy/scipy; make_pdf.py only uses Pillow). If packages are missing, ask for the user's consent before installing, and install in a virtual environment.
  • To check PDFs, use pdfinfo, pdftoppm (poppler); Pillow can write PDFs but cannot open PDFs.
  • Scripts are executed as python scripts/xxx.py, relative to this skill's folder.

Step 0: Opening Confirmation (Ask the user all at once)

  1. What is the theme? (If vague, give 2–3 directions for them to choose from; do not decide on your own.)
  2. Page count: Default is 96 pages, 8x8 inch square (= 47 images; we used this for both books). "Pages" refers to printed pages; "images" = pages/2 - 1 (KDP minimum is 24 pages = 11 images); if the user says "24 pages", confirm which one they mean.
  3. Which image generation method do you have? (Gemini API, free Gemini app manual, or local GPU ComfyUI/FLUX) → See Step ②. 3b. Who will color it? Sparse (for young children) or Busy (for adults), choose one (corresponds to QC --mode sparse|busy, default is sparse). We have not made a full kids' version; check the images to confirm.
  4. Author's name (to be printed on the cover) and book title: decided by the user.
  5. Does their KDP account have tax and payment information already set up? (If not, tell them they need to configure it themselves first; it does not affect steps ①–④.)
  6. How many KDP paperbacks have you already created this week? (Our recorded limit: maximum 2 per week, see kdp-upload-fields.md. Please refer to KDP's current policy.)

Create a working folder (custom name), containing: scenes.json, spares.json, book.json, raw/, pages/, log.csv, needs_human.txt. Template formats for the three record files are in references/templates/ (book.json, log.csv, needs_human.txt); field character limits are in references/kdp-upload-fields.md.

Step ①: Scene Prompts

Follow references/prompt-principles.md:

  • Generate N page scene sentences (N = pages / 2 - 1; for 96 pages = 47 sentences) + roughly 1/6 backup scenes (we used 47 main scenes with 8 backups).
  • Scene sentence = fixed prefix + that page's scene sentence (location determined by the theme, use {theme}/{place} as placeholders, do not hardcode a specific town) + Square 1:1 image.. Core prefix requirements: black bold lines, no color, no gradient shading, no cross-hatching, no solid black blobs, no text or people, draw things small and sparse, fill the whole page with things to color, and do not repeat the same object type.
  • Main characters and locations should not repeat throughout the book; alternate compositions and seasons; gradually increase the number of objects.
  • Save as scenes.json (array of strings) and spares.json. Show the scene list to the user and wait for them to say OK before starting image generation (generation costs money or GPU time).

Step ②: Generate Images

How to choose (ask the user and select one):

  • A. Gemini Image Model (API or Web) – We actually used Nano Banana 2.1 (model codename gemini-nano-banana-2.1), square 1:1 ratio, then scaled down to 2400 px. The API route can generate multiple images in parallel (we used 4 parallel streams); the web route involves the user pasting prompts while you help organize files. The user must provide their own API key or login; store the key only in environment variables; do not write it into any file or paste back into the conversation.
  • C. Free Gemini App (Manual) – You provide the full prompt for each page; the user pastes it into the Gemini app, saves the image into the specified folder (raw/), and you run Step ③ QC on each. For rejections, tell the user the reason (one-line plain text from qc_page.py) and ask them to regenerate. Note: this is manual; the free tier has daily limits (please check the limit yourself; we have not verified); the app's model may differ from ours; check image quality visually; QC, book assembly, and upload are still done by you; not fully automated, and time-consuming for many pages.
  • B. Local GPU (ComfyUI + FLUX-style models) – We tested FLUX.2 Klein 4B and another flux3 workflow, output size 1088 x 1088. Our observation: Klein often produces lines that are too thin on medium-detail pages (measured 2–4 px, threshold 4.5); we once applied a "black line expand 1 px, up to 3 times" post-process to pages with too-thin lines, then remeasured line width. The two books we actually published used images from the Gemini route; the local route has never been used for a published book, so it is considered unverified. If Gemini is available, use it first.
  • Costs: This skill does not require any image generation software subscription. Gemini API is pay-per-use (web version depends on your own plan); local GPU requires your own GPU and electricity; executing the skill file requires Claude Code (per Anthropic plan). Please assess costs yourself.
  • Minimum specifications (we tested): Square 1:1; original image at least ~1000 px (our local version: 1088; Gemini default size during validation: 1024, final version enlarged to 2400; lines remain smooth, QC passes); final pages at 2400 x 2400 px (8 inches x 300 dpi), pure black and white.
  • Cover main image: Generate one color square image from the same model; we used 2K size. Prompt requires: "top 25% blank calm cream color, no text, no people". We encountered during validation: writing only "top 25% blank" sometimes caused the model to duplicate the image into two sections; we rewrote it as "single continuous scene (not split, not tiled)… compose in the lower three quarters; the top quarter is a flat plain cream color" to get normal results. After generation, always check the image yourself to confirm there is blank space at the top before passing it to make_pdf.py.
  • If Option A is chosen and the user has no API key: Do not suggest finding ways to bypass restrictions; ask them to use the web version they have access to, generate images one by one, place files in raw/, and you take over QC.
  • Before using an AI image service, ask the user to independently confirm that the service's terms allow commercial use and book publication (the services we used—Gemini, FLUX.2 Klein 4B—each have their own terms; we read that FLUX.2 Klein 4B is Apache-2.0; the user must re-check for themselves).

Step ③: QC, Until All Pages Pass

Only tell the user four points:

  1. Only black and white; no gray or large black blobs.
  2. Lines are thick enough.
  3. The page is not empty: each of the nine-grid cells must contain at least 3 colorable shapes.
  4. If it fails, it is automatically redrawn (max 3 times per page; if still failing, swap to a backup scene). (The script checks more details; no need to explain each one.)

For each page:

Up to 3 times:
  Generate image -> raw/sNN_try.png
  python scripts/qc_page.py [--mode sparse|busy] raw/sNN_try.png   # rejection prints plain reason
  If program PASS, then you visually check: is the protagonist's head clear? Is it merged with circular objects? (references/qc-rules.md)
  If all PASS: python scripts/qc_page.py --finalize raw/sNN_try.png pages/cNN.png ; write log ; break
  Otherwise: write log (including reason); discard original image; redraw with the same scene prompt (manual route: ask user to regenerate)
If 3 attempts fail: swap to next backup scene from spares.json; if backups are exhausted and still fail: record in needs_human.txt, move to next page
  • Do not modify thresholds to make images pass; do not manually select failed images and put them into pages/. If needs_human.txt is non-empty, stop and present it to the user for a decision.
  • Multiple images can be generated in parallel; records must be clear (time, page, attempt number, result, reason).
  • After all pages are done, create a summary overview contact sheet for the user to review, and wait for them to say OK before proceeding to Step ④.
  • Our actual reference: for a 47-image book, the log had 90 entries; each page had a PASS at the end, with 8 automatic backup scene swaps in between. Expect rejections and swaps; this is normal.

Step ④: Book Assembly, Produce PDFs

Follow references/book-spec.md (our tested specs: 8x8 inches, 96 pages, 300 dpi, white paper black-and-white interior, single-sided—each image followed by a blank page, cover includes 0.125-inch bleed, spine width = pages x 0.002252 inches).

  • Example: python scripts/make_pdf.py pages/ out/ --title "..." --subtitle "..." --author "..." --blurb "..." --cover-art cover.png Produces out/interior_upload.pdf, out/cover.pdf, out/cover_preview.png.
  • --pages must be an even number; number of images must = pages/2 - 1 (for validation, using 2 images, specify --pages 6; if insufficient, it will report "only N images"). KDP paperback has a minimum page count (we recorded 24 pages; please check yourself); a 6-page validation book cannot be uploaded; the script will not duplicate pages to meet the count, nor should it.
  • Script behavior: The interior title page auto-wraps text (if more than 4 lines, font shrinks); cover title/subtitle/author text automatically chooses dark/light text color based on background and adds a semi-transparent bar; spine text is only placed when --pages ≥ 79 (our recorded value; official page says 79 or 80, please verify); otherwise it is left blank with a notice; spine text direction (clockwise, top to bottom) – please verify. Always check the cover preview to confirm positioning.
  • You may also write your own script as long as it meets the same specifications. After completion, open and review the PDFs yourself before showing the preview to the user.
  • Write the title, subtitle, author, description, keywords (7 sets), and categories (2) into book.json for user confirmation (our format is in kdp-upload-fields.md). All text is laid out programmatically; do not ask a model to draw text.

Step ⑤: Upload (You Are Present, Confirm Before Submitting)

Follow references/kdp-upload-fields.md. Key points:

  1. Stop first: Ask the user to log into kdp.amazon.com themselves (including password and 2FA), and confirm their tax and payment information is set. These must be done by the user; do not ask them to give you their password, cookies, verification codes, or ID, nor record them.
  2. In their logged-in browser (e.g., using a browser automation tool), go from Bookshelf → Create → Paperback, fill in each field from book.json. After completing each page, briefly report "This page has been filled with X" and let the user confirm on screen.
  3. Copyright Declaration (Publishing Rights) radio button: Ask the user to select and click it themselves.
  4. AI-generated content disclosure: Declare honestly. For our two books: images were heavily AI-generated with minimal editing, so we filled AI images = Many AI-generated images, with minimal or no editing, and the Tools field listed the actual tool names; interior text was only manually typeset title pages; for your case, fill truthfully according to your situation and have the user confirm.
  5. After uploading the interior and cover files, launch Previewer and Approve (we tested: you cannot proceed without this step).
  6. Stop before Publish, let the user review all fields and previews, and let them decide whether to click.
  7. Remind the user about the weekly limit (we recorded a maximum of 2 books per week; please refer to KDP's current policy). Only do one book at a time; do not batch upload while the user is away.
  8. If the form page differs from our template, or if a CAPTCHA, risk warning, or account alert appears: Stop and ask the user; do not try to bypass them.

Tone When Reporting to the User

  • Use phrases like "In our workflow…" "We tested…"; do not say "KDP allows", "officially supported", "won't be banned", "fully automated upload".
  • If something cannot be done or has not been verified, say it is unverified.
  • Final deliverables: pages/ (final pages), out/interior_upload.pdf, out/cover.pdf, book.json, log.csv, (if exists) needs_human.txt, and a checklist of "things for the user to do themselves".

Appendix: Things We Have Not Verified (Do Not Claim to the User)

  • Other sizes, cream paper, hardcover, or 8.5x11 inch published books.
  • Whether the thresholds are appropriate for non-"cute animal scenes" styles (mandalas, realistic, people); the "sparse (for children)" default has not been tested on a full book.
  • Whether the structural check done by the main AI on its own matches results from a separate vision model we hired to review images.
  • Sales, rankings, revenue: We provide no guarantees.

Related Skills