@tayo-dev/rtl 1.3.1 → 1.4.0

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 (65) hide show
  1. package/README.md +41 -41
  2. package/assets/claude/commands/@tayo-dev/rtl/generate.md +2 -2
  3. package/assets/claude/commands/@tayo-dev/rtl/help.md +1 -1
  4. package/assets/codex/@tayo-dev/rtl-conventions/SKILL.md +2 -2
  5. package/assets/codex/@tayo-dev/rtl-generate/SKILL.md +1 -1
  6. package/assets/codex/@tayo-dev/rtl-help/SKILL.md +1 -1
  7. package/assets/gemini/commands/@tayo-dev/rtl/generate.toml +2 -2
  8. package/assets/gemini/commands/@tayo-dev/rtl/help.toml +1 -1
  9. package/assets/opencode/commands/@tayo-dev/rtl-generate.md +2 -2
  10. package/assets/opencode/commands/@tayo-dev/rtl-help.md +1 -1
  11. package/dist/cli/commands/generate.d.ts.map +1 -1
  12. package/dist/cli/commands/generate.js +244 -35
  13. package/dist/cli/commands/generate.js.map +1 -1
  14. package/dist/cli/commands/install.js +6 -6
  15. package/dist/core/baseline-normalizer.d.ts.map +1 -1
  16. package/dist/core/baseline-normalizer.js +42 -0
  17. package/dist/core/baseline-normalizer.js.map +1 -1
  18. package/dist/core/generator.d.ts.map +1 -1
  19. package/dist/core/generator.js +80 -7
  20. package/dist/core/generator.js.map +1 -1
  21. package/dist/core/input-loader.d.ts.map +1 -1
  22. package/dist/core/input-loader.js +1 -0
  23. package/dist/core/input-loader.js.map +1 -1
  24. package/dist/core/js-parser.d.ts +2 -1
  25. package/dist/core/js-parser.d.ts.map +1 -1
  26. package/dist/core/js-parser.js +69 -0
  27. package/dist/core/js-parser.js.map +1 -1
  28. package/dist/core/orchestrator.d.ts +1 -1
  29. package/dist/core/orchestrator.js +4 -4
  30. package/dist/core/parser.js +2 -2
  31. package/dist/core/recording-intelligence.d.ts +1 -1
  32. package/dist/core/recording-intelligence.d.ts.map +1 -1
  33. package/dist/core/recording-intelligence.js +298 -4
  34. package/dist/core/recording-intelligence.js.map +1 -1
  35. package/dist/core/resolver.d.ts +2 -1
  36. package/dist/core/resolver.d.ts.map +1 -1
  37. package/dist/core/resolver.js +334 -4
  38. package/dist/core/resolver.js.map +1 -1
  39. package/dist/core/scanner.d.ts +3 -3
  40. package/dist/core/scanner.js +9 -9
  41. package/dist/core/scorer.d.ts +6 -2
  42. package/dist/core/scorer.d.ts.map +1 -1
  43. package/dist/core/scorer.js +75 -7
  44. package/dist/core/scorer.js.map +1 -1
  45. package/dist/core/suite-planner.d.ts.map +1 -1
  46. package/dist/core/suite-planner.js +186 -17
  47. package/dist/core/suite-planner.js.map +1 -1
  48. package/dist/index.d.ts +1 -1
  49. package/dist/index.js +4 -4
  50. package/dist/install/planner.js +1 -1
  51. package/dist/install/types.d.ts +1 -1
  52. package/dist/learner/index.d.ts +2 -2
  53. package/dist/learner/index.js +3 -3
  54. package/dist/learner/storage.d.ts +1 -1
  55. package/dist/learner/storage.js +2 -2
  56. package/dist/templates/test-template.d.ts +4 -0
  57. package/dist/templates/test-template.d.ts.map +1 -1
  58. package/dist/templates/test-template.js +10 -1
  59. package/dist/templates/test-template.js.map +1 -1
  60. package/dist/types/recording.d.ts +118 -0
  61. package/dist/types/recording.d.ts.map +1 -1
  62. package/dist/types/recording.js.map +1 -1
  63. package/dist/types/score.d.ts +15 -0
  64. package/dist/types/score.d.ts.map +1 -1
  65. package/package.json +5 -5
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # Taro
1
+ # Tayo
2
2
 
3
- Install Taro into Claude Code, OpenCode, Gemini CLI, or Codex, then generate React Testing Library tests from Testing Library Recorder recordings.
3
+ Install Tayo into Claude Code, OpenCode, Gemini CLI, or Codex, then generate React Testing Library tests from Testing Library Recorder recordings.
4
4
 
5
- Taro ships as an installer-first package. The package entrypoint bootstraps runtime-native commands or skills into your agent environment, and the generated runtime surface still routes back to `taro generate` when you want Recorder-to-RTL output.
5
+ Tayo ships as an installer-first package. The package entrypoint bootstraps runtime-native commands or skills into your agent environment, and the generated runtime surface still routes back to `tayo generate` when you want Recorder-to-RTL output.
6
6
 
7
7
  ## Getting Started
8
8
 
@@ -33,7 +33,7 @@ Re-run the installer package to refresh owned assets and repair missing ones:
33
33
  npx @tayo-dev/rtl@latest
34
34
  ```
35
35
 
36
- Taro refreshes unchanged owned files automatically, restores missing owned files, and protects manual edits instead of overwriting them silently.
36
+ Tayo refreshes unchanged owned files automatically, restores missing owned files, and protects manual edits instead of overwriting them silently.
37
37
 
38
38
  ## Non-interactive Install
39
39
 
@@ -80,15 +80,15 @@ npm run build
80
80
  node dist/index.js --all --local
81
81
 
82
82
  # Or verify the publish boundary with a tarball
83
- env NPM_CONFIG_CACHE=/tmp/taro-npm-cache npm pack --pack-destination /tmp/taro-pack
84
- npx /tmp/taro-pack/tayo-dev-rtl-1.0.0.tgz --codex --local
83
+ env NPM_CONFIG_CACHE=/tmp/tayo-npm-cache npm pack --pack-destination /tmp/tayo-pack
84
+ npx /tmp/tayo-pack/tayo-dev-rtl-1.0.0.tgz --codex --local
85
85
  ```
86
86
 
87
87
  The tarball flow is the closest match to what end users get from npm.
88
88
 
89
89
  ## Generate RTL Tests
90
90
 
91
- After installation, use `taro generate` directly or call the runtime-native installed command/skill that routes to it.
91
+ After installation, use `tayo generate` directly or call the runtime-native installed command/skill that routes to it.
92
92
 
93
93
  ### Prerequisites
94
94
 
@@ -100,7 +100,7 @@ After installation, use `taro generate` directly or call the runtime-native inst
100
100
 
101
101
  Open Chrome DevTools → Recorder panel → click "Start new recording" → perform your user flow → click "End recording".
102
102
 
103
- Taro supports two export paths:
103
+ Tayo supports two export paths:
104
104
 
105
105
  - Testing Library Recorder JS baseline export: save as `recording.js`
106
106
  - Chrome Recorder JSON export: save as `recording.json`
@@ -109,39 +109,39 @@ Taro supports two export paths:
109
109
 
110
110
  ```bash
111
111
  # JS baseline path
112
- taro generate ./recording.js
112
+ tayo generate ./recording.js
113
113
 
114
114
  # Supported JSON path
115
- taro generate ./recording.json
115
+ tayo generate ./recording.json
116
116
  ```
117
117
 
118
118
  Expected output:
119
119
 
120
120
  ```text
121
121
  Parsed: my user flow — 8 steps
122
- [taro] Score: 78/100 (B) — query: 80, assertions: 70, structure: 85
122
+ [tayo] Score: 78/100 (B) — query: 80, assertions: 70, structure: 85
123
123
  Created: src/components/MyComponent.test.tsx
124
- [taro] ✓ post-write verified
124
+ [tayo] ✓ post-write verified
125
125
  ```
126
126
 
127
- On subsequent runs in the same project, Taro reads `.taro/conventions.json` to match your test style automatically.
127
+ On subsequent runs in the same project, Tayo reads `.tayo/conventions.json` to match your test style automatically.
128
128
 
129
129
  ### Draft-quality output is explicit
130
130
 
131
- When Taro cannot prove the final render/query boundary yet, it keeps the output writable but marks it as draft-quality instead of pretending the gaps are solved.
131
+ When Tayo cannot prove the final render/query boundary yet, it keeps the output writable but marks it as draft-quality instead of pretending the gaps are solved.
132
132
 
133
133
  ```text
134
- [taro] Score: 77/100 (C) — query: 100, assertions: 30, structure: 70, boundary: 100
135
- [taro] Manual review required — this generated test is still a draft (77/100, C).
136
- [taro] Top blockers: The generated test still renders <App /> instead of a resolved repo target. | Boundary warnings remain in the generated file, so the render/mock boundary still needs cleanup.
137
- // taro-query-checkpoint: click step requires manual RTL query recovery
134
+ [tayo] Score: 77/100 (C) — query: 100, assertions: 30, structure: 70, boundary: 100
135
+ [tayo] Manual review required — this generated test is still a draft (77/100, C).
136
+ [tayo] Top blockers: The generated test still renders <App /> instead of a resolved repo target. | Boundary warnings remain in the generated file, so the render/mock boundary still needs cleanup.
137
+ // tayo-query-checkpoint: click step requires manual RTL query recovery
138
138
  ```
139
139
 
140
- That draft banner is advisory. Taro does not block writes, but it does tell you when import targets, placeholder queries, or unresolved boundaries still need cleanup.
140
+ That draft banner is advisory. Tayo does not block writes, but it does tell you when import targets, placeholder queries, or unresolved boundaries still need cleanup.
141
141
 
142
142
  ## CLI Reference
143
143
 
144
- ### `taro generate <file>`
144
+ ### `tayo generate <file>`
145
145
 
146
146
  Generates a React Testing Library test from a Testing Library Recorder JS export or a Chrome Recorder JSON export.
147
147
 
@@ -157,7 +157,7 @@ Generates a React Testing Library test from a Testing Library Recorder JS export
157
157
  |------|-------|---------|-------------|
158
158
  | `--output <path>` | `-o` | Same directory as input, `{name}.test.tsx` | Override the output file path for the generated test. |
159
159
  | `--dry-run` | `-d` | `false` | Print the generated test to stdout and show the score without writing to disk. Useful for previewing output before committing. |
160
- | `--force` | `-f` | `false` | Overwrite an existing test file. Without this flag, Taro exits with an error if the output file already exists. |
160
+ | `--force` | `-f` | `false` | Overwrite an existing test file. Without this flag, Tayo exits with an error if the output file already exists. |
161
161
  | `--version` | `-v` | — | Print the installed version and exit. |
162
162
  | `--help` | `-h` | — | Display command help and exit. |
163
163
 
@@ -165,24 +165,24 @@ Generates a React Testing Library test from a Testing Library Recorder JS export
165
165
 
166
166
  ```bash
167
167
  # Generate and write a test next to the recording
168
- taro generate ./recordings/checkout-flow.js
168
+ tayo generate ./recordings/checkout-flow.js
169
169
 
170
170
  # Preview without writing (dry run)
171
- taro generate --dry-run ./recordings/checkout-flow.js
171
+ tayo generate --dry-run ./recordings/checkout-flow.js
172
172
 
173
173
  # Write to a specific path
174
- taro generate --output src/__tests__/checkout.test.tsx ./recordings/checkout-flow.js
174
+ tayo generate --output src/__tests__/checkout.test.tsx ./recordings/checkout-flow.js
175
175
 
176
176
  # Overwrite an existing test
177
- taro generate --force ./recordings/checkout-flow.js
177
+ tayo generate --force ./recordings/checkout-flow.js
178
178
  ```
179
179
 
180
180
  **Output file naming:**
181
- If `--output` is not provided, Taro derives the output path from the input file: `{input-dir}/{input-basename}.test.tsx`. For example, `./recordings/login.js` → `./recordings/login.test.tsx`.
181
+ If `--output` is not provided, Tayo derives the output path from the input file: `{input-dir}/{input-basename}.test.tsx`. For example, `./recordings/login.js` → `./recordings/login.test.tsx`.
182
182
 
183
183
  **Supported input formats:**
184
- - Testing Library Recorder JS (`.js`) — primary v1.3 path; Taro treats this as a baseline artifact to parse, enrich, and transform into a project-shaped RTL test
185
- - Chrome Recorder JSON (`.json`) — supported parity path; Taro preserves the existing JSON generate flow while JS fidelity improves
184
+ - Testing Library Recorder JS (`.js`) — primary v1.3 path; Tayo treats this as a baseline artifact to parse, enrich, and transform into a project-shaped RTL test
185
+ - Chrome Recorder JSON (`.json`) — supported parity path; Tayo preserves the existing JSON generate flow while JS fidelity improves
186
186
 
187
187
  ## Worked Example
188
188
 
@@ -207,21 +207,21 @@ test('login flow', async () => {
207
207
  ### Command
208
208
 
209
209
  ```bash
210
- taro generate ./login-flow.js
210
+ tayo generate ./login-flow.js
211
211
  ```
212
212
 
213
213
  ### Terminal output
214
214
 
215
215
  ```
216
216
  Parsed: login flow — 7 steps
217
- [taro] Score: 82/100 (B) — query: 90, assertions: 75, structure: 80
217
+ [tayo] Score: 82/100 (B) — query: 90, assertions: 75, structure: 80
218
218
  Created: login-flow.test.tsx
219
- [taro] ✓ post-write verified
219
+ [tayo] ✓ post-write verified
220
220
  ```
221
221
 
222
222
  ### Output: Generated test (`login-flow.test.tsx`)
223
223
 
224
- Taro generates a convention-aware RTL test with accessible queries:
224
+ Tayo generates a convention-aware RTL test with accessible queries:
225
225
 
226
226
  ```typescript
227
227
  import { render, screen } from '@testing-library/react'
@@ -244,7 +244,7 @@ describe('login flow', () => {
244
244
  })
245
245
  ```
246
246
 
247
- ### What Taro did here
247
+ ### What Tayo did here
248
248
 
249
249
  - Parsed the navigate step and inferred the component under test
250
250
  - Upgraded CSS selectors (`#email`, `#password`) to accessible `getByRole` queries using aria attributes from the recording
@@ -252,30 +252,30 @@ describe('login flow', () => {
252
252
  - Mapped the `waitForElement` step to a `toBeInTheDocument()` assertion
253
253
  - Scored the output (82/100) and emitted no blocking errors
254
254
 
255
- > **Note:** The component import path (`../LoginPage`) is a placeholder. Taro generates a comment in the file indicating where to update it.
255
+ > **Note:** The component import path (`../LoginPage`) is a placeholder. Tayo generates a comment in the file indicating where to update it.
256
256
 
257
257
  ### JSON is also supported
258
258
 
259
259
  If you export Chrome Recorder JSON instead, the command surface stays the same:
260
260
 
261
261
  ```bash
262
- taro generate ./login-flow.json --dry-run
262
+ tayo generate ./login-flow.json --dry-run
263
263
  ```
264
264
 
265
- JSON generation is still supported, but it does not inherit the repo-aware JS recovery stack. When the generated preview contains placeholder queries or weak assertions, Taro keeps those gaps explicit with score and manual-review messaging instead of fabricating stronger evidence.
265
+ JSON generation is still supported, but it does not inherit the repo-aware JS recovery stack. When the generated preview contains placeholder queries or weak assertions, Tayo keeps those gaps explicit with score and manual-review messaging instead of fabricating stronger evidence.
266
266
 
267
267
  ## Agent Usage
268
268
 
269
- After installation, each runtime gets a namespaced help entrypoint plus a generate command or skill that routes back to `taro generate`.
269
+ After installation, each runtime gets a namespaced help entrypoint plus a generate command or skill that routes back to `tayo generate`.
270
270
 
271
271
  ### Tips
272
272
 
273
273
  - Use `--dry-run` first to preview output before committing generated files
274
- - If you record multiple flows, run Taro on each to build up convention state in `.taro/conventions.json` — later runs benefit from earlier ones
274
+ - If you record multiple flows, run Tayo on each to build up convention state in `.tayo/conventions.json` — later runs benefit from earlier ones
275
275
  - Pass `--force` when re-recording an updated flow to overwrite the old test
276
- - The `.taro/` directory should be committed to your repo so convention learning persists across team members
276
+ - The `.tayo/` directory should be committed to your repo so convention learning persists across team members
277
277
 
278
278
  ### Notes
279
279
 
280
- - Taro does not require network access at generation time (DOM inspection via Playwright is optional and only runs when a live URL is in the recording)
281
- - All state is local to `.taro/` — no external service is contacted
280
+ - Tayo does not require network access at generation time (DOM inspection via Playwright is optional and only runs when a live URL is in the recording)
281
+ - All state is local to `.tayo/` — no external service is contacted
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: "@tayo-dev/rtl:generate"
3
- description: "Generate RTL tests from Recorder exports with Taro"
3
+ description: "Generate RTL tests from Recorder exports with Tayo"
4
4
  ---
5
5
 
6
6
  <objective>
@@ -9,7 +9,7 @@ Generate a React Testing Library test from a Recorder export.
9
9
 
10
10
  <process>
11
11
  1. Confirm the recording path before running anything destructive.
12
- 2. Run `taro generate <recording-file>` by default.
12
+ 2. Run `tayo generate <recording-file>` by default.
13
13
  3. Add `--dry-run`, `--output <path>`, or `--force` only when the user asks for them or the context requires them.
14
14
  4. Report the generated file path and score output.
15
15
  </process>
@@ -10,7 +10,7 @@ Help the user install and use @tayo-dev/rtl from Claude Code.
10
10
  <process>
11
11
  1. Explain that `/@tayo-dev/rtl:help` is the installed help entrypoint for @tayo-dev/rtl.
12
12
  2. For installation or updates, tell the user to run `npx @tayo-dev/rtl@latest`.
13
- 3. For test generation, use `/@tayo-dev/rtl:generate` or run `taro generate <recording-file>`.
13
+ 3. For test generation, use `/@tayo-dev/rtl:generate` or run `tayo generate <recording-file>`.
14
14
  4. Mention `--dry-run`, `--output <path>`, and `--force` only when they fit the request.
15
15
  5. When generation runs, report the score and generated file path.
16
16
  </process>
@@ -5,12 +5,12 @@ description: "Explain how Tayo learns project test conventions and how to keep t
5
5
 
6
6
  # Tayo Conventions
7
7
 
8
- Use `$@tayo-dev/rtl-conventions` when the user asks why generated tests follow a certain style or how `.taro/conventions.json` affects output.
8
+ Use `$@tayo-dev/rtl-conventions` when the user asks why generated tests follow a certain style or how `.tayo/conventions.json` affects output.
9
9
 
10
10
  ## Focus
11
11
 
12
12
  - explain that Tayo learns local test conventions from the codebase
13
- - call out when `.taro/conventions.json` will influence generated imports, mocks, and file placement
13
+ - call out when `.tayo/conventions.json` will influence generated imports, mocks, and file placement
14
14
  - recommend `--dry-run` when the user wants to inspect convention alignment before writing files
15
15
 
16
16
  ## Guardrails
@@ -16,7 +16,7 @@ Use `$@tayo-dev/rtl-generate` when the user wants to turn a Recorder JS export o
16
16
 
17
17
  ## Execution
18
18
 
19
- Run `taro generate <recording-file>` with the requested flags.
19
+ Run `tayo generate <recording-file>` with the requested flags.
20
20
 
21
21
  ## Response contract
22
22
 
@@ -21,5 +21,5 @@ Invoke this skill with `$@tayo-dev/rtl-help`.
21
21
 
22
22
  1. Confirm the recording path or test target.
23
23
  2. Choose the matching packaged Tayo skill.
24
- 3. If direct CLI execution is appropriate, run `taro generate <recording-file>` with any requested flags.
24
+ 3. If direct CLI execution is appropriate, run `tayo generate <recording-file>` with any requested flags.
25
25
  4. Report the generated file path, score, and any blocking issues.
@@ -1,10 +1,10 @@
1
- description = "Generate RTL tests from Recorder exports with Taro"
1
+ description = "Generate RTL tests from Recorder exports with Tayo"
2
2
  prompt = """
3
3
  You are the installed /@tayo-dev/rtl:generate command for @tayo-dev/rtl.
4
4
 
5
5
  Generate a React Testing Library test from a Recorder export.
6
6
  1. Confirm the recording path before running anything destructive.
7
- 2. Run `taro generate <recording-file>` by default.
7
+ 2. Run `tayo generate <recording-file>` by default.
8
8
  3. Add `--dry-run`, `--output <path>`, or `--force` only when the user asks for them or the context requires them.
9
9
  4. Report the generated file path and score output.
10
10
  """
@@ -5,7 +5,7 @@ You are the installed /@tayo-dev/rtl:help command for @tayo-dev/rtl.
5
5
  When the user wants help:
6
6
  1. Explain that /@tayo-dev/rtl:help is the runtime-native help entrypoint.
7
7
  2. For installation or updates, tell them to run `npx @tayo-dev/rtl@latest`.
8
- 3. For generation, direct them to /@tayo-dev/rtl:generate or `taro generate <recording-file>`.
8
+ 3. For generation, direct them to /@tayo-dev/rtl:generate or `tayo generate <recording-file>`.
9
9
  4. Mention `--dry-run`, `--output <path>`, and `--force` only when they match the request.
10
10
  5. When generation runs, report the score and generated file path.
11
11
  """
@@ -1,11 +1,11 @@
1
1
  ---
2
- description: Generate RTL tests from Recorder exports with Taro
2
+ description: Generate RTL tests from Recorder exports with Tayo
3
3
  ---
4
4
 
5
5
  You are the installed `/@tayo-dev/rtl-generate` command for `@tayo-dev/rtl`.
6
6
 
7
7
  Generate a React Testing Library test from a Recorder export.
8
8
  1. Confirm the recording path before running anything destructive.
9
- 2. Run `taro generate <recording-file>` by default.
9
+ 2. Run `tayo generate <recording-file>` by default.
10
10
  3. Add `--dry-run`, `--output <path>`, or `--force` only when the user asks for them or the context requires them.
11
11
  4. Report the generated file path and score output.
@@ -7,6 +7,6 @@ You are the installed `/@tayo-dev/rtl-help` command for `@tayo-dev/rtl`.
7
7
  When the user wants help:
8
8
  1. Explain that `/@tayo-dev/rtl-help` is the runtime-native help entrypoint.
9
9
  2. For installation or updates, tell them to run `npx @tayo-dev/rtl@latest`.
10
- 3. For generation, direct them to `/@tayo-dev/rtl-generate` or `taro generate <recording-file>`.
10
+ 3. For generation, direct them to `/@tayo-dev/rtl-generate` or `tayo generate <recording-file>`.
11
11
  4. Mention `--dry-run`, `--output <path>`, and `--force` only when they match the request.
12
12
  5. When generation runs, report the score and generated file path.
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/generate.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AA+CnC,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AA2lBD,wBAAgB,qBAAqB,IAAI,OAAO,CAqL/C"}
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/generate.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAiDnC,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAo2BD,wBAAgB,qBAAqB,IAAI,OAAO,CAoN/C"}