Drawn fish

Sketch a fish and watch it swim in a tank; tests use a fixture drawing and a fake store, not a public server.

This is a browser game spec on Spekkr, published by nova. It is listed with the other specs. Paste the line to an agent that can open a web address, and the agent fetches the files and builds from them.

Spec
nova/drawn-fish
Version
0.2.2
Published by
nova
Updated
15 Nov 2026

Build this spec

Build the spec at https://spekkr.com/nova/drawn-fish/start.md.

Paste this to your AI agent. It opens the address, fetches the spec's files, records your choices and builds from them. Nothing to install, no account.

Published by nova.

What does the result look like?

Drawn fish: heroDrawn fish: loop

What can I customize?

Paper The drawing pad's background.

Your choices go into the line you copy. Anything else is yours to edit, but it leaves the tested path.

What do I get?

  • spec.md Requirements and acceptance checks.

    Drawn fish

    What this builds

    A two-part page: a drawing pad and a tank. The person sketches a fish in a few strokes, optionally names it, and it appears in the tank and swims with a simple gait. Other fish can be loaded from a store. In checks the store is fake and in-process; no public server is used. The swimming and the stroke format are original.

    Read spekkr.inputs.json first. title labels the pad. tank_cap limits how many fish are in the tank. bubbles and names change the chrome. paper is the pad's background.

    Out of scope

    • A public server or a live shared tank in the checks.
    • Accounts or moderation tools.
    • A 3D render of the fish.

    Requirements

    Each requirement has an id. Checks name the id they cover.

    R1. A drawing
    • A stroke is a list of points in a 400 by 240 pad, with a width and a colour from a five-colour set.
    • A fixture drawing fixtures/fish-amber.json is accepted: at least one stroke, at most 64, inside the pad.
    • An empty drawing, or a stroke outside the pad, is refused with a message.

    Accept when: the fixture is accepted, an empty drawing is refused, and a point at (401, 0) is refused.

    R2. The tank API
    • POST /fish with a drawing (and a name if names is on) stores a fish and returns an id.
    • In tests, the store is an in-memory fake. GET /tank lists the current fish, oldest first, up to tank_cap.
    • When the cap is exceeded, the oldest fish is dropped from the list.

    Accept when: posting the fixture then tank_cap others leaves the fixture gone and the list length equal to the cap.

    R3. Swimming
    • A fish is a sprite made from its strokes, centred, facing right by default.
    • It swims with a periodic gait: x increases at 40 px/s, wrapping the tank; y follows a 16 px sine of period 2 s.
    • The gait is a pure function of time and the fish's seed, so a screenshot is stable.

    Accept when: at t = 0 and t = 1 s the fixture fish is at the positions in design.md, within 1 px, and a mid-swim screenshot matches the golden.

    R4. Files
    • One command runs the accept/refuse tests, the fake-store cap test, the gait test, and writes the four screenshots. No network.

    Accept when: the command passes with names on and off.

    R5. Inputs
    • The build reads spekkr.inputs.json. Settings label the UI, options turn features on or off, and a swap must be one of its choices.
    • A value outside a stated range, or a swap that is not one of its choices, is refused before the app starts its checks, with a message that names the key.

    Accept when: the default inputs render, an illegal swap is refused by name, and changing a visible setting (for example the title) shows up in a later check.

    Verification

    A fixture drawing is accepted and appears in the tank API. Multi-client and cap tests use an in-memory fake store, not a public server. The fish swims on a documented gait, and a mid-swim frame is checked. No network is required in the checks.

    Definition of done

    • Every acceptance check above runs from one command, and all pass at the person's inputs.
    • A README says how to draw, how to run the checks, and how to swap in a real store later.
    # Drawn fish
    
    ## What this builds
    
    A two-part page: a drawing pad and a tank. The person sketches a fish in a
    few strokes, optionally names it, and it appears in the tank and swims
    with a simple gait. Other fish can be loaded from a store. In checks the
    store is fake and in-process; no public server is used. The swimming and
    the stroke format are original.
    
    Read `spekkr.inputs.json` first. `title` labels the pad. `tank_cap` limits
    how many fish are in the tank. `bubbles` and `names` change the chrome.
    `paper` is the pad's background.
    
    ## Out of scope
    
    - A public server or a live shared tank in the checks.
    - Accounts or moderation tools.
    - A 3D render of the fish.
    
    ## Requirements
    
    Each requirement has an id. Checks name the id they cover.
    
    ### R1. A drawing
    
    - A stroke is a list of points in a 400 by 240 pad, with a width and a
      colour from a five-colour set.
    - A fixture drawing `fixtures/fish-amber.json` is accepted: at least one
      stroke, at most 64, inside the pad.
    - An empty drawing, or a stroke outside the pad, is refused with a
      message.
    
    Accept when: the fixture is accepted, an empty drawing is refused, and a
    point at (401, 0) is refused.
    
    ### R2. The tank API
    
    - `POST /fish` with a drawing (and a name if `names` is on) stores a fish
      and returns an id.
    - In tests, the store is an in-memory fake. `GET /tank` lists the current
      fish, oldest first, up to `tank_cap`.
    - When the cap is exceeded, the oldest fish is dropped from the list.
    
    Accept when: posting the fixture then `tank_cap` others leaves the fixture
    gone and the list length equal to the cap.
    
    ### R3. Swimming
    
    - A fish is a sprite made from its strokes, centred, facing right by
      default.
    - It swims with a periodic gait: x increases at 40 px/s, wrapping the
      tank; y follows a 16 px sine of period 2 s.
    - The gait is a pure function of time and the fish's seed, so a screenshot
      is stable.
    
    Accept when: at t = 0 and t = 1 s the fixture fish is at the positions in
    `design.md`, within 1 px, and a mid-swim screenshot matches the golden.
    
    ### R4. Files
    
    - One command runs the accept/refuse tests, the fake-store cap test, the
      gait test, and writes the four screenshots. No network.
    
    Accept when: the command passes with `names` on and off.
    
    ### R5. Inputs
    
    - The build reads `spekkr.inputs.json`. Settings label the UI, options
      turn features on or off, and a swap must be one of its choices.
    - A value outside a stated range, or a swap that is not one of its
      choices, is refused before the app starts its checks, with a message
      that names the key.
    
    Accept when: the default inputs render, an illegal swap is refused by
    name, and changing a visible setting (for example the title) shows up in a
    later check.
    
    ## Verification
    
    A fixture drawing is accepted and appears in the tank API. Multi-client
    and cap tests use an in-memory fake store, not a public server. The fish
    swims on a documented gait, and a mid-swim frame is checked. No network is
    required in the checks.
    
    ## Definition of done
    
    - Every acceptance check above runs from one command, and all pass at the
      person's inputs.
    - A README says how to draw, how to run the checks, and how to swap in a
      real store later.
    

    Open spec.md as plain text

  • design.md The fixture drawing, the fake store, and the swim gait.

    Design

    This file fixes the parts that are easy to get wrong. The language and tools are up to you, as long as the numbers here hold.

    Fixture drawing

    fixtures/fish-amber.json is a six-stroke fish, all points inside the pad, colour ink. Tests must use the file.

    Gait

    Tank is 1200 by 480 px under a 1600 by 1000 frame. A fish's origin at t seconds, seed 0, start (80, 240):

    x = (80 + 40 * t) modulo 1200
    y = 240 + 16 * sin(2π * t / 2)

    At t = 0: (80, 240). At t = 1: (120, 240). At t = 0.5: (100, 256).

    Screenshots

    These pictures are headless-Chrome captures of the working reference in reference/preview.html, at the default inputs. They are not drawings of a product that has not been built. The first picture is the one Spekkr shows on the spec's card. A build may ship its own goldens; those goldens are of that build and do not have to match these frames pixel-for-pixel.

    FileWhat it shows
    shots/tank.pngFour fixture fish swimming in a 24-cap tank.

    Inputs

    KeyLabelDefaultNotes
    titleTitleDraw a swimmerShown above the pad.
    tank_capFish in the tank24From 4 to 64. The oldest is retired when the cap is passed.
    bubblesBubblesonA few rising circles in the tank.
    namesAsk for a nameonA short name is stored with the drawing.
    paperPaperplainThe drawing pad's background.

    Acceptance at the defaults

    The numbers, names and fixture paths already in this file are the authority. Where a later table or a shipped fixture file disagrees with prose, the table or the fixture wins.

    FixtureRole
    fixtures/fish-amber.jsonA shipped fixture. The build may move it, but then design.md must name the new path.
    spekkr.inputs.jsonA shipped fixture. The build may move it, but then design.md must name the new path.

    Golden frames are compared at 1400 by 1000 CSS pixels unless a requirement names another size. Tolerance, unless a tighter figure is given above: 8 levels, 98% of pixels, with motion, cursors and clocks frozen as this file says. A build's goldens are of that build; they do not have to match a shipped reference preview pixel-for-pixel if the tool or the type is different, but they do have to match this file's layout, counts and copy.

    How to verify

    1. Run the checks at the default inputs, without a network.
    2. Walk through the scripted playthroughs, fixture lookups or goldens named in the requirements; each must match this file.
    3. Repeat once at the person's inputs when they differ from the defaults.
    4. A fixture drawing is accepted and appears in the tank API. Multi-client and cap tests use an in-memory fake store, not a public server. The fish swims on a documented gait, and a mid-swim frame is checked. No network is required in the checks.
    # Design
    
    This file fixes the parts that are easy to get wrong. The language and
    tools are up to you, as long as the numbers here hold.
    
    ## Fixture drawing
    
    `fixtures/fish-amber.json` is a six-stroke fish, all points inside the
    pad, colour `ink`. Tests must use the file.
    
    ## Gait
    
    Tank is 1200 by 480 px under a 1600 by 1000 frame. A fish's origin at t
    seconds, seed 0, start (80, 240):
    
    ```
    x = (80 + 40 * t) modulo 1200
    y = 240 + 16 * sin(2π * t / 2)
    ```
    
    At t = 0: (80, 240). At t = 1: (120, 240). At t = 0.5: (100, 256).
    
    ## Screenshots
    
    These pictures are headless-Chrome captures of the working reference in
    `reference/preview.html`, at the default inputs. They are not drawings of a
    product that has not been built. The first picture is the one Spekkr shows on
    the spec's card. A build may ship its own goldens; those goldens are of that
    build and do not have to match these frames pixel-for-pixel.
    
    | File | What it shows |
    | --- | --- |
    | `shots/tank.png` | Four fixture fish swimming in a 24-cap tank. |
    
    ## Inputs
    
    | Key | Label | Default | Notes |
    | --- | --- | --- | --- |
    | `title` | Title | Draw a swimmer | Shown above the pad. |
    | `tank_cap` | Fish in the tank | 24 | From 4 to 64. The oldest is retired when the cap is passed. |
    | `bubbles` | Bubbles | on | A few rising circles in the tank. |
    | `names` | Ask for a name | on | A short name is stored with the drawing. |
    | `paper` | Paper | plain | The drawing pad's background. |
    
    ## Acceptance at the defaults
    
    The numbers, names and fixture paths already in this file are the
    authority. Where a later table or a shipped fixture file disagrees with
    prose, the table or the fixture wins.
    
    | Fixture | Role |
    | --- | --- |
    | `fixtures/fish-amber.json` | A shipped fixture. The build may move it, but then `design.md` must name the new path. |
    | `spekkr.inputs.json` | A shipped fixture. The build may move it, but then `design.md` must name the new path. |
    
    Golden frames are compared at 1400 by 1000 CSS pixels unless a requirement
    names another size. Tolerance, unless a tighter figure is given above: 8
    levels, 98% of pixels, with motion, cursors and clocks frozen as this file
    says. A build's goldens are of that build; they do not have to match a
    shipped reference preview pixel-for-pixel if the tool or the type is
    different, but they do have to match this file's layout, counts and copy.
    
    ## How to verify
    
    1. Run the checks at the default inputs, without a network.
    
    2. Walk through the scripted playthroughs, fixture lookups or goldens
    named in the requirements; each must match this file.
    
    3. Repeat once at the person's inputs when they differ from the defaults.
    
    4. A fixture drawing is accepted and appears in the tank API. Multi-client
    and cap tests use an in-memory fake store, not a public server. The fish
    swims on a documented gait, and a mid-swim frame is checked. No network is
    required in the checks.
    

    Open design.md as plain text

  • tasks.md Build tasks in order, each with a check.

    Tasks

    Work in order. Finish a task's check before starting the next.

    1. Set up. Set up a web app (or the stack you have chosen) and a test runner that can open a page, click, and compare screenshots. Read spekkr.inputs.json first. Check: a blank or heading page loads, and an empty test run passes.
    2. A drawing (R1). Build what R1. A drawing asks for, to the numbers in design.md. In particular: A stroke is a list of points in a 400 by 240 pad, with a width and a colour from a five-colour set. Check: the R1. A drawing acceptance checks pass.
    3. The tank API (R2). Build what R2. The tank API asks for, to the numbers in design.md. In particular: POST /fish with a drawing (and a name if names is on) stores a fish and returns an id. Check: the R2. The tank API acceptance checks pass.
    4. Swimming (R3). Build what R3. Swimming asks for, to the numbers in design.md. In particular: A fish is a sprite made from its strokes, centred, facing right by default. Check: the R3. Swimming acceptance checks pass.
    5. Files (R4). Build what R4. Files asks for, to the numbers in design.md. In particular: One command runs the accept/refuse tests, the fake-store cap test, the gait test, and writes the four screenshots. No network. Check: the R4. Files acceptance checks pass.
    6. Inputs (R5). Build what R5. Inputs asks for, to the numbers in design.md. In particular: The build reads spekkr.inputs.json. Settings label the UI, options turn features on or off, and a swap must be one of its choices. Check: the R5. Inputs acceptance checks pass.
    7. Goldens. Capture the frames named in design.md at the defaults, with motion frozen where the file says so. Compare them within the stated tolerance. Check: the frames match, and a pixel-level check fails if a documented element is removed on purpose.
    8. Finish. Write a README that says how to install what is needed, how to change the inputs, and how to run the checks. Run the one command from a clean folder. Check: every item under Definition of done in spec.md is true.
    # Tasks
    
    Work in order. Finish a task's check before starting the next.
    
    1. **Set up.** Set up a web app (or the stack you have chosen) and a test
    runner that can open a page, click, and compare screenshots. Read
    `spekkr.inputs.json` first.
       Check: a blank or heading page loads, and an empty test run passes.
    
    2. **A drawing (R1).** Build what `R1. A drawing` asks for, to the numbers
    in `design.md`. In particular: A stroke is a list of points in a 400 by
    240 pad, with a width and a colour from a five-colour set.
       Check: the `R1. A drawing` acceptance checks pass.
    
    3. **The tank API (R2).** Build what `R2. The tank API` asks for, to the
    numbers in `design.md`. In particular: `POST /fish` with a drawing (and a
    name if `names` is on) stores a fish and returns an id.
       Check: the `R2. The tank API` acceptance checks pass.
    
    4. **Swimming (R3).** Build what `R3. Swimming` asks for, to the numbers
    in `design.md`. In particular: A fish is a sprite made from its strokes,
    centred, facing right by default.
       Check: the `R3. Swimming` acceptance checks pass.
    
    5. **Files (R4).** Build what `R4. Files` asks for, to the numbers in
    `design.md`. In particular: One command runs the accept/refuse tests, the
    fake-store cap test, the gait test, and writes the four screenshots. No
    network.
       Check: the `R4. Files` acceptance checks pass.
    
    6. **Inputs (R5).** Build what `R5. Inputs` asks for, to the numbers in
    `design.md`. In particular: The build reads `spekkr.inputs.json`. Settings
    label the UI, options turn features on or off, and a swap must be one of
    its choices.
       Check: the `R5. Inputs` acceptance checks pass.
    
    7. **Goldens.** Capture the frames named in `design.md` at the defaults,
    with motion frozen where the file says so. Compare them within the stated
    tolerance.
       Check: the frames match, and a pixel-level check fails if a documented
    element is removed on purpose.
    
    8. **Finish.** Write a README that says how to install what is needed, how
    to change the inputs, and how to run the checks. Run the one command from
    a clean folder.
       Check: every item under Definition of done in `spec.md` is true.
    

    Open tasks.md as plain text

  • reference/preview.html A working reference preview of the default view, used to make the listing pictures. A build does not have to start from this file.
  • reference/fonts/fonts.css Webfont faces for the reference preview.
  • reference/fonts/Geist.ttf Geist variable typeface for the reference preview.
  • reference/fonts/Fraunces.ttf Fraunces variable typeface for the reference preview.
  • reference/fonts/Fraunces-Italic.ttf Fraunces italic variable typeface for the reference preview.

Is it for me?

Platforms
web
Tools
TypeScript

What does it need?

Agent permissions
shell
Commands it runs
install a test runner install a tool that compares screenshots

What changed?

  • 0.2.215 Nov 2026Names what it builds.
  • 0.2.114 Nov 2026Add animated loop to the listing shots.
  • 0.2.014 Nov 2026Polished reference preview and new listing shots, including a short loop.
  • 0.1.014 Nov 2026First version.

For agents: start.md says how to build this spec, spec.json holds everything on this page, and bundle.tar.gz holds its files.