@ethlete/agent-rules 0.1.0-next.4 → 0.1.0-next.41

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 (229) hide show
  1. package/AGENTS.md +28 -0
  2. package/CHANGELOG.md +627 -0
  3. package/CLAUDE.md +1 -0
  4. package/README.md +406 -29
  5. package/THIRD-PARTY-LICENSES.md +35 -0
  6. package/content/defaults.json +1 -1
  7. package/content/git-hooks/post-checkout.sh +10 -0
  8. package/content/git-hooks/pre-push.sh +5 -0
  9. package/content/hooks/away-mode.py +287 -0
  10. package/content/hooks/background-design-commands.py +215 -0
  11. package/content/hooks/builder-chat-words.py +269 -0
  12. package/content/hooks/context-warning.py +836 -142
  13. package/content/hooks/git-safety.py +213 -0
  14. package/content/hooks/subagent-model-policy.py +261 -0
  15. package/content/mods/.claude-plugin/marketplace.json +16 -0
  16. package/content/mods/plugins/e2e-progress/.claude-plugin/plugin.json +6 -0
  17. package/content/mods/plugins/e2e-progress/hooks/hooks.json +1 -0
  18. package/content/mods/plugins/e2e-progress/hooks/register.tsx +442 -0
  19. package/content/mods/plugins/e2e-progress/tsconfig.json +3 -0
  20. package/content/mods/plugins/e2e-progress/types/index.d.ts +23 -0
  21. package/content/mods/plugins/status-line/.claude-plugin/plugin.json +6 -0
  22. package/content/mods/plugins/status-line/hooks/hooks.json +1 -0
  23. package/content/mods/plugins/status-line/hooks/line.ts +73 -0
  24. package/content/mods/plugins/status-line/hooks/register.tsx +141 -0
  25. package/content/mods/plugins/status-line/types/index.d.ts +5 -0
  26. package/content/output-styles/ste-clarity.md +131 -0
  27. package/content/rules/agent-sessions-wake-up.md +11 -0
  28. package/content/rules/app-styling.md +66 -0
  29. package/content/rules/comments.md +4 -1
  30. package/content/rules/lint-and-format.md +7 -5
  31. package/content/rules/nx-layout.md +53 -0
  32. package/content/rules/reactive-state.md +1 -1
  33. package/content/rules/styling.md +19 -10
  34. package/content/rules/subagent-models.md +42 -0
  35. package/content/skills/agent-sessions/SKILL.md +94 -0
  36. package/content/skills/agent-sessions/agent-sessions.mjs +1125 -0
  37. package/content/skills/angular-patterns/SKILL.md +31 -7
  38. package/content/skills/api-source/SKILL.md +156 -0
  39. package/content/skills/app-testing/SKILL.md +141 -0
  40. package/content/skills/codex-subagent/SKILL.md +90 -0
  41. package/content/skills/codex-subagent/codex-agent.mjs +229 -0
  42. package/content/skills/design-exploration/SKILL.md +190 -0
  43. package/content/skills/design-exploration/check-story.mjs +139 -0
  44. package/content/skills/design-exploration/reference-check-and-notes.md +92 -0
  45. package/content/skills/design-exploration/reference-flows-and-wireframes.md +78 -0
  46. package/content/skills/design-exploration/reference-inbox-and-mcp.md +54 -0
  47. package/content/skills/design-exploration/reference-order-and-design-system.md +124 -0
  48. package/content/skills/design-exploration/reference-products-and-sketches.md +211 -0
  49. package/content/skills/design-exploration/reference-shots.md +25 -0
  50. package/content/skills/design-exploration/shoot-template.mjs +61 -0
  51. package/content/skills/domain-modeling/ADR-FORMAT.md +47 -0
  52. package/content/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  53. package/content/skills/domain-modeling/SKILL.md +80 -0
  54. package/content/skills/e2e-triage/SKILL.md +80 -0
  55. package/content/skills/figma-export/SKILL.md +191 -0
  56. package/content/skills/figma-export/dump-figma-layers.py +83 -0
  57. package/content/skills/figma-export/dump-figma-svg.py +235 -0
  58. package/content/skills/figma-export/measure-template.mjs +87 -0
  59. package/content/skills/git-commit/SKILL.md +21 -7
  60. package/content/skills/git-flow/SKILL.md +87 -0
  61. package/content/skills/grill-with-docs/SKILL.md +13 -0
  62. package/content/skills/grilling/SKILL.md +52 -0
  63. package/content/skills/handoff/SKILL.md +29 -69
  64. package/content/skills/handoff/save.md +187 -0
  65. package/content/skills/query/SKILL.md +165 -64
  66. package/content/skills/report/SKILL.md +26 -0
  67. package/content/skills/rxjs-signals/SKILL.md +33 -4
  68. package/content/skills/sdk-docs/SKILL.md +50 -14
  69. package/content/skills/sdk-local-build/SKILL.md +26 -8
  70. package/content/skills/sdk-local-build/sdk-local-baseline.mjs +64 -0
  71. package/content/skills/sdk-source/SKILL.md +37 -34
  72. package/content/skills/sdk-update/SKILL.md +103 -0
  73. package/content/skills/story-styling/SKILL.md +10 -8
  74. package/content/skills/styleguide/SKILL.md +13 -8
  75. package/content/skills/styleguide/assets.md +54 -0
  76. package/content/skills/styleguide/changesets.md +17 -0
  77. package/content/skills/styleguide/file-structure.md +73 -0
  78. package/content/skills/styleguide/lint-rule-lookup.md +52 -0
  79. package/content/skills/styleguide/storybook-structure.md +25 -0
  80. package/content/skills/theming/SKILL.md +56 -28
  81. package/content/skills/timetrack/SKILL.md +324 -0
  82. package/content/skills/verify-in-app/SKILL.md +107 -0
  83. package/content/skills/verify-in-storybook/SKILL.md +1 -1
  84. package/migrations/list-state-query-form.md +20 -0
  85. package/migrations/nx-layout.md +29 -0
  86. package/migrations/sdk-components-over-hand-built-ui.md +27 -0
  87. package/migrations/search-query-field.md +52 -0
  88. package/migrations.json +39 -0
  89. package/package.json +19 -3
  90. package/src/index.js +99 -32
  91. package/src/index.js.map +1 -1
  92. package/src/lib/cli-args.d.ts +9 -0
  93. package/src/lib/cli-args.js +48 -0
  94. package/src/lib/cli-args.js.map +1 -0
  95. package/src/lib/commitlint.d.ts +10 -0
  96. package/src/lib/commitlint.js +51 -0
  97. package/src/lib/commitlint.js.map +1 -0
  98. package/src/lib/config.d.ts +51 -6
  99. package/src/lib/config.js +127 -10
  100. package/src/lib/config.js.map +1 -1
  101. package/src/lib/filter.d.ts +2 -0
  102. package/src/lib/filter.js +4 -4
  103. package/src/lib/filter.js.map +1 -1
  104. package/src/lib/frontmatter.d.ts +2 -0
  105. package/src/lib/frontmatter.js +33 -5
  106. package/src/lib/frontmatter.js.map +1 -1
  107. package/src/lib/git-flow/build.d.ts +35 -0
  108. package/src/lib/git-flow/build.js +24 -0
  109. package/src/lib/git-flow/build.js.map +1 -0
  110. package/src/lib/git-flow/config.d.ts +59 -0
  111. package/src/lib/git-flow/config.js +50 -0
  112. package/src/lib/git-flow/config.js.map +1 -0
  113. package/src/lib/git-flow/index.d.ts +6 -0
  114. package/src/lib/git-flow/index.js +23 -0
  115. package/src/lib/git-flow/index.js.map +1 -0
  116. package/src/lib/git-flow/parse.d.ts +49 -0
  117. package/src/lib/git-flow/parse.js +300 -0
  118. package/src/lib/git-flow/parse.js.map +1 -0
  119. package/src/lib/git-flow/rename.d.ts +24 -0
  120. package/src/lib/git-flow/rename.js +70 -0
  121. package/src/lib/git-flow/rename.js.map +1 -0
  122. package/src/lib/git-flow/start.d.ts +49 -0
  123. package/src/lib/git-flow/start.js +57 -0
  124. package/src/lib/git-flow/start.js.map +1 -0
  125. package/src/lib/git-flow/validate.d.ts +34 -0
  126. package/src/lib/git-flow/validate.js +72 -0
  127. package/src/lib/git-flow/validate.js.map +1 -0
  128. package/src/lib/git-flow-command.d.ts +4 -0
  129. package/src/lib/git-flow-command.js +165 -0
  130. package/src/lib/git-flow-command.js.map +1 -0
  131. package/src/lib/git-flow-repair.d.ts +17 -0
  132. package/src/lib/git-flow-repair.js +165 -0
  133. package/src/lib/git-flow-repair.js.map +1 -0
  134. package/src/lib/git-flow-start.d.ts +20 -0
  135. package/src/lib/git-flow-start.js +140 -0
  136. package/src/lib/git-flow-start.js.map +1 -0
  137. package/src/lib/git-test-env.fixtures.d.ts +11 -0
  138. package/src/lib/git-test-env.fixtures.js +31 -0
  139. package/src/lib/git-test-env.fixtures.js.map +1 -0
  140. package/src/lib/git.d.ts +64 -0
  141. package/src/lib/git.js +131 -0
  142. package/src/lib/git.js.map +1 -0
  143. package/src/lib/gitlab.d.ts +35 -0
  144. package/src/lib/gitlab.js +116 -0
  145. package/src/lib/gitlab.js.map +1 -0
  146. package/src/lib/index.d.ts +2 -0
  147. package/src/lib/index.js +26 -11
  148. package/src/lib/index.js.map +1 -1
  149. package/src/lib/migrate.js +8 -2
  150. package/src/lib/migrate.js.map +1 -1
  151. package/src/lib/output-style-command.d.ts +3 -0
  152. package/src/lib/output-style-command.js +69 -0
  153. package/src/lib/output-style-command.js.map +1 -0
  154. package/src/lib/output-style.d.ts +38 -0
  155. package/src/lib/output-style.js +134 -0
  156. package/src/lib/output-style.js.map +1 -0
  157. package/src/lib/owned-paths.js +27 -3
  158. package/src/lib/owned-paths.js.map +1 -1
  159. package/src/lib/package-runner.d.ts +4 -0
  160. package/src/lib/package-runner.js +86 -0
  161. package/src/lib/package-runner.js.map +1 -0
  162. package/src/lib/peer-path.d.ts +12 -0
  163. package/src/lib/peer-path.js +39 -0
  164. package/src/lib/peer-path.js.map +1 -0
  165. package/src/lib/plain-text.d.ts +9 -0
  166. package/src/lib/plain-text.js +22 -0
  167. package/src/lib/plain-text.js.map +1 -0
  168. package/src/lib/plan.d.ts +6 -6
  169. package/src/lib/plan.js +168 -40
  170. package/src/lib/plan.js.map +1 -1
  171. package/src/lib/prettier.d.ts +21 -0
  172. package/src/lib/prettier.js +51 -0
  173. package/src/lib/prettier.js.map +1 -0
  174. package/src/lib/prompt.d.ts +8 -0
  175. package/src/lib/prompt.js +35 -0
  176. package/src/lib/prompt.js.map +1 -0
  177. package/src/lib/render.d.ts +26 -2
  178. package/src/lib/render.js +45 -10
  179. package/src/lib/render.js.map +1 -1
  180. package/src/lib/report-command.d.ts +33 -0
  181. package/src/lib/report-command.js +312 -0
  182. package/src/lib/report-command.js.map +1 -0
  183. package/src/lib/sessions-command.d.ts +4 -0
  184. package/src/lib/sessions-command.js +16 -0
  185. package/src/lib/sessions-command.js.map +1 -0
  186. package/src/lib/sync.d.ts +1 -2
  187. package/src/lib/sync.js +37 -17
  188. package/src/lib/sync.js.map +1 -1
  189. package/src/lib/targets/agents-skills.js +1 -1
  190. package/src/lib/targets/agents-skills.js.map +1 -1
  191. package/src/lib/targets/claude-hooks.d.ts +3 -23
  192. package/src/lib/targets/claude-hooks.js +22 -86
  193. package/src/lib/targets/claude-hooks.js.map +1 -1
  194. package/src/lib/targets/claude-mods.d.ts +20 -0
  195. package/src/lib/targets/claude-mods.js +47 -0
  196. package/src/lib/targets/claude-mods.js.map +1 -0
  197. package/src/lib/targets/claude.js +2 -3
  198. package/src/lib/targets/claude.js.map +1 -1
  199. package/src/lib/targets/codex-hooks.d.ts +12 -0
  200. package/src/lib/targets/codex-hooks.js +35 -0
  201. package/src/lib/targets/codex-hooks.js.map +1 -0
  202. package/src/lib/targets/codex.js +4 -4
  203. package/src/lib/targets/codex.js.map +1 -1
  204. package/src/lib/targets/copilot.js +4 -4
  205. package/src/lib/targets/copilot.js.map +1 -1
  206. package/src/lib/targets/cursor.js +3 -3
  207. package/src/lib/targets/cursor.js.map +1 -1
  208. package/src/lib/targets/git-hooks.d.ts +25 -0
  209. package/src/lib/targets/git-hooks.js +71 -0
  210. package/src/lib/targets/git-hooks.js.map +1 -0
  211. package/src/lib/targets/hooks-shared.d.ts +60 -0
  212. package/src/lib/targets/hooks-shared.js +174 -0
  213. package/src/lib/targets/hooks-shared.js.map +1 -0
  214. package/src/lib/targets/mcp.d.ts +16 -0
  215. package/src/lib/targets/mcp.js +72 -0
  216. package/src/lib/targets/mcp.js.map +1 -0
  217. package/src/lib/targets/shared.d.ts +1 -9
  218. package/src/lib/targets/shared.js +4 -8
  219. package/src/lib/targets/shared.js.map +1 -1
  220. package/src/lib/timetrack-command.d.ts +11 -0
  221. package/src/lib/timetrack-command.js +1262 -0
  222. package/src/lib/timetrack-command.js.map +1 -0
  223. package/src/lib/timetrack-snapshot.d.ts +66 -0
  224. package/src/lib/timetrack-snapshot.js +146 -0
  225. package/src/lib/timetrack-snapshot.js.map +1 -0
  226. package/src/lib/timetrack.d.ts +607 -0
  227. package/src/lib/timetrack.js +285 -0
  228. package/src/lib/timetrack.js.map +1 -0
  229. package/content/skills/styleguide/STYLEGUIDE.md +0 -520
package/CLAUDE.md ADDED
@@ -0,0 +1 @@
1
+ @AGENTS.md
package/README.md CHANGED
@@ -15,6 +15,17 @@ npx ethlete-agents init # writes ethlete-agents.config.json
15
15
  npx ethlete-agents sync # writes the generated rules and skills
16
16
  ```
17
17
 
18
+ With Yarn 4.18+ and `npmMinimalAgeGate`, a freshly published release is blocked until it ages. Add
19
+ `npmPreapprovedPackages: ["@ethlete/*"]` to `.yarnrc.yml` to install new `@ethlete/*` versions right away.
20
+
21
+ `init` pre-fills `vars` with the lint, format and Storybook commands for your repo, using its package manager; check them before
22
+ the first sync. `sync`, `check`, `init` and `migrate` reject a flag they do not know and print the usage
23
+ instead of running, and a config file that does not parse is reported by name.
24
+
25
+ Adopting the rules in an existing app includes a styling audit: count the global CSS files,
26
+ classes and hardcoded colours that break the `app-styling` rule, tell the user the numbers, and
27
+ record the conversion as owed work.
28
+
18
29
  Commit the generated files, and add a drift check to CI:
19
30
 
20
31
  ```bash
@@ -38,6 +49,11 @@ Marker-block files (`AGENTS.md`, `.github/copilot-instructions.md`) are only rew
38
49
  between `<!-- ethlete:agent-rules:start -->` and `:end` - everything you wrote around
39
50
  them survives.
40
51
 
52
+ When the repo has `@ethlete/cli` installed, `sync` also registers its design MCP server
53
+ (`et design mcp` through the `packageRunner`, for example `yarn et design mcp`) as `ethlete-design`: in `.mcp.json` for Claude Code and in
54
+ `.codex/config.toml` for Codex. Only that entry is written; other servers and tables
55
+ stay as they are.
56
+
41
57
  ## Migrating a repo to the AGENTS.md layout
42
58
 
43
59
  `AGENTS.md` is the cross-tool standard, and Claude Code officially supports reading it
@@ -99,12 +115,26 @@ Prettier rewrites them and `check` then reports drift on every run:
99
115
  `.agents/skills/` is the cross-tool baseline) and adds `claude`, `cursor` or `copilot`
100
116
  when their directory exists; or list an explicit subset.
101
117
  - **`profile`** - `"consumer"` (default) emits `scope: consumer` and `scope: both`
102
- content. `"sdk"` emits only `both`; the SDK repo uses it so its own hand-written,
103
- authoring-side guides are not overwritten by the consumer-side versions.
118
+ content. `"sdk"` emits `scope: sdk` and `scope: both`; the SDK repo uses it so its own
119
+ hand-written, authoring-side guides are not overwritten by the consumer-side versions.
104
120
  - **`vars`** - values for the template tokens a guide declares. Defaults live in
105
121
  `content/defaults.json`; a guide whose variable has no default and no value is
106
- skipped with a warning rather than emitted with a dangling placeholder.
107
- - **`exclude`** - content names to skip entirely.
122
+ skipped with a warning rather than emitted with a dangling placeholder. Some are
123
+ derived from the repo instead of defaulted - the `gitFlow*` ones from the `gitFlow`
124
+ block, `packageRunner` (`yarn`, `pnpm exec`, `bunx` or `npx`) from the root
125
+ `package.json`'s `packageManager` or the lockfile, and `commitRuleSource` / `commitValidation` from whether a commitlint config
126
+ exists (`commitlint.config.*`, `.commitlintrc*`, or a `commitlint` key in
127
+ `package.json`). Without one, the git-commit guide presents the format as the repo's
128
+ convention and never mentions a `commitlint` run - an agent that goes looking for a
129
+ promised validator and finds nothing reports the discrepancy instead of just
130
+ committing. `lintCommand` / `lintFixCommand` run the repo's `lint` script, else
131
+ `nx lint <project>` when Nx is installed, and `storybookStartCommand` runs its `storybook`
132
+ script; `sync` warns when a lint var names a script `package.json` does not have. Setting
133
+ any derived var in `vars` overrides the detection.
134
+ - **`exclude`** - rule or skill names to skip entirely for every configured agent and
135
+ developer. For example, `"exclude": ["git-flow", "handoff"]` prevents those skills
136
+ from being generated; the next `sync` also removes copies generated previously. Unknown
137
+ names produce a warning so a typo cannot silently leave a skill enabled.
108
138
  - **`claudeMdImportsAgentsMd`** - set (usually by `migrate`) when `CLAUDE.md` is an
109
139
  `@AGENTS.md` import or symlink; the claude target then skips `.claude/rules/ethlete/`
110
140
  so the rules don't load twice. `sync` warns when the flag is set but the import is
@@ -113,56 +143,390 @@ Prettier rewrites them and `check` then reports drift on every run:
113
143
  Content that declares `requires` is only emitted when those packages are installed, so
114
144
  a repo without `@ethlete/query` never sees the query guide.
115
145
 
146
+ ## Git flow
147
+
148
+ The branch convention lives in the same config, as one machine-readable grammar that the
149
+ CLI, a git hook, a CI job and `@ethlete/timetrack` all read:
150
+
151
+ ```json
152
+ {
153
+ "gitFlow": {
154
+ "keyPrefixes": ["FIP"],
155
+ "baseBranches": { "development": "next", "production": "main" }
156
+ }
157
+ }
158
+ ```
159
+
160
+ ```bash
161
+ npx ethlete-agents git-flow start FIP-2177 # name it and branch off the right base
162
+ npx ethlete-agents git-flow check # the current branch
163
+ npx ethlete-agents git-flow check "$SOURCE" --target "$TARGET"
164
+ npx ethlete-agents git-flow check --all # adoption report
165
+ npx ethlete-agents git-flow repair dev-game-codes --key FIP-2900
166
+ npx ethlete-agents git-flow explain feat/FIP-2177-user-management
167
+ ```
168
+
169
+ The shapes:
170
+
171
+ | Shape | Branch from | Merges into |
172
+ | ------------------------------------------ | ----------------------- | ------------------------------ |
173
+ | `feat/<KEY>-<subject>` | development | development |
174
+ | `sub/feat/<KEY>-<subject>/<KEY>-<subject>` | the main feature branch | the main feature branch |
175
+ | `release/<YYYY.MM.DD>` | development | development **and** production |
176
+ | `sub/release/<YYYY.MM.DD>/<KEY>-<subject>` | the release branch | the release branch |
177
+ | `hotfix/<KEY>-<subject>` | production | production |
178
+
179
+ **Why nested branches carry a `sub/` prefix.** Git refuses a ref that is both a branch and
180
+ a directory of branches, so `feat/FIP-2177-user-management/FIP-2178-reset` cannot exist
181
+ while `feat/FIP-2177-user-management` does - the push is rejected with `refname conflict`.
182
+ The prefix moves the nested tree out of the way while keeping the parent's full path inside
183
+ the child's name, so the merge request target is still derivable from the name alone. The
184
+ unprefixed spelling still parses, reports why it cannot exist, and `repair` moves it.
185
+ Configurable as `subPrefix`.
186
+
187
+ - **`enforcement`** - `"advisory"` (default) reports everything and blocks nothing, so a
188
+ repo can adopt the convention before it gates on it. `"gated"` applies each rule's
189
+ `severity`. A direct push to a base branch is blocked in both modes, and
190
+ `wrong-mr-target` can be raised to `"error"` on its own without ending the naming
191
+ grace period.
192
+ - **`keyPrefixes`** - the project's issue prefixes. Leave it empty and anything shaped
193
+ like `keyPattern` counts, which reads `chore/angular-22` as issue `ANGULAR-22`.
194
+ - **`severity`** - per rule: `unknown-type`, `missing-key`, `key-case`,
195
+ `missing-subject`, `type-alias`, `deprecated-prefix`, `release-date`,
196
+ `wrong-mr-target`, `protected-push`.
197
+ - **`deprecatedShapes`** - legacy spellings that still classify correctly and only earn a
198
+ rename suggestion. `dev-*` ships as the old spelling of a main feature branch.
199
+
200
+ The grammar is also importable on its own - `@ethlete/agent-rules/git-flow` has no
201
+ dependencies and touches no Node built-ins, so it runs in a browser:
202
+
203
+ ```ts
204
+ import { parseBranch, planStart, resolveGitFlowConfig } from '@ethlete/agent-rules/git-flow';
205
+
206
+ const { storyKey, taskKey, findings } = parseBranch({ branch, config: resolveGitFlowConfig() });
207
+ ```
208
+
209
+ ### `start` - the prospective flow
210
+
211
+ `git-flow start <KEY>` reads the issue from Jira, computes the name from the grammar and
212
+ creates the branch off the correct base. It prints the plan first and asks before writing;
213
+ `--dry-run` stops after the plan and `--yes` skips the question. It refuses on a dirty
214
+ working tree, when the branch already exists, and when the base branch is nowhere to be
215
+ found.
216
+
217
+ A Task with a parent Story nests under that Story's feature branch, which therefore has to
218
+ exist already - `start` says so rather than inventing a parent. `--of <branch>` picks the
219
+ parent explicitly, `--hotfix` branches off production, `--release <date>` makes a release
220
+ branch, and `--subject <text>` skips Jira entirely.
221
+
222
+ The issue is read through the Timetrack app - see [Jira, through Timetrack](#jira-through-timetrack).
223
+ No repository holds a Jira credential, so the only thing the committed config still says about
224
+ Jira is how an issue type becomes a branch type:
225
+
226
+ ```json
227
+ {
228
+ "jira": {
229
+ "typeByIssueType": { "Bug": "fix" }
230
+ }
231
+ }
232
+ ```
233
+
234
+ - **`typeByIssueType`** - the branch type per Jira issue type; anything unlisted becomes
235
+ `feat`. `--type` overrides it per call.
236
+
237
+ The branch subject comes from the instance's own subject field, which Timetrack resolves
238
+ because the field id is a property of the instance rather than of this repo. An issue that
239
+ sets no subject falls back to its summary, and the printed plan says which of the two it used.
240
+
241
+ ### `repair` - renaming a branch that does not conform
242
+
243
+ `git-flow repair [ref]` derives the conforming name (`--key FIP-2900` when the old name
244
+ carries no issue key, `--to <branch>` to override), renames the branch locally and on the
245
+ remote, and retargets the open merge requests aimed at it through the GitLab API.
246
+ `GITLAB_TOKEN` needs the `api` scope, and is sent only to the hosts named in `GITLAB_HOST`
247
+ (comma-separated) or, in a GitLab CI job, `CI_SERVER_HOST`.
248
+
249
+ Everything is checked before the first mutation, and it refuses rather than half-finishing:
250
+
251
+ - An open merge request whose **source** is the branch blocks the repair. GitLab cannot
252
+ move a merge request to another source branch, and closing it would lose its discussion -
253
+ merge or close it first.
254
+ - A branch that is pushed but whose merge requests cannot be listed (no token, or a remote
255
+ that is not a configured GitLab host) blocks too. `--no-mr-check` asserts that none point at it.
256
+ - If a retarget fails halfway, the old branch is still there and the recovery commands are
257
+ printed.
258
+
259
+ ## Jira, through Timetrack
260
+
261
+ A Jira token in every repository is a secret nobody can rotate. There is one on this machine
262
+ instead, in the Timetrack app's keychain entry, and every repository asks the running app:
263
+
264
+ ```bash
265
+ npx ethlete-agents timetrack status # is it reachable, and what does it hold?
266
+ npx ethlete-agents timetrack issue FIP-2177 # summary, type, parent, branch subject
267
+ npx ethlete-agents timetrack search "password" # open issues of the picked projects
268
+ npx ethlete-agents timetrack project # which project does this repo log into?
269
+ npx ethlete-agents timetrack create --summary "…" # file a ticket with the instance's settings
270
+ npx ethlete-agents timetrack log --issue FIP-2177 --minutes 45
271
+ npx ethlete-agents timetrack approval <id> # where a queued write stands
272
+ ```
273
+
274
+ `timetrack snapshot [from] [to] [--out <file>]` records the rows of real days (default: the last 7) with
275
+ the git HEAD and uncommitted files of the current repo; without `--out` the file lands in the app's data
276
+ directory under `snapshots/`, never in a repo. `timetrack snapshot --compare <file>` reads the same days
277
+ again and prints every row gone, new or changed (`--json` for a script); it exits 1 when anything changed.
278
+
279
+ `--json` prints the raw answer instead of lines. `git-flow start` uses the same channel.
280
+
281
+ **Every write waits for the user.** `create`, `log` and every other write answer at once with an
282
+ approval id and write nothing; the user approves or rejects the request in the app, and
283
+ `approval <id>` reads the outcome. A request still waiting at the end of its day expires.
284
+ `TIMETRACK_CLIENT` names the caller in the queue.
285
+
286
+ **How it connects.** The app binds a loopback socket and writes its port and a fresh token
287
+ into `agent.json` in its own data directory (`~/.local/share/io.ethlete.timetrack/` on Linux,
288
+ `~/Library/Application Support/…` on macOS, `%APPDATA%\…` on Windows), readable by its owner
289
+ alone. The token lives no longer than the run, so a caller left over from an earlier one is
290
+ refused rather than trusted, and a request carrying an `Origin` header is refused outright -
291
+ a page the user happens to have open must not reach Jira through a port it guessed.
292
+ `TIMETRACK_AGENT_DISCOVERY` names the file for a machine that keeps it elsewhere.
293
+
294
+ **What the app answers, not this package.** The instance, the credentials, the picked
295
+ projects, the subject field and the ticket shape are all settings there. That is what makes
296
+ `create` file a ticket indistinguishable from one the app filed, and it is why none of them
297
+ appear in a repo's config any more.
298
+
299
+ **`log` writes to the day, not to Tempo.** It adds the same row the app's own timeline draws
300
+ for work nothing observed, and the user reviews the day before syncing it. A worklog posted
301
+ behind the review would double-book against whatever the evidence already proposed for that
302
+ hour.
303
+
304
+ **When the app is not running** every command says so and exits non-zero. There is no
305
+ fallback to an environment variable on purpose - a fallback is how the per-repo secret comes
306
+ back.
307
+
116
308
  ## Hooks (opt-in)
117
309
 
118
- Claude Code hooks run commands on the developer's machine, so none are emitted by
119
- default - opt in per hook in the config:
310
+ Hooks run commands on the developer's machine, so none are emitted by default - opt in
311
+ per hook in the config:
120
312
 
121
313
  ```json
122
314
  {
123
- "hooks": ["context-warning"]
315
+ "hooks": [
316
+ "context-warning",
317
+ "subagent-model-policy",
318
+ "background-design-commands",
319
+ "git-safety",
320
+ "builder-chat-words",
321
+ "away-mode"
322
+ ]
124
323
  }
125
324
  ```
126
325
 
127
- `sync` writes the script to `.claude/hooks/ethlete/` and registers it in
128
- `.claude/settings.json` (your own entries are left untouched); removing the name from
129
- `hooks` unregisters and deletes it again.
326
+ They are emitted for whichever of the `claude` and `codex` targets is enabled:
327
+
328
+ | Target | Script | Registered in |
329
+ | -------- | ------------------------ | ----------------------- |
330
+ | `claude` | `.claude/hooks/ethlete/` | `.claude/settings.json` |
331
+ | `codex` | `.codex/hooks/ethlete/` | `.codex/hooks.json` |
332
+
333
+ Your own entries in those files are left untouched; removing the name from `hooks`
334
+ unregisters and deletes the script again. Codex only loads project-local hooks once the
335
+ `.codex/` layer is trusted, and honours `[features] hooks = false`.
130
336
 
131
337
  Available hooks:
132
338
 
133
- - **`context-warning`** - warns once per tier (and instructs Claude) when the session
134
- context crosses 70% / 85% of the token budget, recommending `/handoff`. The budget is
135
- capped at the 200k long-context pricing boundary: on 1M-window models every request
136
- past 200k input tokens bills the whole context at a premium rate, so the warnings
137
- fire at ~140k/~170k instead of deep into the expensive range.
339
+ - **`context-warning`** - warns once per tier (and instructs the agent) when the session
340
+ context crosses 70% / 85% / 95% of the token budget, recommending a handoff. Under Claude the
341
+ budget is capped at the 200k long-context pricing boundary: on 1M-window models every
342
+ request past 200k input tokens bills the whole context at a premium rate, so the
343
+ warnings fire at ~140k/~170k instead of deep into the expensive range. Codex uses
344
+ the model-specific 272k pricing boundary for GPT-5.6, GPT-5.5 and GPT-5.4, and the
345
+ rollout's reported context window for models without that pricing rule.
346
+
347
+ The 85% tier asks the agent to choose - finish the task, or hand off - because a session
348
+ is often a step or two from done when it fires. The 95% tier takes that choice away. Every
349
+ prompt after the first warning carries a short reminder instead of a new warning: the
350
+ remaining budget, and how to work so that either ending stays cheap. The `handoff` skill
351
+ calls this handoff mode.
352
+
353
+ Under Claude the hook runs on four events, because a warning that only a user prompt can
354
+ trigger never reaches a long autonomous run. `SessionStart` names the budget before the
355
+ first request. `UserPromptSubmit` carries the tiered warning and the reminder.
356
+ `PostToolBatch` fires between the agent's own model requests, so it learns the count while
357
+ it works. `Stop` fires as a turn ends over 85% and the turn then continues, so the agent
358
+ must take one of three and say which: finish, hand off, or cross the boundary on purpose
359
+ for a reason it states. Each event speaks once per tier. Codex has none of the three, so
360
+ its registration stays on `UserPromptSubmit`.
361
+
362
+ Two things are Claude-only: the separate user-facing line (Codex documents only
363
+ `additionalContext`, so there the warning is folded into the text the model is told to
364
+ relay), and the auto-mode escalation that writes the handoff file unprompted - Codex's
365
+ `permission_mode` values are undocumented, so no value enables it.
366
+
367
+ Codex sub-agents are tracked by their own thread ids even though they share the root
368
+ session id. A sub-agent warning tells that child to report its state to the parent; it
369
+ never tells the user or the main agent to hand off the root session.
370
+
371
+ - **`subagent-model-policy`** (Claude Code only) - gates every call to the subagent tool.
372
+ A call that names no `model` runs on sonnet, and the model table is returned with it:
373
+ haiku for a lookup, sonnet for scoped work, opus for hard work, fable for judgment-heavy
374
+ work. Without it a subagent inherits the model leading the session, which is how an
375
+ expensive model ends up doing every grep it delegates.
376
+
377
+ Each start appends a line to `.git/ethlete/subagent-starts.jsonl` (model, effort, HEAD,
378
+ description, prompt head, the file paths the prompt names), to join with later commits.
379
+
380
+ A call that names `fable` asks the user - it is the most expensive option, and only the
381
+ user knows whether the task is judgment-heavy. A fork and an agent type whose own
382
+ definition sets a model both pass untouched, because `model` would change nothing there.
383
+
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/`.
138
393
 
139
394
  Hooks can be turned off per machine - see the local config below.
140
395
 
396
+ ## Mods (Claude Code)
397
+
398
+ `"mods": ["status-line"]` in the config enables a Claude Code mod from the `ethlete` marketplace the
399
+ package ships (`yarn agents:sync` writes the marketplace and `enabledPlugins` into
400
+ `.claude/settings.json`). A mod runs code in every session of the repo, so none is on by default.
401
+
402
+ - **`e2e-progress`** - live Playwright run progress as a status line entry and a pane.
403
+ - **`status-line`** - a band above the prompt, always visible: `▶ <running slice> · 42 min · 14 offen · ❓2`.
404
+ The slice comes from the git `slice-paths` file (`kein Slice` once it is older than 2 h), the queue
405
+ count from the `### Warteschlange` list of the `report.planFiles` markdown files, `❓N` from the
406
+ `-` lines of `<git common dir>/ethlete/open-questions.md`, and `⛔ CI rot` when the latest `gh run`
407
+ of the branch failed (checked every 2 minutes). A field whose source is missing is left out.
408
+
409
+ ## Progress report
410
+
411
+ `ethlete-agents report [today|yesterday|week | --since <date> [--until <date>]]` prints a fixed
412
+ markdown table of the period: one line per row with a feature, fix or other non-docs commit (short
413
+ sha, result), the parked rows, and a figures line (commit counts, reverts, red CI runs via `gh`,
414
+ subagent starts per model, the running slice). Without config it works from the git log alone.
415
+ Opt in to short names and the parked section with
416
+ `"report": { "planFiles": ["plans/STATUS.md", "plans/queue.md", "plans/rows.md"] }`: repo-relative paths
417
+ of markdown files holding `| <id> | <short name> | <what> | <state> | <what is missing> | <who> |` rows
418
+ and `N. **<name> (<id>)**` queue lines. The `report` skill runs it and pastes the output.
419
+
420
+ ## Git hooks (opt-in)
421
+
422
+ Separate from the agent hooks above, and opt-in for the same reason - a generated block
423
+ that can reject a push is a higher-stakes artifact than a markdown one:
424
+
425
+ ```json
426
+ {
427
+ "gitHooks": ["pre-push", "post-checkout"]
428
+ }
429
+ ```
430
+
431
+ Each one is written as an `# ethlete:git-flow:start` … `end` block **appended** to your
432
+ `.husky/<name>`, so an existing hook there (a git-lfs hook, typically) keeps working and
433
+ keeps reading stdin first - which is why the block never reads stdin itself. Removing the
434
+ name from `gitHooks` takes the block back out and leaves the rest of the file alone.
435
+
436
+ - **`pre-push`** - runs `git-flow check --push` on the current branch. In `advisory` mode
437
+ only a direct push to a base branch can actually stop it.
438
+ - **`post-checkout`** - reports a non-conforming name on a branch that is on no remote yet,
439
+ which is the whole window in which renaming it is free.
440
+
441
+ Only `.husky/` is written, never `.git/hooks/`: the generated files are committed and CI's
442
+ `check` diffs them, so a hook outside the working tree could never be in sync. Without a
443
+ `.husky/` directory `sync` warns and writes nothing. The block calls
444
+ `node_modules/.bin/ethlete-agents` directly rather than through `npx`, so a repo where the
445
+ package is missing gets silence instead of a registry lookup that would fail the push.
446
+ `ETHLETE_GIT_FLOW_SKIP=1` silences both hooks on one machine.
447
+
448
+ ## CI job
449
+
450
+ On GitLab, the merge request target is the half no local hook can see. The job needs no
451
+ configuration beyond the predefined variables:
452
+
453
+ ```yaml
454
+ Git Flow:
455
+ stage: Checks
456
+ rules:
457
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
458
+ allow_failure: true
459
+ script:
460
+ - >
461
+ npx ethlete-agents git-flow check "$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME"
462
+ --target "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
463
+ ```
464
+
465
+ `allow_failure: true` on top of `advisory` mode is deliberate belt and braces: the job
466
+ reports for a whole grace period before it can ever be the reason a merge request is red.
467
+
468
+ ## Output styles (Claude Code)
469
+
470
+ An output style replaces Claude Code's own answer style for a whole session. This package
471
+ ships one - **`ste-clarity`**, which writes every answer in ASD-STE100 Simplified Technical
472
+ English - and installs it into the machine's Claude config rather than into a repo, because
473
+ that is where Claude Code reads styles from:
474
+
475
+ ```bash
476
+ npx ethlete-agents output-style # install ste-clarity and switch to it
477
+ npx ethlete-agents output-style --dry-run # print what would change
478
+ npx ethlete-agents output-style --remove # take it back out
479
+ ```
480
+
481
+ Two files, both under `~/.claude` (or `$CLAUDE_CONFIG_DIR`, or `--config-dir <path>`):
482
+
483
+ | File | What changes |
484
+ | ------------------------------ | ------------------------------------------------------------------ |
485
+ | `output-styles/ste-clarity.md` | The style itself, written whole |
486
+ | `settings.json` | `"outputStyle": "ste-clarity"` - every other setting is left alone |
487
+
488
+ - **`--no-activate`** writes the style file but not the setting, so switching to it is then
489
+ `/output-style ste-clarity` inside a session.
490
+ - A style file this command did not write is never overwritten or deleted - it says so and
491
+ stops, and `--force` is the way through. A copy of the same style that differs only in
492
+ layout still counts as its own.
493
+ - Nothing here is repo-local, so `sync` and `check` neither write nor diff it. `--remove`
494
+ clears `outputStyle` only while it still points at that style.
495
+
496
+ **Claude Code only.** Codex has no output-style mechanism - everything it is told comes
497
+ from `AGENTS.md`, which `sync` already writes.
498
+
141
499
  ## Per-machine local config
142
500
 
143
- A gitignored `ethlete-agents.config.local.json` at the repo root holds the values that
144
- differ per developer, without touching any committed file:
501
+ A gitignored `ethlete-agents.config.local.json` at the repo root holds the agent behaviour
502
+ that differs per developer, without touching any committed file:
145
503
 
146
504
  ```json
147
505
  {
148
506
  "disableHooks": true,
149
- "sdkSourcePath": "/absolute/path/to/ethlete-sdk"
507
+ "disableAutoHandoffSave": true
150
508
  }
151
509
  ```
152
510
 
153
511
  - **`disableHooks`** - `true` disables every generated hook; an array
154
512
  (`["context-warning"]`) just the named ones. The hook scripts read the file at
155
513
  runtime, so toggling takes effect on the next prompt - no `sync` needed.
156
- - **`sdkSourcePath`** - a local `ethlete-sdk` checkout. The `sdk-source` and
157
- `sdk-local-build` skills read it when the agent needs the SDK's own sources, or has to
158
- build the SDK and install it here through a `file:` dependency. A relative path is
159
- resolved from the repo root.
514
+ - **`disableAutoHandoffSave`** - keeps the `context-warning` hook's tiered warnings but
515
+ drops the auto-mode escalation: at the critical tier it recommends `/ethlete-handoff`
516
+ instead of saving the handoff file itself.
160
517
 
161
518
  Everything in this file is read at runtime, never by `sync`: the generated files stay
162
519
  identical on every machine and in CI, which is what lets `check` diff them. That is also
163
- why the file takes nothing beyond these keys - `sync`/`check` warn about unknown keys,
164
- and about an `sdkSourcePath` that is missing or is not an SDK checkout. Add the filename
165
- to your repo's `.gitignore`.
520
+ why the file takes nothing beyond these keys - `sync`/`check` warn about unknown keys. Add
521
+ the filename to your repo's `.gitignore`.
522
+
523
+ ### Where the sibling checkouts live
524
+
525
+ `sdkSourcePath`, `apiRepoPaths` and `apiRepoBranches` used to live in the file above. They
526
+ moved to `ethlete.config.local.json`, which [`@ethlete/cli`](../cli/README.md) owns, because
527
+ `et api` needs the same values the skills do. `sync`/`check` still read that file and warn
528
+ about a path that is missing or is not the checkout it claims to be, and they tell you to
529
+ move any of the three keys still found in the agents file.
166
530
 
167
531
  ## Authoring content
168
532
 
@@ -178,11 +542,24 @@ scope: consumer # consumer | sdk | both
178
542
  requires: ['@ethlete/core'] # optional
179
543
  paths: ['**/*.css'] # optional; becomes Claude `paths` and Cursor `globs` on rules
180
544
  vars: [docsBaseUrl] # optional
545
+ modelInvocation: false # optional; a skill only the user may start
181
546
  ---
182
547
  ```
183
548
 
549
+ A content file vendored from another repository keeps its upstream wording apart from the
550
+ link syntax, and names its source in the body. `THIRD-PARTY-LICENSES.md` lists each one,
551
+ its upstream commit and its license.
552
+
553
+ `content/output-styles/<name>.md` is a third kind, and the only one this package does not
554
+ compile: it is a Claude Code output style verbatim, so its frontmatter is Claude's
555
+ (`name`, `description`, `keep-coding-instructions`) and `output-style` installs the file
556
+ as it is, apart from a marker line that records where it came from.
557
+
184
558
  In a body, `{% varName %}` substitutes a variable, `{% skill:other-name %}` links to
185
- another guide the way the current target expects, and `{% resource:file.mjs %}` links to
186
- a bundled file. The delimiter is `{% … %}`, not `{{ … }}`, so Angular templates in
187
- examples pass through untouched. Resource files get variable substitution too, but no
188
- links.
559
+ another emitted package guide, and `{% resource:file.mjs %}` links to a bundled file.
560
+ Skill links are required dependencies: after scope, package, variable, and exclusion
561
+ filtering, `sync` and `check` fail with the source and missing target instead of emitting
562
+ a dangling name. Optional guidance must be self-contained when its guide is absent. Use
563
+ the structured marker instead of a plain `` `name` skill`` reference so validation can
564
+ see it. The delimiter is `{% … %}`, not `{{ … }}`, so Angular templates in examples pass
565
+ through untouched. Resource files get variable substitution too, but no links.
@@ -0,0 +1,35 @@
1
+ # Third-party content
2
+
3
+ Content in this package that comes from another repository, with the license it keeps.
4
+ To update one, copy it again from upstream and record the new commit here.
5
+
6
+ ## [mattpocock/skills](https://github.com/mattpocock/skills)
7
+
8
+ Commit `3cca18b` (2026-09-04). Vendored skills, kept as written upstream apart from the
9
+ generator's own link syntax:
10
+
11
+ - `content/skills/grill-with-docs` - the entry point; calls the other two.
12
+ - `content/skills/grilling` - plus our own section "Local addition" after the upstream footer.
13
+ - `content/skills/domain-modeling`
14
+
15
+ MIT License
16
+
17
+ Copyright (c) 2026 Matt Pocock
18
+
19
+ Permission is hereby granted, free of charge, to any person obtaining a copy
20
+ of this software and associated documentation files (the "Software"), to deal
21
+ in the Software without restriction, including without limitation the rights
22
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23
+ copies of the Software, and to permit persons to whom the Software is
24
+ furnished to do so, subject to the following conditions:
25
+
26
+ The above copyright notice and this permission notice shall be included in all
27
+ copies or substantial portions of the Software.
28
+
29
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35
+ SOFTWARE.
@@ -4,7 +4,7 @@
4
4
  "formatCommand": "npx prettier --write <files>",
5
5
  "storybookUrl": "http://localhost:6006",
6
6
  "storybookStartCommand": "npm run storybook",
7
- "docsBaseUrl": "https://ethlete-sdk-docs.web.app",
7
+ "docsBaseUrl": "https://ethlete-sdk-docs-next.web.app",
8
8
  "sdkStorybookUrl": "https://ethlete-sdk.web.app",
9
9
  "handoffDir": ".agents/handoffs"
10
10
  }
@@ -0,0 +1,10 @@
1
+ if [ "$3" = "1" ] && [ -z "$ETHLETE_GIT_FLOW_SKIP" ] && [ -x node_modules/.bin/ethlete-agents ]; then
2
+ ethlete_branch=$(git rev-parse --abbrev-ref HEAD)
3
+
4
+ # Only while the branch is on no remote: that is the whole window in which renaming it is free.
5
+ if [ -z "$(git for-each-ref --format='%(refname)' "refs/remotes/*/$ethlete_branch")" ]; then
6
+ node_modules/.bin/ethlete-agents git-flow check || true
7
+ fi
8
+
9
+ unset ethlete_branch
10
+ fi
@@ -0,0 +1,5 @@
1
+ # Never `npx`: it reaches the registry when the package is absent, and a network error here would
2
+ # reject the push. A missing binary must make this block do nothing at all.
3
+ if [ -z "$ETHLETE_GIT_FLOW_SKIP" ] && [ -x node_modules/.bin/ethlete-agents ]; then
4
+ node_modules/.bin/ethlete-agents git-flow check --push || exit 1
5
+ fi