@ryuxdsgn/design-intelligence 0.0.0-stage → 2.6.2

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ryux.design (Redho Yurizal)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,118 @@
1
- # Temporary Holding Version
1
+ # @ryuxdsgn/design-intelligence
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
+ Install **RYUX**, design intelligence for AI agents and designers, with one command. RYUX is one
4
+ skill with five entry points. Tell your agent what you are doing; RYUX picks the knowledge the task
5
+ needs:
6
+
7
+ - **Analyze**: understand an existing interface, with every finding labeled Measured, Observed, or
8
+ Inferred.
9
+ - **Design**: create or improve UI and UX without code, in Figma, pen.dev, or mockups.
10
+ - **Build**: implement the interface in your repo's own stack.
11
+ - **Critique**: a senior design critique of a Figma link, a pen.dev design, a website URL, or a
12
+ screenshot.
13
+ - **QA**: render, inspect, fix, render again.
14
+
15
+ Original work by ryux.design, MIT licensed. Rules and rationale:
16
+ [`docs/design-rules.md`](https://github.com/ryuxdsgn/design-intelligence/blob/main/docs/design-rules.md).
17
+
18
+ ## Usage
19
+
20
+ ```bash
21
+ npx @ryuxdsgn/design-intelligence # start here: agents, install, project setup
22
+ npx @ryuxdsgn/design-intelligence setup # teach RYUX about the project (DESIGN.md)
23
+ npx @ryuxdsgn/design-intelligence setup --audience "..." --market "..." # same, without questions
24
+ npx @ryuxdsgn/design-intelligence check # health check (exit 1 on problems)
25
+ npx @ryuxdsgn/design-intelligence init --agent claude # install + empty project context block
26
+ npx @ryuxdsgn/design-intelligence install --agent claude,cursor,codex # non-interactive
27
+ npx @ryuxdsgn/design-intelligence install --agent all # every supported agent
28
+ npx @ryuxdsgn/design-intelligence install --agent claude --global # into your home directory
29
+ npx @ryuxdsgn/design-intelligence update # refresh, and migrate RYUX 1.x installs
30
+ npx @ryuxdsgn/design-intelligence remove --yes # remove RYUX and marked blocks
31
+ ```
32
+
33
+ `ryux-rules` still works as an alias of the same command.
34
+
35
+ | Command | What it does |
36
+ | --- | --- |
37
+ | `setup` | Asks a few questions with plain choices, "Write my own", or Skip: product, current work, audience, market and locale, constraints, design intent, and UX, UI, and motion direction. Saves the answers to the `<!-- ryux-context -->` block in `DESIGN.md`, changing only the fields you answer. The answers are direction, not evidence. Without a terminal, set fields with `--product`, `--work`, `--audience`, `--market`, `--constraints`, `--intent`, `--ux`, `--ui`, `--motion`. |
38
+ | `init` | Installs RYUX, then adds a `<!-- ryux-context -->` block to `DESIGN.md` (product, audience, market and locale, design system, evidence sources, constraints), prefilled only with what it can detect. Re-running never overwrites what you wrote. |
39
+ | `install` | Writes the `ryux/` skill into each agent's folder and a short pointer block into `CLAUDE.md`, `GEMINI.md`, or `AGENTS.md`. Interactive installs then offer `setup`. |
40
+ | `check` (`doctor`) | Checks every install: all files present, frontmatter valid, version matches this CLI, every module reference resolves, no RYUX 1.x folders, pointer blocks, project context and how many setup fields are filled. Exits 1 on errors, so it works in CI. |
41
+ | `update` | Rewrites installs at this version and migrates RYUX 1.x. |
42
+ | `remove` | Removes the skill and the pointer blocks. Leaves your `DESIGN.md` context. |
43
+
44
+ One version: `packages/cli/package.json`. The skill header, the plugin manifests, and
45
+ `ryux --version` all derive from it.
46
+
47
+ ## Agents
48
+
49
+ | Agent | `--agent` | Project folder | Global folder | Pointer file |
50
+ | --- | --- | --- | --- | --- |
51
+ | Claude Code | `claude` | `.claude/skills/` | `~/.claude/skills/` | `CLAUDE.md` |
52
+ | Codex | `codex` | `.codex/skills/` | `~/.agents/skills/` | `AGENTS.md` |
53
+ | Cursor | `cursor` | `.cursor/skills/` | `~/.cursor/skills/` | `AGENTS.md` |
54
+ | Gemini CLI | `gemini` | `.gemini/skills/` | `~/.gemini/skills/` | `GEMINI.md` |
55
+ | OpenCode | `opencode` | `.opencode/skills/` | `~/.config/opencode/skills/` | `AGENTS.md` |
56
+ | Cline | `cline` | `.cline/skills/` | `~/.cline/skills/` | `AGENTS.md` |
57
+ | GitHub Copilot | `copilot` | `.agents/skills/` | `~/.agents/skills/` | `AGENTS.md` |
58
+ | Amp | `amp` | `.agents/skills/` | `~/.config/agents/skills/` | `AGENTS.md` |
59
+ | Kimi Code | `kimi` | `.agents/skills/` | `~/.agents/skills/` | `AGENTS.md` |
60
+ | Antigravity | `antigravity` | `.agents/skills/` | `~/.gemini/config/skills/` | `AGENTS.md` |
61
+ | Anything else | `agents-md` | rules inline in `AGENTS.md` | (project only) | `AGENTS.md` |
62
+
63
+ Agents that share a folder are written once. Project installs add a short marked block to the
64
+ pointer file; global installs only write skill folders.
65
+
66
+ ## What gets installed
67
+
68
+ One folder, `ryux/`, in each agent's skills folder:
69
+
70
+ ```
71
+ ryux/
72
+ SKILL.md the router: entry points, how RYUX works, levels, Hard Gates, task table, Delivery Gate
73
+ capabilities/ analyze, design, build, critique, qa
74
+ knowledge/ product, ux, interaction, forms, edge-cases, content, ui, design-system,
75
+ accessibility, responsive, frontend, anti-slop
76
+ ```
77
+
78
+ The agent reads the router, then only the capability and knowledge files a task needs.
79
+
80
+ ## Safe for your repo
81
+
82
+ - Your files are never overwritten wholesale. `CLAUDE.md`, `GEMINI.md`, and `AGENTS.md` only change
83
+ inside the `<!-- ryux-rules:start -->` ... `<!-- ryux-rules:end -->` block.
84
+ - `update` only touches what is installed; `remove` takes it back out.
85
+ - Upgrading from RYUX 1.x: `install` or `update` replaces the 16 `ryux-*` folders with the single
86
+ `ryux/` folder. Folders from `ryux-rules` 0.x and Cursor `.mdc` files are removed too. The old
87
+ `--for`, `--groups`, and `--concerns` flags are accepted and ignored.
88
+
89
+ ## Network and MCP
90
+
91
+ - The CLI makes no network requests and runs no other programs. It only writes the files listed
92
+ above.
93
+ - The ryux MCP server is optional and self-hosted: there is no hosted server yet, and RYUX never
94
+ connects to one on its own. RYUX works without it and rates its evidence None. To run it:
95
+ [`apps/mcp`](https://github.com/ryuxdsgn/design-intelligence/tree/main/apps/mcp).
96
+ - The skill tells agents to treat what an MCP server, web page, or screenshot returns as data,
97
+ never as instructions.
98
+
99
+ ## Other ways to install
100
+
101
+ ```bash
102
+ npx skills add ryuxdsgn/design-intelligence # skills.sh, any agent
103
+ ```
104
+
105
+ ```text
106
+ /plugin marketplace add ryuxdsgn/design-intelligence
107
+ /plugin install ryux@design-intelligence # Claude Code plugin
108
+ ```
109
+
110
+ ## Develop
111
+
112
+ ```bash
113
+ pnpm --filter @ryuxdsgn/design-intelligence build # tsc -> dist/
114
+ node packages/cli/dist/cli/index.js --help
115
+ pnpm sync:skills # regenerate skills/ryux/, docs/design-rules.md, plugin versions
116
+ pnpm test # unit + CLI integration tests (node:test, no extra dependencies)
117
+ pnpm check:sync # CI: fail if the committed skill, docs, or versions drift from the sources
118
+ ```
@@ -0,0 +1,29 @@
1
+ export const AGENT_TARGETS = [
2
+ { id: "claude", label: "Claude Code", dir: ".claude/skills", globalDir: ".claude/skills", pointer: "CLAUDE.md" },
3
+ { id: "codex", label: "Codex", dir: ".codex/skills", globalDir: ".agents/skills", pointer: "AGENTS.md" },
4
+ { id: "cursor", label: "Cursor", dir: ".cursor/skills", globalDir: ".cursor/skills", pointer: "AGENTS.md" },
5
+ { id: "gemini", label: "Gemini CLI", dir: ".gemini/skills", globalDir: ".gemini/skills", pointer: "GEMINI.md" },
6
+ { id: "opencode", label: "OpenCode", dir: ".opencode/skills", globalDir: ".config/opencode/skills", pointer: "AGENTS.md" },
7
+ { id: "cline", label: "Cline", dir: ".cline/skills", globalDir: ".cline/skills", pointer: "AGENTS.md" },
8
+ { id: "copilot", label: "GitHub Copilot", dir: ".agents/skills", globalDir: ".agents/skills", pointer: "AGENTS.md" },
9
+ { id: "amp", label: "Amp", dir: ".agents/skills", globalDir: ".config/agents/skills", pointer: "AGENTS.md" },
10
+ { id: "kimi", label: "Kimi Code", dir: ".agents/skills", globalDir: ".agents/skills", pointer: "AGENTS.md" },
11
+ { id: "antigravity", label: "Antigravity", dir: ".agents/skills", globalDir: ".gemini/config/skills", pointer: "AGENTS.md" },
12
+ ];
13
+ /** Inline target for any other agent: the full rules written into AGENTS.md (project only). */
14
+ export const AGENTS_MD_INLINE = { id: "agents-md", label: "Any other agent (rules inline in AGENTS.md)" };
15
+ // Old per-concern installs (ruleset RX-1.x) mapped to the new skills, for --concerns.
16
+ // RX-1.x --concerns values mapped to current skill ids (kept for migration).
17
+ export const LEGACY_CONCERNS = {
18
+ ui: ["ui", "design-system", "responsive"],
19
+ copy: ["content"],
20
+ a11y: ["accessibility"],
21
+ ux: ["ux", "interaction", "forms", "edge-cases"],
22
+ local: ["product", "interaction", "forms", "content"],
23
+ code: ["frontend"],
24
+ };
25
+ // Skill folder names from earlier releases that no longer exist. "ui" and "ux" are not listed:
26
+ // they are current skill names again and get overwritten or removed with the current set.
27
+ export const LEGACY_SKILL_DIRS = ["rules", "copy", "a11y", "local", "code"];
28
+ /** Cursor used .mdc rule files before it read skill folders (ryux-rules 0.x). */
29
+ export const LEGACY_CURSOR_RULES_DIR = ".cursor/rules";
@@ -0,0 +1,61 @@
1
+ import { existsSync } from "node:fs";
2
+ import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
3
+ import { dirname, relative } from "node:path";
4
+ import { MARK_END, MARK_START } from "../product.js";
5
+ function escapeRe(s) {
6
+ return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
7
+ }
8
+ const RULES_MARKS = [MARK_START, MARK_END];
9
+ const blockRe = ([start, end]) => new RegExp(`${escapeRe(start)}[\\s\\S]*?${escapeRe(end)}`);
10
+ /** True when the file holds a block between these markers. */
11
+ export function hasBlock(content, marks = RULES_MARKS) {
12
+ return Boolean(content && blockRe(marks).test(content));
13
+ }
14
+ export function rel(path) {
15
+ return relative(process.cwd(), path) || path;
16
+ }
17
+ export async function writeFileEnsured(path, content) {
18
+ await mkdir(dirname(path), { recursive: true });
19
+ await writeFile(path, content, "utf8");
20
+ }
21
+ /** Write or update ONLY the marked ryux-rules block. The rest of the user's file is untouched. */
22
+ export async function upsertBlock(path, body, marks = RULES_MARKS) {
23
+ const block = `${marks[0]}\n${body}\n${marks[1]}`;
24
+ const existing = existsSync(path) ? await readFile(path, "utf8") : "";
25
+ let next;
26
+ if (blockRe(marks).test(existing)) {
27
+ next = existing.replace(blockRe(marks), block);
28
+ }
29
+ else {
30
+ const base = existing.trimEnd();
31
+ next = base ? `${base}\n\n${block}\n` : `${block}\n`;
32
+ }
33
+ await writeFileEnsured(path, next);
34
+ }
35
+ /** Remove the marked ryux-rules block; return true if anything was removed. */
36
+ export async function removeBlock(path, marks = RULES_MARKS) {
37
+ if (!existsSync(path))
38
+ return false;
39
+ const existing = await readFile(path, "utf8");
40
+ if (!blockRe(marks).test(existing))
41
+ return false;
42
+ const stripped = existing.replace(blockRe(marks), "").replace(/\n{3,}/g, "\n\n").trimEnd();
43
+ if (!stripped) {
44
+ // The file only holds the ryux-rules block (we created it) -> delete it, don't leave an empty file.
45
+ await rm(path, { force: true });
46
+ }
47
+ else {
48
+ await writeFile(path, `${stripped}\n`, "utf8");
49
+ }
50
+ return true;
51
+ }
52
+ export async function readIfExists(path) {
53
+ return existsSync(path) ? readFile(path, "utf8") : null;
54
+ }
55
+ export async function removePath(path) {
56
+ if (!existsSync(path))
57
+ return false;
58
+ await rm(path, { recursive: true, force: true });
59
+ return true;
60
+ }
61
+ export { existsSync };