@ethlete/agent-rules 0.1.0-next.42 → 0.1.0-next.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -13,8 +13,8 @@ yarn agents:sync # then regenerate
13
13
  ```
14
14
 
15
15
  A few content files are vendored from another repository. Keep them as written upstream,
16
- apart from the generator's link syntax - `libs/agent-rules/THIRD-PARTY-LICENSES.md` names
17
- each one, its upstream commit and its license.
16
+ apart from the generator's link syntax and the local changes `libs/agent-rules/THIRD-PARTY-LICENSES.md`
17
+ names, with each file's upstream commit and its license.
18
18
 
19
19
  `content/output-styles/` is the exception: a Claude Code output style is a machine-level
20
20
  file, so `sync` never emits it and `agents:check` never diffs it. It is installed on
package/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # @ethlete/agent-rules
2
2
 
3
+ ## 0.1.0-next.44
4
+
5
+ ### Minor Changes
6
+
7
+ - The `codex-subagent` skill and its wrapper now default to `gpt-6.2-sol`; `gpt-6.2-astra` is for the hardest work and needs the user's approval first.
8
+ - Add the opt-in `design-live-check` hook: after each write of a design file it runs `et design lint` on it and hands every finding back to the agent.
9
+ - Remove the `away-mode` and `builder-chat-words` hooks and the `awayMode` config key.
10
+ - Add `et design studio open [<dir>]`: it adds a checkout to the running Studio and switches Studio to it, after the agent asks the human.
11
+
12
+ ### Patch Changes
13
+
14
+ - The domain-modeling and grill-with-docs skills record a decision as a test or a tool, never as an ADR; `ADR-FORMAT.md` is gone.
15
+ - `agent-sessions run` called from an agent shell inside tmux now starts the session detached instead of switching the human's client to it.
16
+ - The design guidance keeps a variant note to two short sentences in the words of the screen, and lets the agent work only from its repo and what the user hands it, asking for missing images in one plain sentence.
17
+ - Teach a new product to start with one real screen in finished moods instead of a wireframe round, and add rules for looking at a shot before `ready`, talking about the product, hover and focus states, and the app shell.
18
+ - The design exploration guide draws interactions once, on the first grid row, and a content row only at rest with `interactionRows` `restOnly`.
19
+ - Reword the design skill so a mood round asks for comments, not a pick, and the first real page is drawn from them.
20
+ - Reword the design skill so the first sketch draws the shell as an imported element and interaction states live on the parts a page imports.
21
+ - Make the design check's FONT-FACE rule flag a font the design names but that did not load in the shot, and tell the agent to self-host it.
22
+ - `interactionRows` takes a plain row-name list as `restOnly` when it is called with explicit type arguments.
23
+ - The Studio logo part gets anatomy, clear space, minimum size, colour variants, misuse and motion sections and owns the busy animation; the design check reports a merged logo part that lacks one.
24
+ - Stop the design check's OVERFLOW rule from failing a page taller than its preset height, so a page can scroll.
25
+ - Drop the ADR plan-question open point and ADR numbers from design CLI texts and comments.
26
+ - `agent-sessions restart` refuses a stored command that does not run `claude` or `codex` instead of starting a bare shell, and a footer with only "↓ to manage" no longer counts as background work.
27
+ - The design-exploration skill says that the pick of another sketch is not a wait: a sketch draws with the part as merged now and goes ready, so the user can choose it.
28
+ - The design exploration skill says a composition's variants differ only in arrangement and how a sub-part from an open sketch is used.
29
+ - The Studio menu puts client runs in a submenu named by date and time, lists projects apart from the actions, opens the design server as a submenu and marks "Projekt entfernen" as dangerous; the Start page tells same-name checkouts apart.
30
+ - The design guide asks for states that read as different from rest at a glance, not a lift of a few px alone.
31
+
32
+ ## 0.1.0-next.43
33
+
34
+ ### Patch Changes
35
+
36
+ - Use neutral example names in the design exploration skill instead of parts from a real product.
37
+
3
38
  ## 0.1.0-next.42
4
39
 
5
40
  ### Patch Changes
package/README.md CHANGED
@@ -312,14 +312,7 @@ per hook in the config:
312
312
 
313
313
  ```json
314
314
  {
315
- "hooks": [
316
- "context-warning",
317
- "subagent-model-policy",
318
- "background-design-commands",
319
- "git-safety",
320
- "builder-chat-words",
321
- "away-mode"
322
- ]
315
+ "hooks": ["context-warning", "subagent-model-policy", "background-design-commands", "git-safety"]
323
316
  }
324
317
  ```
325
318
 
@@ -381,16 +374,6 @@ Available hooks:
381
374
  user knows whether the task is judgment-heavy. A fork and an agent type whose own
382
375
  definition sets a model both pass untouched, because `model` would change nothing there.
383
376
 
384
- - **`away-mode`** (Claude Code only) - switches an interactive session into "user is away" mode
385
- on its own. Opt in with `"awayMode": { "skills": ["my-skill"], "thresholdMinutes": 15 }` in the
386
- config (the local config overrides it); a session is tracked once a prompt starts with
387
- `/my-skill`. When a prompt that is not typed by a human (mailbox, cross-session, task
388
- notification, restart) arrives after the threshold without typed input, the hook tells the
389
- agent the user is away; the next typed prompt tells it the user is back. A typed `afk` marks
390
- the session away at once. With `"reportCommand": "<cli> report"` inside `awayMode`, the back
391
- message also carries that command's table since the last typed input (dropped when it fails or
392
- takes over 10 s). State is kept in `.git/ethlete/away/`.
393
-
394
377
  Hooks can be turned off per machine - see the local config below.
395
378
 
396
379
  ## Mods (Claude Code)
@@ -6,11 +6,11 @@ To update one, copy it again from upstream and record the new commit here.
6
6
  ## [mattpocock/skills](https://github.com/mattpocock/skills)
7
7
 
8
8
  Commit `3cca18b` (2026-09-04). Vendored skills, kept as written upstream apart from the
9
- generator's own link syntax:
9
+ generator's own link syntax and the local changes named below:
10
10
 
11
- - `content/skills/grill-with-docs` - the entry point; calls the other two.
11
+ - `content/skills/grill-with-docs` - the entry point; calls the other two. Its description names tests, not ADRs.
12
12
  - `content/skills/grilling` - plus our own section "Local addition" after the upstream footer.
13
- - `content/skills/domain-modeling`
13
+ - `content/skills/domain-modeling` - our change: a decision becomes a test or a tool, never an ADR; `ADR-FORMAT.md` is gone.
14
14
 
15
15
  MIT License
16
16
 
@@ -0,0 +1,136 @@
1
+ #!/usr/bin/env python3
2
+ """PostToolUse hook: each design file the agent writes gets the design check's findings at once.
3
+
4
+ After an Edit, Write or MultiEdit of a `.ts`, `.css` or `.html` file under `.ethlete/design/`, it runs
5
+ `et design lint <file>`: the static design rules of the file's part or sketch variant, and eslint on it.
6
+ No draw, no type check. A finding comes back to the agent as a blocking message, one line each, so it fixes
7
+ the file before it hands the design to a human. A clean file stays silent.
8
+
9
+ It runs `et` the way the repo's `ethlete-design` MCP server in `.mcp.json` does, with `lint` in place
10
+ of `mcp`, else `node_modules/.bin/et`. A repo with neither gets no check.
11
+
12
+ Can be disabled per machine via a gitignored ethlete-agents.config.local.json at the repo
13
+ root: {"disableHooks": true} or {"disableHooks": ["design-live-check"]}.
14
+
15
+ Fail-safe: any error exits 0 with no output.
16
+ """
17
+
18
+ import json
19
+ import os
20
+ import subprocess
21
+ import sys
22
+
23
+ HOOK_NAME = "design-live-check"
24
+ LOCAL_CONFIG_FILE = "ethlete-agents.config.local.json"
25
+ TOOLS = frozenset(("Edit", "Write", "MultiEdit"))
26
+ DESIGN_DIR = os.path.join(".ethlete", "design")
27
+ CHECKED_EXTENSIONS = (".ts", ".mts", ".css", ".html")
28
+ RUN_SECONDS = 50
29
+
30
+
31
+ def agent_name(argv):
32
+ for index, arg in enumerate(argv):
33
+ if arg == "--agent" and index + 1 < len(argv):
34
+ return argv[index + 1]
35
+ if arg.startswith("--agent="):
36
+ return arg.split("=", 1)[1]
37
+ return "claude"
38
+
39
+
40
+ def repo_root(data):
41
+ for variable in ("CLAUDE_PROJECT_DIR", "CODEX_PROJECT_DIR"):
42
+ value = os.environ.get(variable)
43
+ if value:
44
+ return value
45
+ cwd = data.get("cwd")
46
+ return cwd if isinstance(cwd, str) and cwd else os.getcwd()
47
+
48
+
49
+ def load_json(path):
50
+ try:
51
+ with open(path, encoding="utf-8") as f:
52
+ value = json.load(f)
53
+ except (OSError, ValueError):
54
+ return {}
55
+ return value if isinstance(value, dict) else {}
56
+
57
+
58
+ def disabled_locally(root):
59
+ disabled = load_json(os.path.join(root, LOCAL_CONFIG_FILE)).get("disableHooks")
60
+ return disabled is True or (isinstance(disabled, list) and HOOK_NAME in disabled)
61
+
62
+
63
+ def design_file_of(root, path):
64
+ if not isinstance(path, str) or not path.endswith(CHECKED_EXTENSIONS):
65
+ return None
66
+ file = os.path.normpath(os.path.join(root, path))
67
+ relative = os.path.relpath(file, root)
68
+ if relative.startswith("..") or not relative.startswith(DESIGN_DIR + os.sep):
69
+ return None
70
+ return file if os.path.isfile(file) else None
71
+
72
+
73
+ def lint_command_of(root):
74
+ servers = load_json(os.path.join(root, ".mcp.json")).get("mcpServers", {})
75
+ design = servers.get("ethlete-design") if isinstance(servers, dict) else None
76
+ if isinstance(design, dict) and isinstance(design.get("command"), str):
77
+ args = design.get("args") if isinstance(design.get("args"), list) else []
78
+ words = [design["command"], *[str(arg) for arg in args]]
79
+ if words[-1] == "mcp":
80
+ return [*words[:-1], "lint"]
81
+ local = os.path.join(root, "node_modules", ".bin", "et")
82
+ return [local, "design", "lint"] if os.path.isfile(local) else None
83
+
84
+
85
+ def message_of(relative, findings):
86
+ return (
87
+ f"The design check finds this in {relative}. Fix each finding now, before you hand the design back; "
88
+ "every line says what to change:\n" + findings
89
+ )
90
+
91
+
92
+ def main():
93
+ if agent_name(sys.argv[1:]) != "claude":
94
+ return
95
+
96
+ data = json.load(sys.stdin)
97
+
98
+ if data.get("tool_name") not in TOOLS:
99
+ return
100
+
101
+ tool_input = data.get("tool_input")
102
+ root = repo_root(data)
103
+
104
+ if not isinstance(tool_input, dict) or disabled_locally(root):
105
+ return
106
+
107
+ file = design_file_of(root, tool_input.get("file_path"))
108
+ command = lint_command_of(root) if file else None
109
+
110
+ if not command:
111
+ return
112
+
113
+ run = subprocess.run(
114
+ [*command, file],
115
+ cwd=root,
116
+ capture_output=True,
117
+ text=True,
118
+ timeout=RUN_SECONDS,
119
+ )
120
+ findings = run.stdout.strip()
121
+
122
+ if run.returncode != 1 or not findings:
123
+ return
124
+
125
+ sys.stderr.write(message_of(os.path.relpath(file, root), findings) + "\n")
126
+ sys.exit(2)
127
+
128
+
129
+ if __name__ == "__main__":
130
+ try:
131
+ main()
132
+ except SystemExit:
133
+ raise
134
+ except Exception:
135
+ pass
136
+ sys.exit(0)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "e2e-progress",
3
- "version": "0.1.0-next.42",
3
+ "version": "0.1.0-next.44",
4
4
  "description": "Live Playwright e2e progress from a run log, as a status line entry and a pane",
5
5
  "types": "./types/index.d.ts"
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "status-line",
3
- "version": "0.1.0-next.42",
3
+ "version": "0.1.0-next.44",
4
4
  "description": "Always-visible band with the running task, its duration, the open queue, open questions and a CI blocked mark",
5
5
  "types": "./types/index.d.ts"
6
6
  }
@@ -238,6 +238,22 @@ const hasAgentBinary = (words) => {
238
238
  index++;
239
239
  return index < words.length;
240
240
  };
241
+ const AGENT_PROGRAM = /^(?:claude|codex)$/;
242
+ const programIndexOf = (words) => {
243
+ let index = 0;
244
+ while (
245
+ index < words.length &&
246
+ (ENV_WORD.test(words[index]) ||
247
+ words[index] === 'env' ||
248
+ (index > 0 && words.includes('env') && words[index].startsWith('-')))
249
+ )
250
+ index++;
251
+ return index;
252
+ };
253
+ const runsAgentProgram = (words) => {
254
+ const index = programIndexOf(words);
255
+ return index < words.length && AGENT_PROGRAM.test(basename(words[index]));
256
+ };
241
257
  const quoteShellWord = (word) =>
242
258
  ENV_WORD.test(word) ? word.replace(/^([^=]+=)(.*)$/s, (_, key, value) => `${key}${quote(value)}`) : quote(word);
243
259
  const unwrappedRun = (command) => {
@@ -254,20 +270,12 @@ const unwrappedRun = (command) => {
254
270
  const end = rest.findIndex((word) => /[;&|]$/.test(word));
255
271
  const inner = end < 0 ? rest : [...rest.slice(0, end), rest[end].replace(/[;&|]+$/, '')];
256
272
  const program = inner.findIndex((word) => !ENV_WORD.test(word));
257
- if (program < 0 || !hasAgentBinary(inner)) return null;
273
+ if (program < 0 || !runsAgentProgram(inner)) return null;
258
274
  const kept = [...inner.slice(0, program), ...withoutPrompt(inner.slice(program))];
259
275
  const env = tokens.slice(0, at).filter((word) => ENV_WORD.test(word));
260
276
  const unwrapped = [...env, ...kept.map(quoteShellWord)].join(' ');
261
277
  return runRole ? commandWithRole(unwrapped, runRole) : unwrapped;
262
278
  };
263
- const healedCommand = (command, agent) => {
264
- const unwrapped = unwrappedRun(command);
265
- if (unwrapped) return unwrapped;
266
- const words = [...command.matchAll(SHELL_WORD)].map(([word]) => unquoteWord(word));
267
- if (hasAgentBinary(words)) return command;
268
- const binary = agent.match(/^(claude|codex)/)?.[1];
269
- return binary ? `${command} ${quote(binary)}` : null;
270
- };
271
279
  const SHELL_WRAP =
272
280
  /^((?:[A-Za-z_][A-Za-z0-9_]*=(?:'[^']*'|\S*)\s+)*)'?((?:\S*\/)?(?:sh|bash|zsh|dash))'?\s+'?(-[a-z]*c)'?\s+(.+)$/s;
273
281
  const wrapOf = (command) => {
@@ -279,6 +287,17 @@ const wrapOf = (command) => {
279
287
  const inner = single ? single[1].replaceAll("'\\''", "'") : double ? double[1].replace(/\\(["\\$`])/g, '$1') : rest;
280
288
  return { head, shell, flag, inner };
281
289
  };
290
+ const wordsOf = (command) => [...command.matchAll(SHELL_WORD)].map(([word]) => unquoteWord(word));
291
+ const healedCommand = (command, agent) => {
292
+ const unwrapped = unwrappedRun(command);
293
+ if (unwrapped) return unwrapped;
294
+ const wrap = wrapOf(command);
295
+ if (wrap) return runsAgentProgram(wordsOf(wrap.inner)) ? command : null;
296
+ const words = wordsOf(command);
297
+ if (programIndexOf(words) < words.length) return runsAgentProgram(words) ? command : null;
298
+ const binary = agent.match(/^(claude|codex)/)?.[1];
299
+ return binary ? `${command} ${quote(binary)}` : null;
300
+ };
282
301
  const rewrapped = (wrap, head, inner) => `${head}${wrap.shell} ${wrap.flag} ${quote(inner)}`;
283
302
  const commandWithoutPrompt = (command) => {
284
303
  const wrap = wrapOf(command);
@@ -485,7 +504,7 @@ const inAgentScopeCommand = (command, session, unscoped = (plain) => plain) => {
485
504
  };
486
505
  const EXIT_DIALOG_JOBS = /will stop when you exit/i;
487
506
  const EXIT_AND_STOP = /exit and stop/i;
488
- const BACKGROUND_FOOTER = /\b\d+ (?:shells?|agents?)\b|↓ to manage/i;
507
+ const BACKGROUND_FOOTER = /\b\d+ (?:shells?|agents?)\b/i;
489
508
 
490
509
  /**
491
510
  * Reads the last prompt line (`❯` for Claude Code, `›` for Codex) of the pane. Dim text is the empty
@@ -829,13 +848,9 @@ if (command === 'send' && sender) {
829
848
  );
830
849
  process.exitCode = 1;
831
850
  } else createRunSession(session, shellCommand, baseCommand);
832
- const callerSession = tmux(
833
- 'display-message',
834
- '-p',
835
- '-t',
836
- process.env.TMUX_PANE ?? '',
837
- '#{session_id}',
838
- ).stdout.trim();
851
+ const callerSession = hasTerminal
852
+ ? tmux('display-message', '-p', '-t', process.env.TMUX_PANE ?? '', '#{session_id}').stdout.trim()
853
+ : '';
839
854
  const [callerClient] = callerSession
840
855
  ? tmux('list-clients', '-t', callerSession, '-F', '#{client_tty}').stdout.split('\n').filter(Boolean)
841
856
  : [];
@@ -949,7 +964,7 @@ if (command === 'send' && sender) {
949
964
  healedCommand(commandWithoutPrompt(agentCommandOf(session)), sender) === null
950
965
  ) {
951
966
  process.stderr.write(
952
- `Refused: the stored command of ${session} has no agent program (${agentCommandOf(session)}), restarting would end the session. Nothing was stopped.\n`,
967
+ `Refused: the stored command of ${session} has no claude or codex program (${agentCommandOf(session)}), restarting would end the session. Nothing was stopped.\n`,
953
968
  );
954
969
  restartLog(`${session} refused, stored command has no agent program: ${agentCommandOf(session)}`);
955
970
  process.exitCode = 1;
@@ -979,6 +994,10 @@ if (command === 'send' && sender) {
979
994
  const restartRole = restartRoleOf(session, words.join(' '));
980
995
  const recorded = commandWithoutPrompt(agentCommandOf(session));
981
996
  const stored = healedCommand(recorded, sender);
997
+ if (stored === null) {
998
+ restartNotice(`restart of ${session} refused, its stored command has no agent program: ${recorded}`);
999
+ process.exit(1);
1000
+ }
982
1001
  if (configMismatch(stored.split(' ').map((word) => word.replaceAll("'", '')))) {
983
1002
  restartNotice(
984
1003
  `restart of ${session} refused, its command sets another CLAUDE_CONFIG_DIR than the caller (${callerConfigDir()})`,
@@ -24,7 +24,7 @@ only the final message, so one run costs you a few hundred tokens instead of the
24
24
  Below, `<skill-dir>` is the directory this file sits in.
25
25
 
26
26
  ```bash
27
- node <skill-dir>/codex-agent.mjs -m gpt-6.1-terra -e medium "<prompt>"
27
+ node <skill-dir>/codex-agent.mjs -m gpt-6.2-sol -e medium "<prompt>"
28
28
  ```
29
29
 
30
30
  Options: `-m` model, `-e` effort (`low`, `medium`, `high`, `xhigh`), `-C` working root,
@@ -36,12 +36,10 @@ id and the log path. Read the log only when a run fails.
36
36
 
37
37
  ## Pick the model
38
38
 
39
- | Model | The work it fits |
40
- | --------------- | ------------------------------------------------------------------------------------------------------------ |
41
- | `gpt-6-luna` | Fast and cheap: a lookup, a grep, a question about one file. |
42
- | `gpt-6.1-terra` | Balanced agentic coding. The default for real work, and the wrapper's default. |
43
- | `gpt-6.1-sol` | A reliable workhorse for a straight task. Its usage limit runs out fast, so ask the user before you pick it. |
44
- | `gpt-6-astra` | Complex, demanding work. The most expensive of the four, so ask the user before you pick it. |
39
+ | Model | The work it fits |
40
+ | --------------- | --------------------------------------------------------------------------------------- |
41
+ | `gpt-6.2-sol` | The default for real work, lookups included, and the wrapper's default. No need to ask. |
42
+ | `gpt-6.2-astra` | The hardest work. Ask the user (through the doc session) before you pick it. |
45
43
 
46
44
  Effort follows both the flag and the prompt. Pass `-e low` for a lookup and `-e high` for a
47
45
  hard bug. Say "keep it brief" in the prompt when you want a short answer.
@@ -14,7 +14,7 @@ import { tmpdir } from 'node:os';
14
14
  import { join } from 'node:path';
15
15
  import { createInterface } from 'node:readline';
16
16
 
17
- const DEFAULT_MODEL = 'gpt-6.1-terra';
17
+ const DEFAULT_MODEL = 'gpt-6.2-sol';
18
18
  const DEFAULT_TIMEOUT_SECONDS = 900;
19
19
 
20
20
  const USAGE = `Usage: node codex-agent.mjs [options] "<prompt>"
@@ -23,12 +23,11 @@ or loses only against the other variants of its question.
23
23
  1. **One open call at a time.** Take one question. Draw its variants. Stop.
24
24
  2. **Put the variants in the call, then name your pick.** Two to four variants, drawn for
25
25
  real, side by side, labelled, with what each one costs. Your pick is a proposal. Never ask
26
- a yes/no question about content, and never ask the user what they want: deliver strong
27
- variants, and the user picks.
28
- 3. **Commit only when the user says commit.** A merge the user makes in Ethlete Studio counts as
29
- that word for the merged part: commit the part, not the open sketches.
30
- 4. **A clear rejection starts the next call.** Settle and record the rejected call, then draw
31
- the next focused question automatically, within the user's original scope. Stop only when the
26
+ the user what they want or a yes/no question about content: deliver strong variants.
27
+ 3. **Commit only when the user says commit.** A merge in Ethlete Studio counts as
28
+ that word for the merged part: commit the part, not open sketches.
29
+ 4. **A clear rejection starts the next call.** Settle and record it, then draw
30
+ the next focused question, within the user's original scope. Stop only when the
32
31
  user asks to pause or end the exploration, or when their feedback leaves no grounded next
33
32
  question.
34
33
  5. **Keep the answer short.** 120 words at most.
@@ -43,8 +42,7 @@ or loses only against the other variants of its question.
43
42
  "regression" items are no exception. Without a picked sketch, build data and specs only and
44
43
  stop at the UI.
45
44
 
46
- Confirm the step size once, at the start. Do not ask again at every stop. A task is not
47
- finished while the user is still talking about it.
45
+ Confirm the step size once, at the start. A task is not finished while the user is still talking about it.
48
46
 
49
47
  ## What one stop looks like
50
48
 
@@ -69,7 +67,10 @@ The exploration's plan file names the tool. Two shapes exist.
69
67
  user reads and decides in Ethlete Studio. The tool is `et design`, from `@ethlete/cli`; run
70
68
  `et design --help` for every command, `et design <command> [<subcommand>] --help` for one.
71
69
  In the SDK checkout, `yarn design` builds the CLI before each call; in a check-and-shot loop,
72
- build once and call `node dist/libs/cli/src/index.js design` instead.
70
+ build once and call `node dist/libs/cli/src/index.js design`.
71
+ Ask the user, then run `et design studio open` to show your checkout in Studio. If it is not
72
+ running, the user opens it; run again. In a client run (`CLEAN_SLATE_SANDBOX` is set) the
73
+ command refuses: a run must not write the user's Studio roots, so the user opens the run's checkout.
73
74
 
74
75
  ```
75
76
  .ethlete/design/
@@ -81,43 +82,61 @@ build once and call `node dist/libs/cli/src/index.js design` instead.
81
82
  calls/ old calls: Legacy, read-only
82
83
  ```
83
84
 
84
- Studio no longer takes new calls. **New work goes to a product, never to a new call**; do not run
85
- `et design new`. Old calls stay in Studio's Legacy tab as reference for moving them into a
86
- product. They take no picks and no new variants.
85
+ Studio takes no new calls. **New work goes to a product**, never `et design new`. Old calls stay in
86
+ the Legacy tab as reference for moving them into a product, with no picks and no new variants.
87
87
 
88
88
  ## Hard rules for products and sketches
89
89
 
90
90
  - A change to a merged part, also a small one, is a **sketch**; never edit a merged part directly. When
91
91
  nothing is to choose, the sketch has one variant (`--variants a`). Variants are alternatives, never a state
92
92
  of another variant. Two to four variants, each with its cost; run `sketch check` before `sketch ready`.
93
- - **Never run `sketch merge` or `sketch discard`, and never pick a variant, unless your role has its own picks.** Studio merges on the user's
93
+ - **Never run `sketch merge` or `sketch discard`, and never pick a variant, unless your role has its own picks; discarding the mood sketch is the one exception.** Studio merges on the user's
94
94
  click. After a pick or discard, do not merge. Run `sketch reject` or `reopen` only when the user did.
95
- - Mark a sketch `ready` only when no change to it waits on anything; otherwise `sketch hold`.
95
+ - Mark a sketch `ready` only when no change waits on anything; otherwise `sketch hold`. The pick of another
96
+ sketch is not a wait: draw with the part as merged now.
96
97
  - Every write command takes `--by <model id>`. **Never guess your id**: use the one your prompt names, or ask
97
- the coordinator or the user before you write.
98
- - A direct edit of a merged part is never accepted by hand: `design check` opens an old/new edit sketch and the
99
- user picks in Studio. Remove a part only with `et design part remove`, never `git rm`.
100
- - Studio takes no new calls: never run `et design new`. New work goes to a product.
101
- - Share code between variants in the sketch's `shared/` folder only; no shared parameter or branch for one
102
- variant. An asset is one file in `<product>/assets/`, never inlined.
98
+ before you write.
99
+ - `design check` opens an edit sketch for a direct edit of a merged part; the user picks in Studio. Remove a part only with `et design part remove`, never `git rm`.
100
+ - Share code between variants in the sketch's `shared/` folder only. An asset is one file in `<product>/assets/`.
103
101
  - A user comment to combine variants is a new variant in a new round (`sketch variant --from --round --note`).
104
102
  - Read the inbox at the start of a session and after each `ready`. Answer with `inbox done <id> --note`,
105
103
  ask with `comment reply --question` only when you cannot go on. Only the user resolves a thread.
106
104
  - Use the `ethlete-design` MCP tools when they are in your tool list, and call `sketch_report` before every
107
105
  variant edit.
108
106
  - Draw from the design system, never invent a button or field: the product's parts, then SDK components via
109
- `ng()`, then new. Colours come from the SDK theming systems, never your own tokens. A part exists only
110
- because the user picked a sketch.
111
- - A wireframe is rough and fast: regions and names only, no polish, no subagent, one sketch per screen.
112
- - Do not start a design stage before the one above it is settled: wireframes, foundations, logo and CI,
113
- components, elements, pages, prototype.
107
+ `ng()`, then new. Colours come from the SDK theming systems. A part exists only because the user picked a sketch.
108
+ - **A new product starts with one real screen** (a film app: the overview) in two or three finished moods:
109
+ real colours, real type, real content from the product's data. The user picks no mood and nothing merges:
110
+ he collects by commenting on what he likes. Wait for his "collected enough", then draw the first real
111
+ page from his comments as a new sketch and discard the mood sketch. Menu, navigation
112
+ and layout are your call, shown only inside the finished screen: draw the masthead, menu and navigation as
113
+ `elements/shell-<purpose>` inside each mood's variant folder, and let the page import it, never an inline
114
+ `<header>` or `<nav>` in the page. Never draw a wireframe or a layout round of grey boxes.
115
+ - Do not start a design stage before the one above it is settled: foundations, logo and
116
+ CI, components, elements, pages, prototype.
117
+ - A logo is explored small and elaborated after the pick: a logo sketch variant shows only the mark, at one size,
118
+ so ten variants stay ten quick looks. Only after the merge of the picked variant, draw the six sections of
119
+ `foundations/logo`: anatomy, clear space, minimum size, colour variants, misuse and motion (one state each:
120
+ `anatomy`, `clear-space`, `minimum-size`, `colour-variants`, `misuse`, `motion`). The design check reports a missing section on a merged logo.
121
+ - Mark a sketch `ready` only after you looked at a shot of each variant ({%resource:reference-shots.md%}).
122
+ - Talk to the user about the product: screens, moods, content. Never name tools, commands or file paths.
123
+ A variant note is at most two short sentences in the words of the screen, never a field or prop name.
124
+ - Work only from your repo and what the user hands you; never search the machine or other folders for
125
+ material. When an image or other material is missing, ask for it in one plain sentence.
126
+ - Every interactive part (a poster card, a search field, a chip, a button) draws its own hover and focus-visible
127
+ states next to rest. A page has none: it imports those parts and shows theirs, so never write a hover or
128
+ focus rule only in a page's CSS.
129
+ - A state must read as different from rest at a glance: change colour, surface, outline or shadow. A lift or move
130
+ of a few px alone barely differs, and `sketch check` and `sketch ready` warn about it.
131
+ - The app shell (masthead, menu, navigation, and any header or footer every page shares) is one element each
132
+ page imports, never drawn inside a page. This holds in the first sketch too.
114
133
 
115
134
  Details, commands and examples, read on demand:
116
135
 
117
136
  - {%resource:reference-products-and-sketches.md%}: creating a product, every `sketch` command, shared code,
118
137
  assets, rounds, `--by`, the merge and accept flow. Read before the first sketch command.
119
138
  - {%resource:reference-inbox-and-mcp.md%}: reading and answering comments, thread states, the MCP tools.
120
- - {%resource:reference-flows-and-wireframes.md%}: flow JSON, the wireframe kit and its rules.
139
+ - {%resource:reference-flows.md%}: flow JSON, `embedPage`, the shell.
121
140
  - {%resource:reference-check-and-notes.md%}: `design check` rules and warnings, drawing-file constraints,
122
141
  `setup`, `ngStates`, notes.
123
142
  - {%resource:reference-order-and-design-system.md%}: the stage order, component states and
@@ -146,10 +165,8 @@ With a Storybook, copy {%resource:check-story.mjs%} to the **repository root** f
146
165
  node check-story.mjs --lint <changed files> --tsconfig apps/<app>/.storybook/tsconfig.json
147
166
  ```
148
167
 
149
- Both take about four seconds and need no dev server. Then stop and hand the slug to the
150
- user. Do not also render it in a browser: it costs a browser launch, and both tools
151
- transpile without type checking, so the render reports `ok` on a file that does not
152
- compile. Open it only when the check passes and the drawing still does not appear:
168
+ Both take about four seconds and need no dev server. Open a browser only when the check passes and
169
+ the drawing still does not appear:
153
170
 
154
171
  ```bash
155
172
  et design check --call <slug> # every variant of the call
@@ -159,8 +176,7 @@ node check-story.mjs --tsconfig <path> --story <story-id>
159
176
 
160
177
  A passing check says the variant builds, not that it looks good. Before `sketch ready`, look at
161
178
  each variant at a readable scale and in its whole host page, and critique its hierarchy, spacing,
162
- nesting and host context together. Drop a variant that is technically valid but visually weak
163
- before the user sees it. In your summary, say "renders correctly", never "good" or "approved":
179
+ nesting and host context together. Drop a visually weak variant before the user sees it. In your summary, say "renders correctly", never "good" or "approved":
164
180
  the user decides that.
165
181
 
166
182
  ## Delegating a sketch
@@ -184,7 +200,4 @@ command." You know the id because you chose the model; the sub-agent does not, a
184
200
 
185
201
  ## Writing it down
186
202
 
187
- Every settled call goes in the exploration's plan file: what won, what lost, and why. Keep
188
- an **Open** list for the calls not yet made. A rejected variant written down stops the next
189
- session from drawing it again. After a clear rejection, use that record to frame and draw the
190
- next call; do not wait for the user to type “continue”.
203
+ Every settled call goes in the exploration's plan file: what won, what lost, and why, plus an **Open** list. After a clear rejection, draw the next call from that record without waiting.
@@ -17,7 +17,11 @@ Once the other rules pass, the check draws every state in a headless Chromium on
17
17
  `sketch check` does the same for the open variants and the pages they show in. Each line names
18
18
  product, part, state, size and a selector path:
19
19
 
20
- - `OVERFLOW` - the frame scrolls: content wider than the frame, or taller than a preset height.
20
+ - `OVERFLOW` - the frame scrolls sideways: content wider than the frame. A page taller than its preset
21
+ height is fine: it scrolls, so draw the whole list, not the films that fit.
22
+ - `FONT-FACE` - a font the design names did not load in the shot (an `@font-face` that fails, or a family no
23
+ stylesheet delivers, e.g. a Google Fonts link the sandbox blocks). Self-host it: a woff2 file in the product's
24
+ `assets/` and an `@font-face` rule, never a CDN link.
21
25
  - `CLIPPED` - an element with `overflow: hidden|clip` cuts its content, unless it sets
22
26
  `text-overflow: ellipsis` or a line clamp.
23
27
  - `WRAP` - text in a button, tab, badge, chip or `white-space: nowrap` box runs onto a second line.
@@ -0,0 +1,38 @@
1
+ # Design exploration: flows
2
+
3
+ ### Draw a flow
4
+
5
+ A flow joins states of pages into a path the user reads left to right in Studio's Flows view.
6
+ It is `<product>/flows/<name>.json`; `position` and `label` are optional:
7
+
8
+ ```json
9
+ {
10
+ "frames": [{ "part": "pages/projects", "state": "empty", "position": { "x": 0, "y": 0 } }],
11
+ "lines": [
12
+ {
13
+ "from": { "part": "pages/projects", "state": "empty" },
14
+ "to": { "part": "pages/project-detail", "state": "default" },
15
+ "label": "user adds a project"
16
+ }
17
+ ]
18
+ }
19
+ ```
20
+
21
+ Every flow line is labelled, and the element the label names is visible in the frame before it: a line
22
+ labelled "user clicks 'Log in'" starts from a frame that shows a "Log in" button. A line that names
23
+ nothing the reader can see, or a label for a control the page lacks, is a defect.
24
+
25
+ A line may join two states of one page. A frame may name a page that exists only as an open sketch;
26
+ the flow then shows its first variant. Lines hold for every preset. Without `position`, Studio
27
+ lays the frames out along the lines.
28
+
29
+ A page may not import another page. To show a page inside a page ("in context"), embed it:
30
+ `embedPage('pages/system', { state, width, height, scale })` from `@design-system` answers a
31
+ drawing whose `body` is a frame of that page, drawn in the same product, sketch variant and theme
32
+ as the embedding frame. `width` and `height` are the viewport the page is drawn at (default
33
+ 1280 x 800; `height: 'auto'` fits its content), `scale` shrinks the frame. Never rebuild a page
34
+ from its elements to show it.
35
+
36
+ The app shell (menu, navigation) is one element named by purpose (`elements/shell-primary`) that each page
37
+ imports, so a shell pick lands in one file. Never draw the shell inside a page, and never as a state of one.
38
+ A dialog without its own URL is an element that a page state shows ("login open").