The gallery

The gallery is where people share layouts and mods. Give your agent an item's address and it adds it beside yours, without overwriting anything.

The Board layout from the gallery: every agent as a card in Needs you, Working and Done columns, the picked one live beside it.

https://woolshed.dev/gallery/ is where people share layouts and mods, and where Woolshed puts more of its own. Each one is a folder laid out like this home: a layout has layouts/<name>.json and the mods/<name>/ it needs; a mod is a piece for the person's own window, so it has only mods/<name>/ (main.js, maybe mod.json and its assets) and maybe a keys.json with the keys it expects. Both have a RECIPE.md (the brief to build it from scratch) and a preview.png. The files are one build of the recipe.

The person can also browse it inside Woolshed: the Gallery (mod.open:gallery, or Gallery… in the menu) shows every item with its picture and recipe, and adds one with a click by the rules below: every file downloaded under data/gallery/staging/ and read first, what its code reaches for shown before adding, a taken name renamed everywhere it's used, keys merged without replacing one in use, nothing overwritten.

To find one, read https://woolshed.dev/gallery/index.json: { "schemaVersion": 1, "generatedAt", "items": [{ "kind", "owner", "name", "title", "blurb", "page", "manifest", "preview", "stars", "updated" }] }. Offer the person a few by title and blurb, with their page.

woolshed check <folder> on such a folder (no main.js of its own: one you downloaded, or one you're about to publish) checks the whole package: each layout (the window reads it, and every mod it names is in the package or ships with Woolshed), its keys.json, and each mod.

Add a layout or mod

Asked to add one, get its files from the address you're given into a new, empty folder outside this home (a folder in mods/ can start running as soon as it lands there):

  • A gallery page, woolshed.dev/gallery/layouts/<owner>/<name> or woolshed.dev/gallery/mods/<owner>/<name> (with or without https:// and the last /). Read its manifest, the same address plus /manifest.json: { "kind": "layout" | "mod", "owner", "name", "title", "blurb", "source": { "type": "woolshed" | "github", "repo", "commit", "path" }, "base", "files": ["RECIPE.md", "preview.png", "layouts/<name>.json", "mods/<name>/main.js", ...] }. Download every path in files from base followed by the path, keeping the paths. Stop if a path is absolute or contains ...
  • A GitHub folder, github.com/<owner>/<repo>/tree/<ref>/<path>, or a whole repository, github.com/<owner>/<repo>: download the repository at <ref> (else its default branch) with git clone or as https://github.com/<owner>/<repo>/archive/<ref>.tar.gz, and use <path> in it.

Then:

  1. Read RECIPE.md and every file before writing anything. Before adding, tell the person if a mod reaches the network, runs programs (exec, hc) or reads files outside its own folder.
  2. Never overwrite: if a layout or mod name is taken (the person's or Woolshed's), first rename the new one in the downloaded folder (letters, digits, - and _) everywhere it's used: its file or folder; the mod names in the layout (blocks, pane headers, floating blocks, terminal_menu) and wherever the code names it (openOverlay, mod.open, pane.split, tab.new); its asset paths (mods/<name>/..., the layout's preview); and in its keys.json, the layout:<name> or mod:<name> section and <name>.<command> actions. Then copy the layout file to layouts/ and each mod folder to mods/, leaving the recipe and preview out.
  3. Fit it to this setup only where its assumptions don't hold (a missing program, a name clash) or the person asks. Where its files name a different command or home folder for the window, use woolshed and ~/.config/woolshed (WOOLSHED_HOME). If the files don't work on this version, or the person wants it different, build it from the recipe instead.
  4. A keys.json: merge it into the person's. Add its sections and keys, and ask before replacing a key they already use.
  5. woolshed check ~/.config/woolshed/mods/<name> for each mod you added; for a layout, then woolshed do layout.switch --name <name>. The person's own layout stays as it was; ctrl-shift-l switches back, and deleting the files removes it.

Publishing makes the person's files public: do it only with their go-ahead.

  1. Make a new folder laid out as above: for a layout, layouts/<name>.json (and its preview picture, if it has one) and each mods/<name>/ it uses that doesn't ship with Woolshed; for a mod, mods/<name>/ and, if it expects keys, a keys.json with only those. Clicks (layouts/.state/) don't travel: write any the look depends on (a size, a theme) into the layout file. Leave out the person's own files (settings.json, shared.json, data/, view.json) and anything private in the code (tokens, host names, paths); ask if unsure.
  2. Write its RECIPE.md from the real files (below), with the sections What you see, How it behaves, Built from, Watch out and Done when.
  3. Show it in the window (woolshed do layout.switch --name <name>, or the mod on screen) and save woolshed shot <folder>/preview.png. The picture is what's on screen, terminals included: look at it, and show it to the person before it goes public.
  4. woolshed check <folder>; fix what it reports until it passes.
  5. Push the folder to a public GitHub repository (one folder per layout or mod if it holds several) and give the repository the topic woolshed-layout for a layout or woolshed-mod for a mod. With gh, in the folder: git init and commit it, then gh repo create <repo> --public --source . --push and gh repo edit --add-topic <topic>. The gallery lists repositories with these topics. Give the person its address, github.com/<owner>/<repo> (.../tree/<branch>/<folder> for a folder in it): anyone can add it from there.

RECIPE.md

A RECIPE.md is a brief: another agent with an empty folder builds the layout or mod from it. Write it from the real files, in this order:

  1. # Name, one paragraph of what the person sees, ![Name](preview.png).
  2. What you see: the regions top to bottom or left to right, their sizes, colors and type; what each one shows.
  3. How it behaves: every agent status (working, blocked, done, idle) and how it looks; what clicks, keys and hovers do; what moves.
  4. Built from: the layout's node tree and blocks, each mod and its props roles, the shipped mods it uses, the woolshed functions and commands it calls, any programs it runs, its art.
  5. Watch out: what tripped the build up and what a fresh build would get wrong; limits (sizes, counts); controls that do nothing yet; what it assumes about the setup.
  6. Done when: checks that prove a build works, each one something the build really does.

The person and what they see come first; code only in Built from and Watch out. Exact over vague (#ab7748, 29px, agent.focus), and nothing the build doesn't do.

Your agents read these same words: Woolshed writes this guide to ~/.config/woolshed/AGENTS.md on every start. In it, “you” is the agent and “the person” is you.