**Product:** Dino *Built 2026-12-02, merged as PR #1516 (9b206c6b0); the task is registered, its first scheduled run is not yet seen.* *Planned.* The owner, 2026-12-02: "have generated images for at least 17 books ... do we have enough information to look at what went wrong and optimize the illustrator skill so that it changes it prompt so that gemini would not do the same mistake again? ... can we make a skill out of it and run it once a week/2 weeks". Approved the same day ("agree with all ...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Slices?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/elinsoft-ltd-slices-84739913)
# Slice 497 — Dino: a lessons skill that improves the illustrator's prompts every two weeks
**Product:** Dino
*Built 2026-12-02, merged as PR #1516 (9b206c6b0); the task is registered, its first scheduled run is not yet seen.*
*Planned.* The owner, 2026-12-02: "have generated images for at least 17 books ... do we have enough information to look at what went wrong and optimize the illustrator skill so that it changes it prompt so that gemini would not do the same mistake again? ... can we make a skill out of it and run it once a week/2 weeks". Approved the same day ("agree with all the suggestions. build it"): every two weeks on this PC, changes merged directly, a short note of what changed and why.
**Touches:** `.claude/skills/picture-lessons/SKILL.md` (new), `.claude/agents/picture-lessons.md` (new repo agent, Opus: the judgment is the point), `.claude/skills/create-dino-story/gemini-lessons.md` (new: the known Gemini mistakes and the wording that fixes each), `.claude/skills/create-dino-story/prompts.md`, `.claude/skills/create-dino-story/SKILL.md` (points to `gemini-lessons.md`; moves the Gemini lessons now scattered through it there), `tools/dino/picture-lessons/` (new: the run script and the scheduled-task setup), `CLAUDE.md` (*Where the rules live* line), this file. Needs Slice 495's log.
## Why
Gemini repeats the same mistakes book after book (a cat too big, paws hidden or below the 73% line, a faded or blank bottom, flipped markings, a scarf no one asked for, "can't edit images" refusals). The lessons sit as scattered notes in a 475-line SKILL.md and in each book's `art.md`, and the prompts in `prompts.md` change only when someone remembers.
## Work
- [x] The skill reads every `docs/books/*/picture-log.jsonl` line since the last run (the last run's date is kept in `gemini-lessons.md`), and on its first run also every book's `art.md` `## Check results` and `## Accepted by the user` (14 of 17 books have them).
- [x] It groups failures by kind and counts them per model and account, and pairs each kind with the prompt wording on the tries that passed after it failed. The owner's overrules (`owner-accept` of a failed try, `owner-reject` of a passed one) count most: they show where the checker and the owner disagree.
- [x] It rewrites `gemini-lessons.md` (each mistake: how often, since when, the wording that fixes it, the source tries) and changes `prompts.md`'s templates and the illustrator's check list where a fix is clear. It never weakens a hard rule (nobody hurt, no scarf, accepted pages untouched, the two-illustrator cap).
- [x] It ships as a normal docs PR that merges on its own (`ship-branch`, `+semver: none`), and the owner gets a short note: what changed and why, with the counts. The note goes on a board card; nothing is sent outside.
- [x] Runs every two weeks on this PC: a Windows scheduled task, created by `tools/dino/picture-lessons/install-task.ps1`, starts `claude -p` headless in a fresh worktree of `origin/main` (the detached start used by `run-all-waves`). A run that finds no new tries makes no PR and says so on its card.
- registered 2026-12-02, task DinoPictureLessons, next run 2026-12-16 03:00 (schtasks /query).
- [x] First run done by this slice, on the 14 books' notes and Golbaghali Kitten's log; its PR is the first `gemini-lessons.md`.
- [x] `CLAUDE.md` *Where the rules live* names the skill and agent (the line is under `#### For CLAUDE.md` below; the index pass lifts it, a feature branch does not edit `CLAUDE.md`).
## Decisions
- Every two weeks with direct changes, not suggestions for a yes (owner-approved recommendation: no approval rounds, and a timer runs even when no book finishes).
- A Windows scheduled task, not a GitHub Actions cron: the logs and the `claude` CLI are on this PC, and Actions minutes are capped (`.github/CLAUDE.md`).
- Opus for the agent: deciding which wording fixed a mistake is judgment, not mechanics.
### Built
Built 2026-12-02. `tools/dino/picture-lessons/collect.mjs` (+ 10 tests) prints the agent's input as JSON; `run.ps1` makes a fresh worktree of `origin/main` and starts `claude -p --agent picture-lessons` through `start-detached.ps1`; `install-task.ps1` registers task `DinoPictureLessons` (every 14 days at 03:00, idempotent, `-DryRun`/`-WhatIf`; NOT registered yet, the owner or the caller runs it). `gemini-lessons.md` holds the lessons moved out of `create-dino-story/SKILL.md` steps 3 and 4 and an empty `Last run:` line (a run with an empty line is a first run, and reads every `art.md`). Choices: `Last run:` is a UTC timestamp, so tries logged later the same day are not missed; `collect.mjs` only gathers and counts (tries, passed, failed, refused from the verdict events) and the Opus agent reads the notes and groups them into mistake kinds itself (after three review rounds of faults in a keyword classifier); a prompt change needs the same wording passing twice after one failure or an owner overrule (old log lines have no prompt, so they count for frequency only).
First run 2026-12-02 (`collect.mjs --first-run`, `Last run: 2026-12-02T13:50:36Z`): 54 logged tries from gol-baghali-cat (25 passed, 20 failed, 9 refused; 7 refusals on `elinsoftuk`, no model on any line) plus 15 books' `art.md` notes and 2 owner overrules; `gemini-lessons.md` now holds 12 lessons; `prompts.md` gained `<FULL BLEED>` (Cover, Page, Back cover), left-to-right places, `<MARKINGS>`, `<COUNTED PROPS>` and blank labels in the Page template, and a Words-only page template; SKILL.md step 5 and the illustrator's check gained scarf, one-sided-marking and counted-things lines. The collector's keyword kinds first mislabelled two checker notes ("no scarf" as `scarf`, "text-only:" as `text-in-picture`); the review round fixed it (negations dropped, whole words only) and the counts in the lessons file were redone.
Before the first scheduled run: the task's `run.ps1` is read from the primary checkout, so this PR must be merged and the primary fast-forwarded first; the Golbaghali log has no prompts and times of `2026-12-02T00:00:00Z`.
#### For CLAUDE.md (lifted 2026-12-02)
Add to *Where the rules live* (the index pass lifts it): `- `.claude/skills/picture-lessons/SKILL.md` — every two weeks (scheduled task `DinoPictureLessons`, `tools/dino/picture-lessons/install-task.ps1`) repo agent `picture-lessons` (Opus) reads the picture logs, rewrites `.claude/skills/create-dino-story/gemini-lessons.md` and fixes the illustrator's prompts; its docs PR merges on its own, the note goes on a board card (Slice 497).`
#### From review
- Fixed #1 (`reviews/s497-high.md`): failure kinds drop the clause after no, nobody, none, never, without and "not wearing/having" before matching, and "text-only" is not a text fault (`classify` in `collect.mjs`); a bare "not" is kept so "paw not above the line" still counts. Tests added.
- Fixed #2 (`reviews/s497-high.md`): every keyword in `KINDS` starts at a word boundary, `hat` is `hats?`, `wear` is `wears?|wearing`. Tests added.
- Fixed #3 (`reviews/s497-high.md`): a try is new by its own non-owner rows' time and only failure rows newer than `Last run` are counted; an owner row never makes an old try new, and overrules are counted by the owner row's own time. Test added.
- Fixed #4 (`reviews/s497-high.md`): the agent has no agent-board MCP tool, so the agent file and SKILL.md step 6 name the `board.mjs report-progress` Bash route the other repo agents use (`--outcome`, `--tool mark_done`).
- Fixed #5 (`reviews/s497-high.md`): the "Runs every two weeks" item is unticked with the line "registered by the coordinator after merge (install-task.ps1), then ticked in the index pass".
- Fixed #6 (`reviews/s497-high.md`): `install-task.ps1` picks a real `pwsh.exe` (never the WindowsApps alias) and falls back to Windows PowerShell 5.1's `powershell.exe`; on this PC the alias is the only pwsh, so the dry run shows `powershell.exe`. Parses in pwsh and 5.1; `-DryRun` only, nothing registered.
- Fixed #7 (`reviews/s497-high.md`): `public-name.yml` also runs `tools/dino/picture-lessons/*.test.mjs` and its path filters cover `tools/dino/picture-lessons/**`.
- Fixed #8 (`reviews/s497-high.md`): lessons in `gemini-lessons.md` carry stable slugs (`{#scarf-not-asked}`, ...); prompts.md, SKILL.md step 5 and the illustrator cite the slug, and the agent and skill tell the run to keep them.
- Fixed #9 (`reviews/s497-high.md`): `LAST_RUN_PATTERN` uses `[ \t]*` so it stays on its line. Test added.
- Fixed #10 (`reviews/s497-high.md`): the root `CLAUDE.md` edit is reverted and the line is under `#### For CLAUDE.md` above.
- Coordinator extra: first-run recount after fixes 1 and 2: `scarf` 3 -> 0, `text-in-picture` 1 -> 0 (that try is now `wrong-outfit` 1, "flipped"), `over-the-line` 11 -> 12, `other` 4 -> 5, `wrong-count` 0 -> 1; refusal 9 and wrong-size 1 unchanged. `gemini-lessons.md` lesson 10's note carries the new numbers; its other counts did not change.
- Fixed #1 (`reviews/s497-medium.md`): `wrong-count` takes a number before a counted noun with up to two words between ("3 white shoes", "two baskets", "two bowls"; nouns cat, pig, shoe, character, figure, basket, bowl, jar, prop) and "only/exactly N", but not "all four shoes" or "page-6 basket"; it is tested before `over-the-line`. Test added.
- Fixed #2 (`reviews/s497-medium.md`): `classifyAll` returns every kind a reason matches (`classify` is the first); a try counts once per kind. Test added.
- Fixed #3 (`reviews/s497-medium.md`): `over-the-line` is tested before `text-in-picture`, whose `words` no longer matches "words panel"; `menac\w*` catches "menacing". Test added.
- Fixed #4 (`reviews/s497-medium.md`): new rows are the lines past the counts in the `Lines read: <stem>=<n>, ...` line of `gemini-lessons.md` (a book with no entry is all new); with no such line, the old time rule against `Last run:`. `collect.mjs` prints `linesRead` to write back; SKILL.md steps 1 and 4 say so. The lessons file now holds `Lines read: gol-baghali-cat=57`. Test added.
- Fixed #5 (`reviews/s497-medium.md`): `Last run:` takes the rest of the line ("2026-12-02 13:50 UTC"), and an unreadable one warns on stderr. Test added.
- Fixed #6 (`reviews/s497-medium.md`): units named in the file header (kinds count tries once per kind; byModel/byAccount count tries and tries with a failure); `pageKey` removed. Test added.
- Fixed #7 (`reviews/s497-medium.md`): `run.ps1` removes the branch with `-D` after the origin/main..HEAD check, and the per-folder check is `Test-FinishedWorktree` with try/catch that keeps the folder on any error.
- Medium-round recount of the first run: `wrong-count` 1 -> 13 (the 13 tries lesson `{#counted-props}` already lists), `wrong-size` 1 -> 4 (lesson `{#character-size}` lists the same 4), `other` 5 -> 1 (page 4 try 1), `wrong-action` 0 -> 1, `over-the-line` 12 and refusal 9 unchanged, per-model/account counts unchanged. No count in `gemini-lessons.md` changed; only `Lines read:` was added.
- Fixed #1 (`reviews/s497-check.md`): removed: the agent groups notes itself, `collect.mjs` no longer classifies (keyword tables and their tests are gone; SKILL.md step 1 and the agent file say so).
- Fixed #2 (`reviews/s497-check.md`): removed: the agent groups notes itself, `collect.mjs` no longer classifies.
- Fixed #3 (`reviews/s497-check.md`): `noNewTries` is true only with no new try and no new owner row; the output lists `ownerRows`. Test added.
- Fixed #4 (`reviews/s497-check.md`): `run.ps1` never removes a worktree younger than 24 hours (folder creation time), and still only a clean one with nothing ahead of origin/main.
- Fixed #5 (`reviews/s497-check.md`): a last log line with no newline is neither read nor counted in `linesRead`. Test added.
- Fixed #6 (`reviews/s497-check.md`): `run.ps1` runs git through `Invoke-GitCapture` (ErrorActionPreference Continue inside, exit code checked), and `install-task.ps1` does the same for its one git call; both parse under 5.1 and pwsh.
- Fixed #7 (`reviews/s497-check.md`): `Lines read:` works without `Last run:` (not a first run, `sinceUsed` null), and a recorded count above the log's complete lines warns on stderr. Tests added.
- Fixed #8 (`reviews/s497-check.md`): removed: the agent groups notes itself, `collect.mjs` no longer classifies; a try is also counted once, in the run that reads its first verdict row (a saved-only try is listed as `unchecked`). Test added.
- Fixed #1 (`reviews/s497-check2.md`): a try whose status changes in a later run is counted again in that run with its latest status, listed under `changed` and `changedFrom` (earlier counts not rewritten); an unchanged later verdict is still not counted. Test added.
- Fixed #2 (`reviews/s497-check2.md`): `Object.hasOwn` for the recorded counts, `__proto__` ignored in `Lines read:`. Test added.
- Fixed #3 (`reviews/s497-check2.md`): tries are keyed by the log folder (`_stem`), not the row's `stem` field. Test added.
- Fixed #4 (`reviews/s497-check2.md`): a final complete JSON line with no newline is read and counted; an unparsable one is left unread with a warning. Test added.
- Fixed #5 (`reviews/s497-check2.md`): SKILL.md step 1 and the agent file list `firstRun`, `changed`, per-try `counted`/`changedFrom`, status `unchecked`, `nextPass` for refused tries, and when `sinceUsed` is null.
- Fixed #6 (`reviews/s497-check2.md`): the time test uses `>=` (the count-once rule prevents a double count) and timeless rows warn. Test added.
- Fixed #7 (`reviews/s497-check2.md`): `run.ps1` runs `git worktree prune` first and removes the fresh worktree and branch when start-detached fails (exception or non-zero exit).
- Skipped #1 (`reviews/s497-check3.md`): "tools/dino/picture-lessons/collect.mjs:239 (nit). `>=` time rule" - only without a `Lines read:` line or with `--since`; every real run writes `Lines read:`, so the time rule never decides.
- Skipped #2 (`reviews/s497-check3.md`): "tools/dino/picture-lessons/collect.mjs:124 (nit). `add()` byModel/byAccount" - model and account values are written by the illustrator into picture-log.jsonl (Gemini model and account labels, empty on older rows); none is an Object property name.
- Skipped #3 (`reviews/s497-check3.md`): "tools/dino/picture-lessons/run.ps1:101 (nit). If the branch exists" - the run is every two weeks and the branch name carries the date; a same-day retry is a hand run, and the error names the branch to delete.
- Skipped #4 (`reviews/s497-check3.md`): "tools/dino/picture-lessons/run.ps1:107 (nit). Failed-start cleanup" - start-detached.ps1 throws only when the process could not be created or exited within 5 seconds, so nothing is left running in the removed worktree.