@vitronai/themis 0.1.14 → 1.2.1

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/CHANGELOG.md CHANGED
@@ -4,6 +4,43 @@ All notable changes to this project are documented in this file.
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 1.2.1 - 2026-04-09
8
+
9
+ - Added `init --cursor` flag to install a `.cursorrules` file with Themis conventions. Composable with `--agents` and `--claude-code`.
10
+ - Bare `npx themis init` now auto-detects agent markers (`.claude/` dir, `.cursorrules` file) and installs the right assets without requiring flags.
11
+ - Added 5 new Tessl eval scenarios (agent reporter fix loop, Claude Code integration setup, deterministic test authoring, intent phase structure, Vitest full migration). Eval results: 37% baseline → 97% with skill.
12
+ - Published Tessl tile `vitron-ai/themis@1.2.1` with eval scenarios included.
13
+
14
+ ## 1.2.0 - 2026-04-08
15
+
16
+ ### Added
17
+
18
+ - **Claude Code one-command adoption.** New `npx themis init --claude-code` flag installs everything Claude Code needs to drive Themis natively: a `CLAUDE.md` at the repo root, a Claude Code skill at `.claude/skills/themis/SKILL.md` that auto-loads when the user asks Claude to write, run, fix, or migrate tests, and four slash commands (`/themis-test`, `/themis-generate`, `/themis-migrate`, `/themis-fix`) wired to the agent-readable test loop. Composes with `--agents` so a single `init --agents --claude-code` installs both bundles. Idempotent: re-running appends to an existing `CLAUDE.md` only when the Themis section is missing, and skips skill/command files that already exist.
19
+ - **Claude Code `PostToolUse` hook wrapper** at `scripts/claude-hook.js`. Reads tool input from stdin, filters non-source edits and edits inside `.themis/`, `__themis__/`, `node_modules/`, `.git/`, prefers `--rerun-failed` when a prior failed-tests artifact exists, and surfaces failures via stderr + exit 2 so Claude Code feeds the structured `failures[].cluster` and `failures[].repairHints` payload directly back into the model. Disable with `THEMIS_HOOK_DISABLED=1`. Opt-in only — not installed by `init --claude-code`. See [Claude Code one-command setup](docs/agents-adoption.md#claude-code-one-command-setup) for the `.claude/settings.json` recipe.
20
+ - New downstream templates under `templates/`: `CLAUDE.themis.md`, `claude-skill/SKILL.md`, and `claude-commands/{themis-test,themis-generate,themis-migrate,themis-fix}.md`. All ship in the npm tarball.
21
+ - New `--claude` alias for `--claude-code`.
22
+
23
+ ### Changed
24
+
25
+ - **Repositioned README and `package.json` description** to lead with the job-to-be-done (a Node/TS unit test framework designed for AI coding agents — drop-in alternative to Jest and Vitest) instead of the philosophy ("intent-first ... for AI agents"), which read ambiguously as "tests AI agents". The five-bullet value prop now sits above the fold with the benchmark numbers, and Claude Code, Cursor, and Codex are named explicitly in the agent-output bullet.
26
+ - `runInit` now returns `{ agents, claudeCode }` instead of a single `{ path, created }` object so both flags can report independently. Existing `--agents` CLI output strings are preserved exactly.
27
+
28
+ ### Documentation
29
+
30
+ - Added a "Claude Code One-Command Setup" section to `docs/agents-adoption.md` listing every file `init --claude-code` installs and explaining why the agent reporter loop matters.
31
+ - Added an "Optional: Wire Themis Into Claude Code's Edit Loop With A Hook" section with the `.claude/settings.json` snippet, plain-English explanation of the wrapper's three behaviors, and trade-offs (wall-clock cost, hook security, two ways to disable).
32
+ - README quickstart now includes a one-paragraph "Using Claude Code?" callout linking to the adoption guide.
33
+
34
+ ### Tests
35
+
36
+ - Added `tests/claude-hook.test.js` with six tests covering `THEMIS_HOOK_DISABLED`, empty/invalid stdin, non-source extensions, ignored directories, real-source-edit-with-green-suite (end-to-end via in-tempdir shim), and real-source-edit-with-red-suite (exit 2 + stderr payload assertion).
37
+ - Extended `tests/cli-output.test.js` with three tests for `init --claude-code`: happy-path install, append-then-idempotent on existing `CLAUDE.md`, and composed `--agents --claude-code`.
38
+
39
+ ## 0.1.15 - 2026-03-27
40
+
41
+ - Added a direct in-sidebar `Quick Actions` group plus an `Artifact Files` drawer to the in-repo VS Code extension scaffold so core Themis commands and raw artifact navigation remain reachable even when the VS Code view toolbar overflows.
42
+ - Improved `themis generate` onboarding and error guidance so downstream docs/templates now refer to `npx themis generate <source-root>`, and missing `src/` targets surface corrective suggestions for likely repo layouts such as `app/`, `pages/`, or repo-root scans.
43
+
7
44
  ## 0.1.14 - 2026-03-27
8
45
 
9
46
  - Added first-party `npx themis test --fix` support so generated-test repair loops can apply fix-handoff autofixes, tighten hints when needed, and rerun the suite directly from the CLI.
package/README.md CHANGED
@@ -7,24 +7,30 @@
7
7
  </a>
8
8
  </p>
9
9
 
10
- Themis is an intent-first unit test framework for AI agents in Node.js and TypeScript.
10
+ **A Node.js and TypeScript unit test framework designed for AI coding agents.**
11
11
 
12
- It is built for agent workflows: deterministic reruns, machine-readable outputs, strict phase semantics, and a branded verdict loop for humans.
12
+ Themis is a drop-in alternative to Jest and Vitest, built for the way code gets written today: humans and agents working the same edit-test-fix loop. Strict phase semantics keep generated tests legible, machine-readable failure output lets agents self-repair, and an incremental migration path means you don't rewrite your suite on day one.
13
13
 
14
- ## AI Quickstart
14
+ - **Faster than Jest and Vitest** — `68.59%` faster than Vitest and `130.26%` faster than Jest on the same React showcase benchmark ([proof](#performance-proof))
15
+ - **Agent-native output** — `--agent` JSON with failure clusters and structured repair hints, ready to feed back into Claude Code, Cursor, Codex, or any agent loop
16
+ - **One-command migration** — `npx themis migrate jest` or `npx themis migrate vitest` with codemods and a structured findings report
17
+ - **Modern by default** — native `.js`, `.jsx`, `.ts`, `.tsx`, ESM, JSX, and React Testing Library, no config gymnastics
18
+ - **Discoverable to agents** — ships an `AGENTS.md` template, a `themis.ai.json` manifest, and a [Tessl tile](tessl/tile.json) so AI assistants can find and adopt it without you copy-pasting docs
15
19
 
16
- If you are a human or AI agent adopting Themis in another repo, use:
20
+ ## Quickstart
17
21
 
18
22
  ```bash
19
23
  npm install -D @vitronai/themis@latest
20
24
  npx themis init --agents
21
- npx themis generate src
25
+ npx themis generate src # or `app` for Next App Router repos
22
26
  npx themis test
23
27
  ```
24
28
 
25
- - `npx themis init --agents` writes `themis.config.json`, updates `.gitignore`, and scaffolds a downstream `AGENTS.md` when one does not already exist.
29
+ `init --agents` writes `themis.config.json`, updates `.gitignore`, and scaffolds a downstream `AGENTS.md` so the agents on your team know how to use it. See the [agent adoption guide](docs/agents-adoption.md) for the full setup, including migration from Jest or Vitest.
30
+
31
+ **Using Claude Code?** Run `npx themis init --claude-code` to install a `CLAUDE.md`, a Claude Code skill at `.claude/skills/themis/`, and slash commands (`/themis-test`, `/themis-generate`, `/themis-migrate`, `/themis-fix`) wired to the agent-readable test loop. See [Claude Code one-command setup](docs/agents-adoption.md#claude-code-one-command-setup).
32
+
26
33
  - machine-readable agent manifest: [`themis.ai.json`](themis.ai.json)
27
- - downstream adoption guide: [`docs/agents-adoption.md`](docs/agents-adoption.md)
28
34
  - copyable downstream rules file: [`templates/AGENTS.themis.md`](templates/AGENTS.themis.md)
29
35
 
30
36
  <p align="center">
@@ -33,7 +39,7 @@ npx themis test
33
39
 
34
40
  ## Contents
35
41
 
36
- - [AI Quickstart](#ai-quickstart)
42
+ - [Quickstart](#quickstart)
37
43
  - [Adopt In Another Repo](#adopt-in-another-repo)
38
44
  - [Code Scan](#code-scan)
39
45
  - [Positioning](#positioning)
@@ -70,6 +76,18 @@ On the current same-host React showcase benchmark sample, Themis measured `68.59
70
76
 
71
77
  The exact comparison artifact is emitted by CI as `.themis/benchmarks/showcase-comparison/perf-summary.json` and `.themis/benchmarks/showcase-comparison/perf-summary.md`. Treat those percentages as the current documented sample, not a universal constant for every environment.
72
78
 
79
+ ### First-Try Test Pass Rate
80
+
81
+ The first-try benchmark measures how often Claude generates tests that pass on the first run — the metric that matters most for agent-driven development. For each of 5 fixture source files (pure functions, async services, React components, hooks), Claude generates tests using Themis, Vitest, and Jest, and each generated suite is run once without edits.
82
+
83
+ ```bash
84
+ ANTHROPIC_API_KEY=sk-... npm run benchmark:first-try
85
+ ```
86
+
87
+ Results are written to `.themis/benchmarks/first-try/first-try-results.json` and `.themis/benchmarks/first-try/first-try-results.md`. The generated test code is saved under `.themis/benchmarks/first-try/generated-tests/` for manual review.
88
+
89
+ Themis's advantage here comes from its `CLAUDE.md` template and Claude Code skill, which give Claude structured guidance about phase semantics, import conventions, and common pitfalls — context that Jest and Vitest users do not ship out of the box.
90
+
73
91
  ## Modern JS/TS Support
74
92
 
75
93
  Themis is built for modern Node.js and TypeScript projects:
@@ -93,7 +111,7 @@ Themis is built for modern Node.js and TypeScript projects:
93
111
 
94
112
  ## Adopt In Another Repo
95
113
 
96
- Use the AI Quickstart above as the canonical install/generate/test flow. Generated files land under `__themis__/tests` by default. TypeScript-generated tests are emitted as strict-typecheckable artifacts and self-reference Themis globals so downstream TS projects do not need a special `types` override just to compile generated output.
114
+ Use the AI Quickstart above as the canonical install/generate/test flow. Replace `<source-root>` with the repo's actual source tree such as `src` or `app`. Generated files land under `__themis__/tests` by default. TypeScript-generated tests are emitted as strict-typecheckable artifacts and self-reference Themis globals so downstream TS projects do not need a special `types` override just to compile generated output.
97
115
  TypeScript-generated suites use `import` syntax so downstream ESLint and ESM-style rules do not flag Themis output as legacy `require(...)` code.
98
116
 
99
117
  If another repo wants its agents to reliably choose Themis, put the framework choice directly in that repo's agent instructions instead of assuming agents will infer it from package metadata alone.
@@ -296,7 +314,7 @@ Short version:
296
314
  - Migration proof job runs `npm run proof:migration` against checked-in Jest/Vitest fixtures for basic suites, table tests, RTL/jsdom flows, timers, module mocking, and a context/provider-heavy RTL example, then uploads the resulting migration reports plus Themis run artifacts as evidence.
297
315
  - Themis React Showcase job verifies a straight-up native Themis React fixture as a first-party example.
298
316
  - React showcase perf job runs `npm run benchmark:showcase` on the exact same React scenarios for Themis, Jest, and Vitest on one CI host, then uploads `.themis/benchmarks/showcase-comparison/perf-summary.{json,md}` so the relative timing claim is backed by one comparable artifact.
299
- - Release `0.1.14` packages this expanded proof lane so every CI run now proves the provider-heavy example alongside the earlier fixtures.
317
+ - Release `1.0.17` packages this expanded proof lane so every CI run now proves the provider-heavy example alongside the earlier fixtures.
300
318
 
301
319
  ## Agent Guide
302
320
 
@@ -7,16 +7,18 @@ Use this guide when you want another repository to adopt Themis and make that ch
7
7
  ```bash
8
8
  npm install -D @vitronai/themis@latest
9
9
  npx themis init --agents
10
- npx themis generate src
10
+ npx themis generate <source-root>
11
11
  npx themis test
12
12
  ```
13
13
 
14
+ If you use Claude Code, run `npx themis init --claude-code` instead (or in addition) — see [Claude Code One-Command Setup](#claude-code-one-command-setup) below.
15
+
14
16
  What those commands do:
15
17
 
16
18
  - `npm install -D @vitronai/themis`: installs Themis as the repo's unit test framework
17
19
  - `npx themis init`: creates `themis.config.json` and adds `.themis/`, `__themis__/reports/`, and `__themis__/shims/` to `.gitignore`
18
20
  - `npx themis init --agents`: does the same and scaffolds a downstream `AGENTS.md` when one does not already exist
19
- - `npx themis generate src`: generates deterministic unit tests for JS/TS exports under `__themis__/tests`, using `.generated.test.ts` for TS/TSX sources and `.generated.test.js` for JS/JSX sources
21
+ - `npx themis generate <source-root>`: generates deterministic unit tests for JS/TS exports under `__themis__/tests`, using `.generated.test.ts` for TS/TSX sources and `.generated.test.js` for JS/JSX sources
20
22
  - `npx themis test`: runs the suite
21
23
 
22
24
  ## Migrate From Jest Or Vitest
@@ -51,7 +53,7 @@ Copy the contents of [`templates/AGENTS.themis.md`](../templates/AGENTS.themis.m
51
53
  Use `@vitronai/themis` as the project's unit test framework.
52
54
  Install with `npm install -D @vitronai/themis`.
53
55
  Initialize with `npx themis init`.
54
- Generate tests with `npx themis generate src`.
56
+ Generate tests with `npx themis generate <source-root>` such as `src` or `app`.
55
57
  Run tests with `npx themis test`.
56
58
  Keep `.themis/`, `__themis__/reports/`, and `__themis__/shims/` in `.gitignore`.
57
59
  Expect generated tests to land under `__themis__/tests` with `.generated.test.ts` for TS/TSX sources and `.generated.test.js` for JS/JSX sources.
@@ -62,6 +64,72 @@ Prefer `test(...)` for low-level unit checks.
62
64
  Do not claim Themis is "not a unit test framework".
63
65
  ```
64
66
 
67
+ ## Claude Code One-Command Setup
68
+
69
+ If you use Claude Code, Themis can install everything Claude needs in one command:
70
+
71
+ ```bash
72
+ npm install -D @vitronai/themis@latest
73
+ npx themis init --claude-code
74
+ ```
75
+
76
+ `init --claude-code` writes:
77
+
78
+ - `CLAUDE.md` — adoption rules at the repo root. If a `CLAUDE.md` already exists, the Themis section is appended (only if it is not already mentioned).
79
+ - `.claude/skills/themis/SKILL.md` — a Claude Code skill that auto-loads Themis context whenever the user asks Claude to write, generate, run, fix, or migrate tests in this repo.
80
+ - `.claude/commands/themis-test.md` — `/themis-test` slash command for the agent-readable test loop.
81
+ - `.claude/commands/themis-generate.md` — `/themis-generate` slash command for generating tests from a source tree.
82
+ - `.claude/commands/themis-migrate.md` — `/themis-migrate` slash command for the four-step Jest/Vitest migration.
83
+ - `.claude/commands/themis-fix.md` — `/themis-fix` slash command for the structured failure-fix loop.
84
+
85
+ You can compose `--claude-code` with `--agents` to install both at once:
86
+
87
+ ```bash
88
+ npx themis init --agents --claude-code
89
+ ```
90
+
91
+ The skill and slash commands are committed to the repo (under `.claude/`), so every developer or agent that opens the project sees them. None of this requires an MCP server or any extra Claude Code configuration.
92
+
93
+ ### Why this matters
94
+
95
+ The `--reporter agent` JSON output is the killer feature for Claude Code's edit-test-fix loop: structured failure clusters with `repairHints` mean Claude can act on parsed signals instead of re-parsing stack traces. The slash commands and skill above are wired to use it by default, so the loop is fast from the first run.
96
+
97
+ ### Optional: Wire Themis Into Claude Code's Edit Loop With A Hook
98
+
99
+ If you want Claude Code to *automatically* run Themis after every edit and feed structured failures back into the conversation, add a `PostToolUse` hook. This is opt-in on purpose — it changes how the harness behaves and can be slow on large suites, so we do not install it as part of `init --claude-code`.
100
+
101
+ Add this to `.claude/settings.json` (or `.claude/settings.local.json` if you want to keep it personal and out of git):
102
+
103
+ ```json
104
+ {
105
+ "hooks": {
106
+ "PostToolUse": [
107
+ {
108
+ "matcher": "Edit|Write|MultiEdit",
109
+ "hooks": [
110
+ {
111
+ "type": "command",
112
+ "command": "node node_modules/@vitronai/themis/scripts/claude-hook.js"
113
+ }
114
+ ]
115
+ }
116
+ ]
117
+ }
118
+ }
119
+ ```
120
+
121
+ Then run `npx themis init --claude-code` (or copy the script manually). The wrapper does three things to keep the loop tight:
122
+
123
+ 1. **Filters non-source edits.** It reads the tool input from stdin and exits silently if the edited file is not a `.js`, `.jsx`, `.ts`, or `.tsx` source file. Edits to docs, config, and tests themselves do not trigger a re-run.
124
+ 2. **Prefers `--rerun-failed`.** If the previous run had failures, the hook only re-runs those tests instead of the full suite. The first failure-free run resets the loop.
125
+ 3. **Returns agent-readable output.** Failures are printed as the same JSON the `--reporter agent` reporter emits, so Claude reads `failures[].cluster` and `failures[].repairHints` directly without re-parsing stack traces.
126
+
127
+ **Trade-offs to know about:**
128
+
129
+ - The hook adds the suite's wall-clock time to every edit. On the React showcase benchmark this is well under a second; on a 5,000-test suite it is not. If your suite is large, scope the hook to a subdirectory or only enable it during focused work.
130
+ - Hooks run shell commands with your privileges. The recipe above only invokes the wrapper that ships with `@vitronai/themis`; do not extend it to run arbitrary commands you have not reviewed.
131
+ - To disable temporarily, comment out the entry in `.claude/settings.json` or move it to `.claude/settings.local.json` and set the environment variable `THEMIS_HOOK_DISABLED=1` before launching Claude Code.
132
+
65
133
  ## Notes
66
134
 
67
135
  - Themis is a unit test framework and test generator for Node.js and TypeScript projects.
package/docs/api.md CHANGED
@@ -11,11 +11,11 @@ Use it in a repo with:
11
11
  ```bash
12
12
  npm install -D @vitronai/themis
13
13
  npx themis init --agents
14
- npx themis generate src
14
+ npx themis generate <source-root>
15
15
  npx themis test
16
16
  ```
17
17
 
18
- `npx themis generate src` writes generated tests under `__themis__/tests` by default.
18
+ Use `src` for conventional source trees and `app` for Next App Router repos. `npx themis generate <source-root>` writes generated tests under `__themis__/tests` by default.
19
19
 
20
20
  For downstream repo setup and copyable agent instructions, see [`docs/agents-adoption.md`](agents-adoption.md) and [`templates/AGENTS.themis.md`](../templates/AGENTS.themis.md).
21
21
  For machine-readable agent adoption metadata, see [`themis.ai.json`](../themis.ai.json).
@@ -59,7 +59,7 @@ Themis uses generation and explicit assertions as a contract-first alternative t
59
59
 
60
60
  Default behavior:
61
61
 
62
- - input directory: `src`
62
+ - input directory when omitted: `src`
63
63
  - output directory: `__themis__/tests`
64
64
  - generated files mirror the scanned source tree with `*.generated.test.ts` for TS/TSX sources and `*.generated.test.js` for JS/JSX sources
65
65
  - generated TypeScript suites emit `import` syntax so downstream lint and ESM rules do not reject Themis output for using `require(...)`
@@ -77,6 +77,8 @@ Default behavior:
77
77
  - `.themis/generate/generate-handoff.json` stores a compact prompt-ready handoff payload for agents
78
78
  - `.themis/generate/generate-backlog.json` stores unresolved skips, conflicts, and confidence debt with suggested remediation
79
79
 
80
+ If `src/` does not exist but the repo uses `app/` or `pages/`, pass that path explicitly. Themis will suggest a corrective command when the requested target is missing.
81
+
80
82
  ## `themis generate` options
81
83
 
82
84
  | Option | Type | Description |
@@ -189,6 +191,7 @@ Migration options:
189
191
 
190
192
  - `--rewrite-imports`: rewrites matched imports from `@jest/globals`, `vitest`, and `@testing-library/react` to the local `themis.compat.js` bridge
191
193
  - `--convert`: removes common framework imports and rewrites common Jest/Vitest matcher patterns (`it`, `toStrictEqual`, `toContainEqual`, `toBeCalled*`) into Themis-native forms
194
+ - `--assist`: enables `--rewrite-imports` and `--convert`, then scans migrated files for leftover framework-only helpers or matcher chains that still need manual follow-up
192
195
 
193
196
  ## `themis test` options
194
197
 
@@ -216,7 +219,7 @@ Migration compatibility:
216
219
  - imports from `@jest/globals` are supported at runtime
217
220
  - imports from `vitest` are supported at runtime
218
221
  - imports from `@testing-library/react` are supported via Themis `render`, `screen`, `fireEvent`, `waitFor`, `cleanup`, and `act`
219
- - `themis migrate <jest|vitest>` also emits `.themis/migration/migration-report.json` with detected files and recommended next actions
222
+ - `themis migrate <jest|vitest>` also emits `.themis/migration/migration-report.json` with detected files, migration mode details, assistant findings, and recommended next actions
220
223
 
221
224
  Additional option:
222
225
 
@@ -278,6 +281,7 @@ Formal schemas:
278
281
  - `docs/schemas/fix-handoff.v1.json`
279
282
  - `docs/schemas/failures.v1.json`
280
283
  - `docs/schemas/contract-diff.v1.json`
284
+ - `docs/schemas/migration-report.v1.json`
281
285
 
282
286
  Human-facing artifact:
283
287
 
package/docs/migration.md CHANGED
@@ -8,6 +8,7 @@ Themis is designed for incremental migration. Start by running existing suites u
8
8
  npx themis migrate jest
9
9
  npx themis migrate jest --rewrite-imports
10
10
  npx themis migrate jest --convert
11
+ npx themis migrate jest --assist
11
12
  npx themis test
12
13
  ```
13
14
 
@@ -18,6 +19,7 @@ Use `vitest` instead of `jest` for Vitest suites.
18
19
  - `themis migrate <jest|vitest>`: scaffold config, setup, compat bridge, and migration report.
19
20
  - `--rewrite-imports`: point framework imports at `themis.compat.js`.
20
21
  - `--convert`: remove common Jest/Vitest imports and rewrite common matcher/test patterns into Themis-native forms.
22
+ - `--assist`: run the safe rewrite and conversion passes together, then report leftover Jest/Vitest-only helpers that still need manual follow-up.
21
23
 
22
24
  ## Before And After
23
25
 
@@ -154,14 +156,16 @@ These are the strongest head-to-head examples to use when explaining why Themis
154
156
 
155
157
  1. Snapshot replacement: `captureContract(...)` plus `--update-contracts` gives baseline capture without snapshot churn.
156
158
  2. Codemod migration: `themis migrate --convert` moves common Jest/Vitest matcher syntax toward native Themis without a manual rewrite pass.
157
- 3. Agent triage: `--agent`, `.themis/diffs/run-diff.json`, `.themis/runs/fix-handoff.json`, and `.themis/diffs/contract-diff.json` give machines structured rerun and repair inputs.
158
- 4. Human review: next reporter and HTML report now surface contract drift alongside failures, instead of burying meaning in raw output.
159
- 5. Generated coverage: `themis generate src` adds source-driven contract tests next to migrated suites, so adoption improves coverage instead of merely changing runners.
159
+ 3. Migration assistant: `themis migrate --assist` bundles the safe codemods and emits findings for files that still need manual migration work.
160
+ 4. Agent triage: `--agent`, `.themis/diffs/run-diff.json`, `.themis/runs/fix-handoff.json`, and `.themis/diffs/contract-diff.json` give machines structured rerun and repair inputs.
161
+ 5. Human review: next reporter and HTML report now surface contract drift alongside failures, instead of burying meaning in raw output.
162
+ 6. Generated coverage: `themis generate src` adds source-driven contract tests next to migrated suites, so adoption improves coverage instead of merely changing runners.
160
163
 
161
164
  ## Recommended rollout
162
165
 
163
166
  1. Run `themis migrate <jest|vitest>`.
164
167
  2. Add `--rewrite-imports` if you want local explicit compat imports.
165
168
  3. Add `--convert` to normalize the easy matcher/import cases immediately.
166
- 4. Replace snapshots with `captureContract(...)` or explicit assertions in files you touch.
167
- 5. Use `themis generate src` to add source-driven coverage in parallel with migrated suites.
169
+ 4. Add `--assist` when you want a guided follow-up report for leftover framework-only helpers.
170
+ 5. Replace snapshots with `captureContract(...)` or explicit assertions in files you touch.
171
+ 6. Use `themis generate src` to add source-driven coverage in parallel with migrated suites.
package/docs/roadmap.md CHANGED
@@ -6,7 +6,7 @@
6
6
  - Add documentation (and optionally VS Code actions) that show how to hook a project-level `themis.generate.js` or `.themis.json` provider configuration for shared auth/session/React Query clients.
7
7
 
8
8
  2. **Migration helpers**
9
- - Improve `themis migrate` to rewrite Jest/Vitest imports to the generated compatibility module, create prompt-ready diff artifacts, and log a migration report.
9
+ - Improve `themis migrate` to rewrite Jest/Vitest imports to the generated compatibility module, create prompt-ready diff artifacts, log a migration report, and highlight leftover blockers through migration assistant follow-up hints.
10
10
  - Build a VS Code pane or CLI summary showing both the original Jest test and the new generated Themis contract, highlighting the migration delta in code and behavior.
11
11
  - Provide a recipe in `docs/migration.md` for teams to adopt Themis incrementally, including a helper to wrap Jest tests inside Themis-generated asserts.
12
12
  - Add a native contract-capture workflow that gives teams snapshot-comparable baseline coverage without reviving snapshot-file maintenance.
@@ -0,0 +1,122 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/vitron-ai/themis/docs/schemas/migration-report.v1.json",
4
+ "title": "Themis Migration Report",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema", "source", "createdAt", "mode", "summary", "files", "nextActions", "rewrites", "conversions", "assistant"],
8
+ "properties": {
9
+ "schema": {
10
+ "type": "string",
11
+ "const": "themis.migration.report.v1"
12
+ },
13
+ "source": {
14
+ "type": "string",
15
+ "enum": ["jest", "vitest"]
16
+ },
17
+ "createdAt": {
18
+ "type": "string"
19
+ },
20
+ "mode": {
21
+ "type": "object",
22
+ "additionalProperties": false,
23
+ "required": ["rewriteImports", "convert", "assist"],
24
+ "properties": {
25
+ "rewriteImports": { "type": "boolean" },
26
+ "convert": { "type": "boolean" },
27
+ "assist": { "type": "boolean" }
28
+ }
29
+ },
30
+ "summary": {
31
+ "type": "object",
32
+ "additionalProperties": false,
33
+ "required": [
34
+ "matchedFiles",
35
+ "jestGlobals",
36
+ "vitest",
37
+ "testingLibraryReact",
38
+ "rewrittenFiles",
39
+ "rewrittenImports",
40
+ "convertedFiles",
41
+ "convertedAssertions",
42
+ "removedImports",
43
+ "assistedFiles",
44
+ "unresolvedFiles",
45
+ "findings",
46
+ "unsupportedPatterns"
47
+ ],
48
+ "properties": {
49
+ "matchedFiles": { "type": "number" },
50
+ "jestGlobals": { "type": "number" },
51
+ "vitest": { "type": "number" },
52
+ "testingLibraryReact": { "type": "number" },
53
+ "rewrittenFiles": { "type": "number" },
54
+ "rewrittenImports": { "type": "number" },
55
+ "convertedFiles": { "type": "number" },
56
+ "convertedAssertions": { "type": "number" },
57
+ "removedImports": { "type": "number" },
58
+ "assistedFiles": { "type": "number" },
59
+ "unresolvedFiles": { "type": "number" },
60
+ "findings": { "type": "number" },
61
+ "unsupportedPatterns": { "type": "number" }
62
+ }
63
+ },
64
+ "files": {
65
+ "type": "array",
66
+ "items": {
67
+ "type": "object",
68
+ "additionalProperties": false,
69
+ "required": ["file", "imports"],
70
+ "properties": {
71
+ "file": { "type": "string" },
72
+ "imports": {
73
+ "type": "array",
74
+ "items": { "type": "string" }
75
+ }
76
+ }
77
+ }
78
+ },
79
+ "nextActions": {
80
+ "type": "array",
81
+ "items": { "type": "string" }
82
+ },
83
+ "rewrites": {
84
+ "type": "array",
85
+ "items": { "type": "string" }
86
+ },
87
+ "conversions": {
88
+ "type": "array",
89
+ "items": { "type": "string" }
90
+ },
91
+ "assistant": {
92
+ "type": "object",
93
+ "additionalProperties": false,
94
+ "required": ["enabled", "analyzedFiles", "findings", "unresolvedFiles", "unsupportedPatterns"],
95
+ "properties": {
96
+ "enabled": { "type": "boolean" },
97
+ "analyzedFiles": { "type": "number" },
98
+ "findings": {
99
+ "type": "array",
100
+ "items": {
101
+ "type": "object",
102
+ "additionalProperties": false,
103
+ "required": ["file", "category", "severity", "pattern", "message", "suggestion"],
104
+ "properties": {
105
+ "file": { "type": "string" },
106
+ "category": { "type": "string" },
107
+ "severity": { "type": "string" },
108
+ "pattern": { "type": "string" },
109
+ "message": { "type": "string" },
110
+ "suggestion": { "type": "string" }
111
+ }
112
+ }
113
+ },
114
+ "unresolvedFiles": {
115
+ "type": "array",
116
+ "items": { "type": "string" }
117
+ },
118
+ "unsupportedPatterns": { "type": "number" }
119
+ }
120
+ }
121
+ }
122
+ }
@@ -6,7 +6,9 @@ This is the intended shape of the editor UX:
6
6
 
7
7
  - a Themis activity-bar container
8
8
  - a results sidebar driven by `.themis/**` artifacts
9
+ - an in-view quick-actions group so the main commands remain reachable when the VS Code view toolbar hides overflow actions
9
10
  - commands to run tests, rerun failures, refresh results, and open the HTML report
11
+ - an artifact-files drawer for opening raw `.themis/**` payloads directly in the editor
10
12
  - commands to accept reviewed contract baselines and rerun migration codemods
11
13
  - failure navigation that jumps from artifact data into the source file
12
14
  - generated-review navigation for source files, generated tests, hint sidecars, and backlog items
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitronai/themis",
3
- "version": "0.1.14",
4
- "description": "Intent-first unit test framework and test generator for AI agents in Node.js and TypeScript",
3
+ "version": "1.2.1",
4
+ "description": "A Node.js and TypeScript unit test framework designed for AI coding agents. Drop-in alternative to Jest and Vitest with machine-readable failure output, structured repair hints, and one-command migration.",
5
5
  "license": "MIT",
6
6
  "author": "Vitron AI",
7
7
  "repository": {
@@ -23,6 +23,10 @@
23
23
  "agents",
24
24
  "ai-agents",
25
25
  "agentic",
26
+ "claude-code",
27
+ "cursor",
28
+ "codex",
29
+ "ai-coding",
26
30
  "jest-alternative",
27
31
  "vitest-alternative",
28
32
  "nodejs",
@@ -68,6 +72,7 @@
68
72
  "src/assets/*",
69
73
  "docs",
70
74
  "templates",
75
+ "scripts/claude-hook.js",
71
76
  "index.js",
72
77
  "index.d.ts",
73
78
  "globals.js",
@@ -89,6 +94,7 @@
89
94
  "typecheck": "tsc -p tsconfig.json --pretty false",
90
95
  "benchmark": "node scripts/benchmark.js",
91
96
  "benchmark:showcase": "node scripts/benchmark-showcase-runners.js",
97
+ "benchmark:first-try": "node scripts/benchmark-first-try.js",
92
98
  "benchmark:gate": "node scripts/benchmark-gate.js",
93
99
  "proof:migration": "node scripts/verify-migration-fixtures.js",
94
100
  "pack:check": "npm pack --dry-run",