twoux 0.0.0-stage → 0.1.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/LICENSE.md ADDED
@@ -0,0 +1,61 @@
1
+ # TwoUX Licence 1.0
2
+
3
+ Copyright (c) 2026 Giulia Pizzignacco. All rights reserved, except as granted below.
4
+
5
+ TwoUX is free to use. You may build and ship your own products with it, including commercial products and client work. You may not sell it, give it away or offer it as your own design system, UI kit or component library.
6
+
7
+ ## 1. Definitions
8
+
9
+ "TwoUX" means everything in this repository and published from it: the component source code, styles, tokens and themes, the documentation, the examples and example apps, and the knowledge files written for people and coding agents (including AGENTS.md, CLAUDE.md, llms.txt, llms-full.txt, docs-md, the rules, the job table and the skills).
10
+
11
+ "Product" means a website, application, internal tool, service or other software that you, your employer or your client build and offer, whose main value comes from its own features and content rather than from TwoUX.
12
+
13
+ "You" means the person or organisation using TwoUX under this licence.
14
+
15
+ ## 2. What you may do
16
+
17
+ Free of charge, worldwide and for as long as you follow this licence, you may:
18
+
19
+ 1. Use, copy and modify TwoUX to design, build and run any number of Products, commercial or not.
20
+ 2. Build Products for clients, and hand those Products, including the parts of TwoUX inside them, to the client, who may then use them under this licence.
21
+ 3. Distribute TwoUX as part of a Product, in source or compiled form, as long as it is not offered as a separate kit or library (see section 3) and this licence travels with the TwoUX files.
22
+ 4. Let your coding agents and tools read TwoUX, including its knowledge files, to write code for your Products.
23
+ 5. Fork the public repository to suggest changes back, or to keep a modified copy for your own Products.
24
+
25
+ ## 3. What you may not do
26
+
27
+ You may not, whether you charge for it or not:
28
+
29
+ 1. Sell, sublicense, rent or lease TwoUX, or any part of it, on its own.
30
+ 2. Redistribute or publish TwoUX, a modified version of it, or a substantial part of it, as or inside a design system, UI kit, component library, template, theme, starter kit, code generator, design file or any other product whose main value is TwoUX itself.
31
+ 3. Offer a service that lets other people generate, download or copy TwoUX components or knowledge files for their own use.
32
+ 4. Use TwoUX, its documentation or its knowledge files to train, fine-tune or evaluate a machine learning model, or to build a dataset for that purpose. Agents reading the files to write code for your Products, as in section 2.4, is allowed.
33
+ 5. Remove or change the copyright notice, this licence or the third-party notices.
34
+
35
+ ## 4. Third-party software
36
+
37
+ TwoUX includes and is built on open-source software, such as shadcn/ui and Radix UI, under their own licences. Those parts stay under their own licences, listed in NOTICE.md. Nothing in this licence limits the rights those licences give you.
38
+
39
+ ## 5. Name and logo
40
+
41
+ This licence does not give you any right to use the name TwoUX or its logo, except to say truthfully that your Product is built with TwoUX.
42
+
43
+ ## 6. Ending the licence
44
+
45
+ If you break this licence, your rights under it end automatically. If you fix the breach within 30 days of first learning about it, your rights come back.
46
+
47
+ ## 7. No warranty
48
+
49
+ To the extent the applicable law allows, TwoUX is provided "as is", without warranty of any kind, express or implied, including the warranties of merchantability, fitness for a particular purpose and non-infringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with TwoUX or its use.
50
+
51
+ ## 8. Contributions
52
+
53
+ If you send a change, suggestion or other contribution to TwoUX, for example a pull request or an issue, you confirm that you have the right to send it, and you grant Giulia Pizzignacco a perpetual, worldwide, royalty-free and irrevocable licence to use, modify, sublicense and distribute it as part of TwoUX, under this licence or any other.
54
+
55
+ ## 9. Governing law
56
+
57
+ This licence is governed by the laws of Portugal. The courts of Portugal have jurisdiction over any dispute arising from it or from the use of TwoUX. This does not remove any right the law of your country gives you to bring proceedings where you live.
58
+
59
+ ## 10. Questions
60
+
61
+ If you are unsure whether your use is allowed, email hi@axdexpert.ai before you ship it.
package/README.md CHANGED
@@ -1,3 +1,212 @@
1
- # Temporary Holding Version
1
+ <div align="center">
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ <img src="https://raw.githubusercontent.com/axdexpert/twoux/main/.github/assets/banner.png?v=2" alt="The TwoUX wordmark surrounded by TwoUX components: keyboard settings, a stat card, a twoux find command, status badges, a list table with two rows selected, the assistant composer and a suggested-changes proposal" width="100%">
4
+
5
+ # TwoUX
6
+
7
+ TwoUX is an engineering-first design system for complex apps that makes UI and UX decisions explicit<br>
8
+ for engineers and AI agents, and enforces quality before inconsistent experiences reach production.
9
+
10
+ **Currently in Beta** · Built on [shadcn/ui](https://ui.shadcn.com) and [Radix](https://www.radix-ui.com), for [React 19+](https://react.dev) and [Tailwind CSS v4](https://tailwindcss.com)
11
+
12
+ <a href="https://www.npmjs.com/package/@twoux/ui"><img alt="npm version" src="https://img.shields.io/npm/v/@twoux/ui?label=npm&color=5753E0&logo=npm"></a>
13
+ <a href="https://github.com/axdexpert/twoux/blob/main/LICENSE.md"><img alt="Licence: free to use" src="https://img.shields.io/badge/licence-free_to_use-5753E0"></a>
14
+ <a href="#contributing"><img alt="PRs welcome" src="https://img.shields.io/badge/PRs-welcome-brightgreen"></a>
15
+
16
+ <img alt="121 components" src="https://img.shields.io/badge/components-121-5753E0">
17
+ <img alt="46 patterns" src="https://img.shields.io/badge/patterns-46-5753E0">
18
+ <img alt="WCAG 2.2 AA" src="https://img.shields.io/badge/WCAG-2.2_AA-00704A">
19
+ <a href="#connect-over-mcp"><img alt="MCP server included" src="https://img.shields.io/badge/MCP-server_included-17171F"></a>
20
+
21
+ **[Quick start](#quick-start-with-your-agent)** · **[Rules for agents](https://github.com/axdexpert/twoux/blob/main/AGENTS.md)** · **[Every page](https://github.com/axdexpert/twoux/blob/main/llms.txt)** · **[Why TwoUX](#why-twoux)** · **[Contributing](#contributing)** · **[Licence](https://github.com/axdexpert/twoux/blob/main/LICENSE.md)**
22
+
23
+ </div>
24
+
25
+ ## Overview
26
+
27
+ Engineers now build UI through coding agents, often with no designer in the loop and no Figma file to check against. Design systems ship components, not decisions, so the agent picks the nearest piece and fills every gap with a guess. TwoUX writes those decisions down: which component fits which job, how a flow behaves, when to confirm and when to offer Undo, each grounded in published usability research, WCAG, WAI-ARIA and the design systems of major SaaS products.
28
+
29
+ It ships 121 compact, keyboard-first components for dense B2B apps, 122 jobs, 46 patterns, light and dark themes, a theme generator that checks contrast, a lint, an MCP server and agent skills as one system. People and AI agents read the same rules and get the same answers.
30
+
31
+ **What makes TwoUX different:**
32
+
33
+ - **Agent Experience on both sides.** The coding agent that builds the UI gets rules it can read and follow: `AGENTS.md`, `llms.txt`, a Markdown page per component and skills to build, audit and propose. The people who supervise agents inside the product get components for plans, approvals, run timelines and permissions.
34
+ - **A knowledge base, not a component list.** 122 jobs, each mapped to one component with what to use instead, and 46 patterns that walk through whole flows step by step. Every rule carries its reason and its numbered sources.
35
+ - **Complex, never complicated.** Dense tables, spreadsheet grids, charts and AI agent interfaces, compact and keyboard-first, in light and dark, with the right interactions, states and motion built in. WCAG 2.2 AA.
36
+ - **Guardrails over guidelines.** A lint for raw values and local copies, a Claude Code hook that blocks edits to the system, a browser audit for contrast, focus and spacing, and a theme file that refuses colours that fail WCAG.
37
+
38
+ ## Quick start with your agent
39
+
40
+ Paste this into Claude Code, Cursor, Codex or Copilot:
41
+
42
+ ```text
43
+ Set up the TwoUX design system in this project.
44
+ 1. Install @twoux/ui with this repo's package manager.
45
+ 2. Run `npx twoux init`, then read node_modules/@twoux/ui/agent/AGENTS.md.
46
+ 3. For every UI job, find the component with `npx twoux find "<job>"` (or the twoux MCP server's find_component tool) and read its page before writing code.
47
+ 4. Before you finish, run `npx twoux check` and fix every error.
48
+ ```
49
+
50
+ Then give it your brand:
51
+
52
+ ```text
53
+ Give this app our brand with TwoUX.
54
+ 1. Set primary, radius and font in twoux.theme.json to match our brand.
55
+ 2. Run `npx twoux theme`.
56
+ 3. Import ./twoux-theme.css after @twoux/ui/styles.css.
57
+ If the generator refuses a colour for contrast, use the closest colour it accepts and tell me which.
58
+ ```
59
+
60
+ ## Getting started
61
+
62
+ Requires React 19 and Tailwind CSS v4.
63
+
64
+ **1. Install**
65
+
66
+ ```bash
67
+ npm install @twoux/ui
68
+ # or
69
+ pnpm add @twoux/ui
70
+ # or
71
+ yarn add @twoux/ui
72
+ ```
73
+
74
+ **2. Set up your agents**
75
+
76
+ ```bash
77
+ npx twoux init
78
+ ```
79
+
80
+ This adds the TwoUX rules to `AGENTS.md` and `CLAUDE.md`, connects the MCP server, and adds the TwoUX skills, a guard hook and `twoux.theme.json`. It never overwrites a file; it adds to what is there.
81
+
82
+ **3. Import the styles and use a component**
83
+
84
+ ```tsx
85
+ import '@twoux/ui/styles.css';
86
+ import { Button, Toaster, toast } from '@twoux/ui';
87
+
88
+ export function App() {
89
+ return (
90
+ <>
91
+ <Button shortcut="C" onClick={() => toast.success('Listing created')}>
92
+ New listing
93
+ </Button>
94
+ <Toaster />
95
+ </>
96
+ );
97
+ }
98
+ ```
99
+
100
+ **4. Check before you merge**
101
+
102
+ ```bash
103
+ npx twoux check
104
+ ```
105
+
106
+ ## Connect over MCP
107
+
108
+ `npx twoux init` connects it for you. To add it by hand:
109
+
110
+ | Tool | Command or file |
111
+ | ----------- | --------------------------------------------------------------------------------------------------------------------------- |
112
+ | Claude Code | `claude mcp add twoux -- npx -y @twoux/ui mcp` |
113
+ | Codex | `codex mcp add twoux -- npx -y @twoux/ui mcp` |
114
+ | Cursor | `.cursor/mcp.json`: `{ "mcpServers": { "twoux": { "command": "npx", "args": ["-y", "@twoux/ui", "mcp"] } } }` |
115
+ | VS Code | `.vscode/mcp.json`: `{ "servers": { "twoux": { "type": "stdio", "command": "npx", "args": ["-y", "@twoux/ui", "mcp"] } } }` |
116
+
117
+ The server runs on your machine and reads only the installed package. Its tools: `find_component`, `get_doc`, `list_docs`, `get_rules` and `check`.
118
+
119
+ ## The twoux command
120
+
121
+ | Command | What it does |
122
+ | ------------------------ | --------------------------------------------------------------------------------- |
123
+ | `npx twoux init` | Sets up the project for AI agents. `--principles` for an app not built with TwoUX |
124
+ | `npx twoux find "<job>"` | Names the component or pattern for a job, how to use it and what not to use |
125
+ | `npx twoux docs [id]` | Lists every page, or prints one. `docs rules` prints every rule |
126
+ | `npx twoux check` | Lints app code against TwoUX's rules. Exits 1 on errors |
127
+ | `npx twoux theme` | Builds `twoux-theme.css` from `twoux.theme.json`, checking contrast |
128
+ | `npx twoux mcp` | Runs the MCP server |
129
+
130
+ ## Packages
131
+
132
+ | Package | Description |
133
+ | -------------------------- | ------------------------------------------------------------------------------- |
134
+ | [`@twoux/ui`](https://github.com/axdexpert/twoux/tree/main/packages/ui) | Components, tokens, styles, agent files, the `twoux` command and the MCP server |
135
+ | [`twoux`](https://github.com/axdexpert/twoux/tree/main/packages/twoux) | Runs `npx twoux` with the `@twoux/ui` installed in your project |
136
+
137
+ ## Why TwoUX
138
+
139
+ ### Building got faster and cheaper. So did inconsistency.
140
+
141
+ Building and shipping UI has never been faster or cheaper. Consistency didn't come with it. AI doesn't fix the mess, it scales it. Engineers build through coding agents, often with no designer in the loop and no Figma file to check against. But design systems ship components, not decisions. A button doesn't say when not to use it. So the agent picks the nearest piece and fills every gap with a guess.
142
+
143
+ Each guess looks fine on its own: a modal for record detail, a disabled submit, an error in a toast, a delete with no Undo. Together they turn one product into five. That debt shows up later as duplicated components, accessibility fixes and screens that each behave differently.
144
+
145
+ | | |
146
+ | ------ | ----------------------------------------------------------------------------- |
147
+ | **13** | engineers per designer in AI-company job postings¹ |
148
+ | **4×** | more cloned code since AI coding assistants² |
149
+ | **0** | rules on when not to use a dialog in the docs of popular component libraries³ |
150
+
151
+ <sub>¹ Applied Methods, analysis of 9,281 open roles at AI companies, 2026. ² GitClear, AI Copilot Code Quality 2025: 211M changed lines, 2020 to 2024. ³ Dialog pages of shadcn/ui and Radix, checked November 2026: API and examples, no guidance on when to use or avoid it.</sub>
152
+
153
+ The design systems out there weren't built for this. Most give you components, often basic ones, and stop there:
154
+
155
+ - **No Agent Experience.** Written for people browsing docs, not for an AI agent that needs rules it can read and follow.
156
+ - **Not built for complex B2B.** Buttons and cards, but not the dense tables, spreadsheet grids, dashboards and AI interfaces B2B products run on.
157
+ - **No logic, no UX.** What a component looks like, but not which job it's for, how the flow behaves, or when to confirm and when to offer Undo.
158
+ - **No guardrails.** Nothing stops an agent from inventing a grey, rebuilding a dropdown or shipping AI slop.
159
+
160
+ ### Nobody needs more components
161
+
162
+ Engineers and product teams don't need more components. They need what the best UX designers and the design systems of market-leading products already know, written down where every agent can read it and every check can enforce it.
163
+
164
+ TwoUX is a research-backed knowledge base built on UX expertise. It decides the UX, not only the look: which component fits which job, how a flow behaves, when to confirm and when to offer Undo. None of it is an LLM's opinion. Every decision is grounded in published usability research, WCAG, WAI-ARIA and the design systems of major SaaS products, and every component page explains its decisions with numbered sources.
165
+
166
+ ## Tested on real agents
167
+
168
+ Claude Opus, Sonnet and Haiku, given realistic developer requests in a TwoUX project and never told the rules, November 2026:
169
+
170
+ | Result | What it means |
171
+ | ------------ | --------------------------------------------------------------------------- |
172
+ | **0 of 14** | runs changed the design system without being asked |
173
+ | **10 of 10** | planted UX problems found by every model, including the 4 no linter can see |
174
+ | **3 of 3** | rebrands went through the theme file, not page-by-page overrides |
175
+
176
+ The four problems only the rules caught are the judgement calls a designer makes: a modal for record detail, a disabled submit, an error in a toast and a delete without Undo. When a developer insisted on editing a component directly, two of three models did, and `twoux check` caught both. Every failure became a new check.
177
+
178
+ ## Built by a UX engineer, for engineers and their agents
179
+
180
+ TwoUX stands on the shoulders of the brilliant minds behind every source it cites. I started from a decade of UX decisions I kept explaining in reviews, and the mistakes I kept fixing in agent-written UI, then researched how standards and mature SaaS design systems solve each one. Each answer became a rule, a job or a pattern step, with its source (611 links, all checked).
181
+
182
+ Components are generated from shadcn's untouched source by a script, so the API stays familiar to engineers and agents. The docs site and the agent files come from the same content, so people and agents get the same answer.
183
+
184
+ Giulia Pizzignacco, founder and UX engineer
185
+
186
+ ## Project structure
187
+
188
+ | Directory | Purpose |
189
+ | ----------------- | ------------------------------------------------------------------- |
190
+ | `apps/docs` | The docs site, with live examples and example apps |
191
+ | `apps/playground` | A sandbox app built only from TwoUX |
192
+ | `packages/ui` | The `@twoux/ui` package |
193
+ | `packages/twoux` | The `twoux` command package |
194
+ | `docs-md/` | One Markdown page per foundation, component and pattern, for agents |
195
+ | `scripts/` | Generators for the agent files, theme, palette and checks |
196
+
197
+ ## Contributing
198
+
199
+ Issues and pull requests are welcome. By sending one, you agree to the contribution terms in section 8 of the licence.
200
+
201
+ ```bash
202
+ corepack enable
203
+ pnpm install
204
+ pnpm dev # docs site on http://localhost:3100
205
+ pnpm verify # type check, interaction, responsive and design checks
206
+ ```
207
+
208
+ To report a security problem, follow [SECURITY.md](https://github.com/axdexpert/twoux/blob/main/SECURITY.md).
209
+
210
+ ## Licence
211
+
212
+ Free to use under the [TwoUX Licence](https://github.com/axdexpert/twoux/blob/main/LICENSE.md): build and ship any number of your own products with it, including commercial products and client work. Don't sell or republish TwoUX, or a modified copy, as a design system, UI kit, template or component library, and don't train models on it. Third-party notices are in [NOTICE.md](https://github.com/axdexpert/twoux/blob/main/NOTICE.md).
package/bin/twoux.mjs ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+ // twoux: runs the twoux command from @twoux/ui. Uses the copy installed in the current project when there
3
+ // is one, so the rules, docs and checks always match the version the app builds with; otherwise the
4
+ // copy installed alongside this package.
5
+ import { createRequire } from "node:module";
6
+ import { join } from "node:path";
7
+ import { pathToFileURL } from "node:url";
8
+
9
+ function resolveFrom(base) {
10
+ try {
11
+ return createRequire(base).resolve("@twoux/ui/package.json");
12
+ } catch {
13
+ return null;
14
+ }
15
+ }
16
+
17
+ const pkgJson = resolveFrom(join(process.cwd(), "noop.js")) ?? resolveFrom(import.meta.url);
18
+ if (!pkgJson) {
19
+ console.error("TwoUX is not installed. Run npm install @twoux/ui in your project, then run this command again.");
20
+ process.exit(1);
21
+ }
22
+ await import(pathToFileURL(join(pkgJson, "..", "bin/twoux.mjs")).href);
package/package.json CHANGED
@@ -1,6 +1,35 @@
1
1
  {
2
2
  "name": "twoux",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.1",
4
+ "description": "Command line for TwoUX: set a project up for AI agents, find the component for a job, check UI code and run the MCP server. Runs the @twoux/ui installed in your project.",
5
+ "license": "SEE LICENSE IN LICENSE.md",
6
+ "type": "module",
7
+ "bin": {
8
+ "twoux": "./bin/twoux.mjs"
9
+ },
10
+ "files": [
11
+ "bin",
12
+ "LICENSE.md"
13
+ ],
14
+ "dependencies": {
15
+ "@twoux/ui": "^0.1.1"
16
+ },
17
+ "engines": {
18
+ "node": ">=20"
19
+ },
20
+ "author": "Giulia Pizzignacco <hi@axdexpert.ai>",
21
+ "homepage": "https://twoux.com",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/axdexpert/twoux.git",
25
+ "directory": "packages/twoux"
26
+ },
27
+ "bugs": {
28
+ "url": "https://github.com/axdexpert/twoux/issues"
29
+ },
30
+ "publishConfig": {
31
+ "access": "public",
32
+ "provenance": true
33
+ },
34
+ "scripts": {}
6
35
  }