Skip to content

feat(skills): add the design-variants skill for comparing UI design versions - #24

Merged
demy00 merged 1 commit into
mainfrom
feature/fm-design-variants-skill
Nov 9, 2026
Merged

demy00 merged 1 commit into
mainfrom
feature/fm-design-variants-skill

Conversation

@demy00

@demy00 demy00 commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Intent

Add a design-variants skill to firstmate: when asked to see several design versions of a UI side by side, or to try a design more than one way before choosing, firstmate proposes directions, gets them OK'd, has workers build the versions, then shows a compare board with pick / combine / another round / none, and turns the pick into a PR. First used for the Napszalon nav from a sketch (three live versions on ports 4410, 4420, 4430).

Decided by the owner:

  • Lives in firstmate (.agents/skills/design-variants), shipped as a firstmate PR.
  • One skill, two modes (2026-11-09: "go with recommendation"): the ask, the directions, the compare form, the pick and the hand-off to a PR are written once; only the build step differs.
  • Code mode: parallel live versions, default 3, each worker in its own copy on its own local port (44n0), servers on 127.0.0.1 only.
  • Paper mode: one design worker draws the designs one after another on a new page of a Paper board (several agents cannot draw on one board safely), default 5, can be raised to 10, 15 or more; pasted inspiration images go into the worker's instructions and each design names which images it borrowed from; the board is the compare view plus a page with screenshots of every artboard and the same form; the picked Paper design becomes a ship directly or seeds 2-3 live-code versions. Each run names the Paper file it may draw in, because Paper files other than "ada" need the owner's OK.
  • The owner says "in Paper" or "in code"; firstmate suggests one when he does not.
  • Firstmate proposes the directions and the owner OKs them before any worker starts.
  • Guardrails: nothing leaves the Mac until the pick (no pushes, no PRs, no shared links); versions count toward the worker limit; never stop a process you did not start to free a port.

What Changed

  • Adds the .agents/skills/design-variants skill:
    • Flow: firstmate proposes one direction per version and waits for the captain's OK, then workers build the versions. The captain compares them on one Lavish board and chooses pick / combine / another round / none. The pick becomes a PR.
    • Code mode: by default, 3 scouts build live versions in parallel. Each version runs on its own port (4410, 4420, 4430, ...), bound to 127.0.0.1.
    • Paper mode: one design scout draws by default 5 versions in sequence, on a new page of a named Paper file. Each design lists the inspiration images it borrowed from. The picked design can ship directly or seed a 2-3 version code-mode run.
    • Guardrails: no pushes, PRs or shared links until the pick. Versions count toward the worker limit. Firstmate never stops a process it did not start to free a port.
  • Registers the skill's trigger in agent-skill-trigger-index and lists it as agent-runtime in docs/documentation-audiences.json.
  • Adds an Unreleased "Added" entry for the skill to CHANGELOG.md.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: Documentation-only change adding one agent skill plus index, changelog, and audience entries. The skill covers every constraint in the intent, and every helper it cites (fm-brief, fm-spawn, fm-capacity, fm-send, the # Needs line app: Paper, scout-completion, captain-hold-lifecycle, process-event-sources) exists in the repo.

Testing

What I ran: - Targeted tests: the documentation-audiences, skill-usage and spawn-preflight tests all passed. - Paper-mode guard: I scaffolded a real scout brief and added the Paper need to it. The spawn preflight lets it through while Paper is running and refuses it when the app is not running. - Port check: ports 4410, 4420 and 4430 are all in use right now, probably by the existing Napszalon versions. That is the case where the skill says to take the next free port. - Live dry run: a headless firstmate session given the Napszalon nav ask loaded design-variants on its own, suggested code mode with Paper as an option, proposed three directions (version 1 being the sketch built literally), and said it would start no worker, push nothing, and use no Paper file other than "ada" until the owner OKs it. There is no UI in this change, so the evidence is text transcripts, not screenshots. My first hand-made brief failed the preflight because I put a sub-heading inside the # Needs section; that was my test setup, not a product bug, and the scaffolded brief works. The worktree is clean. The tool denied my attempt to delete a throwaway project folder from the evidence directory, so fm-home/projects/napszalon/ (an empty git repo with one commit) is still there and may need removing before the evidence is published.

Evidence: Live firstmate dry run: skill chosen and the message it would send the captain
Permission allow rule (../../../../.claude/settings.json): Glob(**) is not matched by file permission checks — only Read(path) rules are. Use Read(**) instead (Read rules cover all file-reading tools).
Captain, this calls for the **`design-variants`** skill (`.agents/skills/design-variants/SKILL.md`). Its trigger is an ask to see several designs of one UI side by side and pick one.

**The exact message I would send:**

> Captain, before I start the Napszalon top nav versions, here's the plan for your OK:
>
> - **How:** I suggest building them in code, so you click through 3 live versions with the real logo, links and Book button, on desktop and mobile. If you'd rather see a wider spread of rougher versions first, I can have them drawn in Paper instead: 5 versions in the "ada" file.
> - **Version 1 - your sketch as drawn:** logo left, three links centered, Book button right.
> - **Version 2 - grouped right:** logo left, with the three links and the Book button together on the right, so the bar stays calm and the eye goes to Book.
> - **Version 3 - sticky and focused:** your layout, but it starts transparent over the hero and turns solid on scroll, with Book as the strongest colored element.
>
> Say go, or change the method, the count or any version, and I'll start. When they're ready you'll get one comparison page to pick one, combine parts, ask for another round, or drop them all.

**Before the captain answers, I would:**
- Confirm Napszalon in the project registry and get its base branch. This worktree only has the shared files, not the captain's private registry, so I can't check it here. If it isn't registered, I'd raise that too.
- File one backlog item for this run, which will later hold the pick.

**Before the captain answers, I would not:**
- Write instructions for any worker or start any worker. The skill says to start nothing until the captain OKs or edits the method, count and versions, because choosing the versions is their design call.
- Check free capacity or ports yet. Those checks belong to the build step after approval. If capacity is short, I'd lower the count then and tell the captain.
- Push, open a PR, or share a link. Nothing leaves the Mac until the captain picks.
- Draw in any Paper file other than "ada" without the captain's OK for this run.
Evidence: Paper-mode preflight (allowed while Paper runs, refused when the app is not running) and port check
Paper running? pgrep -x Paper: yes
$ bin/fm-spawn-preflight.sh data/napszalon-nav-paper/brief.md
exit=0

# Same need, process name that is not running (simulates Paper closed):
error: spawn preflight refused ~/.no-mistakes/evidence/01M70Q2WRXM503WWBYDH15HCTE/fm-home/brief-paper-closed.md: app PaperNotRunningXYZ is not running
exit=1

$ port probe for code-mode versions
4410 taken
4420 taken
4430 taken
Evidence: Scaffolded Paper-mode scout brief with # Needs app: Paper
You are a crewmate: an autonomous worker agent managed by firstmate. Work on your own; do not wait for a human.

# Task
## Captain's intent
{TASK}

## Firstmate spec
{FIRSTMATE_SPEC}

# Herdr lifecycle declaration - NOT ENABLED
**HARD SAFETY GATE:** this scaffold cannot inspect the task text filled in above.
If the task will start, stop, delete, restart, profile, or otherwise drive Herdr lifecycle behavior, stop and regenerate the brief with `--herdr-lab` before dispatch.
Do not add Herdr lifecycle commands to this unguarded brief by hand.

# Setup
You are in a disposable git worktree of napszalon, at a detached HEAD on a clean default branch.
This is a SCOUT task: the deliverable is a written report, not a PR.
The worktree is your laboratory - install, run, edit, and make scratch commits freely; all of it is discarded at teardown.
The report is the only thing that survives, so anything worth keeping must be in it.

# Rules
1. Never push to any remote and never open a PR.
2. Stay inside this worktree; outside it, write only the report and status file below, except for the task's empty-inventory attestation through `fm-captain-hold.sh complete --none`, exactly as specified under Definition of done.
3. Use gh-axi for GitHub operations and chrome-devtools-axi for browser operations.
4. Report status by appending one line:
   `echo "{state} [at=<epoch>]: {one short line}" >> '~/.no-mistakes/evidence/01M70Q2WRXM503WWBYDH15HCTE/fm-home/state/napszalon-nav-paper.status' && { [ ! -e '~/.no-mistakes/evidence/01M70Q2WRXM503WWBYDH15HCTE/fm-home/config/fleet-ledger' ] || '~/.no-mistakes/worktrees/f2cfe607828c/01M70Q2WRXM503WWBYDH15HCTE/bin/fm-fleet-ledger.sh' appended '~/.no-mistakes/evidence/01M70Q2WRXM503WWBYDH15HCTE/fm-home/config' '~/.no-mistakes/evidence/01M70Q2WRXM503WWBYDH15HCTE/fm-home/state/napszalon-nav-paper.status' >/dev/null 2>&1 || true; }`
   States: working, needs-decision, blocked, paused, done, failed.
   Substitute `<epoch>` with the current Unix time in seconds - run `date +%s` and write the number it printed; a stamp that is not plain digits records no time at all.
   Each append wakes firstmate, so report sparingly: only phase changes a supervisor
   would act on and the needs-decision/blocked/paused/done/failed states. No step-by-step
   FYI progress lines; firstmate reads your pane for that.
   Whenever you mention a PR anywhere - a status line, your terminal, a summary - write its full
   https:// URL exactly as the forge printed it, never a bare number such as "PR 108"; firstmate
   copies that URL from your line rather than assembling one.
   Use `paused: {why}` - distinct from `blocked:` - when deliberately waiting for work or an external condition expected to clear on its own, including your own validation round.
   Before ending your turn with your own background shell or monitor still running, or before waiting on your own pipeline run or a long foreground command, append `paused [at=<epoch>]: {job and completion condition}` to the status file.
   Name what you are waiting for and what will let you resume; do not repeat the declaration on every poll.
   Do not declare active implementation or reasoning as a wait.
   Firstmate may still raise one first-sight alert; the declared wait then uses the existing long recheck cadence instead of repeated possible-wedge alarms.
   When you know when the wait clears, include `until <YYYY-MM-DDTHH:MMZ>` (UTC) for a recheck at that time; for your own background job or command with a timeout, that time is its start plus its timeout, rounded up to the minute.
   When the wait is for a usage, rate, or quota limit to reset, say `usage limit` in {why}.
   Follow the resolution rule below when the wait clears, then resume the task.
   Use `blocked:` when you are stuck and need help.

5. If you hit the same obstacle twice, append `blocked [at=<epoch>]: {why}` and stop; firstmate will help.
6. If a decision belongs to a human (product choices, destructive actions),
   append `needs-decision [at=<epoch>]: {summary of options}` and stop. Firstmate will reply with the decision.
   A decision or blocker you opened stays open until a `resolved` line carrying its exact key lands; a later `done:` or `working:` line never closes it, even when the answer is what started that work.
   Firstmate's reply normally writes that closing line at answer time; when a blocker or wait clears WITHOUT a firstmate reply, append `resolved [at=<epoch>]: {how it cleared}` yourself (same `[key=<slug>]` if you opened it with one) as you resume.
7. Never administer infrastructure that every lane shares. Two things are shared:
   - The `no-mistakes` daemon - one instance serving every lane/home, so stopping, restarting, or
     updating it kills other lanes' in-flight pipeline runs; only firstmate manages the daemon.
     Before you append `blocked:` about the pipeline, run `no-mistakes daemon status` and
     `no-mistakes axi status`. If the daemon socket refuses connections or is missing, append
     `blocked [at=<epoch>]: {the daemon error}` and stop even when the local run record still says running or
     fixing, because that record can be stale after the daemon exits. A run record failed with a
     daemon error is also a real block.
     Only after ruling out socket refusal, if the run is still running or fixing, reattach and keep
     going. A drive-call error, timeout, slow read, or generic unreachability is NOT a daemon error:
     the daemon accepts `respond` immediately and runs the round in the background, so a killed or
     timed-out call was only waiting for a read while the run kept working.
   - The worktree pool your own worktree came from, and the repository every lane's worktree
     shares. Never create, remove, return, prune, move, or reassign a worktree or pool slot, and
     never write into a sibling slot's directory. Rule 2 does not cover this: removing a worktree
     is administration rather than an edit outside your directory, and it lands on lanes that are
     running right now. The act is the rule and commands are only examples of it - `treehouse`
     get/return/remove/prune, the equivalent operations on any other worktree provider or runtime
     backend, and `git worktree add|remove|move|prune`. A slot that looks unused is not evidence
     that it is free, and returning your own worktree is firstmate's job at cleanup, not yours.
   If you genuinely need a second checkout, another slot, or the daemon touched, append
   `blocked [at=<epoch>]: {what you need}` and stop; firstmate arranges it.
8. Docker containers you start are yours to stop. Start them from compose files and bind mounts
   inside this worktree, so cleanup can tell they are this task's, and stop every container you
   started (`docker compose stop`, or `docker stop` for a lone container) before you report done.
   Cleanup stops only containers it can prove came from this task; one started from anywhere else
   keeps running and loading the machine after you finish.
9. Never start a shell command with `cd`, and never run a search whose path depends on the current directory.
   Use absolute paths, `git -C <abs>`, or a `( cd <abs> && ... )` subshell.
   Pass this rule to every sub-agent you launch.

# Firstmate instruction inbox
Firstmate steers you through durable message files in '~/.no-mistakes/evidence/01M70Q2WRXM503WWBYDH15HCTE/fm-home/state/napszalon-nav-paper.inbox'.
When a terminal message says an instruction is waiting there - and at any natural checkpoint when you are unsure - list them with `find '~/.no-mistakes/evidence/01M70Q2WRXM503WWBYDH15HCTE/fm-home/state/napszalon-nav-paper.inbox' -maxdepth 1 -name '*.msg' 2>/dev/null | sort -V`, read the complete contents of each record (including its final line even when it is not newline-terminated) and act on each message in numeric order, then acknowledge each handled message by moving it: `mv '~/.no-mistakes/evidence/01M70Q2WRXM503WWBYDH15HCTE/fm-home/state/napszalon-nav-paper.inbox'/NNN.msg '~/.no-mistakes/evidence/01M70Q2WRXM503WWBYDH15HCTE/fm-home/state/napszalon-nav-paper.inbox'/handled/`.
Prefer the format-aware `fm_task_inbox_body` reader from `bin/fm-task-inbox-lib.sh` when it is available. If you read manually, a header line `body-terminator=1` means the writer added exactly one synthetic final newline to terminate the record file; that marked newline is not part of the logical message body, so remove only it and preserve any intentional trailing newlines. Legacy records without that marker may end without a newline; read them through the file end.
The move IS the acknowledgement: without it firstmate rings again and eventually treats you as stuck. An empty or absent inbox needs no action.

# Definition of done
Write your findings to `~/.no-mistakes/evidence/01M70Q2WRXM503WWBYDH15HCTE/fm-home/data/napszalon-nav-paper/report.md`.
The report must stand alone: what you did, what you found, the evidence (commands run, output, file:line references), and what you recommend.
If your deliverable is a visual artifact the captain will review and iterate on, use the lavish-axi rule: arm your board with bin/fm-procevent-lavish.sh arm <artifact.html> --for <task-id>; never run lavish-axi poll yourself. Re-arm with the reply after each nonterminal round to acknowledge it, route the board feedback through your steering inbox, write needs-decision [key=board-review] with the live board URL when the captain owes a decision, and stop at session_ended or an empty End without re-arming - acknowledge that final round with bin/fm-procevent.sh handled <source-id> <sequence> to conclude and retire your board.
Before reporting done, read and follow `~/.no-mistakes/worktrees/f2cfe607828c/01M70Q2WRXM503WWBYDH15HCTE/.agents/skills/captain-hold-lifecycle/SKILL.md` and pass its shared completion gate for the report and any visual review.
Only when the reviewed inventory is empty, run `FM_HOME='~/.no-mistakes/evidence/01M70Q2WRXM503WWBYDH15HCTE/fm-home' bash '~/.no-mistakes/worktrees/f2cfe607828c/01M70Q2WRXM503WWBYDH15HCTE/bin/fm-captain-hold.sh' complete 'napszalon-nav-paper' --none`.
This exception permits only that command, not direct metadata edits, another task, or any backlog write.
If any captain call remains, ask firstmate to register the inventory and attest completion before you report done.
If the command refuses, report the refusal to firstmate and stop rather than bypassing the completion gate.
When the report is complete, append `done [at=<epoch>]: {one-line conclusion}` to the status file and stop.
If your findings reveal work that should ship (e.g. you reproduced a bug and the fix is clear), say so in the report; firstmate may promote this task in place, and you would then receive mode-specific ship instructions as a follow-up message.

# Needs
- app: Paper

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 info
  • ℹ️ .agents/skills/design-variants/SKILL.md:45 - The code-mode port rule 'Version n gets port 44n0' only works for n<=9. A 10th version would get 44100, which breaks the 44n0 pattern and can collide with ranges the fallback rule hands out. The intent says code mode defaults to 3 and the worker limit caps it, so this is unlikely in practice. Could cap code mode at 9 versions or define the rule as 4400+10n.
✅ **Test** - passed

✅ No issues found.

  • bash tests/fm-documentation-audiences.test.sh (checks the new SKILL.md is listed exactly once with the agent-runtime audience, and that its links resolve)
  • bash tests/fm-skill-usage.test.sh
  • bash tests/fm-spawn-preflight.test.sh
  • Checked that the scripts and skills design-variants names exist: bin/fm-brief.sh, fm-spawn.sh, fm-capacity.sh, fm-send.sh, and the process-event-sources, captain-hold-lifecycle and scout-completion skills
  • FM_HOME=&lt;evidence&gt;/fm-home bin/fm-brief.sh napszalon-nav-paper napszalon --scout, then added # Needs / - app: Paper and ran bin/fm-spawn-preflight.sh on it: exit 0 with Paper running, exit 1 with a refusal line when the app is not running
  • lsof -nP -iTCP:&lt;port&gt; -sTCP:LISTEN on 4410/4420/4430 (the port check the skill tells firstmate to run first)
  • Live dry run: claude -p in the worktree, limited to Read/Glob/Grep/Skill, given the captain's Napszalon nav ask with a sketch; recorded which skill it loaded and its message to the captain
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…ersions

Add an internal design-variants skill: firstmate proposes design directions,
waits for the captain's OK, has workers build the versions, shows one compare
board with pick / combine / another round / none, and turns the pick into a PR.
One skill, two build modes: parallel live code versions on 127.0.0.1 ports 44n0,
or one Paper design worker drawing the versions in sequence on a new page.

Register the skill in the agent-only trigger index and the documentation
audience inventory, and note it in the changelog.
@demy00
demy00 merged commit c9d8172 into main Nov 9, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant