super-ux 0.3.0 → 0.4.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,20 @@ All notable changes to this project are documented in this file. The format
4
4
  follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions
5
5
  follow [SemVer](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.4.0] - 2026-07-19
8
+
9
+ ### Added
10
+
11
+ - Interactive installer menu: bare `npx super-ux` now offers (1) skills for
12
+ any of 70+ agents via the `skills` CLI picker, (2) Cursor rules into a
13
+ project, (3) the Claude Code plugin user-globally (runs the `claude plugin`
14
+ CLI when available). Flag paths (`--cursor [dir] [--force]`) unchanged.
15
+
16
+ ### Fixed
17
+
18
+ - Prompt handling with piped stdin (persistent line buffer instead of
19
+ sequential `rl.question`, which dropped pre-buffered answers).
20
+
7
21
  ## [0.3.0] - 2026-07-19
8
22
 
9
23
  ### Added
package/README.md CHANGED
@@ -60,13 +60,38 @@ Then in your project: `/ux`. That's it — it installs the hard rule, seeds
60
60
  `docs/ux/`, builds the scenario base if empty, and on every later run just
61
61
  reports status and the next action.
62
62
 
63
+ ### Any agent via the skills CLI (70+ agents)
64
+
65
+ ```sh
66
+ npx skills add ssheleg/super-ux # both skills, current project
67
+ npx skills add ssheleg/super-ux -g # user-global
68
+ npx skills add ssheleg/super-ux --skill ux-audit # one skill
69
+ ```
70
+
71
+ [vercel-labs/skills](https://github.com/vercel-labs/skills) discovers the
72
+ skills through this repo's marketplace manifest and installs them for Claude
73
+ Code, Cursor, Codex, OpenCode and others. Note: this installs the two skills
74
+ only — the `/ux` commands and the Cursor always-on hard rule come with the
75
+ methods below.
76
+
77
+ ### Interactive (pick agent + scope)
78
+
79
+ ```sh
80
+ npx super-ux
81
+ ```
82
+
83
+ Menu: skills for any of 70+ agents (delegates to the `skills` CLI picker —
84
+ choose agents and global/project there), Cursor rules into a project, or the
85
+ Claude Code plugin user-globally.
86
+
63
87
  ### Cursor
64
88
 
65
89
  ```sh
66
- npx github:ssheleg/super-ux --cursor /path/to/your/project
90
+ npx super-ux --cursor /path/to/your/project
67
91
  ```
68
92
 
69
- (or clone and run `./install.sh --cursor <dir>` same behavior.) Copies the
93
+ (also works: `npx github:ssheleg/super-ux --cursor <dir>` straight from the
94
+ repo, or clone and run `./install.sh --cursor <dir>` — same behavior.) Copies the
70
95
  three rules into `.cursor/rules/` and seeds `docs/ux/scenarios.md`. An
71
96
  existing scenario base is never overwritten; re-run with `--force` to update
72
97
  rules after a new release.
@@ -100,7 +125,7 @@ is semver; bump `marketplace.json` + `plugin.json` + `CHANGELOG.md` together
100
125
  чек-листом для регулярных аудитов кода (`/ux-audit`) с вердиктами
101
126
  PASS/PARTIAL/FAIL/BLOCKED и доказательствами `file:line`. Установка: в
102
127
  Claude Code — `/plugin marketplace add ssheleg/super-ux`, в Cursor —
103
- `npx github:ssheleg/super-ux --cursor <проект>`. Дальше одна команда — `/ux`: сама ставит
128
+ `npx super-ux --cursor <проект>`. Дальше одна команда — `/ux`: сама ставит
104
129
  правило и базу, а при повторных запусках показывает статус и следующий шаг.
105
130
 
106
131
  ## License
package/bin/super-ux.js CHANGED
@@ -1,33 +1,38 @@
1
1
  #!/usr/bin/env node
2
2
  /*
3
3
  * super-ux installer CLI.
4
- * Cross-platform equivalent of install.sh: copies Cursor rules into a target
5
- * project and seeds the docs/ux skeleton. Claude Code needs no installer
6
- * see usage.
4
+ *
5
+ * No arguments: interactive menu (skills for any agent via the `skills` CLI
6
+ * picker, Cursor rules into a project, Claude Code plugin user-globally).
7
+ * Flags keep the non-interactive paths: --cursor [dir] [--force].
7
8
  */
8
9
  'use strict';
9
10
 
10
11
  const fs = require('fs');
11
12
  const path = require('path');
13
+ const readline = require('readline');
14
+ const { spawnSync } = require('child_process');
12
15
 
13
16
  const ROOT = path.resolve(__dirname, '..');
17
+ const REPO = 'ssheleg/super-ux';
14
18
 
15
19
  function usage() {
16
20
  console.log(`super-ux installer
17
21
 
18
22
  Usage:
19
- npx github:ssheleg/super-ux --cursor [project-dir] [--force]
20
- npx super-ux --cursor [project-dir] [--force] (once published to npm)
21
-
22
- Copies cursor/rules/*.mdc into <project-dir>/.cursor/rules/ (default:
23
- current directory) and seeds docs/ux/scenarios.md from templates/ if absent.
24
- An existing scenario base is NEVER overwritten. Existing rule files are
25
- skipped unless --force is given.
26
-
27
- Claude Code (no installer needed):
28
- /plugin marketplace add ssheleg/super-ux
29
- /plugin install super-ux@super-ux
30
- Then in your project: /ux`);
23
+ npx super-ux interactive menu
24
+ npx super-ux --cursor [project-dir] [--force] Cursor rules, non-interactive
25
+ npx super-ux --help
26
+
27
+ Menu options (also available directly):
28
+ 1. Skills for any AI agent (Claude Code, Codex, Cursor, 70+) — delegates to
29
+ 'npx skills add ${REPO}' with its agent/global/project picker.
30
+ 2. Cursor rules: cursor/rules/*.mdc -> <project>/.cursor/rules/ plus the
31
+ docs/ux skeleton. Existing scenario base is NEVER overwritten; existing
32
+ rule files are skipped unless --force.
33
+ 3. Claude Code plugin (skills + /ux commands, user-global) — runs
34
+ 'claude plugin marketplace add ${REPO}' + 'claude plugin install' when
35
+ the claude CLI is available, otherwise prints the /plugin commands.`);
31
36
  }
32
37
 
33
38
  function fail(message) {
@@ -73,12 +78,112 @@ function installCursor(target, force) {
73
78
  console.log(`done: ${installed} installed, ${skipped} skipped`);
74
79
  }
75
80
 
81
+ function run(cmd, args) {
82
+ const result = spawnSync(cmd, args, { stdio: 'inherit' });
83
+ if (result.error && result.error.code === 'ENOENT') return 'missing';
84
+ return result.status === 0 ? 'ok' : 'failed';
85
+ }
86
+
87
+ function installSkillsCli() {
88
+ console.log(`Delegating to the skills CLI (agent/global/project picker)...`);
89
+ const status = run('npx', ['--yes', 'skills', 'add', REPO]);
90
+ if (status !== 'ok') fail(`'npx skills add ${REPO}' ${status}`);
91
+ }
92
+
93
+ function installClaudePlugin() {
94
+ const probe = spawnSync('claude', ['--version'], { stdio: 'ignore' });
95
+ if (probe.error && probe.error.code === 'ENOENT') {
96
+ console.log(`claude CLI not found. Run inside Claude Code instead:
97
+ /plugin marketplace add ${REPO}
98
+ /plugin install super-ux@super-ux`);
99
+ return;
100
+ }
101
+ if (run('claude', ['plugin', 'marketplace', 'add', REPO]) !== 'ok') {
102
+ console.log('(marketplace may already be added — continuing)');
103
+ }
104
+ if (run('claude', ['plugin', 'install', 'super-ux@super-ux']) === 'ok') {
105
+ console.log('Claude Code plugin installed (scope: user). Restart sessions to pick it up; then run /ux in any project.');
106
+ } else {
107
+ fail('claude plugin install failed — see output above');
108
+ }
109
+ }
110
+
111
+ function makePrompter() {
112
+ // A persistent 'line' listener with a buffer: with piped stdin, lines that
113
+ // arrive between two questions are kept instead of being lost (which is
114
+ // what plain sequential rl.question() does).
115
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
116
+ const buffered = [];
117
+ let pending = null;
118
+ let closed = false;
119
+ rl.on('line', (line) => {
120
+ if (pending) {
121
+ const resolve = pending;
122
+ pending = null;
123
+ resolve(line);
124
+ } else {
125
+ buffered.push(line);
126
+ }
127
+ });
128
+ rl.on('close', () => {
129
+ closed = true;
130
+ if (pending) {
131
+ const resolve = pending;
132
+ pending = null;
133
+ resolve('');
134
+ }
135
+ });
136
+ return {
137
+ ask(question) {
138
+ process.stdout.write(question);
139
+ if (buffered.length > 0) return Promise.resolve(buffered.shift());
140
+ if (closed) return Promise.resolve('');
141
+ return new Promise((resolve) => {
142
+ pending = resolve;
143
+ });
144
+ },
145
+ close() {
146
+ rl.close();
147
+ },
148
+ };
149
+ }
150
+
151
+ async function menu() {
152
+ const prompter = makePrompter();
153
+ console.log(`super-ux — scenario-driven UI development. What do you want to install?
154
+
155
+ 1) Skills for any AI agent (Claude Code, Codex, Cursor, 70+ — interactive picker)
156
+ 2) Cursor rules (always-on hard rule + docs/ux skeleton) into a project
157
+ 3) Claude Code plugin (skills + /ux commands, user-global)
158
+ q) Quit
159
+ `);
160
+ const choice = (await prompter.ask('Choice [1/2/3/q]: ')).trim().toLowerCase();
161
+ if (choice === '1') {
162
+ prompter.close();
163
+ installSkillsCli();
164
+ } else if (choice === '2') {
165
+ const dir = (await prompter.ask('Project directory [.]: ')).trim() || '.';
166
+ prompter.close();
167
+ installCursor(path.resolve(dir), false);
168
+ } else if (choice === '3') {
169
+ prompter.close();
170
+ installClaudePlugin();
171
+ } else {
172
+ prompter.close();
173
+ if (choice !== 'q' && choice !== '') fail(`unknown choice '${choice}'`);
174
+ }
175
+ }
176
+
76
177
  function main() {
77
178
  const args = process.argv.slice(2);
78
- if (args.length === 0 || args[0] === '--help' || args[0] === '-h') {
179
+ if (args[0] === '--help' || args[0] === '-h') {
79
180
  usage();
80
181
  return;
81
182
  }
183
+ if (args.length === 0) {
184
+ menu();
185
+ return;
186
+ }
82
187
  if (args[0] !== '--cursor') {
83
188
  console.error(`error: unknown mode '${args[0]}'`);
84
189
  usage();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-ux",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Scenario-driven UI development for AI agents (Claude Code + Cursor): scenario base, scenario-first hard rule, evidence-backed UX audits. This package is the installer CLI.",
5
5
  "bin": { "super-ux": "bin/super-ux.js" },
6
6
  "files": ["bin", "cursor", "templates", "README.md", "LICENSE", "CHANGELOG.md"],