mudra-skills 1.0.0 → 1.0.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/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # mudra-skills
2
+
3
+ Claude Code skills for building [Mudra Band](https://wearabledevices.co.il) apps — generate 2D flat/screen apps, 3D/XR experiences, or let the router auto-classify your prompt.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npx mudra-skills
9
+ ```
10
+
11
+ Then restart Claude Code or run `/reload-plugins`.
12
+
13
+ ## What You Get
14
+
15
+ Three skills installed to `~/.claude/plugins/mudra/`:
16
+
17
+ | Skill | Invoke | Description |
18
+ |---|---|---|
19
+ | **mudra-master** | `/mudra:mudra-master` | Auto-router — classifies your prompt and hands off to 2D or 3D |
20
+ | **mudra-preview** | `/mudra:mudra-preview` | Generates single-file HTML 2D apps |
21
+ | **mudra-xr** | `/mudra:mudra-xr` | Generates single-file HTML 3D/XR apps using XR Blocks |
22
+
23
+ ## Usage
24
+
25
+ Just describe what you want to build in Claude Code:
26
+
27
+ ```
28
+ /mudra:mudra-master build a gesture-controlled music player
29
+ ```
30
+
31
+ Or let the router figure it out — describe an app idea and it will classify it as 2D or 3D automatically.
32
+
33
+ ## What Gets Generated
34
+
35
+ Every generated app includes:
36
+ - Mudra Band WebSocket connection (`ws://127.0.0.1:8766`)
37
+ - Mock fallback + simulator panel (works without the band)
38
+ - Keyboard shortcuts for every subscribed signal
39
+ - Connection status indicator
40
+
41
+ ## Mudra Signals
42
+
43
+ | Signal | Type | Use for |
44
+ |---|---|---|
45
+ | `gesture` | discrete | finger pinches (index, middle, ring, little, thumb, grab) |
46
+ | `button` | discrete | hardware button press/release |
47
+ | `pressure` | analog | continuous squeeze force (0–1) |
48
+ | `navigation` | pointer | 2D cursor delta (x, y) |
49
+ | `nav_direction` | discrete | swipe direction (up/down/left/right) |
50
+ | `imu_acc` | analog | accelerometer (x, y, z) |
51
+ | `imu_gyro` | analog | gyroscope (x, y, z) |
52
+ | `snc` | analog | 3-channel bio signal |
53
+ | `battery` | discrete | battery level |
54
+
55
+ ## Requirements
56
+
57
+ - [Claude Code](https://claude.ai/code) CLI
58
+ - Node.js 18+
59
+
60
+ ## License
61
+
62
+ MIT
package/bin/install.js CHANGED
@@ -7,10 +7,66 @@ import { execSync } from 'child_process';
7
7
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
8
8
  const pluginSrc = path.resolve(__dirname, '..');
9
9
  const homeDir = process.env.HOME || process.env.USERPROFILE;
10
- const target = path.join(homeDir, '.claude', 'plugins', 'mudra');
10
+ const pluginsDir = path.join(homeDir, '.claude', 'plugins');
11
11
 
12
- fs.mkdirSync(target, { recursive: true });
13
- execSync(`cp -r "${pluginSrc}/." "${target}"`);
12
+ const pkg = JSON.parse(fs.readFileSync(path.join(pluginSrc, 'package.json'), 'utf8'));
13
+ const version = pkg.version;
14
+ const MARKETPLACE = 'mudra-band';
15
+ const PLUGIN_NAME = 'mudra';
16
+ const PLUGIN_KEY = `${PLUGIN_NAME}@${MARKETPLACE}`;
17
+
18
+ // Install to the cache location Claude Code expects for marketplace plugins
19
+ const cacheTarget = path.join(pluginsDir, 'cache', MARKETPLACE, PLUGIN_NAME, version);
20
+ fs.mkdirSync(cacheTarget, { recursive: true });
21
+ execSync(`cp -r "${pluginSrc}/." "${cacheTarget}"`);
22
+
23
+ // Register the marketplace in known_marketplaces.json if not already there
24
+ const marketplacesFile = path.join(pluginsDir, 'known_marketplaces.json');
25
+ let marketplaces = {};
26
+ if (fs.existsSync(marketplacesFile)) {
27
+ marketplaces = JSON.parse(fs.readFileSync(marketplacesFile, 'utf8'));
28
+ }
29
+ if (!marketplaces[MARKETPLACE]) {
30
+ marketplaces[MARKETPLACE] = {
31
+ source: {
32
+ source: 'git',
33
+ url: 'https://github.com/jabbourWearable/mudra-skill.git',
34
+ },
35
+ installLocation: path.join(pluginsDir, 'marketplaces', MARKETPLACE),
36
+ lastUpdated: new Date().toISOString(),
37
+ };
38
+ fs.writeFileSync(marketplacesFile, JSON.stringify(marketplaces, null, 2));
39
+ }
40
+
41
+ // Register the plugin in installed_plugins.json
42
+ const installedFile = path.join(pluginsDir, 'installed_plugins.json');
43
+ let installed = { version: 2, plugins: {} };
44
+ if (fs.existsSync(installedFile)) {
45
+ installed = JSON.parse(fs.readFileSync(installedFile, 'utf8'));
46
+ }
47
+
48
+ // Remove stale npm entry from previous installs
49
+ delete installed.plugins['mudra@npm'];
50
+
51
+ const now = new Date().toISOString();
52
+ const previousInstall = installed.plugins[PLUGIN_KEY]?.[0];
53
+ installed.plugins[PLUGIN_KEY] = [
54
+ {
55
+ scope: 'user',
56
+ installPath: cacheTarget,
57
+ version,
58
+ installedAt: previousInstall?.installedAt ?? now,
59
+ lastUpdated: now,
60
+ },
61
+ ];
62
+
63
+ fs.writeFileSync(installedFile, JSON.stringify(installed, null, 2));
64
+
65
+ // Clean up the old direct-copy install location if it exists
66
+ const oldTarget = path.join(pluginsDir, 'mudra');
67
+ if (fs.existsSync(oldTarget)) {
68
+ fs.rmSync(oldTarget, { recursive: true, force: true });
69
+ }
14
70
 
15
71
  console.log('');
16
72
  console.log('Mudra skills installed successfully!');
@@ -22,4 +78,4 @@ console.log(' /mudra:mudra-master — auto-classify and route');
22
78
  console.log(' /mudra:mudra-preview — generate 2D app');
23
79
  console.log(' /mudra:mudra-xr — generate 3D/XR app');
24
80
  console.log('');
25
- console.log(`Plugin location: ${target}`);
81
+ console.log(`Plugin location: ${cacheTarget}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mudra-skills",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Claude Code skills for building Mudra Band apps — 2D, 3D/XR, or auto-classified",
5
5
  "type": "module",
6
6
  "bin": {