@ethlete/agent-rules 0.1.0-next.6 → 0.1.0-next.60

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 (220) hide show
  1. package/AGENTS.md +28 -0
  2. package/CHANGELOG.md +841 -0
  3. package/CLAUDE.md +1 -0
  4. package/README.md +244 -36
  5. package/THIRD-PARTY-LICENSES.md +35 -0
  6. package/content/defaults.json +1 -1
  7. package/content/hooks/away-mode.py +410 -0
  8. package/content/hooks/background-commands.py +177 -0
  9. package/content/hooks/builder-idle-check.py +529 -0
  10. package/content/hooks/context-warning.py +666 -134
  11. package/content/hooks/git-safety.py +213 -0
  12. package/content/hooks/human-wait-check.py +167 -0
  13. package/content/hooks/subagent-model-policy.py +261 -0
  14. package/content/mods/.claude-plugin/marketplace.json +26 -0
  15. package/content/mods/plugins/codex-runs/.claude-plugin/plugin.json +6 -0
  16. package/content/mods/plugins/codex-runs/hooks/agent-runs.ts +310 -0
  17. package/content/mods/plugins/codex-runs/hooks/hooks.json +1 -0
  18. package/content/mods/plugins/codex-runs/hooks/progress.ts +130 -0
  19. package/content/mods/plugins/codex-runs/hooks/register.tsx +283 -0
  20. package/content/mods/plugins/codex-runs/tests/pane.test.ts +21 -0
  21. package/content/mods/plugins/codex-runs/tsconfig.json +4 -0
  22. package/content/mods/plugins/codex-runs/types/index.d.ts +37 -0
  23. package/content/mods/plugins/e2e-progress/.claude-plugin/plugin.json +6 -0
  24. package/content/mods/plugins/e2e-progress/hooks/hooks.json +1 -0
  25. package/content/mods/plugins/e2e-progress/hooks/progress.ts +205 -0
  26. package/content/mods/plugins/e2e-progress/hooks/register.tsx +498 -0
  27. package/content/mods/plugins/e2e-progress/tsconfig.json +3 -0
  28. package/content/mods/plugins/e2e-progress/types/index.d.ts +27 -0
  29. package/content/mods/plugins/status-line/.claude-plugin/plugin.json +6 -0
  30. package/content/mods/plugins/status-line/hooks/hooks.json +1 -0
  31. package/content/mods/plugins/status-line/hooks/line.ts +74 -0
  32. package/content/mods/plugins/status-line/hooks/register.tsx +141 -0
  33. package/content/mods/plugins/status-line/types/index.d.ts +5 -0
  34. package/content/mods/plugins/usage-line/.claude-plugin/plugin.json +6 -0
  35. package/content/mods/plugins/usage-line/hooks/codex.ts +52 -0
  36. package/content/mods/plugins/usage-line/hooks/format.ts +24 -0
  37. package/content/mods/plugins/usage-line/hooks/hooks.json +1 -0
  38. package/content/mods/plugins/usage-line/hooks/rate-limits.ts +23 -0
  39. package/content/mods/plugins/usage-line/hooks/register.tsx +83 -0
  40. package/content/mods/plugins/usage-line/tsconfig.json +4 -0
  41. package/content/mods/plugins/usage-line/types/index.d.ts +5 -0
  42. package/content/output-styles/ste-clarity.md +131 -0
  43. package/content/rules/agent-sessions-wake-up.md +11 -0
  44. package/content/rules/app-styling.md +66 -0
  45. package/content/rules/comments.md +4 -1
  46. package/content/rules/lint-and-format.md +7 -5
  47. package/content/rules/nx-layout.md +53 -0
  48. package/content/rules/reactive-state.md +1 -1
  49. package/content/rules/styling.md +19 -10
  50. package/content/rules/subagent-models.md +42 -0
  51. package/content/rules/waiting-on-the-human.md +17 -0
  52. package/content/skills/agent-sessions/SKILL.md +101 -0
  53. package/content/skills/agent-sessions/agent-sessions.mjs +1462 -0
  54. package/content/skills/angular-patterns/SKILL.md +31 -7
  55. package/content/skills/api-source/SKILL.md +156 -0
  56. package/content/skills/app-testing/SKILL.md +141 -0
  57. package/content/skills/codex-subagent/SKILL.md +102 -0
  58. package/content/skills/codex-subagent/codex-agent.mjs +260 -0
  59. package/content/skills/codex-subagent/codex-limit.mjs +106 -0
  60. package/content/skills/design-exploration/SKILL.md +121 -0
  61. package/content/skills/design-exploration/check-story.mjs +139 -0
  62. package/content/skills/design-exploration/reference-shots.md +15 -0
  63. package/content/skills/design-exploration/shoot-template.mjs +61 -0
  64. package/content/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  65. package/content/skills/domain-modeling/SKILL.md +71 -0
  66. package/content/skills/e2e-triage/SKILL.md +80 -0
  67. package/content/skills/figma-export/SKILL.md +16 -18
  68. package/content/skills/git-commit/SKILL.md +21 -7
  69. package/content/skills/git-flow/SKILL.md +9 -5
  70. package/content/skills/grill-with-docs/SKILL.md +13 -0
  71. package/content/skills/grilling/SKILL.md +52 -0
  72. package/content/skills/handoff/SKILL.md +30 -72
  73. package/content/skills/handoff/save.md +189 -0
  74. package/content/skills/query/SKILL.md +165 -74
  75. package/content/skills/report/SKILL.md +26 -0
  76. package/content/skills/rxjs-signals/SKILL.md +33 -4
  77. package/content/skills/sdk-docs/SKILL.md +50 -14
  78. package/content/skills/sdk-local-build/SKILL.md +26 -8
  79. package/content/skills/sdk-local-build/sdk-local-baseline.mjs +64 -0
  80. package/content/skills/sdk-source/SKILL.md +37 -34
  81. package/content/skills/sdk-update/SKILL.md +103 -0
  82. package/content/skills/story-styling/SKILL.md +12 -10
  83. package/content/skills/styleguide/SKILL.md +13 -8
  84. package/content/skills/styleguide/assets.md +54 -0
  85. package/content/skills/styleguide/changesets.md +17 -0
  86. package/content/skills/styleguide/file-structure.md +73 -0
  87. package/content/skills/styleguide/lint-rule-lookup.md +52 -0
  88. package/content/skills/styleguide/storybook-structure.md +25 -0
  89. package/content/skills/theming/SKILL.md +76 -49
  90. package/content/skills/verify-in-app/SKILL.md +107 -0
  91. package/content/skills/verify-in-storybook/SKILL.md +1 -1
  92. package/content/skills/verify-on-apple-devices/SKILL.md +100 -0
  93. package/content/skills/verify-on-apple-devices/apple-remote.sh +421 -0
  94. package/content/skills/verify-on-apple-devices/sim-edge-back.m +159 -0
  95. package/migrations/list-state-query-form.md +20 -0
  96. package/migrations/nx-layout.md +29 -0
  97. package/migrations/sdk-components-over-hand-built-ui.md +27 -0
  98. package/migrations/search-query-field.md +52 -0
  99. package/migrations/studio-claude-plugin.md +27 -0
  100. package/migrations.json +47 -0
  101. package/package.json +8 -3
  102. package/src/index.js +84 -28
  103. package/src/index.js.map +1 -1
  104. package/src/lib/cli-args.d.ts +9 -0
  105. package/src/lib/cli-args.js +48 -0
  106. package/src/lib/cli-args.js.map +1 -0
  107. package/src/lib/commitlint.d.ts +10 -0
  108. package/src/lib/commitlint.js +51 -0
  109. package/src/lib/commitlint.js.map +1 -0
  110. package/src/lib/config.d.ts +53 -22
  111. package/src/lib/config.js +128 -12
  112. package/src/lib/config.js.map +1 -1
  113. package/src/lib/filter.d.ts +3 -0
  114. package/src/lib/filter.js +7 -5
  115. package/src/lib/filter.js.map +1 -1
  116. package/src/lib/frontmatter.d.ts +2 -0
  117. package/src/lib/frontmatter.js +33 -5
  118. package/src/lib/frontmatter.js.map +1 -1
  119. package/src/lib/git-flow/config.js +1 -1
  120. package/src/lib/git-flow/config.js.map +1 -1
  121. package/src/lib/git-flow/index.d.ts +1 -0
  122. package/src/lib/git-flow/index.js +20 -6
  123. package/src/lib/git-flow/index.js.map +1 -1
  124. package/src/lib/git-flow/parse.js +38 -12
  125. package/src/lib/git-flow/parse.js.map +1 -1
  126. package/src/lib/git-flow/rename.d.ts +24 -0
  127. package/src/lib/git-flow/rename.js +70 -0
  128. package/src/lib/git-flow/rename.js.map +1 -0
  129. package/src/lib/git-flow/start.d.ts +27 -0
  130. package/src/lib/git-flow/start.js +34 -1
  131. package/src/lib/git-flow/start.js.map +1 -1
  132. package/src/lib/git-flow-command.js +10 -2
  133. package/src/lib/git-flow-command.js.map +1 -1
  134. package/src/lib/git-flow-repair.d.ts +1 -1
  135. package/src/lib/git-flow-repair.js +30 -15
  136. package/src/lib/git-flow-repair.js.map +1 -1
  137. package/src/lib/git-flow-start.d.ts +1 -1
  138. package/src/lib/git-flow-start.js +25 -32
  139. package/src/lib/git-flow-start.js.map +1 -1
  140. package/src/lib/git.d.ts +37 -0
  141. package/src/lib/git.js +85 -3
  142. package/src/lib/git.js.map +1 -1
  143. package/src/lib/gitlab.js +24 -6
  144. package/src/lib/gitlab.js.map +1 -1
  145. package/src/lib/index.d.ts +2 -0
  146. package/src/lib/index.js +26 -11
  147. package/src/lib/index.js.map +1 -1
  148. package/src/lib/migrate.js +8 -2
  149. package/src/lib/migrate.js.map +1 -1
  150. package/src/lib/output-style-command.d.ts +3 -0
  151. package/src/lib/output-style-command.js +69 -0
  152. package/src/lib/output-style-command.js.map +1 -0
  153. package/src/lib/output-style.d.ts +38 -0
  154. package/src/lib/output-style.js +134 -0
  155. package/src/lib/output-style.js.map +1 -0
  156. package/src/lib/owned-paths.js +8 -2
  157. package/src/lib/owned-paths.js.map +1 -1
  158. package/src/lib/package-runner.d.ts +4 -0
  159. package/src/lib/package-runner.js +86 -0
  160. package/src/lib/package-runner.js.map +1 -0
  161. package/src/lib/plain-text.d.ts +9 -0
  162. package/src/lib/plain-text.js +22 -0
  163. package/src/lib/plain-text.js.map +1 -0
  164. package/src/lib/plan.d.ts +6 -6
  165. package/src/lib/plan.js +153 -40
  166. package/src/lib/plan.js.map +1 -1
  167. package/src/lib/prettier.d.ts +21 -0
  168. package/src/lib/prettier.js +51 -0
  169. package/src/lib/prettier.js.map +1 -0
  170. package/src/lib/prompt.js +10 -2
  171. package/src/lib/prompt.js.map +1 -1
  172. package/src/lib/render.d.ts +14 -1
  173. package/src/lib/render.js +23 -5
  174. package/src/lib/render.js.map +1 -1
  175. package/src/lib/report-command.d.ts +34 -0
  176. package/src/lib/report-command.js +322 -0
  177. package/src/lib/report-command.js.map +1 -0
  178. package/src/lib/sessions-command.d.ts +4 -0
  179. package/src/lib/sessions-command.js +16 -0
  180. package/src/lib/sessions-command.js.map +1 -0
  181. package/src/lib/sync.d.ts +1 -2
  182. package/src/lib/sync.js +37 -17
  183. package/src/lib/sync.js.map +1 -1
  184. package/src/lib/targets/agents-skills.js +1 -1
  185. package/src/lib/targets/agents-skills.js.map +1 -1
  186. package/src/lib/targets/claude-hooks.d.ts +5 -0
  187. package/src/lib/targets/claude-hooks.js +27 -4
  188. package/src/lib/targets/claude-hooks.js.map +1 -1
  189. package/src/lib/targets/claude-mods.d.ts +20 -0
  190. package/src/lib/targets/claude-mods.js +47 -0
  191. package/src/lib/targets/claude-mods.js.map +1 -0
  192. package/src/lib/targets/claude.js +2 -3
  193. package/src/lib/targets/claude.js.map +1 -1
  194. package/src/lib/targets/codex-hooks.js +4 -2
  195. package/src/lib/targets/codex-hooks.js.map +1 -1
  196. package/src/lib/targets/codex.js +4 -4
  197. package/src/lib/targets/codex.js.map +1 -1
  198. package/src/lib/targets/copilot.js +4 -4
  199. package/src/lib/targets/copilot.js.map +1 -1
  200. package/src/lib/targets/cursor.js +3 -3
  201. package/src/lib/targets/cursor.js.map +1 -1
  202. package/src/lib/targets/git-hooks.d.ts +1 -1
  203. package/src/lib/targets/git-hooks.js +6 -5
  204. package/src/lib/targets/git-hooks.js.map +1 -1
  205. package/src/lib/targets/hooks-shared.d.ts +34 -5
  206. package/src/lib/targets/hooks-shared.js +132 -36
  207. package/src/lib/targets/hooks-shared.js.map +1 -1
  208. package/src/lib/targets/mcp.d.ts +25 -0
  209. package/src/lib/targets/mcp.js +114 -0
  210. package/src/lib/targets/mcp.js.map +1 -0
  211. package/src/lib/targets/shared.d.ts +1 -9
  212. package/src/lib/targets/shared.js +4 -8
  213. package/src/lib/targets/shared.js.map +1 -1
  214. package/src/lib/timetrack.d.ts +16 -0
  215. package/src/lib/timetrack.js +149 -0
  216. package/src/lib/timetrack.js.map +1 -0
  217. package/content/skills/styleguide/STYLEGUIDE.md +0 -520
  218. package/src/lib/jira.d.ts +0 -28
  219. package/src/lib/jira.js +0 -83
  220. package/src/lib/jira.js.map +0 -1
@@ -0,0 +1,73 @@
1
+ # File structure
2
+
3
+ Read this file when placing routes, views, components, providers, or local utilities.
4
+
5
+ Mirror the route tree in folders and suffix routing components with `-view`:
6
+
7
+ ```ts
8
+ import { Routes } from '@angular/router';
9
+
10
+ export const SHOP_ROUTES: Routes = [
11
+ {
12
+ path: 'items',
13
+ loadComponent: () =>
14
+ import('./items-list-view/items-list-view.component').then((module) => module.ItemsListViewComponent),
15
+ },
16
+ {
17
+ path: 'items/:id',
18
+ loadComponent: () =>
19
+ import('./item-detail-host-view/item-detail-host-view.component').then(
20
+ (module) => module.ItemDetailHostViewComponent,
21
+ ),
22
+ children: [
23
+ {
24
+ path: '',
25
+ loadComponent: () =>
26
+ import('./item-detail-host-view/item-detail-view/item-detail-view.component').then(
27
+ (module) => module.ItemDetailViewComponent,
28
+ ),
29
+ },
30
+ {
31
+ path: 'reviews',
32
+ loadComponent: () =>
33
+ import('./item-detail-host-view/item-reviews-view/item-reviews-view.component').then(
34
+ (module) => module.ItemReviewsViewComponent,
35
+ ),
36
+ },
37
+ ],
38
+ },
39
+ ];
40
+ ```
41
+
42
+ Use these placement rules:
43
+
44
+ - Put reusable view-level pieces in `components/`.
45
+ - Put children used only by one parent in that parent's `partials/`.
46
+ - Put generic presentation-only pieces in `uikit/`.
47
+ - Put application-shell pieces in `shell/`.
48
+ - Keep a directive, pipe, provider, form configuration, or utility beside its narrowest
49
+ consumer. Move it upward only when more consumers appear.
50
+ - Use simple utility names such as `items-list-filter-form.ts`, not `.utils.ts`.
51
+ - Give exportable folders an `index.ts`, but import source files directly. Do not import
52
+ a parent barrel from its subdirectory.
53
+ - Keep application projects thin; move shared or domain logic into buildable libraries
54
+ with clear import paths.
55
+
56
+ ```plaintext
57
+ shop/
58
+ ├── items-list-view/
59
+ │ ├── components/
60
+ │ │ └── item-card/
61
+ │ │ ├── partials/
62
+ │ │ │ ├── item-image/
63
+ │ │ │ └── item-price/
64
+ │ │ ├── item-card.component.ts
65
+ │ │ └── item-card.component.html
66
+ │ ├── items-list-filter-form.ts
67
+ │ └── items-list-view.component.ts
68
+ └── item-detail-host-view/
69
+ ├── item-detail-view/
70
+ ├── item-reviews-view/
71
+ ├── item-detail.provider.ts
72
+ └── item-detail-host-view.component.ts
73
+ ```
@@ -0,0 +1,52 @@
1
+ # Lint rule lookup
2
+
3
+ Read this file only to explain a lint result or identify which rule owns a mechanical
4
+ convention. Run lint with `--fix`; do not hand-check this table before linting.
5
+
6
+ | Convention | Rule |
7
+ | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
8
+ | No `any` / `$any()`; narrow `unknown` | `@typescript-eslint/no-explicit-any`, `@angular-eslint/template/no-any` |
9
+ | Static strings and booleans use attributes | `@angular-eslint/template/prefer-static-string-properties`, `ethlete/prefer-static-boolean-properties` |
10
+ | `type`, not `interface` (module augmentations stay interfaces) | `ethlete/consistent-type-definitions` |
11
+ | No `enum` or `const enum` | `ethlete/no-enum` |
12
+ | `const` by default; one declaration per statement | `no-var`, `prefer-const`, `one-var` |
13
+ | Strict equality | `eqeqeq` |
14
+ | Maximum two positional parameters | `max-params` |
15
+ | No type-only imports | `ethlete/no-type-only-import` |
16
+ | Descriptive `T`-prefixed generic names | `@typescript-eslint/naming-convention` |
17
+ | No `async` / `await` | `ethlete/no-async-await` |
18
+ | Arrow functions standalone; methods in classes | `no-restricted-syntax` |
19
+ | Blank line before a multiline guard return | `ethlete/guard-return-newline` |
20
+ | No trivially inferable return type | `ethlete/no-trivial-return-type` |
21
+ | Member and local naming conventions | `@typescript-eslint/naming-convention`, `ethlete/no-leading-underscore-class-member`, `ethlete/no-screaming-case-local` |
22
+ | Class constants are `readonly` and upper case | `ethlete/class-constant-property` |
23
+ | No `readonly` on reactive members | `ethlete/no-readonly-signal` |
24
+ | Injected and template-visible member accessibility | `ethlete/inject-member-accessibility`, `ethlete/template-member-accessibility` |
25
+ | No inject chains, pure aliases, or trivial wrappers | `ethlete/no-inject-chain`, `ethlete/no-member-alias`, `ethlete/no-trivial-wrapper-method` |
26
+ | No unused private or protected members | `ethlete/no-unused-class-member` |
27
+ | Pure module-scope provider calls | `ethlete/no-impure-top-level-provider` |
28
+ | No redundant `@internal` | `ethlete/no-redundant-internal` |
29
+ | Observable names end in `$` | `ethlete/require-dollar-suffix` |
30
+ | No subscribe body, subscribe in pipe, or RxJS in signal derivations | `ethlete/no-subscribe-with-body`, `ethlete/no-subscribe-in-pipe`, `ethlete/no-rxjs-in-effect` |
31
+ | `takeUntilDestroyed()` is the last operator in its pipe | `ethlete/take-until-destroyed-last` |
32
+ | Effect teardown uses `onCleanup` or `DestroyRef` | `ethlete/no-effect-cleanup-return` |
33
+ | Prefer `linkedSignal` for writable derived state | `ethlete/prefer-linked-signal` |
34
+ | `linkedSignal` source is a `computed`, not an inline function over an input | `ethlete/prefer-computed-linked-signal-source` |
35
+ | Global component CSS encapsulation | `ethlete/require-view-encapsulation-none` |
36
+ | Angular-version-correct change detection metadata | `ethlete/require-on-push-change-detection`, `ethlete/no-redundant-on-push-change-detection` |
37
+ | No redundant standalone flag or empty metadata arrays | `ethlete/no-standalone-flag`, `ethlete/no-empty-angular-metadata-arrays` |
38
+ | No legacy lifecycle hooks or decorators | `no-restricted-syntax`, `ethlete/no-legacy-angular-decorators` |
39
+ | No injectable services, guards, or resolvers | `no-restricted-syntax` |
40
+ | Output naming | `@angular-eslint/no-output-on-prefix`, `@angular-eslint/no-output-native`, `ethlete/prefer-present-tense-output` |
41
+ | Inputs do not collide with global HTML attributes | `ethlete/no-native-html-input-name` |
42
+ | No pipe logic | `ethlete/no-pipe-logic` |
43
+ | Class members and decorator metadata stay ordered | `ethlete/class-member-order`, `ethlete/angular-decorator-property-order` |
44
+ | Routing views use `-view` / `ViewComponent` | `ethlete/enforce-routing-view-naming` |
45
+ | No direct browser globals, DOM queries, native observers, or cookies | `no-restricted-globals`, `ethlete/no-direct-dom-manipulation`, `ethlete/no-dom-query`, `ethlete/no-native-observers`, `ethlete/no-document-cookie` |
46
+ | No barrel imports | `no-restricted-syntax` |
47
+ | Prefer the SDK wrappers for platform utilities | `ethlete/prefer-clone-equal`, `ethlete/prefer-rxjs-timer`, `ethlete/prefer-match-media`, `ethlete/prefer-viewport-size`, `ethlete/no-angular-seo-services`, `ethlete/no-locale-id`, `ethlete/no-angular-router-api` |
48
+
49
+ Judgment still belongs outside lint: name things after their behavior, use an object
50
+ parameter after two positional parameters, expose injected members directly instead of
51
+ aliasing them, and use `/** @internal */` only on technically public library API that
52
+ must be stripped from declarations.
@@ -0,0 +1,25 @@
1
+ # Storybook structure
2
+
3
+ Read this file when placing a `*.stories.ts` file or code used only to render stories.
4
+
5
+ - Keep the `*.stories.ts` file beside the component it documents.
6
+ - Put private host components, dummy data, and story-only helpers in `storybook/`.
7
+ - Never export Storybook-only code from the component's public barrel.
8
+ - A private `storybook/index.ts` may simplify imports into the adjacent story, but no
9
+ production source may import it.
10
+
11
+ ```plaintext
12
+ settings-form/
13
+ ├── storybook/
14
+ │ ├── settings-form-storybook.component.ts
15
+ │ ├── settings-form-storybook.component.html
16
+ │ ├── settings-form-dummy-data.ts
17
+ │ └── index.ts
18
+ ├── settings-form.component.ts
19
+ ├── settings-form.component.html
20
+ ├── settings-form.component.stories.ts
21
+ └── index.ts
22
+ ```
23
+
24
+ The story file stays at the component root; only its private support code goes into
25
+ `storybook/`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: theming
3
- description: The two runtime theming systems in @ethlete/core - surface theming (elevation-aware neutrals) and color theming (semantic accent palettes). Read BEFORE writing or reviewing CSS involving color, background, border, or interaction state, and when wiring theme context across overlay/portal boundaries.
3
+ description: The surface and color theming systems in @ethlete/core. Read BEFORE writing or reviewing CSS involving color, background, border or interaction state, or wiring theme context across overlays/portals.
4
4
  kind: skill
5
5
  scope: consumer
6
6
  requires: ['@ethlete/core']
@@ -13,11 +13,11 @@ vars: [docsBaseUrl]
13
13
  Two **independent** systems in `@ethlete/core`; most components consume both:
14
14
 
15
15
  - **Surface theming** - the neutral, elevation-aware colors of the box a component
16
- sits on: background, text, muted/subtle text, borders, and a neutral
17
- "interaction" color for hover/active tints. Set via `[etProvideSurface]`.
18
- - **Color theming** - semantic accent palettes (brand/primary, success, warning,
19
- error): a primary color, an on-primary contrast color, and an "ink" color for
20
- text/borders on transparent fills. Set via `[etProvideColor]`.
16
+ sits on: background, text, muted/subtle text, borders, and a neutral tint
17
+ for hover/pressed states. Set via `[etProvideSurface]` / `[etAutoSurface]`.
18
+ - **Color theming (tones)** - semantic accent palettes (brand, success,
19
+ warning, error): a fill, the text on that fill, and the tone as text or
20
+ border on the surface (`--et-tone-*`). Set via `[etProvideColor]`.
21
21
 
22
22
  Full reference: {%docsBaseUrl%}/core/theming.
23
23
 
@@ -37,74 +37,101 @@ The generated CSS defines the raw vars on `.et-surface--<name>` / `.et-color--<n
37
37
  classes (plus `:root` defaults) and derives the public tokens below on `:root` **and**
38
38
  every scope class - so the tokens are always resolvable and components just read them.
39
39
 
40
- **Theme names are yours.** `brand`, `danger`, `neutral`, `dark-elevated` are only
41
- examples. Never hardcode a theme-name union in a component type, a doc or an example.
42
- The portable handle is the theme **`type`**: `injectErrorTheme()` finds whichever theme
43
- the app registered with `type: 'error'`.
40
+ **Theme names are yours.** Never hardcode them as an SDK-defined union or reusable API
41
+ contract. App-specific docs may name their own themes when they label them as app values.
42
+ The portable handle is the theme **`type`**: `injectSemanticColorTheme('error')` finds
43
+ whichever theme the app registered with `type: 'error'`.
44
44
 
45
45
  ## Tokens components may consume
46
46
 
47
- Use these **derived** tokens - never the raw `--et-surface-background` /
48
- `--et-color-primary` channel triplets, and never a hardcoded color (a static fallback
49
- _after_ the token is fine).
47
+ Use these tokens - each is a ready color, never a channel triplet. Never use a hardcoded color as the primary value.
48
+ A static fallback inside `var(--token, <fallback>)` is permitted, but not required.
50
49
 
51
- Surface (each exists as `-solid` = usable color, `-rgb` = `R G B` channels):
50
+ Surface:
52
51
 
53
- | Token | Use for |
54
- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
55
- | `--et-surface-background-solid` | component/panel background |
56
- | `--et-surface-color-solid` | text |
57
- | `--et-surface-color-muted-solid` | secondary text, placeholders, group labels |
58
- | `--et-surface-color-subtle-solid` | tertiary text |
59
- | `--et-surface-border-solid` | borders, separators |
60
- | `--et-surface-interaction-solid` | neutral hover/active tint source - mix it: `color-mix(in srgb, var(--et-surface-interaction-solid) 12%, transparent)` (12/16/20% for hover/focus/active, 6–8% for subtle fills) |
52
+ | Token | Use for |
53
+ | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
54
+ | `--et-surface-background` | component/panel background |
55
+ | `--et-surface-text` | text |
56
+ | `--et-surface-text-muted` | secondary text, placeholders, group labels |
57
+ | `--et-surface-text-subtle` | tertiary text |
58
+ | `--et-surface-border` | borders, separators |
59
+ | `--et-surface-tint` | neutral hover/pressed tint source (set by the theme's `tint`, emitted only then) - always mix it with the surface-text fallback: `color-mix(in srgb, var(--et-surface-tint, var(--et-surface-text, gray)) 12%, transparent)`; `--et-surface-control-text[-<state>]` is the text of a neutral control, never a background |
61
60
 
62
61
  Color (from the nearest `[etProvideColor]` scope):
63
62
 
64
- | Token | Use for |
65
- | -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
66
- | `--et-theme-color-primary` | filled backgrounds; **opacity-aware** - set `--et-theme-color-primary-opacity: 0.16` etc. per state to tint without changing the color |
67
- | `--et-theme-color-primary-solid` | accents at full strength: focus borders, selected marks, spinners |
68
- | `--et-theme-color-on-primary` | text/icons on a primary-filled background |
69
- | `--et-theme-color-ink-solid` | primary-tinted text/border on transparent/tonal fills |
63
+ | Token | Use for |
64
+ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
65
+ | `--et-tone-fill` | filled backgrounds and accents at full strength: focus borders, selected marks, spinners. To tint per state, compose it yourself: `color-mix(in srgb, var(--et-tone-fill) calc(var(--_et-tone-fill-opacity, 1) * 100%), transparent)` |
66
+ | `--et-tone-on-fill` | text/icons on a filled background |
67
+ | `--et-tone-text` | the tone as text/border on transparent/tonal fills |
70
68
 
71
- Interaction-state variants (`--et-surface-interaction-{hover,focus,active,disabled}-solid`)
72
- resolve automatically per CSS state when the element has `[etSurfaceInteractive]`;
73
- similarly `[etColorInteractive]` re-resolves the color tokens per state. Put either on
74
- the interactive element itself, never on a wrapper.
69
+ `[etColorInteractive]` re-resolves the color tokens per CSS state. Put it on the
70
+ interactive element itself, never on a wrapper. Neutral hover and pressed feedback mixes
71
+ `--et-surface-tint` per state at the consumer; `etSurfaceInteractive` is removed.
72
+
73
+ **Never use `hover:bg-et-surface-control-text-hover` for a hover row.** The token is a
74
+ full-strength text colour, so in dark mode it gives a light row with near-white text. Mix
75
+ the tint instead: `hover:bg-et-surface-tint/9 active:bg-et-surface-tint/15`.
76
+
77
+ `--et-surface-next-background` / `bg-et-surface-next-background` is the background of the next
78
+ level (the tint mixed over the background on the topmost level): use it for a "hover = next
79
+ level" row instead of a tint.
75
80
 
76
81
  ## Providing context
77
82
 
78
- - `[etProvideSurface]="'dark-elevated'"` / `[etAutoSurface]` (auto-picks the next
79
- elevation) set the surface scope; `[etProvideColor]="'brand'"` sets the color scope.
83
+ - `[etProvideSurface]="surfaceThemeName"` / `[etAutoSurface]` (auto-picks the next
84
+ elevation) set the surface scope; `[etProvideColor]="colorThemeName"` sets the color scope.
80
85
  A component that owns a themed region usually adds `ProvideColorDirective` /
81
86
  `ProvideSurfaceDirective` as `hostDirectives`.
82
87
  - **Detached overlay panes (menu, dialog, tooltip…) do not inherit DOM context.**
83
88
  Re-apply it: inject `COLOR_PROVIDER` / `SURFACE_PROVIDER` with
84
89
  `{ optional: true, skipSelf: true }`, then `ownProvider.syncWithProvider(ctx)` for
85
- color and `resolveSurfaceByElevation(themes, type, elevation + 1)` for the surface.
90
+ color, and re-apply the surface one elevation above the trigger's for the surface.
86
91
  - **Semantic colors come through DI, not CSS.** There is no global "error color"
87
92
  variable - error/warning/success are just color themes. To render something in the
88
- error color, `injectErrorTheme()` (it throws if the app registered no `type: 'error'`
89
- theme) and either bind it (`[etProvideColor]="errorColorTheme"`) or force it
90
- programmatically (`provideColor.forceColor(theme)` / `clearForcedColor()`). Inside
91
- that scope, `--et-theme-color-primary-*` _is_ the error color.
93
+ error color, `injectSemanticColorTheme('error')` (reading it throws if the app
94
+ registered no `type: 'error'` theme) and either bind it
95
+ (`[etProvideColor]="errorColorTheme()"`) or force it programmatically
96
+ (`provideColor.forceColor(theme)` / `clearForcedColor()`). Inside that scope,
97
+ `--et-tone-*` _is_ the error color.
98
+ - **A surface swaps a chosen accent; it never picks one.** The chosen accent is the
99
+ nearest `[etProvideColor]`, else the `isDefault` theme, or for
100
+ `injectSemanticColorTheme(type)` the theme of that `type`. The nearest surface's
101
+ `SurfaceTheme.colorThemeVariants` (e.g. `{ brand: 'brand-on-light', success: 'success-on-light' }`,
102
+ variants registered without a `type`) swaps it; an accent without an entry stays the
103
+ same on every surface. With no surface above, the root surface swaps, and
104
+ `provideColorScheme()` paints its swap of the default accent on `<html>`. A neutral that follows the surface is `color="surface"`
105
+ (`controlText`), not a variant. Never add per-surface logic to a color theme or new
106
+ CSS vars for it.
92
107
 
93
108
  ## Pitfalls
94
109
 
110
+ - A surface theme may have `elevation: -1` (a literal unary minus); the generator fails on a theme it cannot
111
+ parse. Filled form fields, table card rows and grid items resolve `parent.elevation + 1`; toasts and
112
+ `@ethlete/cdk` overlays with a backdrop always resolve elevation 1 (without a backdrop, `parent + 1`), and the
113
+ overlay scope class goes from `et-surface--inherited` to `et-surface--<theme>`. `@ethlete/cdk` CSS reads no
114
+ `--et-surface-*` token, so `etProvideSurface` on a cdk host does nothing.
95
115
  - `@property` `initial-value` cannot contain `var()`, so a public `--et-*` token
96
116
  declared via `@property` can never default to a theme token. If the default should
97
117
  come from the theme, don't declare an `@property` - consume the theme token directly
98
118
  (optionally behind a `--_et-*` indirection var).
99
- - `--et-theme-color-primary-*` always resolves to the **nearest color scope**. A
119
+ - `@property` `initial-value` also cannot use a **font-relative or container unit**
120
+ (`em`, `rem`, `ex`, `ch`, `lh`, `cap`, `ic`, `cq*`). The value must be computationally
121
+ independent, so the browser drops the whole rule and leaves the token unregistered -
122
+ with no error. Percentages and viewport units (`vh`, `vw`, `dvh`) are fine. When the
123
+ default has to be relative, use `syntax: '*'` with no `initial-value` and put the
124
+ default in a fallback at each use site: `var(--et-skeleton-size, 1em)`.
125
+ - `--et-tone-*` always resolves to the **nearest color scope**. A
100
126
  hardcoded semantic color in CSS can't be replaced by it unless the right theme is
101
127
  provided on that element.
102
- - Keep a static fallback (`var(--et-surface-border-solid, rgb(255 255 255 / 0.1))`) so
103
- components degrade in theme-less setups. `injectErrorTheme()` is the exception: it is
104
- a hard requirement wherever it is used.
105
- - **Cascade layers, not `:where()`, are what let a Tailwind utility override component
106
- CSS.** Wrap every component CSS file in `@layer components { … }`; `:where()` only
107
- flattens a component's own modifiers to single-class weight. See the `styling` rule.
108
-
109
- Styling a **story** file rather than a component? The colour rule is the same, but the
110
- Tailwind side has its own traps - {%skill:story-styling%}.
128
+ - A static fallback (`var(--et-surface-border, rgb(255 255 255 / 0.1))`) is
129
+ permitted for theme-less setups, but themes make it unnecessary. `injectSemanticColorTheme()`
130
+ is a hard requirement wherever it is read.
131
+ - **Cascade layers, not `:where()`, decide who wins against SDK component CSS.** SDK
132
+ styles live in `@layer components.sdk`, nested in `components`, so an app rule in
133
+ `@layer components`, a utility, or unlayered app CSS overrides them. See the
134
+ `app-styling` rule.
135
+
136
+ Styling a **story** file rather than a component? The colour rule is the same. Check the
137
+ repository's Storybook guidance before assuming a Tailwind utility exists.
@@ -0,0 +1,107 @@
1
+ ---
2
+ name: verify-in-app
3
+ description: Verify a UI change in the running app by driving it headlessly with Playwright - screenshots, computed styles, pointer and cursor state - and prove a fix with a test that fails without it. Use whenever you change a view, a component or its styles and need to confirm what renders, not just that it compiles.
4
+ kind: skill
5
+ scope: consumer
6
+ ---
7
+
8
+ # Verify a UI change in the running app
9
+
10
+ A build that passes says nothing about what the user sees. Serve the app, drive the real page in
11
+ a headless browser, and assert on the rendered DOM and computed styles.
12
+
13
+ ## 1. Serve the app
14
+
15
+ It may already be running. Check before starting a second instance - the dev server prompts for
16
+ another port and hangs:
17
+
18
+ ```bash
19
+ curl -s -o /dev/null -w "%{http_code}" http://localhost:4200/
20
+ ```
21
+
22
+ - `200` → it is up.
23
+ - anything else → start it in the background and poll the curl above until it answers (a cold
24
+ build can take a minute):
25
+
26
+ ```bash
27
+ npx nx serve <app>
28
+ ```
29
+
30
+ The port and any proxy config live in the app's `project.json` `serve` target. A view behind a
31
+ login needs a session: log in once through the form in the script, or seed the token storage the
32
+ app reads before `page.goto`.
33
+
34
+ ## 2. Drive it with Playwright
35
+
36
+ Use the `playwright` package from the repo's `node_modules`. Write the script in a scratch
37
+ directory outside the repo and run it with `node`:
38
+
39
+ ```js
40
+ import { createRequire } from 'node:module';
41
+
42
+ const require = createRequire(`${process.cwd()}/`);
43
+ const { chromium } = require('playwright');
44
+
45
+ const browser = await chromium.launch();
46
+ const page = await browser.newPage({ viewport: { width: 1280, height: 900 } });
47
+
48
+ await page.goto('http://localhost:4200/players?search=mul', { waitUntil: 'domcontentloaded' });
49
+ await page.waitForSelector('.players-table', { state: 'attached' });
50
+
51
+ const state = await page.$eval('.players-table', (el) => {
52
+ const cs = getComputedStyle(el);
53
+ return { display: cs.display, color: cs.color, rows: el.querySelectorAll('tr').length };
54
+ });
55
+ console.log(JSON.stringify(state));
56
+
57
+ await page.screenshot({ path: '/tmp/players.png', fullPage: true });
58
+ await browser.close();
59
+ ```
60
+
61
+ Then read the screenshot back and look at it.
62
+
63
+ - **`playwright` is CommonJS** - resolve it with `createRequire`; a named ESM import fails.
64
+ - **`waitUntil: 'domcontentloaded'`, never `networkidle`** - the dev server's live-reload socket
65
+ and any polling query keep the network busy forever.
66
+ - **`waitForSelector` waits for visible by default.** Pass `{ state: 'attached' }` for anything
67
+ correctly hidden (`opacity: 0`, collapsed, `inert`).
68
+ - **Overlays render at the end of `<body>`,** not inside the view that opened them. Query them from
69
+ `page`, not from the view's element.
70
+ - After a click that starts a transition, wait out its duration before reading final styles.
71
+
72
+ ## 3. Pointer and cursor state
73
+
74
+ `getComputedStyle(el).cursor` reports what the stylesheet says, not what the pointer gets - an
75
+ overlay, a backdrop or `pointer-events: none` in between changes the answer. Ask the page which
76
+ element is under the point instead:
77
+
78
+ ```js
79
+ const hit = await page.evaluate(
80
+ ([x, y]) => {
81
+ const el = document.elementFromPoint(x, y);
82
+ return el && { tag: el.tagName, class: el.className, cursor: getComputedStyle(el).cursor };
83
+ },
84
+ [640, 300],
85
+ );
86
+ ```
87
+
88
+ `elementFromPoint` returns `null` outside the viewport, so use a viewport tall enough for the
89
+ point, or scroll the target into view first. Hover with `page.mouse.move(x, y)` before reading
90
+ `:hover` styles.
91
+
92
+ ## 4. Prove a fix with a test that bites
93
+
94
+ A screenshot shows the fix once; a test keeps it. For a bug fix, write the spec (a unit spec for
95
+ logic, or a Playwright e2e spec where the app has one), then:
96
+
97
+ 1. run it against the fix - it passes;
98
+ 2. revert the fix (stash it, or comment the one line out) and run it again - it **must fail**;
99
+ 3. restore the fix.
100
+
101
+ A test that passes both ways asserts on the wrong thing. Fix the test before you call the change
102
+ done.
103
+
104
+ ## 5. Report
105
+
106
+ Say what you drove (URL, clicks, viewport) and what you observed, with the numbers you read. Keep
107
+ the script and screenshots in the scratch directory, not the repo.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: verify-in-storybook
3
- description: Visually/behaviorally verify a component change by driving its Storybook story headlessly with Playwright. Use whenever you change a UI component and need to confirm the rendered DOM, computed styles, animations, or interactions actually work - not just that it compiles.
3
+ description: Verify a component change by driving its Storybook story headlessly with Playwright. Use whenever you change a UI component and must confirm rendered DOM, computed styles, animations or interactions.
4
4
  kind: skill
5
5
  scope: consumer
6
6
  vars: [storybookUrl, storybookStartCommand]
@@ -0,0 +1,100 @@
1
+ ---
2
+ name: verify-on-apple-devices
3
+ description: Drive a Mac's iOS Simulator over SSH to verify any reachable URL in Mobile Safari. Also supports WebDriver checks on a paired iPad.
4
+ kind: skill
5
+ scope: both
6
+ modelInvocation: false
7
+ ---
8
+
9
+ # Verify a URL on Apple devices
10
+
11
+ After syncing agent-rules, invoke `/ethlete-verify-on-apple-devices` when you need to verify behavior in iOS Safari.
12
+ Run {%resource:apple-remote.sh%} with Bash. In the examples below, `<skill-dir>` is the directory containing this file.
13
+
14
+ ```bash
15
+ bash <skill-dir>/apple-remote.sh detect
16
+ bash <skill-dir>/apple-remote.sh sim-open https://example.com
17
+ bash <skill-dir>/apple-remote.sh sim-shot safari.png
18
+ ```
19
+
20
+ ## Setup
21
+
22
+ - Enable Remote Login on the Mac and authorize your SSH key for non-interactive login.
23
+ The script uses the SSH host alias `ethlete-mac` by default. Set `ETHLETE_MAC_HOST` to use another alias or hostname.
24
+ - Install Xcode and an iOS Simulator runtime on the Mac. The default simulator is `iPhone 16`.
25
+ Pass a different device name as the second argument to `sim-open` if needed.
26
+ - The Mac and simulator must be able to reach the page. For a local app, bind the dev server to
27
+ `0.0.0.0` and use the dev machine's LAN address and port, for example `http://192.168.1.20:4200/`.
28
+ You can also use a staging URL reachable from the Mac. `localhost` in Simulator Safari refers
29
+ to the Mac. The simulator commands open the supplied URL directly.
30
+ - For taps, coordinate swipes and typing, install idb on the Mac. Run
31
+ `brew trust facebook/fb && brew install idb-companion` and install the Python CLI with
32
+ `pip3 install --user fb-idb`. The script expects the CLI under `~/Library/Python/*/bin/idb`.
33
+ - For WebDriver commands, run `safaridriver --enable` on the Mac. For a real iPad, pair it with the Mac
34
+ over USB and enable Web Inspector and Remote Automation under Settings → Apps → Safari → Advanced.
35
+
36
+ Checks run on iOS 26 only; do not install or select an older runtime. Use Xcode 26 with an iOS 26 runtime to verify Safari 26 behavior such as toolbar tinting.
37
+ Pick the Xcode and the runtime per call with `SIM_DEVELOPER_DIR` (the Xcode's `Contents/Developer` path, passed
38
+ to every remote `xcrun`, `simctl` and `open`) and `SIM_RUNTIME` (for example `iOS-26-3`). When the runtime has no
39
+ device of the requested name, `sim-open` creates one. Without them the Mac's selected Xcode and the newest runtime
40
+ are used. Never switch the Mac's Xcode with `xcode-select -s`. Record the runtime used in the verification report.
41
+ [Apple's Xcode simulator requirements](https://developer.apple.com/xcode/system-requirements)
42
+ and [WebKit issue 301756](https://bugs.webkit.org/show_bug.cgi?id=301756) cover the version requirements and tinting behavior.
43
+
44
+ ## Simulator commands
45
+
46
+ | Command | Behavior |
47
+ | ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
48
+ | `detect` | Check SSH, available iPhone simulators and paired Apple devices. |
49
+ | `sim-open <url> [device]` | Boot the requested device if needed and open the URL in Safari. Quote URLs containing shell characters. |
50
+ | `sim-shot [file]` | Capture the full display, including Safari chrome and the keyboard. Defaults to `sim.png` in the working directory. Waits first until Safari stops loading (`SIM_LOAD_TIMEOUT`, default 30 s). |
51
+ | `sim-swipe edge-back` | Send a left-edge touch gesture in portrait. Visit two pages in the same Safari tab before testing back navigation. |
52
+ | `sim-swipe <x1> <y1> <x2> <y2> [duration]` | Swipe using device points. Duration is in seconds and defaults to 0.3. |
53
+ | `sim-tap <x> <y>` | Tap at device coordinates. Divide screenshot pixels by the display scale, typically 3 on iPhone 16. |
54
+ | `sim-type <text>` | Type into a focused field via idb. iOS autocorrect and capitalization apply. |
55
+ | `sim-keyboard on\|off [device]` | Detach or attach the hardware keyboard preference. Reopen the page afterward. |
56
+ | `sim-keyboard-reset [device]` | Restart Simulator.app and boot the device to restore the soft keys after `sim-type`. |
57
+ | `sim-stop` | Shut down the device selected by `sim-open` or `sim-probe` at the end of the session. |
58
+
59
+ A cold boot can take about a minute. If a command stalls, check the exact SSH or
60
+ Simulator error and whether Simulator.app is running. Simulator.app provides the UI that
61
+ `sim-shot` captures. Keep the device booted between verification rounds.
62
+
63
+ `sim-swipe edge-back` compiles {%resource:sim-edge-back.m%} with the selected Xcode on the Mac.
64
+ The helper sends an edge-tagged SimulatorKit touch directly to the selected device, so the Simulator
65
+ window can stay in the background. Verified with Xcode 26.3 and iOS 26.3. When running parallel sessions,
66
+ use a separate simulator and a separate existing `TMPDIR` on the machine running the script for each session.
67
+
68
+ ## Optional Storybook commands
69
+
70
+ Run `detect --storybook [url]` to also probe Storybook from the Mac. With no URL, the default is
71
+ the dev machine's LAN IP on port 4400. Set `ETHLETE_STORYBOOK_URL` to use a different reachable
72
+ Storybook base URL and include that probe whenever you run `detect`. Plain `detect` skips the
73
+ probe when the variable is unset.
74
+
75
+ `sim-open <story-id>` and `ipad-open <story-id>` still open the Storybook iframe.
76
+ `sim-probe <story-id> [device]` opens the viewport HUD when the Storybook instance serves
77
+ `/assets/viewport-probe.html`. Use `sim-tap` and `sim-shot` to read live viewport metrics
78
+ while the keyboard is open. The HUD disables focus zoom, so open the page directly to
79
+ check zoom on small inputs.
80
+
81
+ ## WebDriver commands
82
+
83
+ | Command | Behavior |
84
+ | --------------------------- | ----------------------------------------------------------------------------------------- |
85
+ | `ipad-start [sim]` | Start Safari WebDriver on the paired iPad or, with `sim`, on an already booted simulator. |
86
+ | `ipad-open <url>` | Navigate the session to a reachable URL. |
87
+ | `ipad-js <script>` | Run JavaScript in the page. Use `return` to read a value. |
88
+ | `ipad-viewport` | Read viewport units, safe-area insets, visual viewport and estimated keyboard state. |
89
+ | `ipad-tap <css>` | Click an element through WebDriver. |
90
+ | `ipad-type <css> <text>` | Call WebDriver send-keys. Safari on iOS may leave the field empty. |
91
+ | `ipad-shot <out.png> [css]` | Capture an element, defaulting to `html`. |
92
+ | `ipad-end` | End the session and close the WebDriver tunnel. |
93
+
94
+ `ipad-start` opens a blank Safari page. Follow it with `ipad-open`. Safari chrome turns
95
+ orange while WebDriver is active. End the session before using idb taps or swipes since
96
+ real input interrupts active automation. If Safari reports that it is already paired
97
+ with another WebDriver session, try `ipad-open` with the stored session first.
98
+
99
+ When reporting a result, include the device, iOS version, URL, interaction and observed
100
+ behavior. Save the screenshot alongside the report.