@ethlete/agent-rules 0.1.0-next.2 → 0.1.0-next.21

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 (178) hide show
  1. package/CHANGELOG.md +275 -0
  2. package/README.md +350 -29
  3. package/THIRD-PARTY-LICENSES.md +35 -0
  4. package/content/git-hooks/post-checkout.sh +10 -0
  5. package/content/git-hooks/pre-push.sh +5 -0
  6. package/content/hooks/context-warning.py +766 -108
  7. package/content/hooks/subagent-model-policy.py +193 -0
  8. package/content/output-styles/ste-clarity.md +131 -0
  9. package/content/rules/app-styling.md +59 -0
  10. package/content/rules/comments.md +53 -20
  11. package/content/rules/lint-and-format.md +6 -5
  12. package/content/rules/nx-layout.md +47 -0
  13. package/content/rules/reactive-state.md +1 -1
  14. package/content/rules/styling.md +9 -7
  15. package/content/rules/subagent-models.md +29 -0
  16. package/content/skills/angular-patterns/SKILL.md +30 -7
  17. package/content/skills/api-source/SKILL.md +130 -0
  18. package/content/skills/app-testing/SKILL.md +141 -0
  19. package/content/skills/codex-subagent/SKILL.md +90 -0
  20. package/content/skills/codex-subagent/codex-agent.mjs +229 -0
  21. package/content/skills/design-exploration/SKILL.md +205 -0
  22. package/content/skills/design-exploration/check-story.mjs +139 -0
  23. package/content/skills/design-exploration/shoot-template.mjs +61 -0
  24. package/content/skills/domain-modeling/ADR-FORMAT.md +47 -0
  25. package/content/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  26. package/content/skills/domain-modeling/SKILL.md +80 -0
  27. package/content/skills/figma-export/SKILL.md +191 -0
  28. package/content/skills/figma-export/dump-figma-layers.py +83 -0
  29. package/content/skills/figma-export/dump-figma-svg.py +235 -0
  30. package/content/skills/figma-export/measure-template.mjs +87 -0
  31. package/content/skills/git-commit/SKILL.md +6 -7
  32. package/content/skills/git-flow/SKILL.md +87 -0
  33. package/content/skills/grill-with-docs/SKILL.md +13 -0
  34. package/content/skills/grilling/SKILL.md +34 -0
  35. package/content/skills/handoff/SKILL.md +74 -4
  36. package/content/skills/query/SKILL.md +165 -64
  37. package/content/skills/rxjs-signals/SKILL.md +31 -4
  38. package/content/skills/sdk-docs/SKILL.md +50 -14
  39. package/content/skills/sdk-local-build/SKILL.md +30 -10
  40. package/content/skills/sdk-local-build/sdk-local-baseline.mjs +64 -0
  41. package/content/skills/sdk-source/SKILL.md +49 -21
  42. package/content/skills/sdk-update/SKILL.md +96 -0
  43. package/content/skills/story-styling/SKILL.md +10 -8
  44. package/content/skills/styleguide/SKILL.md +12 -7
  45. package/content/skills/styleguide/assets.md +54 -0
  46. package/content/skills/styleguide/changesets.md +17 -0
  47. package/content/skills/styleguide/file-structure.md +73 -0
  48. package/content/skills/styleguide/lint-rule-lookup.md +51 -0
  49. package/content/skills/styleguide/storybook-structure.md +25 -0
  50. package/content/skills/theming/SKILL.md +41 -28
  51. package/content/skills/timetrack/SKILL.md +397 -0
  52. package/content/skills/verify-in-app/SKILL.md +107 -0
  53. package/migrations/app-styling-utilities.md +63 -0
  54. package/migrations/list-state-query-form.md +20 -0
  55. package/migrations/nx-layout.md +29 -0
  56. package/migrations/sdk-components-over-hand-built-ui.md +27 -0
  57. package/migrations/search-query-field.md +52 -0
  58. package/migrations.json +48 -0
  59. package/package.json +16 -2
  60. package/src/index.js +63 -28
  61. package/src/index.js.map +1 -1
  62. package/src/lib/cli-args.d.ts +9 -0
  63. package/src/lib/cli-args.js +48 -0
  64. package/src/lib/cli-args.js.map +1 -0
  65. package/src/lib/commitlint.d.ts +10 -0
  66. package/src/lib/commitlint.js +51 -0
  67. package/src/lib/commitlint.js.map +1 -0
  68. package/src/lib/config.d.ts +38 -4
  69. package/src/lib/config.js +84 -8
  70. package/src/lib/config.js.map +1 -1
  71. package/src/lib/filter.d.ts +2 -0
  72. package/src/lib/filter.js +4 -4
  73. package/src/lib/filter.js.map +1 -1
  74. package/src/lib/frontmatter.d.ts +2 -0
  75. package/src/lib/frontmatter.js +33 -5
  76. package/src/lib/frontmatter.js.map +1 -1
  77. package/src/lib/git-flow/build.d.ts +35 -0
  78. package/src/lib/git-flow/build.js +24 -0
  79. package/src/lib/git-flow/build.js.map +1 -0
  80. package/src/lib/git-flow/config.d.ts +59 -0
  81. package/src/lib/git-flow/config.js +50 -0
  82. package/src/lib/git-flow/config.js.map +1 -0
  83. package/src/lib/git-flow/index.d.ts +6 -0
  84. package/src/lib/git-flow/index.js +10 -0
  85. package/src/lib/git-flow/index.js.map +1 -0
  86. package/src/lib/git-flow/parse.d.ts +49 -0
  87. package/src/lib/git-flow/parse.js +300 -0
  88. package/src/lib/git-flow/parse.js.map +1 -0
  89. package/src/lib/git-flow/rename.d.ts +24 -0
  90. package/src/lib/git-flow/rename.js +70 -0
  91. package/src/lib/git-flow/rename.js.map +1 -0
  92. package/src/lib/git-flow/start.d.ts +49 -0
  93. package/src/lib/git-flow/start.js +57 -0
  94. package/src/lib/git-flow/start.js.map +1 -0
  95. package/src/lib/git-flow/validate.d.ts +34 -0
  96. package/src/lib/git-flow/validate.js +72 -0
  97. package/src/lib/git-flow/validate.js.map +1 -0
  98. package/src/lib/git-flow-command.d.ts +4 -0
  99. package/src/lib/git-flow-command.js +157 -0
  100. package/src/lib/git-flow-command.js.map +1 -0
  101. package/src/lib/git-flow-repair.d.ts +17 -0
  102. package/src/lib/git-flow-repair.js +157 -0
  103. package/src/lib/git-flow-repair.js.map +1 -0
  104. package/src/lib/git-flow-start.d.ts +20 -0
  105. package/src/lib/git-flow-start.js +132 -0
  106. package/src/lib/git-flow-start.js.map +1 -0
  107. package/src/lib/git.d.ts +64 -0
  108. package/src/lib/git.js +131 -0
  109. package/src/lib/git.js.map +1 -0
  110. package/src/lib/gitlab.d.ts +35 -0
  111. package/src/lib/gitlab.js +108 -0
  112. package/src/lib/gitlab.js.map +1 -0
  113. package/src/lib/index.d.ts +2 -0
  114. package/src/lib/index.js +2 -0
  115. package/src/lib/index.js.map +1 -1
  116. package/src/lib/migrate.js +1 -1
  117. package/src/lib/migrate.js.map +1 -1
  118. package/src/lib/output-style-command.d.ts +3 -0
  119. package/src/lib/output-style-command.js +69 -0
  120. package/src/lib/output-style-command.js.map +1 -0
  121. package/src/lib/output-style.d.ts +38 -0
  122. package/src/lib/output-style.js +134 -0
  123. package/src/lib/output-style.js.map +1 -0
  124. package/src/lib/owned-paths.js +27 -3
  125. package/src/lib/owned-paths.js.map +1 -1
  126. package/src/lib/package-runner.d.ts +3 -0
  127. package/src/lib/package-runner.js +69 -0
  128. package/src/lib/package-runner.js.map +1 -0
  129. package/src/lib/plain-text.d.ts +9 -0
  130. package/src/lib/plain-text.js +22 -0
  131. package/src/lib/plain-text.js.map +1 -0
  132. package/src/lib/plan.d.ts +6 -6
  133. package/src/lib/plan.js +147 -40
  134. package/src/lib/plan.js.map +1 -1
  135. package/src/lib/prompt.d.ts +8 -0
  136. package/src/lib/prompt.js +27 -0
  137. package/src/lib/prompt.js.map +1 -0
  138. package/src/lib/render.d.ts +24 -2
  139. package/src/lib/render.js +39 -10
  140. package/src/lib/render.js.map +1 -1
  141. package/src/lib/sync.d.ts +0 -1
  142. package/src/lib/sync.js +23 -15
  143. package/src/lib/sync.js.map +1 -1
  144. package/src/lib/targets/agents-skills.js +1 -1
  145. package/src/lib/targets/agents-skills.js.map +1 -1
  146. package/src/lib/targets/claude-hooks.d.ts +1 -23
  147. package/src/lib/targets/claude-hooks.js +17 -85
  148. package/src/lib/targets/claude-hooks.js.map +1 -1
  149. package/src/lib/targets/claude.js +1 -2
  150. package/src/lib/targets/claude.js.map +1 -1
  151. package/src/lib/targets/codex-hooks.d.ts +12 -0
  152. package/src/lib/targets/codex-hooks.js +34 -0
  153. package/src/lib/targets/codex-hooks.js.map +1 -0
  154. package/src/lib/targets/codex.js +4 -4
  155. package/src/lib/targets/codex.js.map +1 -1
  156. package/src/lib/targets/copilot.js +3 -3
  157. package/src/lib/targets/copilot.js.map +1 -1
  158. package/src/lib/targets/cursor.js +2 -2
  159. package/src/lib/targets/cursor.js.map +1 -1
  160. package/src/lib/targets/git-hooks.d.ts +24 -0
  161. package/src/lib/targets/git-hooks.js +71 -0
  162. package/src/lib/targets/git-hooks.js.map +1 -0
  163. package/src/lib/targets/hooks-shared.d.ts +58 -0
  164. package/src/lib/targets/hooks-shared.js +128 -0
  165. package/src/lib/targets/hooks-shared.js.map +1 -0
  166. package/src/lib/targets/shared.d.ts +1 -9
  167. package/src/lib/targets/shared.js +4 -8
  168. package/src/lib/targets/shared.js.map +1 -1
  169. package/src/lib/timetrack-command.d.ts +11 -0
  170. package/src/lib/timetrack-command.js +1055 -0
  171. package/src/lib/timetrack-command.js.map +1 -0
  172. package/src/lib/timetrack-snapshot.d.ts +55 -0
  173. package/src/lib/timetrack-snapshot.js +120 -0
  174. package/src/lib/timetrack-snapshot.js.map +1 -0
  175. package/src/lib/timetrack.d.ts +561 -0
  176. package/src/lib/timetrack.js +271 -0
  177. package/src/lib/timetrack.js.map +1 -0
  178. package/content/skills/styleguide/STYLEGUIDE.md +0 -520
@@ -0,0 +1,52 @@
1
+ # Replace a hand-debounced search with `searchQueryField`
2
+
3
+ The earlier query guidance said there was no built-in debounce and to debounce at the input. So a
4
+ search box that feeds a query was debounced by hand: `debounceTime` on a stream, a `setTimeout`, or a
5
+ debounced copy of the input signal. `searchQueryField()` debounces by itself (300ms), and applies a
6
+ cleared input at once.
7
+
8
+ ## Before you start
9
+
10
+ `et update` regenerates the skills when it moves `@ethlete/agent-rules`. If
11
+ `.agents/skills/ethlete-query/SKILL.md` does not mention `searchQueryField`, run
12
+ `ethlete-agents sync` with this repo's package manager (`yarn`, `pnpm exec` or `npx`) first.
13
+
14
+ ## Find the call sites
15
+
16
+ ```bash
17
+ grep -rnE 'debounceTime\(|debounce\(' apps libs --include='*.ts'
18
+ grep -rnE 'setTimeout\(' apps libs --include='*.ts'
19
+ ```
20
+
21
+ A call site is in scope when the debounced value ends up in the args of a query.
22
+
23
+ ## What to change
24
+
25
+ 1. Add a `search: searchQueryField()` field to the list's `defineQueryForm`, or declare a form with
26
+ that one field.
27
+ 2. Call `.observe()` on it. Keep the URL behaviour the old search had. If it did not write the
28
+ URL, as a search inside a dialog, pass `{ writeToQueryParams: false, syncOnNavigation: false }`.
29
+ `writeToQueryParams: false` alone stops the writes only: the form still reads the page's own
30
+ params, such as `page`.
31
+ 3. Read `this.qf.value().search` in `withArgs`, and bind the input with `[formField]="qf.fields.search"`.
32
+ 4. Delete the debounce, the subject or timer, and the intermediate signal.
33
+ 5. Pass `debounce` to the field when the old delay was deliberately different from 300ms.
34
+
35
+ If the search text is part of list state the component syncs to the URL by hand, skip the call
36
+ site: it moves with the rest of the list to `defineQueryForm` when that list is next edited.
37
+
38
+ ## Leave these alone
39
+
40
+ - A debounce whose value never reaches a query: resize and scroll handlers, autosave, analytics.
41
+ - An SDK control that takes a search input of its own.
42
+
43
+ ## Done when
44
+
45
+ - No hit of the greps above feeds a query any more, apart from the hand-synced lists you skipped.
46
+ Your final message names each skipped one.
47
+ - The type check, lint and tests pass for every project you changed.
48
+
49
+ Then delete this task file.
50
+
51
+ The guide the `Docs` line at the top of this file links (`/query/query-forms` on the SDK docs site)
52
+ has the field creators and their options.
@@ -0,0 +1,48 @@
1
+ {
2
+ "migrations": [
3
+ {
4
+ "name": "app-styling-utilities",
5
+ "version": "0.1.0-next.17",
6
+ "kind": "assisted",
7
+ "level": "required",
8
+ "description": "App rules in @layer components move out of that layer, so SDK styles stop overriding them.",
9
+ "instructions": "./migrations/app-styling-utilities.md",
10
+ "docs": "/components/setup"
11
+ },
12
+ {
13
+ "name": "list-state-query-form",
14
+ "version": "0.1.0-next.17",
15
+ "kind": "manual",
16
+ "level": "optional",
17
+ "description": "Lists that sync their params to the URL by hand move to defineQueryForm when they are next edited.",
18
+ "instructions": "./migrations/list-state-query-form.md",
19
+ "docs": "/query/query-forms"
20
+ },
21
+ {
22
+ "name": "search-query-field",
23
+ "version": "0.1.0-next.17",
24
+ "kind": "assisted",
25
+ "level": "optional",
26
+ "description": "A hand-debounced search that feeds a query moves to searchQueryField.",
27
+ "instructions": "./migrations/search-query-field.md",
28
+ "docs": "/query/query-forms"
29
+ },
30
+ {
31
+ "name": "sdk-components-over-hand-built-ui",
32
+ "version": "0.1.0-next.17",
33
+ "kind": "manual",
34
+ "level": "optional",
35
+ "description": "Hand-built bar charts, avatars and progress bars move to the SDK components when their view is next edited.",
36
+ "instructions": "./migrations/sdk-components-over-hand-built-ui.md",
37
+ "docs": "/components/"
38
+ },
39
+ {
40
+ "name": "nx-layout",
41
+ "version": "0.1.0-next.17",
42
+ "kind": "manual",
43
+ "level": "optional",
44
+ "description": "Compare the workspace with the Nx layout rule, and decide whether any project moves.",
45
+ "instructions": "./migrations/nx-layout.md"
46
+ }
47
+ ]
48
+ }
package/package.json CHANGED
@@ -1,15 +1,29 @@
1
1
  {
2
2
  "name": "@ethlete/agent-rules",
3
- "version": "0.1.0-next.2",
3
+ "version": "0.1.0-next.21",
4
4
  "license": "MIT",
5
5
  "type": "commonjs",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./src/index.d.ts",
9
+ "default": "./src/index.js"
10
+ },
11
+ "./git-flow": {
12
+ "types": "./src/lib/git-flow/index.d.ts",
13
+ "default": "./src/lib/git-flow/index.js"
14
+ },
15
+ "./package.json": "./package.json"
16
+ },
6
17
  "main": "./src/index.js",
7
18
  "typings": "./src/index.d.ts",
8
19
  "bin": {
9
20
  "ethlete-agents": "./src/index.js"
10
21
  },
11
22
  "peerDependencies": {
12
- "tslib": "2.8.1"
23
+ "tslib": "^2.3.0"
24
+ },
25
+ "ethlete": {
26
+ "migrations": "./migrations.json"
13
27
  },
14
28
  "types": "./src/index.d.ts"
15
29
  }
package/src/index.js CHANGED
@@ -4,14 +4,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  const tslib_1 = require("tslib");
5
5
  const fs_1 = require("fs");
6
6
  const path_1 = require("path");
7
+ const cli_args_1 = require("./lib/cli-args");
7
8
  const config_1 = require("./lib/config");
9
+ const git_flow_command_1 = require("./lib/git-flow-command");
10
+ const load_content_1 = require("./lib/load-content");
8
11
  const migrate_1 = require("./lib/migrate");
12
+ const output_style_command_1 = require("./lib/output-style-command");
13
+ const package_runner_1 = require("./lib/package-runner");
14
+ const plain_text_1 = require("./lib/plain-text");
9
15
  const sync_1 = require("./lib/sync");
16
+ const timetrack_command_1 = require("./lib/timetrack-command");
10
17
  const USAGE = `ethlete-agents — compile @ethlete agent rules and skills into your repo
11
18
 
12
19
  ethlete-agents sync Write the generated rules/skills for every detected agent
13
20
  ethlete-agents check Exit non-zero when the generated files are out of date (for CI)
14
21
  ethlete-agents init Write a starter ${config_1.CONFIG_FILE_NAME}
22
+ ethlete-agents git-flow Name, check and repair branches against the repo's git flow
23
+ (start, check, repair, explain)
24
+ ethlete-agents output-style
25
+ Install an Ethlete output style into this machine's Claude Code
26
+ config and switch to it (Claude Code only)
27
+ ethlete-agents timetrack Ask the running Timetrack app about Jira - it holds this
28
+ machine's credentials, so no repo needs a token
29
+ (status, instance, issue, search, project, create, log)
15
30
  ethlete-agents migrate Convert the repo to the AGENTS.md + .agents/skills layout:
16
31
  CLAUDE.md content moves into AGENTS.md (CLAUDE.md becomes an
17
32
  @AGENTS.md import), hand-written .claude/skills move to
@@ -19,7 +34,8 @@ const USAGE = `ethlete-agents — compile @ethlete agent rules and skills into y
19
34
 
20
35
  Options
21
36
  --targets <list> Comma-separated subset of: ${config_1.AGENT_TARGETS.join(', ')}
22
- --root <path> Repo root to write into (default: current directory)
37
+ --root <path> Repo root to write into (default: the nearest directory holding
38
+ ${config_1.CONFIG_FILE_NAME}, else the current directory)
23
39
  --dry-run Print what would change without writing (sync and migrate)
24
40
  `;
25
41
  const readFlag = (args, flag) => {
@@ -28,46 +44,65 @@ const readFlag = (args, flag) => {
28
44
  return undefined;
29
45
  return args[index + 1];
30
46
  };
31
- const parseTargets = (args) => {
32
- const raw = readFlag(args, '--targets');
33
- if (!raw)
34
- return undefined;
35
- return raw.split(',').map((entry) => entry.trim());
36
- };
37
- const readVersion = () => {
38
- const manifest = JSON.parse((0, fs_1.readFileSync)((0, path_1.join)(__dirname, '..', 'package.json'), 'utf8'));
39
- return manifest.version;
40
- };
47
+ const INIT_VARS = ['lintCommand', 'lintFixCommand', 'formatCommand', 'storybookStartCommand', 'storybookUrl'];
41
48
  const init = (root) => {
42
49
  const path = (0, path_1.join)(root, config_1.CONFIG_FILE_NAME);
43
50
  if ((0, fs_1.existsSync)(path)) {
44
51
  console.error(`${config_1.CONFIG_FILE_NAME} already exists.`);
45
52
  return 1;
46
53
  }
54
+ const defaults = (0, load_content_1.loadDefaultVars)();
55
+ const detected = (0, package_runner_1.detectCommandVars)(root);
56
+ const vars = Object.fromEntries(INIT_VARS.map((name) => { var _a; return [name, (_a = detected[name]) !== null && _a !== void 0 ? _a : defaults[name]]; }).filter(([, value]) => value));
47
57
  const template = {
48
58
  targets: (0, config_1.detectTargets)(root),
49
- vars: {},
59
+ vars,
50
60
  exclude: [],
51
61
  hooks: [],
52
62
  };
53
63
  (0, fs_1.writeFileSync)(path, `${JSON.stringify(template, null, 2)}\n`, 'utf8');
54
- console.log(`Wrote ${config_1.CONFIG_FILE_NAME}. Fill in "vars" for your repo, then run \`ethlete-agents sync\`.`);
64
+ console.log(`Wrote ${config_1.CONFIG_FILE_NAME}. Check the commands in "vars" (${Object.keys(vars).join(', ')}) against your repo, then run \`ethlete-agents sync\`.`);
55
65
  return 0;
56
66
  };
57
- const run = (argv) => {
58
- var _a;
59
- const command = argv[0];
60
- const root = (_a = readFlag(argv, '--root')) !== null && _a !== void 0 ? _a : process.cwd();
61
- const options = { root, version: readVersion(), targets: parseTargets(argv) };
67
+ const STRICT_COMMANDS = ['sync', 'check', 'init', 'migrate'];
68
+ const runStrict = (command, args) => {
69
+ var _a, _b;
70
+ const root = (_a = args.root) !== null && _a !== void 0 ? _a : (0, config_1.resolveRepoRoot)(process.cwd());
71
+ const options = { root, targets: args.targets };
62
72
  switch (command) {
63
73
  case 'sync':
64
- return (0, sync_1.sync)(Object.assign(Object.assign({}, options), { dryRun: argv.includes('--dry-run') }));
74
+ return (0, sync_1.sync)(Object.assign(Object.assign({}, options), { dryRun: args.dryRun }));
65
75
  case 'check':
66
76
  return (0, sync_1.check)(options);
67
77
  case 'init':
68
- return init(root);
69
- case 'migrate':
70
- return (0, migrate_1.migrate)(Object.assign(Object.assign({}, options), { dryRun: argv.includes('--dry-run') }));
78
+ return init((_b = args.root) !== null && _b !== void 0 ? _b : process.cwd());
79
+ default:
80
+ return (0, migrate_1.migrate)(Object.assign(Object.assign({}, options), { dryRun: args.dryRun }));
81
+ }
82
+ };
83
+ const run = (argv) => {
84
+ var _a;
85
+ const command = argv[0];
86
+ if (command !== undefined && STRICT_COMMANDS.includes(command)) {
87
+ const args = (0, cli_args_1.parseCommandArgs)(command, argv.slice(1));
88
+ if (args.problems.length) {
89
+ console.error(`${args.problems.join('\n')}\n\n${USAGE}`);
90
+ return 1;
91
+ }
92
+ if (args.help) {
93
+ console.log(USAGE);
94
+ return 0;
95
+ }
96
+ return runStrict(command, args);
97
+ }
98
+ const root = (_a = readFlag(argv, '--root')) !== null && _a !== void 0 ? _a : (0, config_1.resolveRepoRoot)(process.cwd());
99
+ switch (command) {
100
+ case 'git-flow':
101
+ return (0, git_flow_command_1.gitFlowCommand)({ root, argv: argv.slice(1) });
102
+ case 'output-style':
103
+ return (0, output_style_command_1.outputStyleCommand)({ argv: argv.slice(1) });
104
+ case 'timetrack':
105
+ return (0, timetrack_command_1.timetrackCommand)({ root, argv: argv.slice(1) });
71
106
  default:
72
107
  console.log(USAGE);
73
108
  return command === undefined || command === '--help' || command === '-h' ? 0 : 1;
@@ -76,12 +111,12 @@ const run = (argv) => {
76
111
  tslib_1.__exportStar(require("./lib"), exports);
77
112
  // Guarded so the package can also be imported as a library without running the CLI.
78
113
  if (require.main === module) {
79
- try {
80
- process.exit(run(process.argv.slice(2)));
81
- }
82
- catch (error) {
83
- console.error(error instanceof Error ? error.message : error);
114
+ Promise.resolve()
115
+ .then(() => run(process.argv.slice(2)))
116
+ .then((code) => process.exit(code))
117
+ .catch((error) => {
118
+ console.error((0, plain_text_1.plain)(error instanceof Error ? error.message : String(error)));
84
119
  process.exit(1);
85
- }
120
+ });
86
121
  }
87
122
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/agent-rules/src/index.ts"],"names":[],"mappings":";;;;AACA,2BAA6D;AAC7D,+BAA4B;AAC5B,yCAA2F;AAC3F,2CAAwC;AACxC,qCAAyC;AAEzC,MAAM,KAAK,GAAG;;;;6CAI+B,yBAAgB;;;;;;;kDAOX,sBAAa,CAAC,IAAI,CAAC,IAAI,CAAC;;;CAGzE,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,IAAc,EAAE,IAAY,EAAE,EAAE;IAChD,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjC,IAAI,KAAK,KAAK,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IAEnC,OAAO,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AACzB,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,IAAc,EAAE,EAAE;IACtC,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAExC,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAC;IAE3B,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAkB,CAAC;AACtE,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,GAAG,EAAE;IACvB,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAwB,CAAC;IAEh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QAAQ,IAAI,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrF,CAAC;AACH,CAAC,CAAC;AAEF,gDAAsB;AAEtB,oFAAoF;AACpF,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,OAAO,CAAC,OAAO,EAAE;SACd,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;SACtC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAClC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QACxB,OAAO,CAAC,KAAK,CAAC,IAAA,kBAAK,EAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC7E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { AgentTarget } from './config';
2
+ export type CommandArgs = {
3
+ targets?: AgentTarget[];
4
+ root?: string;
5
+ dryRun: boolean;
6
+ help: boolean;
7
+ problems: string[];
8
+ };
9
+ export declare const parseCommandArgs: (command: string, argv: readonly string[]) => CommandArgs;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseCommandArgs = void 0;
4
+ const VALUE_FLAGS = ['--targets', '--root'];
5
+ const FLAGS_BY_COMMAND = {
6
+ sync: ['--targets', '--root', '--dry-run'],
7
+ check: ['--targets', '--root'],
8
+ init: ['--root'],
9
+ migrate: ['--targets', '--root', '--dry-run'],
10
+ };
11
+ const parseCommandArgs = (command, argv) => {
12
+ var _a, _b;
13
+ const allowed = [...((_a = FLAGS_BY_COMMAND[command]) !== null && _a !== void 0 ? _a : []), '--help', '-h'];
14
+ const args = { dryRun: false, help: false, problems: [] };
15
+ for (let index = 0; index < argv.length; index += 1) {
16
+ const argument = (_b = argv[index]) !== null && _b !== void 0 ? _b : '';
17
+ const separator = argument.indexOf('=');
18
+ const flag = separator === -1 ? argument : argument.slice(0, separator);
19
+ if (!allowed.includes(flag)) {
20
+ args.problems.push(flag.startsWith('-') ? `Unknown flag "${flag}" for ${command}.` : `Unexpected argument "${argument}".`);
21
+ continue;
22
+ }
23
+ if (VALUE_FLAGS.includes(flag)) {
24
+ const value = separator === -1 ? argv[++index] : argument.slice(separator + 1);
25
+ const targets = value === null || value === void 0 ? void 0 : value.split(',').map((entry) => entry.trim()).filter((entry) => entry.length > 0);
26
+ if (!value || value.startsWith('-') || (flag === '--targets' && !(targets === null || targets === void 0 ? void 0 : targets.length))) {
27
+ args.problems.push(`${flag} needs a value.`);
28
+ continue;
29
+ }
30
+ if (flag === '--root')
31
+ args.root = value;
32
+ else
33
+ args.targets = targets;
34
+ continue;
35
+ }
36
+ if (separator !== -1) {
37
+ args.problems.push(`${flag} takes no value.`);
38
+ continue;
39
+ }
40
+ if (flag === '--dry-run')
41
+ args.dryRun = true;
42
+ else
43
+ args.help = true;
44
+ }
45
+ return args;
46
+ };
47
+ exports.parseCommandArgs = parseCommandArgs;
48
+ //# sourceMappingURL=cli-args.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-args.js","sourceRoot":"","sources":["../../../../../libs/agent-rules/src/lib/cli-args.ts"],"names":[],"mappings":";;;AAUA,MAAM,WAAW,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AAE5C,MAAM,gBAAgB,GAA6B;IACjD,IAAI,EAAE,CAAC,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAC;IAC1C,KAAK,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC;IAC9B,IAAI,EAAE,CAAC,QAAQ,CAAC;IAChB,OAAO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AK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;YAC/E,MAAM,OAAO,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CACjB,KAAK,CAAC,GAAG,EACV,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,EAC3B,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YAEvC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAA,CAAC,EAAE,CAAC;gBAClF,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,iBAAiB,CAAC,CAAC;gBAC7C,SAAS;YACX,CAAC;YAED,IAAI,IAAI,KAAK,QAAQ;gBAAE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;;gBACpC,IAAI,CAAC,OAAO,GAAG,OAAwB,CAAC;YAC7C,SAAS;QACX,CAAC;QAED,IAAI,SAAS,KAAK,CAAC,CAAC,EAAE,CAAC;YACrB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,kBAAkB,CAAC,CAAC;YAC9C,SAAS;QACX,CAAC;QAED,IAAI,IAAI,KAAK,WAAW;YAAE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;;YACxC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACxB,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AA3CW,QAAA,gBAAgB,oBA2C3B"}
@@ -0,0 +1,10 @@
1
+ /** The file that validates commit messages, as the skill should name it, or `null` when none does. */
2
+ export type CommitlintSource = string | null;
3
+ export declare const findCommitlintConfig: (root: string) => CommitlintSource;
4
+ /**
5
+ * The git-commit skill states where its format comes from, and whether a message can be verified,
6
+ * from what the repo actually has. Promising a `commitlint` run to a repo without one makes the
7
+ * agent narrate the contradiction it finds instead of just writing the commit — so a repo with no
8
+ * commitlint gets a guide that never mentions it.
9
+ */
10
+ export declare const commitMessageVars: (source: CommitlintSource) => Record<string, string>;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.commitMessageVars = exports.findCommitlintConfig = void 0;
4
+ const fs_1 = require("fs");
5
+ const path_1 = require("path");
6
+ const COMMITLINT_CONFIG_FILES = [
7
+ 'commitlint.config.js',
8
+ 'commitlint.config.cjs',
9
+ 'commitlint.config.mjs',
10
+ 'commitlint.config.ts',
11
+ 'commitlint.config.mts',
12
+ 'commitlint.config.json',
13
+ 'commitlint.config.yaml',
14
+ 'commitlint.config.yml',
15
+ '.commitlintrc',
16
+ '.commitlintrc.js',
17
+ '.commitlintrc.cjs',
18
+ '.commitlintrc.mjs',
19
+ '.commitlintrc.ts',
20
+ '.commitlintrc.json',
21
+ '.commitlintrc.yaml',
22
+ '.commitlintrc.yml',
23
+ ];
24
+ const findCommitlintConfig = (root) => {
25
+ const configFile = COMMITLINT_CONFIG_FILES.find((name) => (0, fs_1.existsSync)((0, path_1.join)(root, name)));
26
+ if (configFile)
27
+ return configFile;
28
+ const manifestPath = (0, path_1.join)(root, 'package.json');
29
+ if (!(0, fs_1.existsSync)(manifestPath))
30
+ return null;
31
+ const manifest = JSON.parse((0, fs_1.readFileSync)(manifestPath, 'utf8'));
32
+ return manifest.commitlint ? 'package.json' : null;
33
+ };
34
+ exports.findCommitlintConfig = findCommitlintConfig;
35
+ /**
36
+ * The git-commit skill states where its format comes from, and whether a message can be verified,
37
+ * from what the repo actually has. Promising a `commitlint` run to a repo without one makes the
38
+ * agent narrate the contradiction it finds instead of just writing the commit — so a repo with no
39
+ * commitlint gets a guide that never mentions it.
40
+ */
41
+ const commitMessageVars = (source) => source
42
+ ? {
43
+ commitRuleSource: `the **commitlint rules** in \`${source}\` - conventional commits with a required scope`,
44
+ commitValidation: 'When unsure a message passes, check it: `echo "<msg>" | npx commitlint`.',
45
+ }
46
+ : {
47
+ commitRuleSource: "this repo's **conventional-commit** convention",
48
+ commitValidation: 'Nothing checks the message once it is written, so get the type, scope and subject case right the first time.',
49
+ };
50
+ exports.commitMessageVars = commitMessageVars;
51
+ //# sourceMappingURL=commitlint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commitlint.js","sourceRoot":"","sources":["../../../../../libs/agent-rules/src/lib/commitlint.ts"],"names":[],"mappings":";;;AAAA,2BAA8C;AAC9C,+BAA4B;AAK5B,MAAM,uBAAuB,GAAG;IAC9B,sBAAsB;IACtB,uBAAuB;IACvB,uBAAuB;IACvB,sBAAsB;IACtB,uBAAuB;IACvB,wBAAwB;IACxB,wBAAwB;IACxB,uBAAuB;IACvB,eAAe;IACf,kBAAkB;IAClB,mBAAmB;IACnB,mBAAmB;IACnB,kBAAkB;IAClB,oBAAoB;IACpB,oBAAoB;IACpB,mBAAmB;CACpB,CAAC;AAEK,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAoB,EAAE;IACrE,MAAM,UAAU,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,eAAU,EAAC,IAAA,WAAI,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAExF,IAAI,UAAU;QAAE,OAAO,UAAU,CAAC;IAElC,MAAM,YAAY,GAAG,IAAA,WAAI,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAEhD,IAAI,CAAC,IAAA,eAAU,EAAC,YAAY,CAAC;QAAE,OAAO,IAAI,CAAC;IAE3C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,YAAY,EAAE,MAAM,CAAC,CAA6B,CAAC;IAE5F,OAAO,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC;AACrD,CAAC,CAAC;AAZW,QAAA,oBAAoB,wBAY/B;AAEF;;;;;GAKG;AACI,MAAM,iBAAiB,GAAG,CAAC,MAAwB,EAA0B,EAAE,CACpF,MAAM;IACJ,CAAC,CAAC;QACE,gBAAgB,EAAE,iCAAiC,MAAM,iDAAiD;QAC1G,gBAAgB,EAAE,0EAA0E;KAC7F;IACH,CAAC,CAAC;QACE,gBAAgB,EAAE,gDAAgD;QAClE,gBAAgB,EACd,8GAA8G;KACjH,CAAC;AAVK,QAAA,iBAAiB,qBAUtB"}
@@ -1,8 +1,17 @@
1
1
  import { ContentScope } from './frontmatter';
2
+ import { GitFlowConfig } from './git-flow';
2
3
  export declare const AGENT_TARGETS: readonly ["claude", "codex", "cursor", "copilot"];
3
4
  export type AgentTarget = (typeof AGENT_TARGETS)[number];
4
5
  export declare const CONFIG_FILE_NAME = "ethlete-agents.config.json";
5
6
  export declare const LOCAL_CONFIG_FILE_NAME = "ethlete-agents.config.local.json";
7
+ /**
8
+ * How this repo reads a Jira issue into a branch name. The instance, the credentials and the subject
9
+ * field are not here and cannot be: the Timetrack app holds them, and `git-flow start` asks it.
10
+ */
11
+ export type JiraSettings = {
12
+ /** Branch type per Jira issue type, e.g. `{ "Bug": "fix" }`. Anything unlisted becomes `feat`. */
13
+ typeByIssueType?: Record<string, string>;
14
+ };
6
15
  export type SyncConfig = {
7
16
  root: string;
8
17
  targets: AgentTarget[];
@@ -16,9 +25,17 @@ export type SyncConfig = {
16
25
  * `AGENTS.md` marker block, and a second copy would load twice.
17
26
  */
18
27
  claudeMdImportsAgentsMd: boolean;
19
- /** Opt-in Claude Code hooks (they run commands on the developer's machine, so never default). */
28
+ /** Opt-in agent hooks (they run commands on the developer's machine, so never default). */
20
29
  hooks: string[];
30
+ /** Opt-in git hooks, appended to the repo's own husky hooks. Same reason they never default. */
31
+ gitHooks: string[];
32
+ /** The branch grammar, resolved against its defaults — see `@ethlete/agent-rules/git-flow`. */
33
+ gitFlow: GitFlowConfig;
34
+ jira: JiraSettings;
35
+ configWarnings?: string[];
21
36
  };
37
+ /** The nearest directory at or above `start` holding an `ethlete-agents.config.json`, else `start`. */
38
+ export declare const resolveRepoRoot: (start: string) => string;
22
39
  /**
23
40
  * The gitignored local config holds per-machine values, read at runtime — by the generated hook
24
41
  * scripts, and by the agent while following a skill — never by `sync`. Sync output must be
@@ -26,12 +43,19 @@ export type SyncConfig = {
26
43
  * so nothing here may change what gets emitted:
27
44
  *
28
45
  * - `disableHooks: true` silences every generated hook, `["context-warning"]` just the named ones.
29
- * - `sdkSourcePath` points at a local `ethlete-sdk` checkout, which the SDK source and local-build
30
- * skills read when they need the SDK's own sources instead of the published package.
46
+ * - `disableAutoHandoffSave: true` keeps the context-warning hook's normal tiered messages (including
47
+ * in auto mode), but at the critical tier in auto mode it falls back to just recommending
48
+ * a handoff instead of writing the handoff file automatically.
49
+ *
50
+ * Where the sibling checkouts live (`sdkSourcePath`, `apiRepoPaths`, `apiRepoBranches`) is not here:
51
+ * it moved to `@ethlete/cli`'s `ethlete.config.local.json`, because `et` reads the same values.
52
+ *
53
+ * No secret belongs here any more. Jira is reached through the Timetrack app, which holds the token
54
+ * in the machine's keychain — one secret per machine rather than one per checkout.
31
55
  */
32
56
  export type LocalConfig = {
33
57
  disableHooks?: boolean | string[];
34
- sdkSourcePath?: string;
58
+ disableAutoHandoffSave?: boolean;
35
59
  };
36
60
  export type LocalConfigState = {
37
61
  exists: false;
@@ -43,7 +67,17 @@ export type LocalConfigState = {
43
67
  valid: true;
44
68
  config: LocalConfig;
45
69
  unknownKeys: string[];
70
+ movedKeys: string[];
46
71
  };
72
+ export declare const LOCAL_CONFIG_KEYS: (keyof LocalConfig)[];
73
+ /**
74
+ * Repo topology moved to `@ethlete/cli`'s `ethlete.config.local.json`, because `et` needs it too.
75
+ * Still recognised here so a checkout that has not moved them yet gets told where they went
76
+ * instead of an "unsupported key" warning.
77
+ */
78
+ export declare const MOVED_LOCAL_CONFIG_KEYS: string[];
79
+ /** Named only to point a migration at it. `@ethlete/cli` owns the file and validates its values. */
80
+ export declare const TOPOLOGY_CONFIG_FILE_NAME = "ethlete.config.local.json";
47
81
  export declare const readLocalConfig: (root: string) => LocalConfigState;
48
82
  /**
49
83
  * Emit for the agents a repo already uses. `codex` is always included: `AGENTS.md` is the