@ethlete/agent-rules 0.1.0-next.4 → 0.1.0-next.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +28 -0
- package/CHANGELOG.md +620 -0
- package/CLAUDE.md +1 -0
- package/README.md +406 -29
- package/THIRD-PARTY-LICENSES.md +35 -0
- package/content/defaults.json +1 -1
- package/content/git-hooks/post-checkout.sh +10 -0
- package/content/git-hooks/pre-push.sh +5 -0
- package/content/hooks/away-mode.py +287 -0
- package/content/hooks/background-design-commands.py +215 -0
- package/content/hooks/builder-chat-words.py +269 -0
- package/content/hooks/context-warning.py +836 -142
- package/content/hooks/git-safety.py +213 -0
- package/content/hooks/subagent-model-policy.py +261 -0
- package/content/mods/.claude-plugin/marketplace.json +16 -0
- package/content/mods/plugins/e2e-progress/.claude-plugin/plugin.json +6 -0
- package/content/mods/plugins/e2e-progress/hooks/hooks.json +1 -0
- package/content/mods/plugins/e2e-progress/hooks/register.tsx +442 -0
- package/content/mods/plugins/e2e-progress/tsconfig.json +3 -0
- package/content/mods/plugins/e2e-progress/types/index.d.ts +23 -0
- package/content/mods/plugins/status-line/.claude-plugin/plugin.json +6 -0
- package/content/mods/plugins/status-line/hooks/hooks.json +1 -0
- package/content/mods/plugins/status-line/hooks/line.ts +73 -0
- package/content/mods/plugins/status-line/hooks/register.tsx +141 -0
- package/content/mods/plugins/status-line/types/index.d.ts +5 -0
- package/content/output-styles/ste-clarity.md +131 -0
- package/content/rules/agent-sessions-wake-up.md +11 -0
- package/content/rules/app-styling.md +66 -0
- package/content/rules/comments.md +4 -1
- package/content/rules/lint-and-format.md +7 -5
- package/content/rules/nx-layout.md +53 -0
- package/content/rules/reactive-state.md +1 -1
- package/content/rules/styling.md +19 -10
- package/content/rules/subagent-models.md +42 -0
- package/content/skills/agent-sessions/SKILL.md +94 -0
- package/content/skills/agent-sessions/agent-sessions.mjs +1079 -0
- package/content/skills/angular-patterns/SKILL.md +31 -7
- package/content/skills/api-source/SKILL.md +156 -0
- package/content/skills/app-testing/SKILL.md +141 -0
- package/content/skills/codex-subagent/SKILL.md +90 -0
- package/content/skills/codex-subagent/codex-agent.mjs +229 -0
- package/content/skills/design-exploration/SKILL.md +190 -0
- package/content/skills/design-exploration/check-story.mjs +139 -0
- package/content/skills/design-exploration/reference-check-and-notes.md +92 -0
- package/content/skills/design-exploration/reference-flows-and-wireframes.md +78 -0
- package/content/skills/design-exploration/reference-inbox-and-mcp.md +54 -0
- package/content/skills/design-exploration/reference-order-and-design-system.md +124 -0
- package/content/skills/design-exploration/reference-products-and-sketches.md +211 -0
- package/content/skills/design-exploration/reference-shots.md +25 -0
- package/content/skills/design-exploration/shoot-template.mjs +61 -0
- package/content/skills/domain-modeling/ADR-FORMAT.md +47 -0
- package/content/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/content/skills/domain-modeling/SKILL.md +80 -0
- package/content/skills/e2e-triage/SKILL.md +80 -0
- package/content/skills/figma-export/SKILL.md +191 -0
- package/content/skills/figma-export/dump-figma-layers.py +83 -0
- package/content/skills/figma-export/dump-figma-svg.py +235 -0
- package/content/skills/figma-export/measure-template.mjs +87 -0
- package/content/skills/git-commit/SKILL.md +21 -7
- package/content/skills/git-flow/SKILL.md +87 -0
- package/content/skills/grill-with-docs/SKILL.md +13 -0
- package/content/skills/grilling/SKILL.md +52 -0
- package/content/skills/handoff/SKILL.md +29 -69
- package/content/skills/handoff/save.md +187 -0
- package/content/skills/query/SKILL.md +165 -64
- package/content/skills/report/SKILL.md +26 -0
- package/content/skills/rxjs-signals/SKILL.md +33 -4
- package/content/skills/sdk-docs/SKILL.md +50 -14
- package/content/skills/sdk-local-build/SKILL.md +26 -8
- package/content/skills/sdk-local-build/sdk-local-baseline.mjs +64 -0
- package/content/skills/sdk-source/SKILL.md +37 -34
- package/content/skills/sdk-update/SKILL.md +103 -0
- package/content/skills/story-styling/SKILL.md +10 -8
- package/content/skills/styleguide/SKILL.md +13 -8
- package/content/skills/styleguide/assets.md +54 -0
- package/content/skills/styleguide/changesets.md +17 -0
- package/content/skills/styleguide/file-structure.md +73 -0
- package/content/skills/styleguide/lint-rule-lookup.md +52 -0
- package/content/skills/styleguide/storybook-structure.md +25 -0
- package/content/skills/theming/SKILL.md +56 -28
- package/content/skills/timetrack/SKILL.md +324 -0
- package/content/skills/verify-in-app/SKILL.md +107 -0
- package/content/skills/verify-in-storybook/SKILL.md +1 -1
- package/migrations/list-state-query-form.md +20 -0
- package/migrations/nx-layout.md +29 -0
- package/migrations/sdk-components-over-hand-built-ui.md +27 -0
- package/migrations/search-query-field.md +52 -0
- package/migrations.json +39 -0
- package/package.json +19 -3
- package/src/index.js +99 -32
- package/src/index.js.map +1 -1
- package/src/lib/cli-args.d.ts +9 -0
- package/src/lib/cli-args.js +48 -0
- package/src/lib/cli-args.js.map +1 -0
- package/src/lib/commitlint.d.ts +10 -0
- package/src/lib/commitlint.js +51 -0
- package/src/lib/commitlint.js.map +1 -0
- package/src/lib/config.d.ts +51 -6
- package/src/lib/config.js +127 -10
- package/src/lib/config.js.map +1 -1
- package/src/lib/filter.d.ts +2 -0
- package/src/lib/filter.js +4 -4
- package/src/lib/filter.js.map +1 -1
- package/src/lib/frontmatter.d.ts +2 -0
- package/src/lib/frontmatter.js +33 -5
- package/src/lib/frontmatter.js.map +1 -1
- package/src/lib/git-flow/build.d.ts +35 -0
- package/src/lib/git-flow/build.js +24 -0
- package/src/lib/git-flow/build.js.map +1 -0
- package/src/lib/git-flow/config.d.ts +59 -0
- package/src/lib/git-flow/config.js +50 -0
- package/src/lib/git-flow/config.js.map +1 -0
- package/src/lib/git-flow/index.d.ts +6 -0
- package/src/lib/git-flow/index.js +23 -0
- package/src/lib/git-flow/index.js.map +1 -0
- package/src/lib/git-flow/parse.d.ts +49 -0
- package/src/lib/git-flow/parse.js +300 -0
- package/src/lib/git-flow/parse.js.map +1 -0
- package/src/lib/git-flow/rename.d.ts +24 -0
- package/src/lib/git-flow/rename.js +70 -0
- package/src/lib/git-flow/rename.js.map +1 -0
- package/src/lib/git-flow/start.d.ts +49 -0
- package/src/lib/git-flow/start.js +57 -0
- package/src/lib/git-flow/start.js.map +1 -0
- package/src/lib/git-flow/validate.d.ts +34 -0
- package/src/lib/git-flow/validate.js +72 -0
- package/src/lib/git-flow/validate.js.map +1 -0
- package/src/lib/git-flow-command.d.ts +4 -0
- package/src/lib/git-flow-command.js +165 -0
- package/src/lib/git-flow-command.js.map +1 -0
- package/src/lib/git-flow-repair.d.ts +17 -0
- package/src/lib/git-flow-repair.js +165 -0
- package/src/lib/git-flow-repair.js.map +1 -0
- package/src/lib/git-flow-start.d.ts +20 -0
- package/src/lib/git-flow-start.js +140 -0
- package/src/lib/git-flow-start.js.map +1 -0
- package/src/lib/git-test-env.fixtures.d.ts +11 -0
- package/src/lib/git-test-env.fixtures.js +31 -0
- package/src/lib/git-test-env.fixtures.js.map +1 -0
- package/src/lib/git.d.ts +64 -0
- package/src/lib/git.js +131 -0
- package/src/lib/git.js.map +1 -0
- package/src/lib/gitlab.d.ts +35 -0
- package/src/lib/gitlab.js +116 -0
- package/src/lib/gitlab.js.map +1 -0
- package/src/lib/index.d.ts +2 -0
- package/src/lib/index.js +26 -11
- package/src/lib/index.js.map +1 -1
- package/src/lib/migrate.js +8 -2
- package/src/lib/migrate.js.map +1 -1
- package/src/lib/output-style-command.d.ts +3 -0
- package/src/lib/output-style-command.js +69 -0
- package/src/lib/output-style-command.js.map +1 -0
- package/src/lib/output-style.d.ts +38 -0
- package/src/lib/output-style.js +134 -0
- package/src/lib/output-style.js.map +1 -0
- package/src/lib/owned-paths.js +27 -3
- package/src/lib/owned-paths.js.map +1 -1
- package/src/lib/package-runner.d.ts +4 -0
- package/src/lib/package-runner.js +86 -0
- package/src/lib/package-runner.js.map +1 -0
- package/src/lib/peer-path.d.ts +12 -0
- package/src/lib/peer-path.js +39 -0
- package/src/lib/peer-path.js.map +1 -0
- package/src/lib/plain-text.d.ts +9 -0
- package/src/lib/plain-text.js +22 -0
- package/src/lib/plain-text.js.map +1 -0
- package/src/lib/plan.d.ts +6 -6
- package/src/lib/plan.js +168 -40
- package/src/lib/plan.js.map +1 -1
- package/src/lib/prettier.d.ts +21 -0
- package/src/lib/prettier.js +51 -0
- package/src/lib/prettier.js.map +1 -0
- package/src/lib/prompt.d.ts +8 -0
- package/src/lib/prompt.js +35 -0
- package/src/lib/prompt.js.map +1 -0
- package/src/lib/render.d.ts +26 -2
- package/src/lib/render.js +45 -10
- package/src/lib/render.js.map +1 -1
- package/src/lib/report-command.d.ts +33 -0
- package/src/lib/report-command.js +312 -0
- package/src/lib/report-command.js.map +1 -0
- package/src/lib/sessions-command.d.ts +4 -0
- package/src/lib/sessions-command.js +16 -0
- package/src/lib/sessions-command.js.map +1 -0
- package/src/lib/sync.d.ts +1 -2
- package/src/lib/sync.js +37 -17
- package/src/lib/sync.js.map +1 -1
- package/src/lib/targets/agents-skills.js +1 -1
- package/src/lib/targets/agents-skills.js.map +1 -1
- package/src/lib/targets/claude-hooks.d.ts +3 -23
- package/src/lib/targets/claude-hooks.js +22 -86
- package/src/lib/targets/claude-hooks.js.map +1 -1
- package/src/lib/targets/claude-mods.d.ts +20 -0
- package/src/lib/targets/claude-mods.js +47 -0
- package/src/lib/targets/claude-mods.js.map +1 -0
- package/src/lib/targets/claude.js +2 -3
- package/src/lib/targets/claude.js.map +1 -1
- package/src/lib/targets/codex-hooks.d.ts +12 -0
- package/src/lib/targets/codex-hooks.js +35 -0
- package/src/lib/targets/codex-hooks.js.map +1 -0
- package/src/lib/targets/codex.js +4 -4
- package/src/lib/targets/codex.js.map +1 -1
- package/src/lib/targets/copilot.js +4 -4
- package/src/lib/targets/copilot.js.map +1 -1
- package/src/lib/targets/cursor.js +3 -3
- package/src/lib/targets/cursor.js.map +1 -1
- package/src/lib/targets/git-hooks.d.ts +25 -0
- package/src/lib/targets/git-hooks.js +71 -0
- package/src/lib/targets/git-hooks.js.map +1 -0
- package/src/lib/targets/hooks-shared.d.ts +60 -0
- package/src/lib/targets/hooks-shared.js +174 -0
- package/src/lib/targets/hooks-shared.js.map +1 -0
- package/src/lib/targets/mcp.d.ts +16 -0
- package/src/lib/targets/mcp.js +72 -0
- package/src/lib/targets/mcp.js.map +1 -0
- package/src/lib/targets/shared.d.ts +1 -9
- package/src/lib/targets/shared.js +4 -8
- package/src/lib/targets/shared.js.map +1 -1
- package/src/lib/timetrack-command.d.ts +11 -0
- package/src/lib/timetrack-command.js +1262 -0
- package/src/lib/timetrack-command.js.map +1 -0
- package/src/lib/timetrack-snapshot.d.ts +66 -0
- package/src/lib/timetrack-snapshot.js +146 -0
- package/src/lib/timetrack-snapshot.js.map +1 -0
- package/src/lib/timetrack.d.ts +607 -0
- package/src/lib/timetrack.js +285 -0
- package/src/lib/timetrack.js.map +1 -0
- package/content/skills/styleguide/STYLEGUIDE.md +0 -520
|
@@ -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:
|
|
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,20 @@
|
|
|
1
|
+
# Lists with URL state use `defineQueryForm`
|
|
2
|
+
|
|
3
|
+
The `ethlete-query` skill now says every filtered, searched, sorted or paged list uses
|
|
4
|
+
`defineQueryForm`, not `injectQueryParams()`, `router.navigate` and a draft signal wired by hand.
|
|
5
|
+
Moving a list is a rewrite of its component, so it happens when someone next edits that list. The
|
|
6
|
+
skill says how to keep the old URL working when you do.
|
|
7
|
+
|
|
8
|
+
No code changes in this task. To see how many components still wire their params by hand, count
|
|
9
|
+
the files that both read and write query params:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
grep -rlE 'injectQueryParams?\(|queryParamMap|snapshot\.queryParams|\.queryParams\.(pipe|subscribe)\(' apps libs --include='*.ts' |
|
|
13
|
+
xargs grep -lE '\bqueryParams(Handling)?\b' | wc -l
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Done when
|
|
17
|
+
|
|
18
|
+
- The count is in your final message, or in the report you give the developer.
|
|
19
|
+
|
|
20
|
+
Then delete this task file.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Compare the workspace with the Nx layout rule
|
|
2
|
+
|
|
3
|
+
`@ethlete/agent-rules` now ships an `nx-layout` rule for Nx workspaces: thin apps, feature code in
|
|
4
|
+
one `libs/domain/<app>` lib per app with a folder per feature, shared `queries`, `types`, `uikit`, `theme` and `env` libs, aliases that
|
|
5
|
+
mirror the path, and one `scope:*` tag per project. New code follows it.
|
|
6
|
+
|
|
7
|
+
This is a recommendation, not a rewrite. Moving projects changes import paths, project names, tags
|
|
8
|
+
and CI caches across the whole repo, and the rule itself says not to restructure an existing
|
|
9
|
+
workspace unless the team asks for it.
|
|
10
|
+
|
|
11
|
+
## What to decide
|
|
12
|
+
|
|
13
|
+
1. Read the rule (in `AGENTS.md`, or under `.claude/rules/ethlete/`). If it is missing, run
|
|
14
|
+
`ethlete-agents sync` with this repo's package manager (`yarn`, `pnpm exec` or `npx`).
|
|
15
|
+
2. List where the workspace deviates: feature code inside `apps/`, queries or themes inside an app,
|
|
16
|
+
`feature/ui/data-access/util` folders, aliases that do not mirror the path, missing `scope:*` tags.
|
|
17
|
+
3. Decide per deviation: move it now, move it when that area is next touched, or keep it.
|
|
18
|
+
4. Keep what you decided where an agent reads it, so it stops flagging it: in `AGENTS.md` above the
|
|
19
|
+
`<!-- ethlete:agent-rules:start -->` line or below `<!-- ethlete:agent-rules:end -->`, or in the
|
|
20
|
+
repo's `CONTEXT.md` or an ADR. Never between the two markers: `ethlete-agents sync` rewrites that
|
|
21
|
+
block and drops the edit. If `AGENTS.md` holds nothing but the block, add the decisions above it.
|
|
22
|
+
|
|
23
|
+
An agent may prepare the list in step 2. It must not move a project without that decision.
|
|
24
|
+
|
|
25
|
+
## Done when
|
|
26
|
+
|
|
27
|
+
- Each deviation from step 2 has a decision, recorded as step 4 says.
|
|
28
|
+
|
|
29
|
+
Then delete this task file.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Use the SDK component where one exists
|
|
2
|
+
|
|
3
|
+
The `ethlete-sdk-docs` skill now lists every component domain, with a table that maps common needs
|
|
4
|
+
to them ("Check this list before you build any UI by hand"). Apps built their own bar charts,
|
|
5
|
+
avatars and progress bars because the old list did not name them. Replacing one restyles its view,
|
|
6
|
+
so it happens when someone next edits that view, not in this task.
|
|
7
|
+
|
|
8
|
+
When you do replace one, check every feature of the hand-built one against the SDK component's
|
|
9
|
+
inputs, slots and `--et-*` tokens first, and keep the hand-built one where a feature has no
|
|
10
|
+
counterpart. Known gaps:
|
|
11
|
+
|
|
12
|
+
- `et-bar-chart` renders every category label and only truncates it, and has no slot for a title,
|
|
13
|
+
a note or an empty state.
|
|
14
|
+
- `et-avatar` derives initials from `name` only, and takes its colours from a colour theme only.
|
|
15
|
+
|
|
16
|
+
No code changes in this task. To count the candidates, skipping hits that already use an `et-`
|
|
17
|
+
element:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
grep -rlE 'bar-?chart|bar-?graph|avatar|initials|progress-?bar' apps libs --include='*.html' --include='*.ts' | xargs grep -LE '<et-(bar-chart|avatar|progress-bar)' | wc -l
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Done when
|
|
24
|
+
|
|
25
|
+
- The count is in your final message, or in the report you give the developer.
|
|
26
|
+
|
|
27
|
+
Then delete this task file.
|
|
@@ -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.
|
package/migrations.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"migrations": [
|
|
3
|
+
{
|
|
4
|
+
"name": "list-state-query-form",
|
|
5
|
+
"version": "0.1.0-next.17",
|
|
6
|
+
"kind": "manual",
|
|
7
|
+
"level": "optional",
|
|
8
|
+
"description": "Lists that sync their params to the URL by hand move to defineQueryForm when they are next edited.",
|
|
9
|
+
"instructions": "./migrations/list-state-query-form.md",
|
|
10
|
+
"docs": "/query/query-forms"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "search-query-field",
|
|
14
|
+
"version": "0.1.0-next.17",
|
|
15
|
+
"kind": "assisted",
|
|
16
|
+
"level": "optional",
|
|
17
|
+
"description": "A hand-debounced search that feeds a query moves to searchQueryField.",
|
|
18
|
+
"instructions": "./migrations/search-query-field.md",
|
|
19
|
+
"docs": "/query/query-forms"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "sdk-components-over-hand-built-ui",
|
|
23
|
+
"version": "0.1.0-next.17",
|
|
24
|
+
"kind": "manual",
|
|
25
|
+
"level": "optional",
|
|
26
|
+
"description": "Hand-built bar charts, avatars and progress bars move to the SDK components when their view is next edited.",
|
|
27
|
+
"instructions": "./migrations/sdk-components-over-hand-built-ui.md",
|
|
28
|
+
"docs": "/components/"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "nx-layout",
|
|
32
|
+
"version": "0.1.0-next.17",
|
|
33
|
+
"kind": "manual",
|
|
34
|
+
"level": "optional",
|
|
35
|
+
"description": "Compare the workspace with the Nx layout rule, and decide whether any project moves.",
|
|
36
|
+
"instructions": "./migrations/nx-layout.md"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethlete/agent-rules",
|
|
3
|
-
"version": "0.1.0-next.
|
|
3
|
+
"version": "0.1.0-next.40",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/ethlete-io/ethdk",
|
|
7
|
+
"directory": "libs/agent-rules"
|
|
8
|
+
},
|
|
4
9
|
"license": "MIT",
|
|
5
10
|
"type": "commonjs",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./src/index.d.ts",
|
|
14
|
+
"default": "./src/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./git-flow": {
|
|
17
|
+
"types": "./src/lib/git-flow/index.d.ts",
|
|
18
|
+
"default": "./src/lib/git-flow/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./package.json": "./package.json"
|
|
21
|
+
},
|
|
6
22
|
"main": "./src/index.js",
|
|
7
23
|
"typings": "./src/index.d.ts",
|
|
8
24
|
"bin": {
|
|
9
25
|
"ethlete-agents": "./src/index.js"
|
|
10
26
|
},
|
|
11
|
-
"
|
|
12
|
-
"
|
|
27
|
+
"ethlete": {
|
|
28
|
+
"migrations": "./migrations.json"
|
|
13
29
|
},
|
|
14
30
|
"types": "./src/index.d.ts"
|
|
15
31
|
}
|
package/src/index.js
CHANGED
|
@@ -1,17 +1,54 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
3
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
18
|
const fs_1 = require("fs");
|
|
19
|
+
const prettier_1 = require("./lib/prettier");
|
|
6
20
|
const path_1 = require("path");
|
|
21
|
+
const cli_args_1 = require("./lib/cli-args");
|
|
7
22
|
const config_1 = require("./lib/config");
|
|
23
|
+
const git_flow_command_1 = require("./lib/git-flow-command");
|
|
24
|
+
const load_content_1 = require("./lib/load-content");
|
|
25
|
+
const sessions_command_1 = require("./lib/sessions-command");
|
|
8
26
|
const migrate_1 = require("./lib/migrate");
|
|
27
|
+
const output_style_command_1 = require("./lib/output-style-command");
|
|
28
|
+
const package_runner_1 = require("./lib/package-runner");
|
|
29
|
+
const plain_text_1 = require("./lib/plain-text");
|
|
30
|
+
const report_command_1 = require("./lib/report-command");
|
|
9
31
|
const sync_1 = require("./lib/sync");
|
|
32
|
+
const timetrack_command_1 = require("./lib/timetrack-command");
|
|
10
33
|
const USAGE = `ethlete-agents — compile @ethlete agent rules and skills into your repo
|
|
11
34
|
|
|
12
35
|
ethlete-agents sync Write the generated rules/skills for every detected agent
|
|
13
36
|
ethlete-agents check Exit non-zero when the generated files are out of date (for CI)
|
|
14
37
|
ethlete-agents init Write a starter ${config_1.CONFIG_FILE_NAME}
|
|
38
|
+
ethlete-agents git-flow Name, check and repair branches against the repo's git flow
|
|
39
|
+
(start, check, repair, explain)
|
|
40
|
+
ethlete-agents output-style
|
|
41
|
+
Install an Ethlete output style into this machine's Claude Code
|
|
42
|
+
config and switch to it (Claude Code only)
|
|
43
|
+
ethlete-agents timetrack Ask the running Timetrack app about Jira - it holds this
|
|
44
|
+
machine's credentials, so no repo needs a token
|
|
45
|
+
(status, instance, issue, search, project, create, log)
|
|
46
|
+
ethlete-agents sessions Run agents in tmux sessions of one checkout: message them, wake idle
|
|
47
|
+
ones, restart one with a prompt, claim paths (run, up, down, restart,
|
|
48
|
+
send, inbox, claim). The old name "mailbox" works too
|
|
49
|
+
ethlete-agents report Print a table of what was done in a period: rows with their commits,
|
|
50
|
+
parked rows, commit counts, CI and subagent figures
|
|
51
|
+
(today, yesterday, week, --since <date> [--until <date>])
|
|
15
52
|
ethlete-agents migrate Convert the repo to the AGENTS.md + .agents/skills layout:
|
|
16
53
|
CLAUDE.md content moves into AGENTS.md (CLAUDE.md becomes an
|
|
17
54
|
@AGENTS.md import), hand-written .claude/skills move to
|
|
@@ -19,7 +56,8 @@ const USAGE = `ethlete-agents — compile @ethlete agent rules and skills into y
|
|
|
19
56
|
|
|
20
57
|
Options
|
|
21
58
|
--targets <list> Comma-separated subset of: ${config_1.AGENT_TARGETS.join(', ')}
|
|
22
|
-
--root <path> Repo root to write into (default:
|
|
59
|
+
--root <path> Repo root to write into (default: the nearest directory holding
|
|
60
|
+
${config_1.CONFIG_FILE_NAME}, else the current directory)
|
|
23
61
|
--dry-run Print what would change without writing (sync and migrate)
|
|
24
62
|
`;
|
|
25
63
|
const readFlag = (args, flag) => {
|
|
@@ -28,60 +66,89 @@ const readFlag = (args, flag) => {
|
|
|
28
66
|
return undefined;
|
|
29
67
|
return args[index + 1];
|
|
30
68
|
};
|
|
31
|
-
const
|
|
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
|
-
};
|
|
69
|
+
const INIT_VARS = ['lintCommand', 'lintFixCommand', 'formatCommand', 'storybookStartCommand', 'storybookUrl'];
|
|
41
70
|
const init = (root) => {
|
|
42
71
|
const path = (0, path_1.join)(root, config_1.CONFIG_FILE_NAME);
|
|
43
72
|
if ((0, fs_1.existsSync)(path)) {
|
|
44
73
|
console.error(`${config_1.CONFIG_FILE_NAME} already exists.`);
|
|
45
74
|
return 1;
|
|
46
75
|
}
|
|
76
|
+
const defaults = (0, package_runner_1.followPackageManager)(root, (0, load_content_1.loadDefaultVars)());
|
|
77
|
+
const detected = (0, package_runner_1.detectCommandVars)(root);
|
|
78
|
+
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
79
|
const template = {
|
|
48
80
|
targets: (0, config_1.detectTargets)(root),
|
|
49
|
-
vars
|
|
81
|
+
vars,
|
|
50
82
|
exclude: [],
|
|
51
83
|
hooks: [],
|
|
52
84
|
};
|
|
53
|
-
(0,
|
|
54
|
-
console.log(`Wrote ${config_1.CONFIG_FILE_NAME}.
|
|
85
|
+
(0, prettier_1.writeJsonFile)({ file: path, value: template });
|
|
86
|
+
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
87
|
return 0;
|
|
56
88
|
};
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const root = (_a =
|
|
61
|
-
const options = { root,
|
|
89
|
+
const STRICT_COMMANDS = ['sync', 'check', 'init', 'migrate'];
|
|
90
|
+
const runStrict = (command, args) => {
|
|
91
|
+
var _a, _b;
|
|
92
|
+
const root = (_a = args.root) !== null && _a !== void 0 ? _a : (0, config_1.resolveRepoRoot)(process.cwd());
|
|
93
|
+
const options = { root, targets: args.targets };
|
|
62
94
|
switch (command) {
|
|
63
95
|
case 'sync':
|
|
64
|
-
return (0, sync_1.sync)(Object.assign(Object.assign({}, options), { dryRun:
|
|
96
|
+
return (0, sync_1.sync)(Object.assign(Object.assign({}, options), { dryRun: args.dryRun }));
|
|
65
97
|
case 'check':
|
|
66
98
|
return (0, sync_1.check)(options);
|
|
67
99
|
case 'init':
|
|
68
|
-
return init(root);
|
|
69
|
-
|
|
70
|
-
return (0, migrate_1.migrate)(Object.assign(Object.assign({}, options), { dryRun:
|
|
100
|
+
return init((_b = args.root) !== null && _b !== void 0 ? _b : process.cwd());
|
|
101
|
+
default:
|
|
102
|
+
return (0, migrate_1.migrate)(Object.assign(Object.assign({}, options), { dryRun: args.dryRun }));
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
const run = (argv) => {
|
|
106
|
+
var _a;
|
|
107
|
+
const command = argv[0];
|
|
108
|
+
if (command !== undefined && STRICT_COMMANDS.includes(command)) {
|
|
109
|
+
const args = (0, cli_args_1.parseCommandArgs)(command, argv.slice(1));
|
|
110
|
+
if (args.problems.length) {
|
|
111
|
+
console.error(`${args.problems.join('\n')}\n\n${USAGE}`);
|
|
112
|
+
return 1;
|
|
113
|
+
}
|
|
114
|
+
if (args.help) {
|
|
115
|
+
console.log(USAGE);
|
|
116
|
+
return 0;
|
|
117
|
+
}
|
|
118
|
+
return runStrict(command, args);
|
|
119
|
+
}
|
|
120
|
+
const root = (_a = readFlag(argv, '--root')) !== null && _a !== void 0 ? _a : (0, config_1.resolveRepoRoot)(process.cwd());
|
|
121
|
+
switch (command) {
|
|
122
|
+
case 'git-flow':
|
|
123
|
+
return (0, git_flow_command_1.gitFlowCommand)({ root, argv: argv.slice(1) });
|
|
124
|
+
case 'sessions':
|
|
125
|
+
case 'mailbox':
|
|
126
|
+
return (0, sessions_command_1.sessionsCommand)({ argv: argv.slice(1) });
|
|
127
|
+
case 'output-style':
|
|
128
|
+
return (0, output_style_command_1.outputStyleCommand)({ argv: argv.slice(1) });
|
|
129
|
+
case 'report':
|
|
130
|
+
return (0, report_command_1.reportCommand)({ root, argv: argv.slice(1) });
|
|
131
|
+
case 'timetrack':
|
|
132
|
+
return (0, timetrack_command_1.timetrackCommand)({ root, argv: argv.slice(1) });
|
|
71
133
|
default:
|
|
72
134
|
console.log(USAGE);
|
|
73
135
|
return command === undefined || command === '--help' || command === '-h' ? 0 : 1;
|
|
74
136
|
}
|
|
75
137
|
};
|
|
76
|
-
|
|
138
|
+
__exportStar(require("./lib"), exports);
|
|
139
|
+
const exitAfterDrain = (code) => {
|
|
140
|
+
process.exitCode = code;
|
|
141
|
+
// A piped stdout is written asynchronously, and exit() would cut off what is still buffered.
|
|
142
|
+
process.stdout.write('', () => process.exit(code));
|
|
143
|
+
};
|
|
77
144
|
// Guarded so the package can also be imported as a library without running the CLI.
|
|
78
145
|
if (require.main === module) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
console.error(error instanceof Error ? error.message : error);
|
|
84
|
-
|
|
85
|
-
}
|
|
146
|
+
Promise.resolve()
|
|
147
|
+
.then(() => run(process.argv.slice(2)))
|
|
148
|
+
.then((code) => exitAfterDrain(code))
|
|
149
|
+
.catch((error) => {
|
|
150
|
+
console.error((0, plain_text_1.plain)(error instanceof Error ? error.message : String(error)));
|
|
151
|
+
exitAfterDrain(1);
|
|
152
|
+
});
|
|
86
153
|
}
|
|
87
154
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/agent-rules/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,2BAAgC;AAChC,6CAA+C;AAC/C,+BAA4B;AAC5B,6CAA+D;AAC/D,yCAA+F;AAC/F,6DAAwD;AACxD,qDAAqD;AACrD,6DAAyD;AACzD,2CAAwC;AACxC,qEAAgE;AAChE,yDAA+E;AAC/E,iDAAyC;AACzC,yDAAqD;AACrD,qCAAyC;AACzC,+DAA2D;AAE3D,MAAM,KAAK,GAAG;;;;6CAI+B,yBAAgB;;;;;;;;;;;;;;;;;;;;;kDAqBX,sBAAa,CAAC,IAAI,CAAC,IAAI,CAAC;;uBAEnD,yBAAgB;;CAEtC,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,SAAS,GAAG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AC,CAAC,CAAC,CAAC;IACrF,CAAC;AACH,CAAC,CAAC;AAEF,wCAAsB;AAEtB,MAAM,cAAc,GAAG,CAAC,IAAY,EAAE,EAAE;IACtC,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IACxB,6FAA6F;IAC7F,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACrD,CAAC,CAAC;AAEF,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,cAAc,CAAC,IAAI,CAAC,CAAC;SACpC,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,cAAc,CAAC,CAAC,CAAC,CAAC;IACpB,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,EAAE,CAAC,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAC;CAC9C,CAAC;AAEK,MAAM,gBAAgB,GAAG,CAAC,OAAe,EAAE,IAAuB,EAAe,EAAE;;IACxF,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,MAAA,gBAAgB,CAAC,OAAO,CAAC,mCAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;IACvE,MAAM,IAAI,GAAgB,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAEvE,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACpD,MAAM,QAAQ,GAAG,MAAA,IAAI,CAAC,KAAK,CAAC,mCAAI,EAAE,CAAC;QACnC,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACxC,MAAM,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,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>;
|