I added engineering-standards to my skills in 8329df9. I want every app I build to start from the same foundation: simple objects, strong single responsibility, strong boundaries, full dependency injection, and state and logic you can test. Writing it down once means agents build to that standard by default, instead of me re-explaining it on every project.
Five core rules up front.SKILL.md holds them, each a principle with its Swift form; 17 more rules sit in three reference files (structure and dependencies, screen state and presentation, tests) loaded only when needed.
Fake the world, keep my layers real. Tests replace only the outside world; canned values at a unit's own injected functions are fine, recording mocks are out.
Precise values stay precise. Money and similar values use a decimal type parsed from strings.
description: Build and review app code to a fixed set of engineering standards (simple objects, single responsibility, strong boundaries, full dependency injection, testable state and logic), each stated as a principle with its Swift or SwiftUI form. Use when designing or reviewing app architecture, wiring dependency injection, writing view models or view states, mapping network responses and errors into domain types, applying code layout conventions, or when the user says "our standards" or "to our engineering standards".
---
# Engineering standards
Principle first, then the Swift form as one example; in another language, use its plainest idiom for the same rule. Test shape, doubles, factories and fixtures are in the `behavior-tests` skill; the rules in the tests reference add only what that skill leaves open.
## Core
1.**Simple objects.** Values and functions before classes and interfaces. Domain and view-state types are immutable values; computation is pure functions grouped by topic. A class only where mutable, observed state lives (the view model); an interface only for a real boundary, never one interface and one mock per dependency. Swift: `let`-only structs and enums, `static func`s on a `nonisolated enum`, one `@Observable` class per screen.
2.**Strong single responsibility.** One type, one job, named after the job. Networking alone is four types: configuration (base URL, version), endpoints (paths), client (fetch and decode), mapper (wire type to domain). The reverse holds too: actions that share one piece of state stay in one type instead of being split to shorten it.
3.**Strong boundaries.** Each layer speaks only its own types, and raw data stops at the edge. A weather DTO holds the server's strings; the repository maps it to a `Forecast` with typed temperatures; every failure becomes the layer's own error before it crosses. Callers consume capabilities (`fetchForecast`), never construct lower layers. A view sees view states, never a DTO or the client.
4.**Full dependency injection.** Every side effect (network, stored data, a delay's length) is passed in at construction with no default, so a caller can't forget it and a test can't be fooled by a built-in. One composition root: the entry point reads the configuration switches and builds the live wiring as locals in one function; preview or demo wiring is a second set that doesn't ship. Nothing below the root reads a global. Time and delays are injected only when a test needs to control them; a presentation delay doesn't earn a clock. Swift: `@Sendable` closures in `init`; `Dependencies+Live.swift`, and `Dependencies+Preview.swift` behind `#if DEBUG`; no `URLSession.shared` outside the root.
5.**Testable state and logic.** State is a value you can assert on: one state enum with payloads, readable by all and written only by its owner's actions. Logic is a pure function whose inputs (locale, units, the loaded data) are parameters, so a test needs no environment. Tests drive the real types through the user's flow and fake only the outermost boundary. Swift: `enum State: Equatable`, `private(set) var state`, `#expect(viewModel.state == .loaded(expected))`.
## Reference
- Read [structure.md](references/structure.md) when separating view models from view states, wiring dependencies, defining configuration, concurrency, validation and error boundaries, choosing request serialization or boundary payloads, naming functions and their argument labels, grouping members and function stages, or choosing enum projections versus behavioural pattern matching.
- Read [layout.md](references/layout.md) when formatting multiline conditions, arguments, parameters or nested calls.
- Read [screen-state.md](references/screen-state.md) when deriving screen state, formatting values, guarding async actions, extracting components or documenting escape hatches.
- Read [tests.md](references/tests.md) when choosing test boundaries, recording fixture provenance, covering screen states offline or verifying request wire output.
## Done
Each changed type has one job and a name that says it, every side effect enters through its initialiser, every new boundary has its own types and error, and each behaviour has a test that reads as the user's flow with only the world faked.
I released v1.4.1 of my skills. It ships design-lab, a private lab for comparing mockups and image rounds on one phone-friendly index before building anything. Its local server never serves hidden files or directory listings, with offline tests in the release checks, Tailscale is now optional, and dark screenshots set the colour scheme explicitly so they no longer depend on the Mac's own appearance.
I added design-lab to my skills in 549cfa8. With how easy it is to try things with AI agents, I like to experiment with designs, and this skill captures the lab I ran while redesigning this blog's themes: every mockup round, image round and verdict on one private, phone-friendly index, before any real code.
Nothing reviewed gets overwritten. Each revision is a new folder next to the old one, so I compare against what I actually saw.
Verdicts are my words. Loved, Approved, Not picked and Dropped are only recorded when I say so, and each one lands in the gallery, the index and the plan at the same time.
Phone first and private. Every page is checked at phone width in light and dark, served from a no-store local server on 127.0.0.1, shared over my tailnet only when one is available.
A finalists view with a side-by-side compare mode helps pick a default once most verdicts are in.
description: Run a private design lab for a project, with throwaway mockups and image rounds on one phone-friendly index the user reviews on their phone or the same machine, ending in a decision recorded in the plan. Use when the user wants to explore visual directions, themes, mockups, covers or image options before building, asks for a lab, a gallery, a revision round or a finalists view, or says 设计实验室 / 出几版看看.
---
# Design lab
The lab answers "which direction?" before any real code. Its output is a decision written in the plan doc, never production code. Everything in it is throwaway.
## Rules
-**Private and uncommitted.** The lab lives in a gitignored, build-ignored drafts folder (e.g. `local-drafts/lab/`). Check both ignores before the first file. Nothing in it reaches git, a build, a push or a message to another project.
-**Serve only what is visual.** The served root holds the index plus symlinks to mockup and image folders; never drafts, notes, `.temp`, `.env` or secrets. Bind to 127.0.0.1 with caching off. If a tailnet is available, use `tailscale serve` for phone review; otherwise review on the same machine at 127.0.0.1. Never bind to 0.0.0.0 or substitute a public tunnel.
-**Never overwrite a reviewed version.** A revision is a new folder next to the old one (`x-r2`, `x-r3`, `paper-contrast-a/b/c`, `dark-aurora`, `dark-indigo`). The user compares against what they saw.
-**Phone first.** Check every page at 390px: one column, no horizontal scroll. Every mockup in light and dark unless it is declared single-scheme. Record body and label contrast ratios (aim for 7:1 body text) in each round's notes.
-**Verdicts are the user's words.** Badges: Loved, Approved, To review, To pick, Not picked, Dropped, On hold. Never mark anything approved, picked or dropped unless the user said so; quote them in the note. If a verdict is ambiguous ("aurora indigo": one palette or two?), confirm before recording it.
-**Image rounds.** Unless the user gives an art direction, let the model choose and vary styles. Save every prompt in `prompts.json`. No text, logos, trademarks or personal details in images. Note the target crop ratio (e.g. 100:56) and check each image in that crop. Record each rejected round with the user's reason ("too close to X's style") so the next round avoids it.
-**In an agent chain:** the main relays verdicts as notices and revision asks as requests; answer each revision round with one batched reply holding all links.
## Ops
1.**Start the lab.** Run [scripts/serve-lab.py](scripts/serve-lab.py) `<lab dir> [port]` in the background. With a tailnet, optionally run `tailscale serve --bg --https=<port> <port>` for phone review; otherwise use `http://127.0.0.1:<port>` on the same machine. Done: the tailnet URL loads the index on the phone, or the loopback URL loads it locally; in either case, a reload after an edit shows the edit.
2.**Create the index once.** Copy [references/lab-index-example.html](references/lab-index-example.html) to `<lab dir>/index.html` and replace its sample rows. One row per experiment of any kind (mockups, image rounds, covers): title, date, status, note with verdicts, thumbnail. Done: every experiment the user has seen is a row.
3.**Add an experiment or round.** Build it in its own folder, symlink it into the lab root, add or update its row. Done: the row links to it, its thumbnail loads, and it passes the phone and light/dark checks.
4.**Build a gallery** for a round with several items, following [references/gallery.md](references/gallery.md). Done: it opens with "To pick / review", every item shows what changed since the user's last review and a stable ID with Copy ID, the round landing page lists every item with its ID, and links work.
5.**Record each verdict** in the gallery badge, the index row and the plan doc in the same step. Done: the three agree.
6.**Finalists view** once most items have verdicts: only final picks, no before or unpicked versions, plus a compare mode (same page across all finalists, light/dark, desktop/phone) for choosing a default. Done: linked from the gallery top and the index.
7.**Close out.** Write the decisions in the plan doc, mark everything else Not picked or On hold with the reason, and hand the agreed plan to implementation. Done: no row is left "waiting" without saying what it waits for.
## Failure modes seen
-**Stale cache hid new rows.** The fix is the no-store server; never serve the lab with a caching server.
-**The index showed only one kind of experiment.** Image rounds and mockups both need rows; nothing reviewed may exist only in chat.
-**A "kept" verdict assumed from silence.** Without the user's words it stays To review.
-**Copying instead of taking inspiration.** When the user points at a reference style, ask what to keep from it; a round that copies the reference gets rejected.
-**Agents left to decide the art direction** produced rounds nobody picked. After two unpicked rounds, stop and ask the user for direction instead of generating more.
I released v1.2.0 of my skills. It ships two new skills: illustrate-post, which turns a post's images into a plan, hand-drawn SVG diagrams, image-model variants in a few styles and one gallery to pick from, and avp-mvd-alvr-stutter-resolver, which fixes Vision Pro stutter when Mac Virtual Display and ALVR run together. Every skill folder now also has a short README for people: what the skill does, why it exists, when to use it and what it needs.
Plan first. The agent reads the post and proposes the images with me: what each one shows, where it goes, and whether it is an exact diagram or a mood or hero image. Nothing is generated before I approve the list.
Two kinds of producer. Claude hand-draws the diagrams as SVG, where labels and numbers have to be right, each with a dark twin. An image model renders every concept in 3 or 4 clearly different style families, so each family is a consistent set.
One gallery. Every variant lands in one local HTML page, side by side. I pick per image and mix styles freely; when I like a composition but want a change, the agent edits that image instead of starting over.
Only the picks land. The chosen images go into the post, narrower than the text and centred, with SVG diagrams swapping to their dark twins with the site theme.
The Vision Pro post ended up with three of Claude's diagrams, two Midnight Blueprint illustrations and one Paper Circuit floor plan, picked out of a gallery of more than twenty images.
description: Illustrate a blog post or doc with image variants from several models, shown side by side in one HTML gallery for the user to pick from. Use when the user asks for images, illustrations, diagrams or a hero image for a post or doc, or wants image options to choose from.
---
Several producers each make a **variant** of every **concept** (one image slot in the post); the user picks per concept from one gallery, mixing producers and styles freely. Nothing enters the repo until they pick.
1.**Plan.** Read the post and propose the concepts: what each image shows, where it goes, and whether it is a diagram (exact labels, numbers, real data) or a mood or hero image, and whether it carries text. Name who makes what. Done: the user approved the list; nothing is generated before that.
2.**Produce, in parallel,** into a gitignored folder: `.temp/<topic>-images/<variant>/NN-<concept>.<ext>`. Check `.gitignore` covers it.
-**Diagrams: hand-drawn SVG by Claude.** Self-contained, with its own background card, plus `<title>` and `<desc>`. Make a dark twin, `NN-<concept>-dark.svg`: remap the palette, keep the meaning of each colour readable. Render both to PNG (`rsvg-convert`), look at them, fix overlaps and clipped text, repeat. CSS `text { fill }` beats a `fill=` attribute, so colour single elements with `style="fill:..."`.
-**Every concept: an image model** (Codex's image tool, or another agent's; without one, hand this to an agent that has it). Ask for 3 or 4 clearly different style families, each applied to every concept so a family is a coherent set; leave the rest of the art direction open. Save each family's prompts in `<variant>/prompts.json`.
- Generated images: no logos or trademarks, generic devices, no personal details. Text follows the plan, concept by concept. Models garble it, so ask for short, explicit wording, verify every word and number, and regenerate anything garbled.
Done: every producer delivered its files.
3.**Gallery.** Copy [gallery.html](gallery.html) into the folder and fill its `concepts` and `variants` lists. Serve it with `python3 -m http.server <spare port> --bind 127.0.0.1`. To browse from another device, offer the user's private network (e.g. `tailscale serve`) and ask first. Done: the URL loads and every image shows.
4.**Review and pick.** Each producer lists its own weak spots. Send the user the gallery link with those notes. When they like an image's composition but want a change, edit that image (an image edit with it as the reference) rather than generating a new one. Done: the user picked one image per concept.
5.**Land the picks.** Copy only the chosen images into the repo (check whether it keeps images in Git LFS) and wire them into the post:
- Show images narrower than the text column and centred, around 560px, a hero around 640px. A hero can close the post too.
- An SVG with a dark twin goes in as two `<img>`, one per theme, swapped by one shared CSS rule keyed on the site's theme selector or `prefers-color-scheme`.
- Image pipelines may rasterise SVGs (JPEG with black corners); route SVGs around the transform.
Build, then look at the post in both themes and commit. Ask before pushing. Done: the build passes, both themes look right, and only the picks are committed.
I added avp-mvd-alvr-stutter-resolver to my skills in 197e34a, turning what I wrote up in Vision Pro MVD / ALVR Best Practices - No More Stuttering! into something an agent can run. It audits and fixes Apple Vision Pro stutter for Mac Virtual Display and ALVR: AWDL channel hopping, the router's channel and width, the wired path, subnets and GPU encoder contention. The fix is verified twice: the AWDL schedule now stays on a single channel, and ALVR no longer stutters.
My own agent skills moved out of my dotfiles into skills, and v1.0.0 is the first release. You can now install them without my setup: as a Claude Code plugin, a Codex plugin, or with npx skills add TheClooneyCollection/skills. The release also adds a release skill, which cut this release, and a CI check that keeps the skills, the plugin manifests and the README in step.