@ethlete/agent-rules 0.1.0-next.26 → 0.1.0-next.28

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.
Files changed (42) hide show
  1. package/AGENTS.md +28 -0
  2. package/CHANGELOG.md +114 -0
  3. package/CLAUDE.md +1 -0
  4. package/THIRD-PARTY-LICENSES.md +1 -1
  5. package/content/hooks/context-warning.py +46 -7
  6. package/content/mods/.claude-plugin/marketplace.json +11 -0
  7. package/content/mods/plugins/e2e-progress/.claude-plugin/plugin.json +6 -0
  8. package/content/mods/plugins/e2e-progress/hooks/hooks.json +1 -0
  9. package/content/mods/plugins/e2e-progress/hooks/register.tsx +442 -0
  10. package/content/mods/plugins/e2e-progress/tsconfig.json +3 -0
  11. package/content/mods/plugins/e2e-progress/types/index.d.ts +23 -0
  12. package/content/rules/agent-sessions-wake-up.md +11 -0
  13. package/content/rules/lint-and-format.md +2 -1
  14. package/content/rules/subagent-models.md +4 -0
  15. package/content/skills/agent-sessions/SKILL.md +81 -0
  16. package/content/skills/agent-sessions/agent-sessions.mjs +436 -0
  17. package/content/skills/design-exploration/SKILL.md +429 -135
  18. package/content/skills/e2e-triage/SKILL.md +80 -0
  19. package/content/skills/git-commit/SKILL.md +5 -0
  20. package/content/skills/grilling/SKILL.md +17 -0
  21. package/content/skills/handoff/SKILL.md +51 -1
  22. package/content/skills/sdk-update/SKILL.md +7 -0
  23. package/package.json +1 -1
  24. package/src/index.js +7 -0
  25. package/src/index.js.map +1 -1
  26. package/src/lib/config.d.ts +2 -0
  27. package/src/lib/config.js +5 -3
  28. package/src/lib/config.js.map +1 -1
  29. package/src/lib/plan.js +4 -0
  30. package/src/lib/plan.js.map +1 -1
  31. package/src/lib/sessions-command.d.ts +4 -0
  32. package/src/lib/sessions-command.js +16 -0
  33. package/src/lib/sessions-command.js.map +1 -0
  34. package/src/lib/targets/claude-hooks.d.ts +2 -0
  35. package/src/lib/targets/claude-hooks.js +4 -1
  36. package/src/lib/targets/claude-hooks.js.map +1 -1
  37. package/src/lib/targets/claude-mods.d.ts +20 -0
  38. package/src/lib/targets/claude-mods.js +47 -0
  39. package/src/lib/targets/claude-mods.js.map +1 -0
  40. package/src/lib/targets/hooks-shared.d.ts +1 -0
  41. package/src/lib/targets/hooks-shared.js +3 -2
  42. package/src/lib/targets/hooks-shared.js.map +1 -1
package/AGENTS.md ADDED
@@ -0,0 +1,28 @@
1
+ # agent-rules
2
+
3
+ `libs/agent-rules` publishes `@ethlete/agent-rules`: the portable slice of this repo's
4
+ guidance, compiled into Claude Code, Codex, Cursor and Copilot formats. Content lives in
5
+ `libs/agent-rules/content/`; what this repo itself consumes is configured in
6
+ `ethlete-agents.config.json` (`profile: sdk`, so only `scope: both` content is emitted
7
+ here). Never hand-edit the generated marker block at the end of the root `AGENTS.md` or a generated
8
+ `ethlete-*` skill - edit the content file in `libs/agent-rules/content/`, then:
9
+
10
+ ```bash
11
+ npx prettier --write libs/agent-rules/content/<file> # format first
12
+ yarn agents:sync # then regenerate
13
+ ```
14
+
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.
18
+
19
+ `content/output-styles/` is the exception: a Claude Code output style is a machine-level
20
+ file, so `sync` never emits it and `agents:check` never diffs it. It is installed on
21
+ demand instead - `node dist/libs/agent-rules/src/index.js output-style` after a build here,
22
+ `npx ethlete-agents output-style` in a consumer repo.
23
+
24
+ Format **before** syncing. The generated copies under `.claude/` and `.agents/` are
25
+ Prettier-ignored, so formatting the content afterwards silently leaves them stale, and
26
+ `yarn agents:check` (which CI runs) fails. The `npx ethlete-agents sync` in the published
27
+ README works in consumer repos only - here the package is the source, not a dependency,
28
+ so `npx` would look it up on the registry and 404.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,119 @@
1
1
  # @ethlete/agent-rules
2
2
 
3
+ ## 0.1.0-next.28
4
+
5
+ ### Minor Changes
6
+
7
+ - New `mods` config key: `sync` turns on Claude Code mods that the package ships, starting with `e2e-progress`, a live Playwright run progress in the status line.
8
+ - Add the consumer skill `e2e-triage`: read the failures file of the `@ethlete/cli` failure reporter, group the failures by error, fix the largest group first, and re-run only the failed spec files.
9
+ - Add the `agent-sessions` skill and `ethlete-agents sessions`: agents in one checkout run in `tmux`, message each other, claim paths, and restart a session with a prompt. The `handoff` skill uses it to clear and resume.
10
+
11
+ ### Patch Changes
12
+
13
+ - `agent-sessions restart` refuses a session the caller does not run in, and the handoff skill says how to read the own session name.
14
+ - The `claude` and `codex` shell functions no longer switch your tmux client when a script or a one-shot flag such as `--version` calls them.
15
+ - `agent-sessions run` starts `<name>-2`, `<name>-3` and so on when the session already has a terminal attached, so a second `claude` terminal gets its own agent.
16
+ - The e2e-triage skill treats connection-refused groups on a local mock as infrastructure, and the e2e-progress mod shows the failure `detail`.
17
+ - The handoff skill counts an open item as the next task, so an agent in tmux restarts itself with it instead of handing the prompt to the user.
18
+ - A handoff self-restart now resumes with the installed skill name and keeps both the restart reason and the text after the slug.
19
+ - In an agent-sessions tmux session, the context-warning hook tells the agent to save and restart itself, not to ask the user for `/clear`.
20
+ - The `sdk-update` skill warns that after Angular 22, `a?.b` gives `undefined`, not `null`, which breaks pipes that treat the two differently.
21
+ - Shorten the mailbox wake-up prompt: it runs `npx ethlete-agents sessions inbox <name>` or the `agents:sessions` script when one exists, and the full script path otherwise.
22
+ - `et design shot --variants` takes `--round <key>` and `--variant <name>` to draw only the current round next to the merged row.
23
+ - Reject and reopen single sketch variants with `et design sketch reject|reopen` or in Studio; a rejected variant keeps its reason, origin and history and can no longer be picked or merged.
24
+ - The `agent-sessions` dispatcher waits when the prompt of an agent holds typed text or an open menu, and sends the wake-up line after the text is sent or cleared.
25
+
26
+ ## 0.1.0-next.27
27
+
28
+ ### Minor Changes
29
+
30
+ - The design-exploration skill says every `et design` write takes `--by <model id>`, that `sketch report` names its variant with `--variant`, and that the coordinator writes the exact model id into each sub-agent prompt; an agent never guesses it.
31
+ - The design-exploration skill says a flow may name a page that exists only as an open sketch, and Studio draws its first variant.
32
+ - The design-exploration skill says elements may draw with the wireframe kit, and a rough shell is a kit element each page imports.
33
+ - The design render check warns of grid rows that leave out interaction columns other rows fill (`GRID-COVERAGE`).
34
+ - `design check` warns of a `.replace` on markup that neither the part nor a part it uses draws (`STALE-REPLACE`).
35
+ - The design render check warns of a class with a product prefix that no stylesheet of the frame defines (`UNDEFINED-CLASS`).
36
+
37
+ ### Patch Changes
38
+
39
+ - The design-exploration skill explains the open, addressed and resolved comment states, and that the agent never merges after a pick.
40
+ - The design-exploration skill says when to pass `--question` to `et design comment reply`.
41
+ - The design-exploration skill covers `et design comment reply` and the inbox group "waiting for the user".
42
+ - The design-exploration skill says to call `node dist/libs/cli/src/index.js design` in a check-and-shot loop instead of `yarn design`, which builds the CLI first.
43
+ - The design-exploration skill now forbids `vh`, `dvh` and `svh` in parts, and requires every flow line to carry a label naming an element visible in the frame before it.
44
+ - Document product flows, the wireframe kit and the FLOW and WIREFRAME-KIT checks in the design-exploration skill.
45
+ - The design exploration skill explains comments on an element variant inside a page.
46
+ - The design-exploration skill says a product's own `presets` replace its base's, so a desktop-only app lists `desktop` alone.
47
+ - Tell design agents that a Tailwind product registers its drawing folders in a stylesheet, so sketches use the app's utilities.
48
+ - Explain a sketch's `shared/` folder, `sketch new --like` and `embedPage()` in the design-exploration skill.
49
+ - Teach the design-exploration skill the product and sketch workflow of Ethlete Studio: `et design product new`, sketches, the inbox, and Studio-side merge.
50
+ - The design exploration skill describes the product config `tokens` list.
51
+ - The design-exploration skill says how a part imports the product's tokens through `@system/foundations/tokens.css?inline`.
52
+ - The design and git-commit skills add rules for variants, pages and commits in a shared checkout.
53
+ - The design-exploration skill draws wireframes first, then foundations, logo and CI, components, elements and pages.
54
+ - The design-exploration skill says a part with `definePart({ styles })` may draw `drawing({ body })` without styles.
55
+ - The design-exploration skill says `et design inbox done` needs `--note`, which replaces the part's note.
56
+ - The design-exploration skill says a part may export named helpers, and that another part imports a piece instead of copying its markup.
57
+ - The design-exploration skill says `sketch check` and `sketch ready` note a problem the product already had instead of failing on it.
58
+ - The design-exploration skill says `sketch new` starts no report, so `report --done` follows only a report of your own.
59
+ - The design-exploration skill says to start each `et design sketch report` message with `variant <name>`, so Studio can mark that variant as drawing.
60
+ - The design-exploration skill names `sketch round` and says `sketch list` shows the rounds.
61
+ - The design-exploration skill tells agents to answer a combine comment with `et design sketch variant --from` in a new round, noting why the old round lost.
62
+ - The design-exploration skill makes wireframes strict: keep what the app already has, one sketch per screen, regions and names only, no polish, no subagent, and stop the stage early.
63
+ - The design-exploration skill lists the wireframe kit's new controls (`select`, `tabs`, `segmented`, `checkbox`, `badge`, `dot`), an icon `glyph` and a box `fill`, and says to draw a control as its type.
64
+ - The design-exploration skill teaches the wireframe kit's `heading`, `image` `ratio` and row `stackBelow` instead of fixed sizes.
65
+ - The delegation rule says a subagent starts with the full start context, so a small lookup stays in the session. The format rule asks for one Prettier call over all edited files.
66
+ - The design-exploration skill says the auto merge blocks only on problems it adds, and that `sketch ready` can be re-run on a ready sketch.
67
+ - The design-exploration skill says that `design check` warns of a merged part changed outside a sketch.
68
+ - Design parts and stylesheets load product assets as `@assets/<file>`.
69
+ - `et design check --tsconfig` also typechecks each variant of an open sketch and prints the tsc output of a failing one.
70
+ - `et design sketch new` takes `--note <text>`, the note of the first round.
71
+ - `et design <command> [<subcommand>] --help` prints the usage of that one command and skips its checks.
72
+ - `et design check` reports a `var(--token)` without a fallback that no part or stylesheet of the product or its base defines.
73
+ - `et design shot --crop x,y,width,height` and `/__design/shot?clip=x,y,width,height` cut a picture to a box in CSS pixels, so a hairline can be judged with `--scale`.
74
+ - `et design shot --variants --diff-props` compares each variant with the merged part drawn with the variant's state props, so changed props no longer paint the whole diff red.
75
+ - `et design shot --interaction <hover|focus-visible|active|disabled>` forces an interaction on every cell, and `--help` names it. The design-exploration skill names it.
76
+ - The diff row of `et design shot --variants` says "no pixel change, but the markup differs" when a variant draws other markup to the same pixels.
77
+ - `et design shot --scale <1-4>` and `/__design/shot?scale=` draw a part at a device scale, so a small part is legible. The design-exploration skill names it.
78
+ - `et design shot --state <a>,<b>` draws only the named states, side by side, and names the states of the part when one does not exist. The design-exploration skill names it.
79
+ - `et design sketch check --fix` writes the variants in the checkout's Prettier format before it checks them; a FORMAT problem points to it.
80
+ - `et design sketch check` warns of a variant that restyles a class of the sketch's `shared/` folder and of a variant file nothing imports.
81
+ - `et design sketch new --round` requires `--note`, so `sketch ready` no longer stops on a round without a note.
82
+ - `et design sketch new` takes `--variant-note`, `sketch variant` takes several variants, and sketch commands format their output, explain each flag and infer `--product`.
83
+ - `et design sketch variant` refuses a sketch the user discarded and asks for a variant pick first; a pick is still cleared.
84
+ - `design check` warns of an export in a part's `shared/` that nothing imports, and `sketch check` of a sketch `shared/` export a variant does not import.
85
+ - `sketch new --variant-note` keeps each variant's note in `sketch.json` instead of overwriting the part's merged note; Studio shows it in the variant's head, and a merge gives it to a new part.
86
+ - A sketch variant may hold its own copy of a shared file at `<variant>/shared/<path>`: `@shared/<path>` resolves to it first in rendering, typechecks and checks, and a merge of that variant carries it.
87
+ - The context-warning hook now tells the agent to apply the handoff save test before it suggests a handoff. When nothing is left to hand off, the agent suggests a fresh session instead.
88
+ - The design-exploration skill says when to run `design accept`.
89
+ - `et design check` also type-checks each variant of an open sketch and fails with a `TYPE-ERROR` line per broken variant. A merge's own check still types only the product.
90
+ - The design-exploration skill lists the render rules of `design check` and how a part opts out of one.
91
+ - The design exploration skill documents component states per axis, and treats an icon set as a foundation asset.
92
+ - The design exploration skill extracts a component only when two hosts draw the same case.
93
+ - `forceInteraction` from `@design-system` forces an interaction on one element of a part's markup, not only its root.
94
+ - The design-exploration skill says the frame loads a product's tokens, so parts stop importing them.
95
+ - The render check reads each drawn part's `grid`: `sketch check` prints `grid <rows> x <columns> ok` or the states it leaves out, and a state in two cells or a cell naming no state fails as `GRID`.
96
+ - `interactionRows` from `@design-system` builds a part's states and grid from one props object per row and a list of interactions.
97
+ - `et design part remove <layer>/<name>` deletes a merged part with its `merged.json` entry and tsconfig path, and resolves its comments. It refuses a part another part imports, a base part, and a part with an open sketch.
98
+ - `definePart({ styles })` exposes a part's stylesheet on its default export and adds it to every drawing of the part.
99
+ - Tell the design-exploration skill to take its own check shots with `et design shot` instead of a scratch script.
100
+ - The design exploration skill now sends every change to a merged part through a sketch. When there is nothing to choose, the sketch has one variant.
101
+ - The design-exploration skill keeps a component's frame-only wrapper in `render` and out of the markup a host embeds.
102
+ - The design-exploration skill mentions the duplicate-class warning of `sketch check`.
103
+ - `svgAsset` sets a `class` and `attrs` on the root `<svg>` of an asset.
104
+ - Add `svgAsset(raw, { size })` to `@design-system`, fail `design check` on an SVG asset without a root `<svg>` or the SVG namespace, print each variant's `assets/` folder, and add a pixel diff row to `design shot --variants`.
105
+ - The design render check reports `UNKNOWN-THEME` when a drawing uses a colour theme that no stylesheet of its frame defines.
106
+ - The grilling skill now asks for questions that read alone: plain words, no chains of question or ADR numbers, a short reminder when a new topic starts, facts checked before a recommendation, and a confirmed summary at the end.
107
+ - When the handoff save test finds nothing to hand off, the handoff skill and the context-warning hook now ask the agent for a prompt the user can copy into the fresh session.
108
+ - The design-exploration skill says the merge note is optional and which sketch commands record a variant's authors.
109
+ - Document design notes in the design-exploration skill: the note file format, the size a pointed note needs, free flow notes, and when to write a note instead of a comment.
110
+ - The design exploration skill says a closed comment thread is resolved, not deleted.
111
+ - The design exploration skill says a merge, discard or new round closes the sketch's open comments.
112
+ - `et design sketch check` and `sketch ready` fail when a variant drops a state the product's part has.
113
+ - `et design sketch ready` merges a sketch by itself when no state of any variant differs by a pixel from the product, and logs it as `auto` in `accepted.json`.
114
+ - `sketch report --variant <key> --done` ends the live "drawing" report of that variant, so Studio shows its frames before `sketch ready`. The design exploration skill names the command.
115
+ - The design-exploration skill says that `sketch variant` without `--round` fails while the sketch has open comments.
116
+
3
117
  ## 0.1.0-next.26
4
118
 
5
119
  ### Patch Changes
package/CLAUDE.md ADDED
@@ -0,0 +1 @@
1
+ @AGENTS.md
@@ -9,7 +9,7 @@ Commit `3cca18b` (2026-09-04). Vendored skills, kept as written upstream apart f
9
9
  generator's own link syntax:
10
10
 
11
11
  - `content/skills/grill-with-docs` - the entry point; calls the other two.
12
- - `content/skills/grilling`
12
+ - `content/skills/grilling` - plus our own section "Local addition" after the upstream footer.
13
13
  - `content/skills/domain-modeling`
14
14
 
15
15
  MIT License
@@ -93,6 +93,7 @@ a tool batch or the end of a turn.
93
93
  import json
94
94
  import os
95
95
  import re
96
+ import subprocess
96
97
  import sys
97
98
  import tempfile
98
99
 
@@ -176,8 +177,16 @@ AGENT_PROFILES = {
176
177
  "emits_system_message": True,
177
178
  "act_now": "Run /{handoff} now and continue in a fresh session.",
178
179
  "act_later": "consider /{handoff} to continue in a fresh session",
179
- "recommend": "recommend the user run /{handoff} to save state and start a fresh session",
180
- "suggest": "suggest the user run /{handoff} to save state and start a fresh session",
180
+ "recommend": (
181
+ "first apply the handoff skill's save test yourself; if it calls for a file, "
182
+ "recommend the user run /{handoff} to save state and start a fresh session, "
183
+ "otherwise recommend /clear and say nothing is left to hand off, with a prompt to copy into the fresh session"
184
+ ),
185
+ "suggest": (
186
+ "first apply the handoff skill's save test yourself; if it calls for a file, "
187
+ "suggest the user run /{handoff} to save state and start a fresh session, "
188
+ "otherwise suggest /clear and say nothing is left to hand off, with a prompt to copy into the fresh session"
189
+ ),
181
190
  "save_now": (
182
191
  "run the handoff skill's save mode right now - finish only an in-flight atomic "
183
192
  "edit first, nothing new. Apply its own test: with every change committed, no "
@@ -209,11 +218,13 @@ AGENT_PROFILES = {
209
218
  "recommend": (
210
219
  "tell the user you are near the context limit, then follow "
211
220
  ".agents/skills/{handoff}/SKILL.md to save a handoff and have them start a "
221
+ "fresh session; when its save test calls for no file, only tell them to start a "
212
222
  "fresh session"
213
223
  ),
214
224
  "suggest": (
215
- "suggest saving a handoff via .agents/skills/{handoff}/SKILL.md and "
216
- "continuing in a fresh session"
225
+ "first apply the save test in .agents/skills/{handoff}/SKILL.md yourself; if it "
226
+ "calls for a file, suggest saving a handoff and continuing in a fresh session, "
227
+ "otherwise suggest a fresh session and say nothing is left to hand off, with a prompt to copy into the fresh session"
217
228
  ),
218
229
  "save_now": (
219
230
  "follow .agents/skills/{handoff}/SKILL.md and save a handoff right now - finish "
@@ -245,11 +256,39 @@ def handoff_skill(root):
245
256
  return "ethlete-handoff"
246
257
 
247
258
 
248
- def resolve_profile(profile, skill):
259
+ SELF_RESTART = (
260
+ "you run in an agent-sessions tmux session, so do not hand this step to the user: apply the {handoff} skill's save "
261
+ "test, save if it calls for a file, then follow its 'Clear and resume on your own' section "
262
+ "and restart this session yourself with the agent-sessions `restart` command - with no file, "
263
+ "restart with a prompt that names the next step"
264
+ )
265
+ USER_DIRECTED_KEYS = ("recommend", "suggest", "save_now", "save_at_stop")
266
+
267
+
268
+ def can_self_restart(root):
269
+ """True only in a tmux session the agent-sessions `restart` command can find and drive."""
270
+ if not os.environ.get("TMUX") or not root:
271
+ return False
272
+ if not any(
273
+ os.path.isfile(os.path.join(root, ".agents/skills", name, "agent-sessions.mjs"))
274
+ for name in ("ethlete-agent-sessions", "agent-sessions")
275
+ ):
276
+ return False
277
+ try:
278
+ session = subprocess.run(
279
+ ["tmux", "display-message", "-p", "#S"], capture_output=True, text=True, timeout=2
280
+ ).stdout.strip()
281
+ except (OSError, subprocess.SubprocessError):
282
+ return False
283
+ return session.endswith("@" + re.sub(r"[.:]", "-", os.path.basename(os.path.normpath(root))))
284
+
285
+
286
+ def resolve_profile(profile, skill, self_restart=False):
249
287
  """Fills the installed handoff skill's name into a profile's message fragments."""
288
+ resolved = {**profile, **{key: SELF_RESTART for key in USER_DIRECTED_KEYS}} if self_restart else profile
250
289
  return {
251
290
  key: value.replace("{handoff}", skill) if isinstance(value, str) else value
252
- for key, value in profile.items()
291
+ for key, value in resolved.items()
253
292
  }
254
293
 
255
294
 
@@ -811,7 +850,7 @@ def main():
811
850
  if disabled_locally(local_config):
812
851
  return
813
852
 
814
- profile = resolve_profile(profile, handoff_skill(root))
853
+ profile = resolve_profile(profile, handoff_skill(root), self_restart=can_self_restart(root))
815
854
 
816
855
  claude_subagent = agent == "claude" and bool(data.get("agent_id"))
817
856
  if claude_subagent:
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "ethlete",
3
+ "owner": { "name": "ethlete" },
4
+ "plugins": [
5
+ {
6
+ "name": "e2e-progress",
7
+ "source": "./plugins/e2e-progress",
8
+ "description": "Live Playwright e2e progress from a run log, as a status line entry and a pane"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "e2e-progress",
3
+ "version": "0.1.0-next.28",
4
+ "description": "Live Playwright e2e progress from a run log, as a status line entry and a pane",
5
+ "types": "./types/index.d.ts"
6
+ }
@@ -0,0 +1 @@
1
+ { "modules": ["./register.tsx"] }