tevra-design-kit 0.0.0-stage → 1.0.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 (185) hide show
  1. package/LICENSE +21 -0
  2. package/PROVENANCE.md +18 -0
  3. package/README.md +251 -2
  4. package/SKILL.md +20 -0
  5. package/THIRD_PARTY_NOTICES.md +23 -0
  6. package/adapters/claude-code/CLAUDE.md +14 -0
  7. package/adapters/codex/AGENTS.md +5 -0
  8. package/adapters/cursor/README.md +5 -0
  9. package/adapters/gemini-cli/README.md +5 -0
  10. package/adapters/github-copilot/README.md +5 -0
  11. package/adapters/kiro/README.md +5 -0
  12. package/adapters/opencode/README.md +5 -0
  13. package/adapters/windsurf/README.md +5 -0
  14. package/dist/packages/cli/src/arguments.d.ts +9 -0
  15. package/dist/packages/cli/src/arguments.js +58 -0
  16. package/dist/packages/cli/src/arguments.js.map +1 -0
  17. package/dist/packages/cli/src/index.d.ts +2 -0
  18. package/dist/packages/cli/src/index.js +132 -0
  19. package/dist/packages/cli/src/index.js.map +1 -0
  20. package/dist/packages/cli/src/project-commands.d.ts +4 -0
  21. package/dist/packages/cli/src/project-commands.js +137 -0
  22. package/dist/packages/cli/src/project-commands.js.map +1 -0
  23. package/dist/packages/cli/src/run-command.d.ts +2 -0
  24. package/dist/packages/cli/src/run-command.js +35 -0
  25. package/dist/packages/cli/src/run-command.js.map +1 -0
  26. package/dist/packages/cli/src/visual-commands.d.ts +5 -0
  27. package/dist/packages/cli/src/visual-commands.js +73 -0
  28. package/dist/packages/cli/src/visual-commands.js.map +1 -0
  29. package/dist/packages/cli/src/workflow-commands.d.ts +2 -0
  30. package/dist/packages/cli/src/workflow-commands.js +73 -0
  31. package/dist/packages/cli/src/workflow-commands.js.map +1 -0
  32. package/dist/packages/contracts/src/index.d.ts +181 -0
  33. package/dist/packages/contracts/src/index.js +3 -0
  34. package/dist/packages/contracts/src/index.js.map +1 -0
  35. package/dist/packages/core/src/analyze.d.ts +6 -0
  36. package/dist/packages/core/src/analyze.js +46 -0
  37. package/dist/packages/core/src/analyze.js.map +1 -0
  38. package/dist/packages/core/src/config.d.ts +4 -0
  39. package/dist/packages/core/src/config.js +39 -0
  40. package/dist/packages/core/src/config.js.map +1 -0
  41. package/dist/packages/core/src/install.d.ts +13 -0
  42. package/dist/packages/core/src/install.js +69 -0
  43. package/dist/packages/core/src/install.js.map +1 -0
  44. package/dist/packages/core/src/router.d.ts +12 -0
  45. package/dist/packages/core/src/router.js +90 -0
  46. package/dist/packages/core/src/router.js.map +1 -0
  47. package/dist/packages/core/src/search.d.ts +12 -0
  48. package/dist/packages/core/src/search.js +31 -0
  49. package/dist/packages/core/src/search.js.map +1 -0
  50. package/dist/packages/core/src/skills.d.ts +7 -0
  51. package/dist/packages/core/src/skills.js +36 -0
  52. package/dist/packages/core/src/skills.js.map +1 -0
  53. package/dist/packages/core/src/workflow.d.ts +3 -0
  54. package/dist/packages/core/src/workflow.js +73 -0
  55. package/dist/packages/core/src/workflow.js.map +1 -0
  56. package/dist/packages/design-context/src/index.d.ts +5 -0
  57. package/dist/packages/design-context/src/index.js +41 -0
  58. package/dist/packages/design-context/src/index.js.map +1 -0
  59. package/dist/packages/design-context/src/migrate.d.ts +2 -0
  60. package/dist/packages/design-context/src/migrate.js +27 -0
  61. package/dist/packages/design-context/src/migrate.js.map +1 -0
  62. package/dist/packages/design-context/src/tokens.d.ts +8 -0
  63. package/dist/packages/design-context/src/tokens.js +65 -0
  64. package/dist/packages/design-context/src/tokens.js.map +1 -0
  65. package/dist/packages/design-context/src/validation.d.ts +1 -0
  66. package/dist/packages/design-context/src/validation.js +22 -0
  67. package/dist/packages/design-context/src/validation.js.map +1 -0
  68. package/dist/packages/design-memory/src/index.d.ts +16 -0
  69. package/dist/packages/design-memory/src/index.js +47 -0
  70. package/dist/packages/design-memory/src/index.js.map +1 -0
  71. package/dist/packages/filesystem/src/index.d.ts +8 -0
  72. package/dist/packages/filesystem/src/index.js +83 -0
  73. package/dist/packages/filesystem/src/index.js.map +1 -0
  74. package/dist/packages/filesystem/src/resources.d.ts +1 -0
  75. package/dist/packages/filesystem/src/resources.js +13 -0
  76. package/dist/packages/filesystem/src/resources.js.map +1 -0
  77. package/dist/packages/performance-qa/src/index.d.ts +24 -0
  78. package/dist/packages/performance-qa/src/index.js +77 -0
  79. package/dist/packages/performance-qa/src/index.js.map +1 -0
  80. package/dist/packages/quality-engine/src/html.d.ts +2 -0
  81. package/dist/packages/quality-engine/src/html.js +15 -0
  82. package/dist/packages/quality-engine/src/html.js.map +1 -0
  83. package/dist/packages/quality-engine/src/index.d.ts +3 -0
  84. package/dist/packages/quality-engine/src/index.js +45 -0
  85. package/dist/packages/quality-engine/src/index.js.map +1 -0
  86. package/dist/packages/registry/src/index.d.ts +49 -0
  87. package/dist/packages/registry/src/index.js +132 -0
  88. package/dist/packages/registry/src/index.js.map +1 -0
  89. package/dist/packages/visual-testing/src/capture.d.ts +12 -0
  90. package/dist/packages/visual-testing/src/capture.js +174 -0
  91. package/dist/packages/visual-testing/src/capture.js.map +1 -0
  92. package/dist/packages/visual-testing/src/checks.d.ts +3 -0
  93. package/dist/packages/visual-testing/src/checks.js +17 -0
  94. package/dist/packages/visual-testing/src/checks.js.map +1 -0
  95. package/dist/packages/visual-testing/src/compare.d.ts +12 -0
  96. package/dist/packages/visual-testing/src/compare.js +85 -0
  97. package/dist/packages/visual-testing/src/compare.js.map +1 -0
  98. package/dist/packages/visual-testing/src/types.d.ts +49 -0
  99. package/dist/packages/visual-testing/src/types.js +2 -0
  100. package/dist/packages/visual-testing/src/types.js.map +1 -0
  101. package/dist/packages/workflow-engine/src/index.d.ts +11 -0
  102. package/dist/packages/workflow-engine/src/index.js +51 -0
  103. package/dist/packages/workflow-engine/src/index.js.map +1 -0
  104. package/docs/agents.md +36 -0
  105. package/docs/architecture.md +86 -0
  106. package/docs/configuration.md +109 -0
  107. package/docs/contributing.md +75 -0
  108. package/docs/security.md +42 -0
  109. package/docs/usage.md +142 -0
  110. package/package.json +85 -4
  111. package/references/accessibility/manual-checklist.md +3 -0
  112. package/references/color-systems/semantic-color.md +3 -0
  113. package/references/design-principles/decision-making.md +3 -0
  114. package/references/frameworks/nextjs.md +3 -0
  115. package/references/frameworks/react-native-expo.md +3 -0
  116. package/references/frameworks/react.md +3 -0
  117. package/references/frameworks/sveltekit.md +3 -0
  118. package/references/frameworks/vue.md +3 -0
  119. package/references/typography/scales.md +3 -0
  120. package/references/ux-patterns/README.md +7 -0
  121. package/references/ux-patterns/UPSTREAM-LICENSE.txt +21 -0
  122. package/references/ux-patterns/catalog.json +221 -0
  123. package/registry/capability-ownership.json +191 -0
  124. package/registry/skills.json +764 -0
  125. package/registry/sources.json +159 -0
  126. package/rubrics/quality-rubric.md +24 -0
  127. package/schemas/capability-ownership.schema.json +69 -0
  128. package/schemas/capture-manifest.schema.json +209 -0
  129. package/schemas/checks.schema.json +83 -0
  130. package/schemas/comparison.schema.json +154 -0
  131. package/schemas/config.schema.json +297 -0
  132. package/schemas/design-context.schema.json +651 -0
  133. package/schemas/design-context.v2.schema.json +395 -0
  134. package/schemas/handoff.schema.json +135 -0
  135. package/schemas/legacy/design-context.master-v1.schema.json +167 -0
  136. package/schemas/legacy/design-context.v1.schema.json +36 -0
  137. package/schemas/memory.schema.json +69 -0
  138. package/schemas/plan.schema.json +139 -0
  139. package/schemas/quality-report.schema.json +151 -0
  140. package/schemas/skill-registry.schema.json +222 -0
  141. package/schemas/sources.schema.json +129 -0
  142. package/skills/accessibility-qa/LICENSE +21 -0
  143. package/skills/accessibility-qa/SKILL.md +56 -0
  144. package/skills/accessibility-qa/references/guide.md +3 -0
  145. package/skills/browser-testing/LICENSE +21 -0
  146. package/skills/browser-testing/SKILL.md +35 -0
  147. package/skills/browser-testing/references/guide.md +11 -0
  148. package/skills/design-direction/LICENSE +21 -0
  149. package/skills/design-direction/SKILL.md +56 -0
  150. package/skills/design-direction/references/guide.md +3 -0
  151. package/skills/design-research/LICENSE +21 -0
  152. package/skills/design-research/SKILL.md +56 -0
  153. package/skills/design-research/references/guide.md +3 -0
  154. package/skills/design-system/LICENSE +21 -0
  155. package/skills/design-system/SKILL.md +56 -0
  156. package/skills/design-system/references/guide.md +3 -0
  157. package/skills/frontend-review/LICENSE +21 -0
  158. package/skills/frontend-review/SKILL.md +35 -0
  159. package/skills/frontend-review/references/guide.md +11 -0
  160. package/skills/interaction-motion/LICENSE +21 -0
  161. package/skills/interaction-motion/SKILL.md +56 -0
  162. package/skills/interaction-motion/references/guide.md +3 -0
  163. package/skills/performance-qa/LICENSE +21 -0
  164. package/skills/performance-qa/SKILL.md +35 -0
  165. package/skills/performance-qa/references/guide.md +9 -0
  166. package/skills/responsive-design/LICENSE +21 -0
  167. package/skills/responsive-design/SKILL.md +56 -0
  168. package/skills/responsive-design/references/guide.md +3 -0
  169. package/skills/ui-builder/LICENSE +21 -0
  170. package/skills/ui-builder/SKILL.md +58 -0
  171. package/skills/ui-builder/references/guide.md +3 -0
  172. package/skills/ui-builder/references/nextjs.md +3 -0
  173. package/skills/ui-builder/references/react-native-expo.md +3 -0
  174. package/skills/ui-builder/references/react.md +3 -0
  175. package/skills/ui-builder/references/sveltekit.md +3 -0
  176. package/skills/ui-builder/references/vue.md +3 -0
  177. package/skills/ui-redesign/LICENSE +21 -0
  178. package/skills/ui-redesign/SKILL.md +56 -0
  179. package/skills/ui-redesign/references/guide.md +3 -0
  180. package/skills/visual-review/LICENSE +21 -0
  181. package/skills/visual-review/SKILL.md +56 -0
  182. package/skills/visual-review/references/guide.md +7 -0
  183. package/templates/direction-decision.md +45 -0
  184. package/templates/research-brief.md +56 -0
  185. package/templates/visual-review.md +46 -0
@@ -0,0 +1,51 @@
1
+ import { randomUUID } from 'node:crypto';
2
+ import { transitionPlan } from '../../core/src/workflow.js';
3
+ import { validate } from '../../design-context/src/validation.js';
4
+ import { loadContext } from '../../design-context/src/index.js';
5
+ import { readJSON, redact, withLock, writeJSON } from '../../filesystem/src/index.js';
6
+ export async function runWorkflow(root, path, adapters) {
7
+ return withLock(root, '.tevra/runner.lock', async () => {
8
+ let plan = validate('plan.schema.json', await readJSON(root, path));
9
+ const revision = (await loadContext(root)).revision;
10
+ if (plan.contextRevision !== revision)
11
+ throw new Error('Workflow context revision is stale');
12
+ if (plan.approvalRequired && !plan.approvedBy)
13
+ throw new Error('Human approval required before executing this high-impact workflow');
14
+ if (plan.steps.length > plan.budget.maxSteps || new Set(plan.steps.map(step => step.skill)).size !== plan.steps.length)
15
+ throw new Error('Invalid workflow step budget or duplicate skills');
16
+ for (const [index, step] of plan.steps.entries())
17
+ for (const dependency of step.dependsOn)
18
+ if (!plan.steps.slice(0, index).some(candidate => candidate.skill === dependency))
19
+ throw new Error(`Dependency must precede ${step.skill}: ${dependency}`);
20
+ for (const step of [...plan.steps]) {
21
+ if (step.status === 'passed' || step.status === 'skipped')
22
+ continue;
23
+ if (step.status === 'running')
24
+ throw new Error(`Stage already running: ${step.skill}; inspect its previous attempt before recovery`);
25
+ if (step.dependsOn.some(dependency => plan.steps.find(candidate => candidate.skill === dependency)?.status !== 'passed'))
26
+ continue;
27
+ while (step.attempts < plan.budget.maxRefinements + 1) {
28
+ plan = await transitionPlan(root, path, step.skill, 'running', [], revision);
29
+ const started = plan.steps.find(candidate => candidate.skill === step.skill);
30
+ if (!started)
31
+ throw new Error('Workflow stage disappeared');
32
+ step.attempts = started.attempts;
33
+ const artifact = `.tevra/workflow-runs/${randomUUID()}.json`;
34
+ let result;
35
+ try {
36
+ const adapter = adapters[step.skill];
37
+ result = adapter ? await adapter() : { status: 'blocked', evidence: [], message: 'This skill requires the coding agent to execute its instructions and submit validation evidence; no supported automatic agent adapter is configured.' };
38
+ }
39
+ catch (error) {
40
+ result = { status: 'blocked', evidence: [], message: redact(error instanceof Error ? error.message : String(error)) };
41
+ }
42
+ await writeJSON(root, artifact, { skill: step.skill, contextRevision: revision, ...result });
43
+ plan = await transitionPlan(root, path, step.skill, result.status, [artifact, ...result.evidence], revision);
44
+ if (result.status !== 'failed')
45
+ break;
46
+ }
47
+ }
48
+ return { status: plan.steps.some(step => step.status === 'failed') ? 'failed' : plan.steps.every(step => step.status === 'passed') ? 'passed' : 'blocked', plan };
49
+ });
50
+ }
51
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/workflow-engine/src/index.ts"],"names":[],"mappings":"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"}
package/docs/agents.md ADDED
@@ -0,0 +1,36 @@
1
+ # Supported agents
2
+
3
+ Tevra skills follow the open [Agent Skills format](https://agentskills.io/specification), so the same folders work across agents. Only the install location differs.
4
+
5
+ | Agent | Install | Skills folder | How skills activate | Notes |
6
+ | --- | --- | --- | --- | --- |
7
+ | Claude Code | Plugin (recommended) | managed by Claude Code | Description match or `/tevra:<skill>` | Namespaced, so no clash with project skills. [Details](../adapters/claude-code/CLAUDE.md) |
8
+ | Claude Code | `--agents claude` | `.claude/skills/` | Description match or `/<skill>` | Refuses to overwrite a same-named skill |
9
+ | Codex | `--agents codex` | `.agents/skills/` | Native selector or `$<skill>` | [Details](../adapters/codex/AGENTS.md) |
10
+ | Cursor | `--agents cursor` | `.cursor/skills/` | `/` in Agent chat | [Details](../adapters/cursor/README.md) |
11
+ | Kiro | `--agents kiro` | `.kiro/skills/` | Description match or `/<skill>` | Custom agents need `skill://.kiro/skills/**/SKILL.md` in `resources`. [Details](../adapters/kiro/README.md) |
12
+ | Gemini CLI | `--agents gemini` | `.gemini/skills/` | Description match, with confirmation | Also reads `.agents/skills`. [Details](../adapters/gemini-cli/README.md) |
13
+ | GitHub Copilot | `--agents copilot` | `.github/skills/` | Agent mode, Copilot CLI, cloud agent | Also reads `.claude/skills` and `.agents/skills`. [Details](../adapters/github-copilot/README.md) |
14
+ | OpenCode | `--agents opencode` | `.opencode/skills/` | Loaded on relevance | Also reads `.claude/skills`; `.opencode/skills` wins. [Details](../adapters/opencode/README.md) |
15
+ | Windsurf / Devin Desktop | `--agents windsurf` | `.windsurf/skills/` | Description match or `@<skill>` | Devin Desktop prefers `.devin/skills/` but still reads this path. [Details](../adapters/windsurf/README.md) |
16
+
17
+ ## Avoid duplicate skills
18
+
19
+ Some agents read more than one folder. Installing Tevra into two folders that the same agent reads shows every skill twice. Pick one per agent:
20
+
21
+ - Gemini CLI: `gemini` **or** `codex`
22
+ - GitHub Copilot: `copilot`, `claude` **or** `codex`
23
+ - OpenCode: `opencode` (or rely on `claude`)
24
+
25
+ ## Installing for several agents
26
+
27
+ ```sh
28
+ tevra-design init --yes --agents codex,cursor,kiro
29
+ tevra-design skills install --agents opencode --dry-run # preview without writing
30
+ ```
31
+
32
+ Each skill folder is self-contained and carries its own references. The installer checks every destination first and aborts the whole install if any file differs from the bundled copy, so local edits are never lost.
33
+
34
+ ## Verifying activation
35
+
36
+ A successful copy does not prove an agent loaded the skill. Agent trust settings, managed policies and versions can affect loading. After installing, open a new agent session and ask for a small task (for example "check the accessibility of the login page") or list skills in the agent's UI.
@@ -0,0 +1,86 @@
1
+ # Architecture
2
+
3
+ Tevra is two things in one repository:
4
+
5
+ 1. **Twelve Agent Skills** (`skills/<name>/SKILL.md` plus focused references). They are plain Markdown that any agent supporting the [Agent Skills format](https://agentskills.io/specification) can load. They work without the CLI.
6
+ 2. **A TypeScript CLI** (`packages/*`) that plans workflows and produces verifiable evidence. It never invokes an LLM; the coding agent does the design and implementation work.
7
+
8
+ ```
9
+ ┌──────────────┐ reads ┌──────────────────────┐
10
+ you ────▶ │ coding agent │ ─────────▶ │ skills/*/SKILL.md │
11
+ └──────┬───────┘ └──────────────────────┘
12
+ │ runs
13
+ ▼
14
+ ┌──────────────┐ writes ┌──────────────────────────────┐
15
+ │ tevra-design │ ────────▶ │ .tevra/ config, context, │
16
+ └──────────────┘ │ memory, plans, screenshots, │
17
+ │ diffs, reports │
18
+ └──────────────────────────────┘
19
+ ```
20
+
21
+ ## Packages
22
+
23
+ Dependencies flow one way: `cli` → feature engines (`workflow-engine` → `core` → `registry`, plus `visual-testing`, `quality-engine`, `performance-qa`, `design-memory`) → `design-context` → `contracts` and `filesystem`. No engine imports the CLI. Runtime and type-only imports follow the same direction, and cycles are not allowed.
24
+
25
+ | Package | Responsibility |
26
+ | --- | --- |
27
+ | `contracts` | Shared types and enums (skill names, plans, handoffs, checks) |
28
+ | `filesystem` | The only write path: project-root boundary, traversal and symlink rejection, atomic writes, locks, secret redaction |
29
+ | `design-context` | Versioned context schema, explicit migration, optimistic revisions, token foundation and export |
30
+ | `design-memory` | Inspectable project decisions with revisioned updates and confirmed reset |
31
+ | `registry` | Skill metadata validation, capability ownership, dependency and conflict resolution |
32
+ | `core` | Skill discovery, installation, request routing, BM25 search, workflow state and handoffs |
33
+ | `workflow-engine` | Executes the QA stages of a plan with retry budgets |
34
+ | `visual-testing` | Playwright capture, axe, runtime errors, overflow and target heuristics, PNG comparison |
35
+ | `performance-qa` | Lighthouse subprocess and budget checks |
36
+ | `quality-engine` | Weighted scoring, blockers and JSON/Markdown/HTML reports |
37
+ | `cli` | Strict argument parsing, setup and command dispatch |
38
+
39
+ ## Skills and capability ownership
40
+
41
+ `registry/skills.json` describes each skill (capabilities, dependencies, conflicts, frameworks, platforms, supported agents, inputs, outputs) without loading its instructions. Each capability has exactly one owner, so two skills never do the same job in one plan:
42
+
43
+ | Capability | Owner | Evidence it produces |
44
+ | --- | --- | --- |
45
+ | UX research | design-research | Cited recommendations with confidence |
46
+ | Visual direction | design-direction | Approved rationale and design controls |
47
+ | Tokens | design-system | Schema-valid tokens and exports |
48
+ | Implementation | ui-builder | Working code, build and behavior checks |
49
+ | Redesign | ui-redesign | Invariant table and before/after evidence |
50
+ | Responsive | responsive-design | Screenshots and overflow findings |
51
+ | Motion | interaction-motion | Interaction and reduced-motion evidence |
52
+ | Visual regression | visual-review | PNG diffs and rubric findings |
53
+ | Accessibility | accessibility-qa | axe results plus manual checklist |
54
+ | Browser testing | browser-testing | Assertions, console and network errors |
55
+ | Performance | performance-qa | Lighthouse lab artifacts |
56
+ | Code review | frontend-review | File and line findings |
57
+
58
+ Selection is deterministic: filter by framework, platform and agent; use an explicit override or the highest priority (ties broken by ID); expand dependencies in topological order; reject conflicts visibly. Third parties can add skills through a registry extension file without changing core code.
59
+
60
+ ## Workflow model
61
+
62
+ `workflow plan` routes a request to a skill chain and records steps, dependencies, mode, step/time/refinement budgets, the context revision and whether human approval is required. Stages move through `pending → running → passed | failed | blocked | skipped`.
63
+
64
+ - Design and implementation stages are completed by the coding agent with an evidence file.
65
+ - `workflow run` executes Tevra's own QA stages. A missing browser, app or integration produces `blocked`, never a pass.
66
+ - Failed stages retry up to the plan's refinement budget; blocked stages are not retried automatically.
67
+ - Stale context, concurrent runs, unapproved high-impact work and invalid dependency order fail before anything executes.
68
+
69
+ ## Evidence and quality gates
70
+
71
+ Capture output is partitioned by route, state, viewport and capture kind, and is identified by hashes of the screenshots, manifest and settings. Comparisons and reports refuse mismatched or stale inputs. Evidence is labeled by kind (deterministic, heuristic, AI, human) and the report keeps them apart. Critical failures and missing required checks block PASS even when the weighted score is high.
72
+
73
+ ## Context and multi-agent handoff
74
+
75
+ The design context (`.tevra/design-context.json`, format version 2.0) holds project identity, brand, approved direction, tokens, responsive requirements, known regressions and provenance. Older context formats migrate explicitly and non-destructively. Updates require the current revision; approved decisions are immutable.
76
+
77
+ Handoffs (`schemas/handoff.schema.json`) carry the task ID, objective, artifacts, context revision, owner, exclusive file claims, constraints, acceptance criteria, evidence, status and error. Tevra rejects stale revisions and overlapping file ownership so agents working in parallel do not overwrite each other.
78
+
79
+ ## Design decisions
80
+
81
+ 1. **Local first.** All state lives in the project's `.tevra/` folder. Tevra never commits, uploads or calls a model endpoint.
82
+ 2. **No simulated success.** A missing browser or tool is an error, not a skipped pass.
83
+ 3. **Validate at boundaries.** External JSON and YAML go through strict JSON Schemas (Ajv); internals use TypeScript types.
84
+ 4. **Small dependency set.** Ajv, YAML, Playwright, axe-core, pngjs, pixelmatch and Lighthouse. Tokens export as portable CSS variables and a CSS-first Tailwind adapter.
85
+ 5. **Self-contained skills.** Each skill folder ships its own narrowly chosen references and installs independently.
86
+ 6. **Humans own approvals.** Baselines, transformative redesigns and shared-system changes need an explicit recorded decision.
@@ -0,0 +1,109 @@
1
+ # Configuration
2
+
3
+ `tevra-design init` creates `.tevra/config.json`. To start from a reviewed file instead, place a `tevra.config.json` in the project root before running `init`. The file is validated against [`schemas/config.schema.json`](../schemas/config.schema.json); unknown fields are rejected.
4
+
5
+ ## Minimal example
6
+
7
+ ```json
8
+ {
9
+ "version": 1,
10
+ "baseURL": "http://localhost:3000",
11
+ "permittedOrigins": ["http://localhost:3000"],
12
+ "viewports": [
13
+ { "name": "mobile", "width": 390, "height": 844 },
14
+ { "name": "desktop", "width": 1440, "height": 900 }
15
+ ],
16
+ "routes": [
17
+ {
18
+ "name": "checkout",
19
+ "path": "/checkout",
20
+ "states": [
21
+ { "name": "default", "actions": [], "masks": [] },
22
+ {
23
+ "name": "invalid-email",
24
+ "actions": [
25
+ { "type": "fill", "selector": "#email", "value": "not-an-email" },
26
+ { "type": "click", "selector": "button[type=submit]" },
27
+ { "type": "expect-visible", "selector": "#email-error" }
28
+ ],
29
+ "masks": ["[data-testid=order-number]"],
30
+ "waitFor": "#email-error"
31
+ }
32
+ ]
33
+ }
34
+ ],
35
+ "browser": {},
36
+ "timeoutMs": 15000,
37
+ "thresholds": { "diffRatio": 0.01, "pixelSensitivity": 0.1, "minScore": 75 },
38
+ "weights": {
39
+ "hierarchy": 15, "typography": 10, "layout": 15, "consistency": 10,
40
+ "responsive": 15, "accessibility": 15, "interaction": 0, "functional": 10, "performance": 10
41
+ },
42
+ "requiredChecks": ["visual-diff", "axe", "overflow", "functional-tests"],
43
+ "maxRefinements": 2
44
+ }
45
+ ```
46
+
47
+ ## Fields
48
+
49
+ | Field | Meaning |
50
+ | --- | --- |
51
+ | `baseURL` | Where the app runs. No credentials, query string or fragment |
52
+ | `permittedOrigins` | Exact HTTP(S) origins the browser may load. Requests to anything else are blocked; add asset or API origins explicitly |
53
+ | `viewports` | Named width × height profiles. Defaults: 390×844, 768×1024, 1280×800, 1440×900. Add intermediate or landscape sizes your product needs |
54
+ | `routes[].states` | Named page conditions to capture. Names use lowercase letters, digits and hyphens |
55
+ | `states[].actions` | Steps to reach the state (see below) |
56
+ | `states[].masks` | CSS/Playwright selectors hidden in screenshots. Each must match at least one element or capture fails |
57
+ | `states[].waitFor` | Selector that must be visible before capture |
58
+ | `readySelector` | Optional marker awaited before any action, useful for client-side hydration |
59
+ | `colorScheme` | `light` (default), `dark` or `no-preference` |
60
+ | `reducedMotion` | `reduce` (default, for repeatable captures) or `no-preference` |
61
+ | `browser` | `channel` (for example `chrome`, `msedge`) or `executablePath` |
62
+ | `timeoutMs` | Upper bound for browser waits |
63
+ | `thresholds.diffRatio` | Fraction of changed pixels allowed before a diff fails (0–1) |
64
+ | `thresholds.pixelSensitivity` | Color difference that counts as "changed" (0–1) |
65
+ | `thresholds.minScore` | Minimum rubric score (0–100). `0` disables the subjective-score requirement; required checks still apply |
66
+ | `weights` | Rubric weights, totalling 100 |
67
+ | `requiredChecks` | Check IDs that must pass for delivery |
68
+ | `maxRefinements` | Default retry budget for new plans |
69
+
70
+ ### Actions
71
+
72
+ Actions use a closed vocabulary; arbitrary scripts are not supported.
73
+
74
+ | `type` | Uses | Effect |
75
+ | --- | --- | --- |
76
+ | `click` | `selector` | Clicks the element |
77
+ | `fill` | `selector`, `value` | Types into a field |
78
+ | `press` | `selector`, `value` | Presses a key on the element |
79
+ | `check` | `selector` | Checks a checkbox or radio |
80
+ | `expect-visible` / `expect-hidden` | `selector` | Asserts visibility |
81
+ | `expect-text` | `selector`, `value` | Asserts the element contains text |
82
+ | `expect-checked` | `selector` | Asserts a checked state |
83
+
84
+ Selectors are Playwright locators, so `button:has-text('Save')` works. `test browser` requires at least one `expect-*` assertion in every state; a click that does not throw is not evidence that the feature works.
85
+
86
+ ## Privacy
87
+
88
+ - Never put real passwords, tokens or customer data in `value`. Use sample data.
89
+ - Mask anything private that can appear on screen (names, emails, ID numbers, plate numbers). Text redaction in reports cannot detect arbitrary personal data inside images.
90
+ - Reports redact URL query strings and common secret patterns.
91
+ - The kit's browser starts without cookies or storage, so pages behind a login redirect to your sign-in page. Test those pages with an agent that uses an already signed-in browser, or point Tevra at a test environment with public routes.
92
+
93
+ ## Design controls
94
+
95
+ Visual direction is described with three integers from 1 to 10, stored in the design context:
96
+
97
+ | Control | Context field | Low values | High values |
98
+ | --- | --- | --- | --- |
99
+ | Variance | `design.variance` | Familiar composition | Experimental composition with explicit usability checks |
100
+ | Motion intensity | `design.motionIntensity` | State feedback only | Rich transitions with a documented task benefit and reduced-motion equivalent |
101
+ | Visual density | `design.visualDensity` | Reading-oriented | Dense comparison views |
102
+
103
+ Defaults are 5, 3 and 5. Controls never override accessibility, approved brand rules or project constraints.
104
+
105
+ ## Extending Tevra
106
+
107
+ - **Research catalog:** add records to `references/ux-patterns/catalog.json` with a stable ID, source, license and confidence, plus a relevance test.
108
+ - **Third-party skills:** describe them in a registry extension file that follows `schemas/skill-registry.schema.json` and pass it with `--registry extension.json` to `skills list|inspect|validate|graph`. Extensions are metadata; they cannot register commands or executables.
109
+ - **Framework guidance:** add a focused file under `references/frameworks/` and link it from the skill that needs it, rather than loading every framework for every task.
@@ -0,0 +1,75 @@
1
+ # Contributing
2
+
3
+ ## Setup
4
+
5
+ ```sh
6
+ pnpm install
7
+ pnpm build
8
+ pnpm exec playwright install chromium
9
+ ```
10
+
11
+ ## Checks
12
+
13
+ ```sh
14
+ pnpm typecheck
15
+ pnpm test # unit + integration
16
+ pnpm test:structure # axe on the built example apps
17
+ pnpm test:examples # acceptance-app model tests
18
+ pnpm test:legacy # Python context validator
19
+ pnpm skills:check # skill metadata and links
20
+ pnpm test:e2e # real browser: screenshots, diffs, axe, task flows
21
+ node --import tsx --test tests/unit/router.test.ts # a single file
22
+ ```
23
+
24
+ `test:e2e` builds first and needs a machine that allows starting Chromium and local servers. Build the examples before `test:structure` and `test:e2e`:
25
+
26
+ ```sh
27
+ pnpm --filter @tevra/example-nextjs build
28
+ pnpm --filter @tevra/example-sveltekit build
29
+ pnpm --filter @tevra/acceptance-app build
30
+ ```
31
+
32
+ CI (`.github/workflows/ci.yml`) runs all of the above on every push and pull request.
33
+
34
+ ## Measuring skill impact
35
+
36
+ `evals/` holds cases for `claude plugin eval`. Each run compares Claude with and without the plugin on the same prompt and reports the score delta.
37
+
38
+ ```sh
39
+ claude plugin eval . --runs 3 --no-publish --max-cost-usd 5
40
+ ```
41
+
42
+ Add a case when you change a skill's behavior: a realistic `prompt.md` and `graders/*.md` that describe observable outcomes. Results go to `evals/results/` (gitignored). Single runs are noisy; report deltas only from several runs.
43
+
44
+ ## Demo images
45
+
46
+ `docs/assets/` and `.claude-plugin/icon.png` are rendered from a real run, never mocked. Reproduce the before/after run from the README ("See it in action"), then:
47
+
48
+ ```sh
49
+ pnpm demo:assets
50
+ ```
51
+
52
+ ## Editing skills
53
+
54
+ - `skills/` is the only source of truth. `.claude/` and `.cursor/` in this repository are local installs and are gitignored; refresh them with `tevra-design skills install`.
55
+ - Start every `description` with what the skill does, then a "Use when…" sentence with the words people actually type. Agents choose skills from that line.
56
+ - Keep `SKILL.md` short. Put conditional detail in `references/` and link it.
57
+ - Keep `registry/skills.json` in sync with skill names and descriptions.
58
+ - Run `pnpm skills:check` after every change.
59
+
60
+ ## Code
61
+
62
+ - Dependencies point one way (see [architecture](architecture.md)). No cycles, including type-only imports.
63
+ - Validate external input with a schema in `schemas/`. Keep internal types strict.
64
+ - Write all files through `packages/filesystem`; never write outside the project root.
65
+ - Production modules stay under about 300 logical lines; split only at a real ownership boundary.
66
+ - Add a test for every changed behavior.
67
+ - Write all repository content in English. Vietnamese keywords in `packages/core/src/router.ts` and `references/ux-patterns/catalog.json` are intentional search terms.
68
+
69
+ ## Before a release
70
+
71
+ - Bump `version` in `package.json`, `packages/*/package.json`, `examples/*/package.json`, `.claude-plugin/plugin.json`, `registry/skills.json` and the skill frontmatter together, and add a [changelog](../CHANGELOG.md) entry.
72
+ - Check the npm contents with `npm pack --dry-run`, then publish with `npm publish`.
73
+ - Run every check above, plus `pnpm audit` and `pnpm licenses list`.
74
+ - Install the plugin and each adapter in a fresh project and confirm the skills load.
75
+ - Report any check you could not run as unverified, not as passing.
@@ -0,0 +1,42 @@
1
+ # Security
2
+
3
+ Tevra treats everything it reads as data, never as instructions: external references, screenshots, project configuration and skill catalogs. It configures no model endpoint, no upload client and no arbitrary shell command.
4
+
5
+ ## Boundaries
6
+
7
+ | Boundary | Protection | Covered by |
8
+ | --- | --- | --- |
9
+ | Project paths | Relative paths only; traversal, absolute paths and symlinked ancestors are rejected | `tests/integration/project.test.ts` |
10
+ | Concurrent writes | Exclusive locks, atomic replacement, expected revisions | Context, memory and workflow tests |
11
+ | Agent ownership | Canonical file claims, stale-revision checks, overlapping owners rejected | Router and handoff tests |
12
+ | Skill installation | Every destination is preflighted and rechecked; changed files are never overwritten | Adapter integration tests |
13
+ | Browser executable | Channels from a closed list; a custom path needs `--allow-custom-browser` | Custom executable regression test |
14
+ | Browser network | Only configured origins load; requests and WebSockets are intercepted; fresh context; downloads and service workers blocked | E2E browser tests |
15
+ | Browser actions | Closed vocabulary (`click`, `fill`, `press`, `check`, `expect-*`); no scripts in config | Config schema |
16
+ | Lighthouse | Subprocess with an argument array, no shell; network access only with `--allow-network` | Performance unit tests |
17
+ | PNG input | Header and dimension budget checked before decoding | Invalid and oversized PNG tests |
18
+ | Evidence integrity | Hashes for screenshots, manifests and settings; failed captures and stale comparisons are rejected | CLI pipeline tests |
19
+ | Reports and memory | Secret patterns and URL queries redacted; secret-like memory entries rejected; Markdown escaped | Quality and memory tests |
20
+ | Human decisions | Approved history protected; resets, constraint changes and baselines need explicit flags | Context, memory and workflow tests |
21
+
22
+ ## Limits to be aware of
23
+
24
+ - File locks coordinate cooperating tools. They do not protect against an administrator or a hostile process running as the same user.
25
+ - `workflow approve --by NAME` records a decision. It is not identity verification.
26
+ - Redaction finds common secret formats in text. It cannot detect arbitrary personal data, and never inside screenshots. Mask private regions before capture.
27
+ - Lighthouse may load every resource origin a page requests once `--allow-network` is given. Only audit apps whose third-party requests you have reviewed.
28
+ - Automated browser checks do not certify screen-reader behavior, native apps or full WCAG conformance.
29
+
30
+ ## Before a release
31
+
32
+ ```sh
33
+ pnpm audit
34
+ pnpm licenses list
35
+ pnpm test && pnpm test:structure && pnpm test:e2e
36
+ ```
37
+
38
+ Run these on a machine that allows browser launch and local servers.
39
+
40
+ ## Reporting a vulnerability
41
+
42
+ Do not open a public issue. Contact the Tevra maintainers privately with steps to reproduce and the affected version.
package/docs/usage.md ADDED
@@ -0,0 +1,142 @@
1
+ # Usage
2
+
3
+ Tevra has two halves that work together:
4
+
5
+ - **Skills** are instructions your coding agent reads and follows. You use them by asking the agent for something.
6
+ - **The `tevra-design` CLI** plans work and produces evidence: screenshots, pixel diffs, axe results, Lighthouse metrics and quality reports. It never calls an LLM.
7
+
8
+ Every command accepts `--root <project>`; other paths are relative to that project. Run `tevra-design help` for the full list.
9
+
10
+ **Exit codes:** `0` success, `1` a check or quality gate failed (or a workflow is blocked), `2` invalid input or environment error. Read the JSON output as well as the exit code.
11
+
12
+ ## Working with skills
13
+
14
+ Ask for the outcome in plain language; the agent picks the matching skill from its description. You can also name one directly (`/tevra:ui-redesign` with the Claude Code plugin, `/ui-redesign` with a project install).
15
+
16
+ | You want to… | Skill chain the router suggests |
17
+ | --- | --- |
18
+ | Build a new screen | research → direction → system → builder → responsive → visual review → accessibility |
19
+ | Improve an existing component | redesign → builder → visual review |
20
+ | Turn a screenshot into code | direction → builder → responsive → visual review → accessibility |
21
+ | Fix one concern (motion, responsive, accessibility, performance, tests, review) | that skill alone, plus the builder when code changes |
22
+
23
+ Preview the chain before starting:
24
+
25
+ ```sh
26
+ tevra-design workflow plan "Improve this pricing card" --mode quick
27
+ ```
28
+
29
+ | Mode | Behavior |
30
+ | --- | --- |
31
+ | `quick` | Drops general research and secondary steps; no retries |
32
+ | `standard` | Default chain with a refinement budget |
33
+ | `full` | Adds accessibility and QA stages (frontend review, browser testing, performance) |
34
+
35
+ Plans record steps, dependencies, step/time/refinement budgets and the context revision. Work that changes shared tokens or brand, or a transformative redesign, is marked `approvalRequired` and waits for a human.
36
+
37
+ ## Research and design data
38
+
39
+ ```sh
40
+ tevra-design analyze # detected framework, styling, design-system files, agent instructions
41
+ tevra-design search "form error validation mobile" --category ux --limit 5
42
+ tevra-design tokens generate --new-system --brand '#175a44' # only when the project has no tokens yet
43
+ tevra-design tokens export # JSON, tokens.css and CSS-first Tailwind under .tevra/exports
44
+ ```
45
+
46
+ `search` ranks a small local catalog by lexical relevance (BM25). Results carry source, confidence and license; a high score means "matches the words", not "is true". It cannot tell what is currently trending.
47
+
48
+ `tokens generate` refuses to run when tokens already exist. Exports never modify your application theme; you choose what to import.
49
+
50
+ ## Checking a running app
51
+
52
+ Start the app first, then configure its origin, routes and states in `.tevra/config.json` (see [configuration](configuration.md)).
53
+
54
+ ```sh
55
+ tevra-design doctor --launch # browser can start
56
+ tevra-design capture --kind baseline --approve-baseline # after a human approves the current screens
57
+ tevra-design capture # current screenshots for every route/state/viewport
58
+ tevra-design compare # pixel diff against the baseline
59
+ tevra-design a11y # fresh capture with axe results
60
+ tevra-design report # .tevra/reports/quality.{json,md,html}
61
+ ```
62
+
63
+ Shortcuts that bundle these steps:
64
+
65
+ ```sh
66
+ tevra-design test browser # requires explicit assertions in every state
67
+ tevra-design test visual # capture + compare + report
68
+ tevra-design test accessibility
69
+ tevra-design test performance --allow-network --lcp-ms 2500 --cls 0.1 --tbt-ms 200
70
+ tevra-design review # capture → compare → report
71
+ ```
72
+
73
+ What each capture records:
74
+
75
+ - Screenshots per route, state and viewport, with dynamic regions masked
76
+ - axe violations and incomplete rules (WCAG 2.0–2.2 A/AA tags)
77
+ - Console errors, failed requests and HTTP errors as separate findings
78
+ - Overflow and touch-target heuristics
79
+ - The browser version, context revision and a hash of the capture settings
80
+
81
+ Comparison fails when the configuration, screenshot set, browser version or context revision does not match the baseline. Reports refuse stale comparisons or failed captures.
82
+
83
+ **Baselines are protected.** They are created only with `--approve-baseline` and never overwritten by `compare`. To replace one, archive the baseline folder yourself after review, then capture again.
84
+
85
+ **Performance** runs Lighthouse in a separate browser. `--allow-network` is required because the page may load third-party resources; review those origins first. Results are lab metrics (LCP, CLS, TBT) and do not represent real-user data such as INP.
86
+
87
+ ## Adding your own evidence
88
+
89
+ Agents and humans can add checks that automation cannot make, such as a keyboard walkthrough, a screen-reader pass or a design judgment:
90
+
91
+ ```sh
92
+ tevra-design report --checks review-checks.json
93
+ ```
94
+
95
+ Checks follow `schemas/checks.schema.json`. Each check names its evidence kind (`deterministic`, `heuristic`, `ai` or `human`) and points to an existing local file as evidence. Add a passing `functional-tests` check only after actually running the behavior tests. The report keeps the four evidence kinds separate.
96
+
97
+ The default rubric scores eight categories (hierarchy, typography, layout, consistency, responsive, accessibility, functional, performance). A category without evidence stays unscored. A critical failure or a missing required check blocks PASS regardless of the total.
98
+
99
+ ## Executing a workflow
100
+
101
+ ```sh
102
+ tevra-design workflow plan "Build a dashboard" --mode full
103
+ tevra-design workflow start .tevra/plans/PLAN.json --skill design-research
104
+ tevra-design workflow complete .tevra/plans/PLAN.json --skill design-research --evidence design-research.md
105
+ tevra-design workflow run .tevra/plans/PLAN.json # runs the local QA stages
106
+ tevra-design workflow status .tevra/plans/PLAN.json
107
+ tevra-design workflow approve .tevra/plans/PLAN.json --by "Product owner" --yes
108
+ ```
109
+
110
+ The coding agent carries out design and implementation stages, then marks them complete with an evidence file. `workflow run` executes the stages Tevra can run itself (browser, visual, accessibility, performance). Stages missing an app, browser or integration are reported `blocked`, never passed. Failed stages retry up to the plan's refinement budget. `approve` records a named human decision; it is not authentication.
111
+
112
+ ## Shared context and memory
113
+
114
+ ```sh
115
+ tevra-design context show
116
+ tevra-design context validate
117
+ tevra-design context update candidate.json --revision 3 [--approve-constraints]
118
+ tevra-design context migrate old-context.json --out .tevra/migrated-context.json
119
+ tevra-design memory list
120
+ tevra-design memory update entry.json --revision 2
121
+ tevra-design memory reset --yes
122
+ tevra-design handoff validate handoff.json
123
+ tevra-design handoff save handoff.json
124
+ ```
125
+
126
+ - **Context** (`.tevra/design-context.json`) holds brand, approved direction, tokens, responsive requirements, known regressions and provenance. Updates must quote the current revision. Approved decisions cannot be replaced by ordinary updates; append a superseding decision. Changing constraints needs `--approve-constraints`.
127
+ - **Memory** (`.tevra/memory.json`) is plain, inspectable JSON for decisions such as directions, rejected options and conventions. Entries that look like secrets are rejected. Reset needs `--yes`.
128
+ - **Handoffs** let several agents share work safely: each declares the files it owns, and Tevra rejects stale context revisions or overlapping file claims.
129
+
130
+ Nothing under `.tevra/` is committed or uploaded by Tevra.
131
+
132
+ ## Examples
133
+
134
+ The repository includes runnable apps to try every command against:
135
+
136
+ | Example | What it shows | Start |
137
+ | --- | --- | --- |
138
+ | `examples/nextjs-dashboard` | Task app: add, validate, complete, remove, empty state | `pnpm --filter @tevra/example-nextjs build && pnpm --filter @tevra/example-nextjs start` (port 4173) |
139
+ | `examples/sveltekit-workspace` | The same app in SvelteKit | `pnpm --filter @tevra/example-sveltekit build && pnpm --filter @tevra/example-sveltekit start` (port 4174) |
140
+ | `examples/acceptance-app` | Analytics filters, pricing calculator and dialog, form validation, before/after redesign | see its [README](../examples/acceptance-app/README.md) |
141
+
142
+ Each example has a reviewed `tevra.config.json`. Point the CLI at it with `--root`, for example `tevra-design capture --root examples/nextjs-dashboard`.
package/package.json CHANGED
@@ -1,6 +1,87 @@
1
1
  {
2
2
  "name": "tevra-design-kit",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "Portable design agent skills and evidence-based local quality tools",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Tevra",
8
+ "homepage": "https://github.com/tevra-si/design-kit#readme",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/tevra-si/design-kit.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/tevra-si/design-kit/issues"
15
+ },
16
+ "keywords": [
17
+ "agent-skills",
18
+ "claude-code",
19
+ "codex",
20
+ "cursor",
21
+ "ai-agents",
22
+ "design-system",
23
+ "accessibility",
24
+ "axe",
25
+ "visual-regression",
26
+ "playwright",
27
+ "lighthouse",
28
+ "frontend",
29
+ "qa"
30
+ ],
31
+ "bin": {
32
+ "tevra-design": "dist/packages/cli/src/index.js"
33
+ },
34
+ "engines": {
35
+ "node": "^22.22.2 || ^24.15.0 || >=26.0.0"
36
+ },
37
+ "packageManager": "pnpm@11.1.3",
38
+ "files": [
39
+ "dist/packages",
40
+ "SKILL.md",
41
+ "skills",
42
+ "references",
43
+ "schemas",
44
+ "adapters",
45
+ "templates",
46
+ "rubrics",
47
+ "LICENSE",
48
+ "PROVENANCE.md",
49
+ "THIRD_PARTY_NOTICES.md",
50
+ "docs",
51
+ "registry",
52
+ "!docs/assets"
53
+ ],
54
+ "scripts": {
55
+ "build": "tsc -p tsconfig.json",
56
+ "typecheck": "tsc -p tsconfig.json --noEmit",
57
+ "test": "node --import tsx --test tests/unit/*.test.ts tests/integration/*.test.ts",
58
+ "test:e2e": "pnpm build && node --test dist/tests/e2e/*.test.js",
59
+ "test:legacy": "python3 -m unittest discover -s tests -p 'test_*.py' -v",
60
+ "test:structure": "node --import tsx --test tests/structure/*.test.ts",
61
+ "skills:check": "node --import tsx packages/cli/src/index.ts skills check",
62
+ "tevra-design": "node dist/packages/cli/src/index.js",
63
+ "prepack": "pnpm build",
64
+ "test:examples": "node --test tests/examples/*.test.mjs",
65
+ "demo:assets": "node scripts/render-demo-assets.mjs"
66
+ },
67
+ "dependencies": {
68
+ "ajv": "8.20.0",
69
+ "axe-core": "4.11.0",
70
+ "pixelmatch": "8.0.0",
71
+ "playwright": "1.63.0",
72
+ "pngjs": "7.0.0",
73
+ "yaml": "2.8.1",
74
+ "lighthouse": "13.0.3"
75
+ },
76
+ "devDependencies": {
77
+ "@types/node": "22.20.5",
78
+ "@types/pngjs": "6.0.5",
79
+ "@types/jsdom": "^27.0.0",
80
+ "jsdom": "30.1.2",
81
+ "tsx": "4.23.15",
82
+ "typescript": "6.0.3"
83
+ },
84
+ "publishConfig": {
85
+ "access": "public"
86
+ }
87
+ }