What does Pocket Field Guide do?
Turn a place, a season, or an invented ecology into a small printed-looking field guide. One style bible and related seeds keep the plates consistent. A packer script refuses to write the booklet until every plate is a real image and the tour is a real mp3.
A live sample booklet, which needs no sign-in, is at https://danieljbinns.github.io/pocket-field-guide/harbor/. Offer it when the user wants to see what a packed guide looks like before spending Pollen.
Do not invent Pollinations keys. Do not read or copy keys from disk into commands, files, or chat. The user spends their own Pollen through polli auth login or POLLINATIONS_API_KEY already in their environment.
1. Sign in
Run polli auth status --json (or polli whoami --json).
- If
authenticatedis true, continue. Mention the reportedpollenbalance if it is below0.02. - If not, start
polli --json auth login --no-browser. Read stderr while it runs, show the user the verification URL and user code, and wait. On approval, stdout is{"authenticated":true}. Tokens stay on the user's machine. - If the user already has a key in
POLLINATIONS_API_KEY, they may runprintf '%s' "$POLLINATIONS_API_KEY" | polli auth login --with-token. Never ask them to paste a key into chat.
If polli is missing: npm i -g @pollinations/cli@latest.
2. Agree the brief
Need a subject (a real place, a season, or an invented ecology) and a tone:
- Naturalist (default): plausible biology, careful language, no magic.
- Slightly uncanny: still biological, a little off, no spells or monsters-as-costume.
Confirm plate count. Default is one habitat cover + four species plates. A pocket edition is two to three plates and may skip the cover image (the booklet sets the title in type). Estimate before generating:
polli gen image "scientific plate of a moth on cream paper" --model black-forest-labs/flux.1-schnell --estimate
flux (black-forest-labs/flux.1-schnell) is about 0.002 pollen per image. zimage (tongyi-mai/z-image-turbo) is about 0.004 and usually sharper. Both are paid_only: false. A full default guide is about 0.011 pollen plus a short tour and the plan. If the balance cannot cover the estimate, offer a pocket edition or a cheaper model. Never switch to a paid_only: true model.
3. Write the plan
Create the output folder, then write guide.json with a free text model. Prefer openai/gpt-5.4-nano. If the balance is tight, use openai/gpt-5-nano. Use --json-response and --no-stream.
polli gen text --model openai/gpt-5.4-nano --json-response --no-stream \
--max-tokens 1600 --reasoning minimal \
--system "You write pocket field guides. Reply with a single JSON object that matches the schema the user gives. No markdown." \
--output "$OUT/guide.raw.json" \
"Write a pocket field guide for: $SUBJECT
Tone: $TONE
Plate count: $N species. Invent names if the ecology is invented; keep biology plausible.
Schema:
{
\"title\": string,
\"subtitle\": string,
\"region\": string,
\"season\": string,
\"style_bible\": string,
\"seed\": integer,
\"voice\": \"onyx\" | \"nova\" | \"alloy\" | \"echo\" | \"fable\" | \"shimmer\",
\"narrator_script\": string,
\"species\": [
{
\"slug\": kebab-case,
\"common_name\": string,
\"latin_name\": binomial,
\"visual_description\": string,
\"field_notes\": 2-4 sentences,
\"signs\": one sentence,
\"habitat\": one sentence
}
]
}
style_bible must be a single reusable illustration sentence, for example:
\"Hand-colored 1890s naturalist's lithograph on cream laid paper, fine steel-point ink line, thin indigo and ochre watercolor washes, specimen centered with a faint habitat vignette, museum lighting from the upper left, no letters, no labels, no caption, no watermark, no frame, no modern photo realism.\"
narrator_script is the spoken tour: 80-180 words, present tense, no stage directions, no SSML, no plate numbers spoken as 'image 1'. It should open the place, then name each species once, then close.
seed is an integer you choose and we will reuse."
Parse the file into $OUT/guide.json. If the model wrapped the object in markdown fences, strip them. Confirm species.length equals the agreed plate count. If the JSON is invalid, retry once with a shorter prompt; if it still fails, stop.
Add (do not ask the model for) these fields if missing:
{
"image_model": "black-forest-labs/flux.1-schnell",
"text_model": "openai/gpt-5.4-nano",
"audio_model": "openai/tts-1"
}
Allowed voice values for openai/tts-1 are alloy, echo, fable, onyx, nova, shimmer. If the model picked sage or anything else, use onyx.
4. Generate the plates
Every image prompt is:
{style_bible} A naturalist's plate of the {common_name} ({latin_name}): {visual_description}. Full specimen, scientifically careful pose, cream paper, no text.
The cover (if any) is a habitat establishing plate, still with the style bible and still with no letters:
{style_bible} A habitat plate of {region} in {season}, no people, no letters, wide view, cream paper.
Use the same model for every image. Reuse seed for the cover and seed + index (1-based) for each species so the set is related but not identical.
mkdir -p "$OUT/plates"
polli gen image "$PROMPT" \
--model black-forest-labs/flux.1-schnell \
--width 1024 --height 1024 \
--seed "$SEED" \
--output "$OUT/plates/01-slug.png"
Write the relative filename on each species as plate (plates/01-slug.png). If you generated a cover, set cover to cover.png.
If a command exits non-zero, or the output file is missing or under 8 KB, retry that plate once with a slightly clarified visual description and a new seed (seed + 50 + index). If polli returns 402, stop and point the user at https://enter.pollinations.ai. Do not keep generating.
An image model may return a JPEG with a .png name. Leave the file as written; pack.mjs detects the type and renames it.
5. Generate the tour
polli gen audio "$NARRATOR_SCRIPT" \
--model openai/tts-1 \
--voice onyx \
--output "$OUT/tour.mp3"
Pipe the script on stdin if it is long: printf '%s' "$NARRATOR_SCRIPT" | polli gen audio --model openai/tts-1 --voice onyx --output "$OUT/tour.mp3".
Set audio on the plan to tour.mp3. If the file is missing or under 1 KB, retry once. Do not use a music model; every current Pollinations music model is paid_only: true.
6. Pack and show the booklet
Save the final guide.json, then:
node skills/pocket-field-guide/scripts/pack.mjs "$OUT"
(From a copied skill folder, node scripts/pack.mjs "$OUT".)
The script checks the plan, the plates, the tour and optional cover, then writes $OUT/index.html. Open that file for the user. Do not hand-write a second HTML page; the packer is the only booklet.
7. Helper
scripts/generate.mjs runs steps 3–6 in one go after auth is already in place:
node skills/pocket-field-guide/scripts/generate.mjs \
--out ./my-guide \
--subject "the salt marsh after the last ferry" \
--plates 4
Useful flags: --tone uncanny, --no-cover, --image-model tongyi-mai/z-image-turbo, --text-model openai/gpt-5-nano, --voice nova, --plan-only, --pack-only. It never accepts a key flag.
Rules
- Call
polliorhttps://gen.pollinations.aiwith the user's login orPOLLINATIONS_API_KEY. Never embed a key in a file, README, or command the user might copy. - Default models must be
paid_only: false. Check withpolli models --json --type image(oraudio/text) if you change one. - Do not put letters, captions, Latin names or watermarks in the image prompts. Lettering lives in the booklet.
- Do not invent species observations you then present as real field data. Invented ecologies are fiction and the subtitle or region should make that clear.
- Keep
SKILL.mdas the instructions; load nothing else unless packing or generating.
See references/models.md for the default model list and cost notes.