@ethlete/agent-rules 0.1.0-next.3 → 0.1.0-next.30
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 +463 -0
- package/CLAUDE.md +1 -0
- package/README.md +362 -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/context-warning.py +871 -110
- package/content/hooks/subagent-model-policy.py +194 -0
- package/content/mods/.claude-plugin/marketplace.json +11 -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/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 +50 -0
- package/content/rules/reactive-state.md +1 -1
- package/content/rules/styling.md +9 -7
- package/content/rules/subagent-models.md +39 -0
- package/content/skills/agent-sessions/SKILL.md +81 -0
- package/content/skills/agent-sessions/agent-sessions.mjs +492 -0
- package/content/skills/angular-patterns/SKILL.md +30 -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 +657 -0
- package/content/skills/design-exploration/check-story.mjs +139 -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 +11 -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 +51 -0
- package/content/skills/handoff/SKILL.md +125 -5
- package/content/skills/query/SKILL.md +165 -64
- 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 +12 -7
- 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 +51 -0
- package/content/skills/styleguide/storybook-structure.md +25 -0
- package/content/skills/theming/SKILL.md +50 -28
- package/content/skills/timetrack/SKILL.md +397 -0
- package/content/skills/verify-in-app/SKILL.md +107 -0
- package/migrations/app-styling-utilities.md +63 -0
- 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 +48 -0
- package/package.json +19 -3
- package/src/index.js +85 -30
- 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 +41 -5
- package/src/lib/config.js +117 -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.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 +6 -1
- 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/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 +164 -40
- package/src/lib/plan.js.map +1 -1
- 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 +25 -2
- package/src/lib/render.js +43 -10
- package/src/lib/render.js.map +1 -1
- 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 +0 -1
- package/src/lib/sync.js +30 -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 +130 -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 +68 -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 +1063 -0
- package/src/lib/timetrack-command.js.map +1 -0
- package/src/lib/timetrack-snapshot.d.ts +55 -0
- package/src/lib/timetrack-snapshot.js +120 -0
- package/src/lib/timetrack-snapshot.js.map +1 -0
- package/src/lib/timetrack.d.ts +561 -0
- package/src/lib/timetrack.js +279 -0
- package/src/lib/timetrack.js.map +1 -0
- package/content/skills/styleguide/STYLEGUIDE.md +0 -520
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Move app CSS out of `@layer components`
|
|
2
|
+
|
|
3
|
+
The `app-styling` rule now says how app components are styled: Tailwind utilities in the
|
|
4
|
+
template, CSS only for what a utility cannot express, and never an app rule in
|
|
5
|
+
`@layer components`. SDK styles are injected into that layer at runtime, after the app's
|
|
6
|
+
stylesheet, so an app rule there ties on layer and loses on source order. That is a bug today,
|
|
7
|
+
and this task fixes it. The rest of the rule applies when a component is next edited.
|
|
8
|
+
|
|
9
|
+
## Before you start
|
|
10
|
+
|
|
11
|
+
If this repo has no `app-styling` rule yet (in `AGENTS.md`, or under `.claude/rules/ethlete/`),
|
|
12
|
+
run `ethlete-agents sync` with this repo's package manager (`yarn`, `pnpm exec` or `npx`), then
|
|
13
|
+
read the rule. If the repo's own styling rules (a styleguide, `CONTRIBUTING.md`, the parts of
|
|
14
|
+
`AGENTS.md` outside the generated block) forbid a change below, follow them and report the
|
|
15
|
+
conflict.
|
|
16
|
+
|
|
17
|
+
## What to change
|
|
18
|
+
|
|
19
|
+
1. Find the app stylesheets with a `@layer components` block, global stylesheets included:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
grep -rlE '@layer components' apps libs --include='*.css' --include='*.scss' --include='*.sass' --include='*.less'
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
2. In each, move the rules out of the block into `@layer utilities`, and delete the empty
|
|
26
|
+
block. In `@layer utilities` a rule still beats the SDK, and does not beat every utility the
|
|
27
|
+
way unlayered CSS would.
|
|
28
|
+
3. The move lets these rules win over SDK styles they used to lose to. Check the views that use
|
|
29
|
+
them. Where a view now looks wrong because the old rule was never meant to apply, delete the
|
|
30
|
+
rule instead.
|
|
31
|
+
|
|
32
|
+
## Leave these alone
|
|
33
|
+
|
|
34
|
+
- A library that ships its own CSS to other repos. The rule is about app components.
|
|
35
|
+
- Generated theme files, such as the surface and colour themes `@ethlete/core` writes.
|
|
36
|
+
- `--spacing` and the other rem scales in `@theme`. If the app has not set `--spacing: 0.4rem`,
|
|
37
|
+
setting it now rescales every utility already in use: report it and leave it.
|
|
38
|
+
- `html { font-size: 62.5%; }`: if it is missing, report it and leave it. Adding it rescales
|
|
39
|
+
every `rem` the app uses.
|
|
40
|
+
|
|
41
|
+
## On touch, not in this task
|
|
42
|
+
|
|
43
|
+
Rewriting BEM classes and component stylesheets to utilities, replacing hardcoded colours with
|
|
44
|
+
theme tokens, and adding `ViewEncapsulation.None` to a component that relies on emulated CSS
|
|
45
|
+
(its CSS would leak) happen when someone edits that component. Count what is left for the
|
|
46
|
+
final message:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
grep -rlE 'styleUrls?:' apps libs --include='*.ts' | wc -l
|
|
50
|
+
grep -rlE 'class="[^"]*\b[a-z0-9-]+__[a-z0-9-]+' apps libs --include='*.html' --include='*.ts' | wc -l
|
|
51
|
+
grep -rlE '@Component\(' apps libs --include='*.ts' | xargs grep -LE 'ViewEncapsulation\.None' | wc -l
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Done when
|
|
55
|
+
|
|
56
|
+
- The grep in step 1 finds no app stylesheet, apart from the ones under "Leave these alone".
|
|
57
|
+
- The type check, lint and build pass for every project you changed.
|
|
58
|
+
- Each view that uses a moved rule is checked in the browser. A view you cannot open (the login
|
|
59
|
+
fails, no API) is listed as unchecked in your final message; that does not block the task.
|
|
60
|
+
- Your final message gives the three counts above, and whether `--spacing` and the 62.5% root
|
|
61
|
+
are set.
|
|
62
|
+
|
|
63
|
+
Then delete this task file.
|
|
@@ -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,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,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethlete/agent-rules",
|
|
3
|
-
"version": "0.1.0-next.
|
|
3
|
+
"version": "0.1.0-next.30",
|
|
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,49 @@
|
|
|
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");
|
|
6
19
|
const path_1 = require("path");
|
|
20
|
+
const cli_args_1 = require("./lib/cli-args");
|
|
7
21
|
const config_1 = require("./lib/config");
|
|
22
|
+
const git_flow_command_1 = require("./lib/git-flow-command");
|
|
23
|
+
const load_content_1 = require("./lib/load-content");
|
|
24
|
+
const sessions_command_1 = require("./lib/sessions-command");
|
|
8
25
|
const migrate_1 = require("./lib/migrate");
|
|
26
|
+
const output_style_command_1 = require("./lib/output-style-command");
|
|
27
|
+
const package_runner_1 = require("./lib/package-runner");
|
|
28
|
+
const plain_text_1 = require("./lib/plain-text");
|
|
9
29
|
const sync_1 = require("./lib/sync");
|
|
30
|
+
const timetrack_command_1 = require("./lib/timetrack-command");
|
|
10
31
|
const USAGE = `ethlete-agents — compile @ethlete agent rules and skills into your repo
|
|
11
32
|
|
|
12
33
|
ethlete-agents sync Write the generated rules/skills for every detected agent
|
|
13
34
|
ethlete-agents check Exit non-zero when the generated files are out of date (for CI)
|
|
14
35
|
ethlete-agents init Write a starter ${config_1.CONFIG_FILE_NAME}
|
|
36
|
+
ethlete-agents git-flow Name, check and repair branches against the repo's git flow
|
|
37
|
+
(start, check, repair, explain)
|
|
38
|
+
ethlete-agents output-style
|
|
39
|
+
Install an Ethlete output style into this machine's Claude Code
|
|
40
|
+
config and switch to it (Claude Code only)
|
|
41
|
+
ethlete-agents timetrack Ask the running Timetrack app about Jira - it holds this
|
|
42
|
+
machine's credentials, so no repo needs a token
|
|
43
|
+
(status, instance, issue, search, project, create, log)
|
|
44
|
+
ethlete-agents sessions Run agents in tmux sessions of one checkout: message them, wake idle
|
|
45
|
+
ones, restart one with a prompt, claim paths (run, up, down, restart,
|
|
46
|
+
send, inbox, claim). The old name "mailbox" works too
|
|
15
47
|
ethlete-agents migrate Convert the repo to the AGENTS.md + .agents/skills layout:
|
|
16
48
|
CLAUDE.md content moves into AGENTS.md (CLAUDE.md becomes an
|
|
17
49
|
@AGENTS.md import), hand-written .claude/skills move to
|
|
@@ -19,7 +51,8 @@ const USAGE = `ethlete-agents — compile @ethlete agent rules and skills into y
|
|
|
19
51
|
|
|
20
52
|
Options
|
|
21
53
|
--targets <list> Comma-separated subset of: ${config_1.AGENT_TARGETS.join(', ')}
|
|
22
|
-
--root <path> Repo root to write into (default:
|
|
54
|
+
--root <path> Repo root to write into (default: the nearest directory holding
|
|
55
|
+
${config_1.CONFIG_FILE_NAME}, else the current directory)
|
|
23
56
|
--dry-run Print what would change without writing (sync and migrate)
|
|
24
57
|
`;
|
|
25
58
|
const readFlag = (args, flag) => {
|
|
@@ -28,60 +61,82 @@ const readFlag = (args, flag) => {
|
|
|
28
61
|
return undefined;
|
|
29
62
|
return args[index + 1];
|
|
30
63
|
};
|
|
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
|
-
};
|
|
64
|
+
const INIT_VARS = ['lintCommand', 'lintFixCommand', 'formatCommand', 'storybookStartCommand', 'storybookUrl'];
|
|
41
65
|
const init = (root) => {
|
|
42
66
|
const path = (0, path_1.join)(root, config_1.CONFIG_FILE_NAME);
|
|
43
67
|
if ((0, fs_1.existsSync)(path)) {
|
|
44
68
|
console.error(`${config_1.CONFIG_FILE_NAME} already exists.`);
|
|
45
69
|
return 1;
|
|
46
70
|
}
|
|
71
|
+
const defaults = (0, package_runner_1.followPackageManager)(root, (0, load_content_1.loadDefaultVars)());
|
|
72
|
+
const detected = (0, package_runner_1.detectCommandVars)(root);
|
|
73
|
+
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
74
|
const template = {
|
|
48
75
|
targets: (0, config_1.detectTargets)(root),
|
|
49
|
-
vars
|
|
76
|
+
vars,
|
|
50
77
|
exclude: [],
|
|
51
78
|
hooks: [],
|
|
52
79
|
};
|
|
53
80
|
(0, fs_1.writeFileSync)(path, `${JSON.stringify(template, null, 2)}\n`, 'utf8');
|
|
54
|
-
console.log(`Wrote ${config_1.CONFIG_FILE_NAME}.
|
|
81
|
+
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
82
|
return 0;
|
|
56
83
|
};
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const root = (_a =
|
|
61
|
-
const options = { root,
|
|
84
|
+
const STRICT_COMMANDS = ['sync', 'check', 'init', 'migrate'];
|
|
85
|
+
const runStrict = (command, args) => {
|
|
86
|
+
var _a, _b;
|
|
87
|
+
const root = (_a = args.root) !== null && _a !== void 0 ? _a : (0, config_1.resolveRepoRoot)(process.cwd());
|
|
88
|
+
const options = { root, targets: args.targets };
|
|
62
89
|
switch (command) {
|
|
63
90
|
case 'sync':
|
|
64
|
-
return (0, sync_1.sync)(Object.assign(Object.assign({}, options), { dryRun:
|
|
91
|
+
return (0, sync_1.sync)(Object.assign(Object.assign({}, options), { dryRun: args.dryRun }));
|
|
65
92
|
case 'check':
|
|
66
93
|
return (0, sync_1.check)(options);
|
|
67
94
|
case 'init':
|
|
68
|
-
return init(root);
|
|
69
|
-
|
|
70
|
-
return (0, migrate_1.migrate)(Object.assign(Object.assign({}, options), { dryRun:
|
|
95
|
+
return init((_b = args.root) !== null && _b !== void 0 ? _b : process.cwd());
|
|
96
|
+
default:
|
|
97
|
+
return (0, migrate_1.migrate)(Object.assign(Object.assign({}, options), { dryRun: args.dryRun }));
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const run = (argv) => {
|
|
101
|
+
var _a;
|
|
102
|
+
const command = argv[0];
|
|
103
|
+
if (command !== undefined && STRICT_COMMANDS.includes(command)) {
|
|
104
|
+
const args = (0, cli_args_1.parseCommandArgs)(command, argv.slice(1));
|
|
105
|
+
if (args.problems.length) {
|
|
106
|
+
console.error(`${args.problems.join('\n')}\n\n${USAGE}`);
|
|
107
|
+
return 1;
|
|
108
|
+
}
|
|
109
|
+
if (args.help) {
|
|
110
|
+
console.log(USAGE);
|
|
111
|
+
return 0;
|
|
112
|
+
}
|
|
113
|
+
return runStrict(command, args);
|
|
114
|
+
}
|
|
115
|
+
const root = (_a = readFlag(argv, '--root')) !== null && _a !== void 0 ? _a : (0, config_1.resolveRepoRoot)(process.cwd());
|
|
116
|
+
switch (command) {
|
|
117
|
+
case 'git-flow':
|
|
118
|
+
return (0, git_flow_command_1.gitFlowCommand)({ root, argv: argv.slice(1) });
|
|
119
|
+
case 'sessions':
|
|
120
|
+
case 'mailbox':
|
|
121
|
+
return (0, sessions_command_1.sessionsCommand)({ argv: argv.slice(1) });
|
|
122
|
+
case 'output-style':
|
|
123
|
+
return (0, output_style_command_1.outputStyleCommand)({ argv: argv.slice(1) });
|
|
124
|
+
case 'timetrack':
|
|
125
|
+
return (0, timetrack_command_1.timetrackCommand)({ root, argv: argv.slice(1) });
|
|
71
126
|
default:
|
|
72
127
|
console.log(USAGE);
|
|
73
128
|
return command === undefined || command === '--help' || command === '-h' ? 0 : 1;
|
|
74
129
|
}
|
|
75
130
|
};
|
|
76
|
-
|
|
131
|
+
__exportStar(require("./lib"), exports);
|
|
77
132
|
// Guarded so the package can also be imported as a library without running the CLI.
|
|
78
133
|
if (require.main === module) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
console.error(error instanceof Error ? error.message : error);
|
|
134
|
+
Promise.resolve()
|
|
135
|
+
.then(() => run(process.argv.slice(2)))
|
|
136
|
+
.then((code) => process.exit(code))
|
|
137
|
+
.catch((error) => {
|
|
138
|
+
console.error((0, plain_text_1.plain)(error instanceof Error ? error.message : String(error)));
|
|
84
139
|
process.exit(1);
|
|
85
|
-
}
|
|
140
|
+
});
|
|
86
141
|
}
|
|
87
142
|
//# 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,2BAA+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,qCAAyC;AACzC,+DAA2D;AAE3D,MAAM,KAAK,GAAG;;;;6CAI+B,yBAAgB;;;;;;;;;;;;;;;;;;kDAkBX,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,I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IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrF,CAAC;AACH,CAAC,CAAC;AAEF,wCAAsB;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,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,IAAI,GAAG,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;QAExE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C,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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