袖珍田野指南
將一個地點、一個季節或一個人造的生態系統,轉變為一本小型、看起來像是印刷品的田野指南。一個風格聖經和相關的種子能保持圖版的一致性。一個打包腳本會拒絕撰寫小冊子,直到每個圖版都是真實圖像,且導覽是真實的 mp3。
一份無需登入的即時範例小冊子位於 https://danieljbinns.github.io/pocket-field-guide/harbor/。當使用者想在花費 Pollen 之前查看打包後的指南樣貌時,請提供此連結。
不要自行發明 Pollinations 金鑰。不要從磁碟讀取或複製金鑰到命令、檔案或聊天中。使用者透過 polli auth login 或已存在於其環境中的 POLLINATIONS_API_KEY 來花費自己的 Pollen。
1. 登入
執行 polli auth status --json(或 polli whoami --json)。
- 如果
authenticated為 true,則繼續。如果回報的pollen餘額低於0.02,請提醒使用者。 - 如果未認證,則啟動
polli --json auth login --no-browser。在執行期間讀取 stderr,向使用者顯示驗證 URL 和用戶代碼,然後等待。批准後,stdout 會是{"authenticated":true}。令牌會保留在使用者的機器上。 - 如果使用者已在
POLLINATIONS_API_KEY中有金鑰,他們可以執行printf '%s' "$POLLINATIONS_API_KEY" | polli auth login --with-token。切勿要求他們將金鑰貼到聊天中。
如果缺少 polli:執行 npm i -g @pollinations/cli@latest。
2. 確認任務概要
需要一個主題(一個真實地點、一個季節或一個人造的生態系統)和一種語調:
- 自然主義者(預設):合理的生物學、謹慎的語言、沒有魔法。
- 略顯詭異:仍然是生物學上的,但有點不對勁,沒有咒語或扮演怪物。
確認圖版數量。預設為一個棲息地封面 + 四個物種圖版。袖珍版為二到三個圖版,且可能跳過封面圖像(小冊子會以字體設定標題)。在生成前進行估算:
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)每個圖像約為 0.002 pollen。zimage(tongyi-mai/z-image-turbo)約為 0.004,通常更清晰。兩者均為 paid_only: false。一個完整的預設指南約為 0.011 pollen,加上一個簡短導覽和計畫。如果餘額無法覆蓋估算,請提供袖珍版或更便宜的模型。切勿切換到 paid_only: true 的模型。
3. 撰寫計畫
建立輸出資料夾,然後使用免費文字模型撰寫 guide.json。偏好使用 openai/gpt-5.4-nano。如果餘額吃緊,則使用 openai/gpt-5-nano。使用 --json-response 和 --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."
將檔案解析為 $OUT/guide.json。如果模型將物件包裹在 markdown 圍欄中,請將其剝離。確認 species.length 等於約定的圖版數量。如果 JSON 無效,請用較短的提示重試一次;如果仍然失敗,請停止。
如果缺少這些欄位,請添加(不要要求模型添加)它們:
{
"image_model": "black-forest-labs/flux.1-schnell",
"text_model": "openai/gpt-5.4-nano",
"audio_model": "openai/tts-1"
}
openai/tts-1 允許的 voice 值為 alloy、echo、fable、onyx、nova、shimmer。如果模型選擇了 sage 或其他值,請使用 onyx。
4. 生成圖版
每個圖像提示為:
{style_bible} A naturalist's plate of the {common_name} ({latin_name}): {visual_description}. Full specimen, scientifically careful pose, cream paper, no text.
封面(如果有的話)是一個棲息地建立圖版,仍然使用風格聖經且不含文字:
{style_bible} A habitat plate of {region} in {season}, no people, no letters, wide view, cream paper.
對每個圖像使用相同的模型。為封面重複使用 seed,並為每個物種使用 seed + index(從 1 開始),以使這組圖像相關但不完全相同。
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"
將每個物種的相對檔名寫入為 plate(plates/01-slug.png)。如果您生成了封面,請將 cover 設定為 cover.png。
如果指令退出碼非零,或輸出檔案遺失或小於 8 KB,請用稍微澄清的視覺描述和新的種子(seed + 50 + index)重試該圖版一次。如果 polli 回傳 402,請停止並引導使用者前往 https://enter.pollinations.ai。不要繼續生成。
圖像模型可能回傳一個副檔名為 .png 的 JPEG。保留寫入的檔案;pack.mjs 會偵測類型並重新命名。
5. 生成導覽
polli gen audio "$NARRATOR_SCRIPT" \
--model openai/tts-1 \
--voice onyx \
--output "$OUT/tour.mp3"
如果腳本很長,可以透過 stdin 傳遞:printf '%s' "$NARRATOR_SCRIPT" | polli gen audio --model openai/tts-1 --voice onyx --output "$OUT/tour.mp3"。
將計畫中的 audio 設定為 tour.mp3。如果檔案遺失或小於 1 KB,請重試一次。不要使用音樂模型;目前所有的 Pollinations 音樂模型都是 paid_only: true。
6. 打包並顯示小冊子
儲存最終的 guide.json,然後:
node skills/pocket-field-guide/scripts/pack.mjs "$OUT"
(從複製的技能資料夾執行:node scripts/pack.mjs "$OUT"。)
該腳本會檢查計畫、圖版、導覽和可選的封面,然後寫入 $OUT/index.html。為使用者開啟該檔案。不要手寫第二個 HTML 頁面;打包器是唯一的小冊子。
7. 輔助腳本
scripts/generate.mjs 在認證就緒後一次執行步驟 3 到 6:
node skills/pocket-field-guide/scripts/generate.mjs \
--out ./my-guide \
--subject "the salt marsh after the last ferry" \
--plates 4
有用的標誌:--tone uncanny、--no-cover、--image-model tongyi-mai/z-image-turbo、--text-model openai/gpt-5-nano、--voice nova、--plan-only、--pack-only。它從不接受金鑰標誌。
規則
- 使用使用者的登入資訊或
POLLINATIONS_API_KEY來呼叫polli或https://gen.pollinations.ai。切勿將金鑰嵌入檔案、README 或使用者可能複製的命令中。 - 預設模型必須是
paid_only: false。如果更改模型,請使用polli models --json --type image(或audio/text)進行檢查。 - 不要在圖像提示中加入文字、標題、拉丁名稱或浮水印。文字排版存在於小冊子中。
- 不要自行發明物種觀察結果,然後將其呈現為真實的田野數據。人造生態系統是虛構的,且副標題或區域應清楚說明這點。
- 將
SKILL.md作為指令;除非是打包或生成,否則不要載入其他任何內容。
請參閱 references/models.md 以取得預設模型清單和費用說明。