{"id":49006398,"url":"https://github.com/vitron-ai/themis","last_synced_at":"2026-04-18T20:12:56.804Z","repository":{"id":345867845,"uuid":"1156774992","full_name":"vitron-ai/themis","owner":"vitron-ai","description":"Intent-first unit testing framework for AI agents in Node.js and TypeScript.","archived":false,"fork":false,"pushed_at":"2026-04-04T22:22:18.000Z","size":13276,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-05T00:29:54.272Z","etag":null,"topics":["agent-testing","ai","ai-agents","ai-testing","developer-tools","llm","nodejs","test-framework","testing","typescript","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vitron-ai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-13T03:15:58.000Z","updated_at":"2026-04-04T22:22:22.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/vitron-ai/themis","commit_stats":null,"previous_names":["vitron-ai/themis"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/vitron-ai/themis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitron-ai%2Fthemis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitron-ai%2Fthemis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitron-ai%2Fthemis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitron-ai%2Fthemis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vitron-ai","download_url":"https://codeload.github.com/vitron-ai/themis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitron-ai%2Fthemis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31982836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T17:30:12.329Z","status":"ssl_error","status_checked_at":"2026-04-18T17:29:59.069Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-testing","ai","ai-agents","ai-testing","developer-tools","llm","nodejs","test-framework","testing","typescript","unit-testing"],"created_at":"2026-04-18T20:12:55.778Z","updated_at":"2026-04-18T20:12:56.785Z","avatar_url":"https://github.com/vitron-ai.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Themis\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"src/assets/themisLogo.png\" alt=\"Themis logo mark\" width=\"42\" valign=\"middle\"\u003e\n  \u003ca href=\"https://github.com/vitron-ai/themis/actions/workflows/ci.yml\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/vitron-ai/themis/ci.yml?branch=main\u0026style=for-the-badge\u0026label=THEMIS%20VERDICT%20PIPELINE\u0026labelColor=111827\u0026color=16a34a\" alt=\"Themis verdict pipeline status\" valign=\"middle\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n**A unit test framework built for AI coding agents.**\n\nDrop-in alternative to Jest and Vitest. Agents write tests, get structured failure output, and self-repair — all in the same edit-test-fix loop.\n\n- **Faster** — 68.59% faster than Vitest, 130.26% faster than Jest on the same benchmark ([proof](#performance))\n- **Agent-native** — `--agent` JSON with failure clusters and structured repair hints\n- **One-command migration** — `npx themis migrate jest` or `vitest` with codemods\n- **Modern by default** — `.ts`, `.tsx`, `.js`, `.jsx`, ESM, React Testing Library, no config gymnastics\n- **Discoverable** — ships `AGENTS.md`, `themis.ai.json`, and a [Tessl tile](tessl/tile.json) so agents find and adopt it automatically\n\n---\n\n## Quickstart\n\n```bash\nnpm install -D @vitronai/themis@latest\nnpx themis init --agents\nnpx themis generate src     # or `app` for Next App Router repos\nnpx themis test\n```\n\n`init --agents` writes config, updates `.gitignore`, and scaffolds a downstream `AGENTS.md`.\n\n**Using Claude Code?** Run `npx themis init --claude-code` to install `CLAUDE.md`, a Claude Code skill, and slash commands (`/themis-test`, `/themis-generate`, `/themis-migrate`, `/themis-fix`).\n\n---\n\n## Performance\n\nOn the same React showcase benchmark, Themis measured **68.59% faster than Vitest** and **130.26% faster than Jest** on median wall-clock time. The comparison artifact is emitted by CI as `.themis/benchmarks/showcase-comparison/perf-summary.json`.\n\nThe first-try benchmark measures how often an AI agent generates tests that pass on the first run — the metric that matters most for agent-driven development:\n\n```bash\nANTHROPIC_API_KEY=sk-... npm run benchmark:first-try\n```\n\n---\n\n## How it works\n\n### Plain English → structured tests\n\n```js\nintent('user can sign in', ({ context, run, verify, cleanup }) =\u003e {\n  context('a valid user', (ctx) =\u003e {\n    ctx.user = { email: 'a@b.com', password: 'pw' };\n  });\n\n  run('the user submits credentials', (ctx) =\u003e {\n    ctx.result = { ok: true };\n  });\n\n  verify('authentication succeeds', (ctx) =\u003e {\n    expect(ctx.result.ok).toBe(true);\n  });\n\n  cleanup('remove test state', (ctx) =\u003e {\n    delete ctx.user;\n  });\n});\n```\n\nPhase names: `context`, `run`, `verify`, `cleanup`. Legacy aliases (`arrange/act/assert`, `given/when/then`) also supported.\n\n### Mocks and UI primitives\n\n```js\nmock('../src/api', () =\u003e ({\n  fetchUser: fn(() =\u003e ({ id: 'u_1', name: 'Ada' }))\n}));\n\nconst { fetchUser } = require('../src/api');\n\ntest('mock captures calls', () =\u003e {\n  const user = fetchUser();\n  expect(fetchUser).toHaveBeenCalledTimes(1);\n  expect(user).toMatchObject({ id: 'u_1', name: 'Ada' });\n});\n```\n\nFor `jsdom` tests, Themis ships `render`, `screen`, `fireEvent`, `waitFor`, `useFakeTimers`, `mockFetch`, and more. Full list in the [API reference](docs/api.md).\n\n### Code generation\n\nThemis scans your source tree and generates contract tests for exported modules, React components, hooks, Next.js routes, and services:\n\n```bash\nnpx themis generate src\nnpx themis test\n```\n\nWhen generated tests fail:\n\n```bash\nnpx themis test --fix\n```\n\n`--fix` regenerates affected targets and reruns the suite. See the [API reference](docs/api.md) for all generation flags (`--review`, `--plan`, `--write-hints`, `--strict`, `--changed`, etc.).\n\n### Migration\n\n```bash\nnpx themis migrate jest\nnpx themis migrate vitest\nnpx themis test\n```\n\nOne command scaffolds a compatibility bridge. Add `--rewrite-imports` to rewrite import paths, `--convert` for codemods. See the [migration guide](docs/migration.md).\n\n---\n\n## Config\n\n`themis.config.json`:\n\n```json\n{\n  \"testDir\": \"tests\",\n  \"generatedTestsDir\": \"__themis__/tests\",\n  \"testRegex\": \"\\\\.(test|spec)\\\\.(js|jsx|ts|tsx)$\",\n  \"maxWorkers\": 7,\n  \"reporter\": \"next\",\n  \"environment\": \"node\",\n  \"setupFiles\": [\"tests/setup.ts\"],\n  \"tsconfigPath\": \"tsconfig.json\"\n}\n```\n\nUse `environment: \"jsdom\"` for DOM-driven tests. Themis auto-stubs common style/asset imports (`.css`, `.scss`, `.png`, `.svg`, etc.).\n\n---\n\n## TypeScript\n\n```json\n{\n  \"compilerOptions\": {\n    \"types\": [\"@vitronai/themis/globals\"]\n  }\n}\n```\n\nShips first-party typings for all test APIs, typed intent context, and project-aware module loading for `.ts`, `.tsx`, ESM `.js`, `.jsx`, and `tsconfig` path aliases.\n\n---\n\n## Pair with Alethia\n\nThemis owns the unit/contract layer. [Alethia](https://github.com/vitron-ai/alethia) owns the E2E/policy layer. Together they form the tightest test loop an autonomous coding agent can sit inside:\n\n1. Agent generates code\n2. **Themis** verifies the contract in milliseconds\n3. **Alethia** verifies the running app in a real browser, under safety policy, with a signed audit trail\n\nUse Themis on its own — it's MIT and stands alone.\n\n---\n\n## Reference docs\n\n- [API reference](docs/api.md) — all CLI flags, globals, matchers, mocks, UI primitives\n- [Agent adoption guide](docs/agents-adoption.md) — downstream repo setup\n- [Migration guide](docs/migration.md) — Jest/Vitest migration details\n- [Why Themis](docs/why-themis.md) — positioning and differentiators\n- [Showcase comparisons](docs/showcases.md) — direct Jest/Vitest examples\n- [Tutorial: Testing with Claude Code](docs/tutorial-claude-code.md)\n- [VS Code extension](docs/vscode-extension.md)\n- [Release policy](docs/release-policy.md)\n- [Publish guide](docs/publish.md)\n- [Changelog](CHANGELOG.md)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"src/assets/themisVerdictEngine.png\" alt=\"Themis verdict engine art\" width=\"960\"\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitron-ai%2Fthemis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvitron-ai%2Fthemis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitron-ai%2Fthemis/lists"}