mudra-skills 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.
- package/.claude-plugin/plugin.json +19 -0
- package/CLAUDE.md +35 -0
- package/bin/install.js +25 -0
- package/package.json +28 -0
- package/skills/mudra-master/SKILL.md +202 -0
- package/skills/mudra-master/mudra-preview/SKILL.md +151 -0
- package/skills/mudra-master/mudra-preview/assets/ar-menu.html +382 -0
- package/skills/mudra-master/mudra-preview/assets/document-scroller.html +468 -0
- package/skills/mudra-master/mudra-preview/assets/drum-machine.html +788 -0
- package/skills/mudra-master/mudra-preview/assets/emg-visualizer.html +390 -0
- package/skills/mudra-master/mudra-preview/assets/generative-art.html +408 -0
- package/skills/mudra-master/mudra-preview/assets/gesture-assistant.html +342 -0
- package/skills/mudra-master/mudra-preview/assets/gesture-speech.html +444 -0
- package/skills/mudra-master/mudra-preview/assets/hands-free-desktop.html +376 -0
- package/skills/mudra-master/mudra-preview/assets/model-rotator.html +365 -0
- package/skills/mudra-master/mudra-preview/assets/mudra-duel.html +3200 -0
- package/skills/mudra-master/mudra-preview/assets/mudra-monitor.html +1451 -0
- package/skills/mudra-master/mudra-preview/assets/mudra-ultimate-template.html +891 -0
- package/skills/mudra-master/mudra-preview/assets/music-sequencer.html +455 -0
- package/skills/mudra-master/mudra-preview/assets/neural-pong.html +380 -0
- package/skills/mudra-master/mudra-preview/assets/neural-snake.html +364 -0
- package/skills/mudra-master/mudra-preview/assets/presentation-controller.html +345 -0
- package/skills/mudra-master/mudra-preview/assets/pressure-painter.html +285 -0
- package/skills/mudra-master/mudra-preview/assets/runner.html +1812 -0
- package/skills/mudra-master/mudra-preview/assets/smart-home.html +461 -0
- package/skills/mudra-master/mudra-preview/assets/space-invaders.html +1154 -0
- package/skills/mudra-master/mudra-preview/assets/waterful-ring-toss.html +1624 -0
- package/skills/mudra-master/mudra-preview/references/agent_protocol.json +646 -0
- package/skills/mudra-master/mudra-preview/references/promt.md +16829 -0
- package/skills/mudra-master/mudra-xr/SKILL.md +245 -0
- package/skills/mudra-master/mudra-xr/assets/demos/3dgs-walkthrough.html +242 -0
- package/skills/mudra-master/mudra-xr/assets/demos/aisimulator.html +792 -0
- package/skills/mudra-master/mudra-xr/assets/demos/balloonpop.html +422 -0
- package/skills/mudra-master/mudra-xr/assets/demos/ballpit.html +284 -0
- package/skills/mudra-master/mudra-xr/assets/demos/drone.html +41 -0
- package/skills/mudra-master/mudra-xr/assets/demos/gemini-icebreakers.html +338 -0
- package/skills/mudra-master/mudra-xr/assets/demos/gemini-xrobject.html +302 -0
- package/skills/mudra-master/mudra-xr/assets/demos/math3d.html +188 -0
- package/skills/mudra-master/mudra-xr/assets/demos/measure.html +247 -0
- package/skills/mudra-master/mudra-xr/assets/demos/occlusion.html +251 -0
- package/skills/mudra-master/mudra-xr/assets/demos/rain.html +498 -0
- package/skills/mudra-master/mudra-xr/assets/demos/screenwiper.html +432 -0
- package/skills/mudra-master/mudra-xr/assets/demos/splash.html +519 -0
- package/skills/mudra-master/mudra-xr/assets/demos/webcam_gestures.html +253 -0
- package/skills/mudra-master/mudra-xr/assets/demos/xremoji.html +833 -0
- package/skills/mudra-master/mudra-xr/assets/demos/xrpoet.html +151 -0
- package/skills/mudra-master/mudra-xr/assets/samples/depthmap.html +266 -0
- package/skills/mudra-master/mudra-xr/assets/samples/depthmesh.html +100 -0
- package/skills/mudra-master/mudra-xr/assets/samples/game_rps.html +1099 -0
- package/skills/mudra-master/mudra-xr/assets/samples/gestures_custom.html +467 -0
- package/skills/mudra-master/mudra-xr/assets/samples/gestures_heuristic.html +256 -0
- package/skills/mudra-master/mudra-xr/assets/samples/lighting.html +163 -0
- package/skills/mudra-master/mudra-xr/assets/samples/mesh_detection.html +46 -0
- package/skills/mudra-master/mudra-xr/assets/samples/modelviewer.html +183 -0
- package/skills/mudra-master/mudra-xr/assets/samples/paint.html +133 -0
- package/skills/mudra-master/mudra-xr/assets/samples/planar-vst.html +45 -0
- package/skills/mudra-master/mudra-xr/assets/samples/reticle.html +95 -0
- package/skills/mudra-master/mudra-xr/assets/samples/skybox_agent.html +384 -0
- package/skills/mudra-master/mudra-xr/assets/samples/sound.html +390 -0
- package/skills/mudra-master/mudra-xr/assets/samples/ui.html +496 -0
- package/skills/mudra-master/mudra-xr/assets/samples/virtual-screens.html +808 -0
- package/skills/mudra-master/mudra-xr/assets/templates/0_basic.html +64 -0
- package/skills/mudra-master/mudra-xr/assets/templates/1_ui.html +107 -0
- package/skills/mudra-master/mudra-xr/assets/templates/2_hands.html +183 -0
- package/skills/mudra-master/mudra-xr/assets/templates/3_depth.html +89 -0
- package/skills/mudra-master/mudra-xr/assets/templates/4_stereo.html +84 -0
- package/skills/mudra-master/mudra-xr/assets/templates/5_camera.html +117 -0
- package/skills/mudra-master/mudra-xr/assets/templates/6_ai.html +154 -0
- package/skills/mudra-master/mudra-xr/assets/templates/7_ai_live.html +253 -0
- package/skills/mudra-master/mudra-xr/assets/templates/8_objects.html +95 -0
- package/skills/mudra-master/mudra-xr/assets/templates/9_xr-toggle.html +90 -0
- package/skills/mudra-master/mudra-xr/assets/templates/heuristic_hand_gestures.html +102 -0
- package/skills/mudra-master/mudra-xr/assets/templates/meshes.html +47 -0
- package/skills/mudra-master/mudra-xr/assets/templates/planes.html +47 -0
- package/skills/mudra-master/mudra-xr/assets/templates/uikit.html +187 -0
- package/skills/mudra-master/mudra-xr/references/agent_protocol.json +878 -0
- package/skills/mudra-master/mudra-xr/references/promt.md +1516 -0
- package/skills/mudra-preview/SKILL.md +151 -0
- package/skills/mudra-preview/assets/ar-menu.html +382 -0
- package/skills/mudra-preview/assets/document-scroller.html +468 -0
- package/skills/mudra-preview/assets/drum-machine.html +788 -0
- package/skills/mudra-preview/assets/emg-visualizer.html +390 -0
- package/skills/mudra-preview/assets/generative-art.html +408 -0
- package/skills/mudra-preview/assets/gesture-assistant.html +342 -0
- package/skills/mudra-preview/assets/gesture-speech.html +444 -0
- package/skills/mudra-preview/assets/hands-free-desktop.html +376 -0
- package/skills/mudra-preview/assets/model-rotator.html +365 -0
- package/skills/mudra-preview/assets/mudra-duel.html +3200 -0
- package/skills/mudra-preview/assets/mudra-monitor.html +1451 -0
- package/skills/mudra-preview/assets/mudra-ultimate-template.html +891 -0
- package/skills/mudra-preview/assets/music-sequencer.html +455 -0
- package/skills/mudra-preview/assets/neural-pong.html +380 -0
- package/skills/mudra-preview/assets/neural-snake.html +364 -0
- package/skills/mudra-preview/assets/presentation-controller.html +345 -0
- package/skills/mudra-preview/assets/pressure-painter.html +285 -0
- package/skills/mudra-preview/assets/runner.html +1812 -0
- package/skills/mudra-preview/assets/smart-home.html +461 -0
- package/skills/mudra-preview/assets/space-invaders.html +1154 -0
- package/skills/mudra-preview/assets/waterful-ring-toss.html +1624 -0
- package/skills/mudra-preview/references/agent_protocol.json +646 -0
- package/skills/mudra-preview/references/promt.md +16829 -0
- package/skills/mudra-xr/SKILL.md +245 -0
- package/skills/mudra-xr/assets/demos/3dgs-walkthrough.html +242 -0
- package/skills/mudra-xr/assets/demos/aisimulator.html +792 -0
- package/skills/mudra-xr/assets/demos/balloonpop.html +422 -0
- package/skills/mudra-xr/assets/demos/ballpit.html +284 -0
- package/skills/mudra-xr/assets/demos/drone.html +41 -0
- package/skills/mudra-xr/assets/demos/gemini-icebreakers.html +338 -0
- package/skills/mudra-xr/assets/demos/gemini-xrobject.html +302 -0
- package/skills/mudra-xr/assets/demos/math3d.html +188 -0
- package/skills/mudra-xr/assets/demos/measure.html +247 -0
- package/skills/mudra-xr/assets/demos/occlusion.html +251 -0
- package/skills/mudra-xr/assets/demos/rain.html +498 -0
- package/skills/mudra-xr/assets/demos/screenwiper.html +432 -0
- package/skills/mudra-xr/assets/demos/splash.html +519 -0
- package/skills/mudra-xr/assets/demos/webcam_gestures.html +253 -0
- package/skills/mudra-xr/assets/demos/xremoji.html +833 -0
- package/skills/mudra-xr/assets/demos/xrpoet.html +151 -0
- package/skills/mudra-xr/assets/samples/depthmap.html +266 -0
- package/skills/mudra-xr/assets/samples/depthmesh.html +100 -0
- package/skills/mudra-xr/assets/samples/game_rps.html +1099 -0
- package/skills/mudra-xr/assets/samples/gestures_custom.html +467 -0
- package/skills/mudra-xr/assets/samples/gestures_heuristic.html +256 -0
- package/skills/mudra-xr/assets/samples/lighting.html +163 -0
- package/skills/mudra-xr/assets/samples/mesh_detection.html +46 -0
- package/skills/mudra-xr/assets/samples/modelviewer.html +183 -0
- package/skills/mudra-xr/assets/samples/paint.html +133 -0
- package/skills/mudra-xr/assets/samples/planar-vst.html +45 -0
- package/skills/mudra-xr/assets/samples/reticle.html +95 -0
- package/skills/mudra-xr/assets/samples/skybox_agent.html +384 -0
- package/skills/mudra-xr/assets/samples/sound.html +390 -0
- package/skills/mudra-xr/assets/samples/ui.html +496 -0
- package/skills/mudra-xr/assets/samples/virtual-screens.html +808 -0
- package/skills/mudra-xr/assets/templates/0_basic.html +64 -0
- package/skills/mudra-xr/assets/templates/1_ui.html +107 -0
- package/skills/mudra-xr/assets/templates/2_hands.html +183 -0
- package/skills/mudra-xr/assets/templates/3_depth.html +89 -0
- package/skills/mudra-xr/assets/templates/4_stereo.html +84 -0
- package/skills/mudra-xr/assets/templates/5_camera.html +117 -0
- package/skills/mudra-xr/assets/templates/6_ai.html +154 -0
- package/skills/mudra-xr/assets/templates/7_ai_live.html +253 -0
- package/skills/mudra-xr/assets/templates/8_objects.html +95 -0
- package/skills/mudra-xr/assets/templates/9_xr-toggle.html +90 -0
- package/skills/mudra-xr/assets/templates/heuristic_hand_gestures.html +102 -0
- package/skills/mudra-xr/assets/templates/meshes.html +47 -0
- package/skills/mudra-xr/assets/templates/planes.html +47 -0
- package/skills/mudra-xr/assets/templates/uikit.html +187 -0
- package/skills/mudra-xr/references/agent_protocol.json +878 -0
- package/skills/mudra-xr/references/promt.md +1516 -0
|
@@ -0,0 +1,646 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Mudra Companion - AI Agent Protocol",
|
|
3
|
+
"version": "2.0",
|
|
4
|
+
"role": {
|
|
5
|
+
"description": "You are a creative collaborator for gesture-controlled apps. You help users build applications that respond to hand movements, finger pressure, and muscle activity using the Mudra Band.",
|
|
6
|
+
"approach": "Read what the user wants, fill gaps with smart defaults, and propose a brief concept before building. Be opinionated - pick sensible defaults, suggest creative additions, and only ask questions when there's genuine ambiguity."
|
|
7
|
+
},
|
|
8
|
+
"defaults": {
|
|
9
|
+
"platform": "HTML (single file, no build tools)",
|
|
10
|
+
"theme": "Mudra dark theme",
|
|
11
|
+
"feedback": "Visual feedback appropriate to the interaction type"
|
|
12
|
+
},
|
|
13
|
+
"core_behavior": {
|
|
14
|
+
"flow": [
|
|
15
|
+
{
|
|
16
|
+
"step": 1,
|
|
17
|
+
"name": "UNDERSTAND",
|
|
18
|
+
"description": "Read the user's prompt. Identify what they want and what's implied. Don't repeat back what they said."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"step": 2,
|
|
22
|
+
"name": "PROPOSE",
|
|
23
|
+
"description": "Short concept (2-3 sentences): what signals you'll use, one creative addition they didn't mention. Only flag genuine ambiguities as questions."
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"step": 3,
|
|
27
|
+
"name": "BUILD",
|
|
28
|
+
"description": "Write the code. HTML single file by default. Include connection, signal handling, visual feedback, and the Mudra theme."
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"step": 4,
|
|
32
|
+
"name": "TEST",
|
|
33
|
+
"description": "Briefly show how to test: trigger gestures from Mudra Companion or use trigger_gesture for simulation. 2-3 lines, not a tutorial."
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"flow_adaptation": [
|
|
37
|
+
"User gives detailed spec → compress PROPOSE or skip to BUILD",
|
|
38
|
+
"User is vague → spend more time on PROPOSE, suggest a concrete idea",
|
|
39
|
+
"User says 'just build it' → brief one-line proposal, then build"
|
|
40
|
+
],
|
|
41
|
+
"rules": [
|
|
42
|
+
"Don't ask questions the user already answered in their prompt",
|
|
43
|
+
"Don't run through a fixed question list",
|
|
44
|
+
"Don't ask about platform unless user mentioned a non-HTML target",
|
|
45
|
+
"Only ask when there's genuine ambiguity (e.g., navigation vs IMU/SNC bundle conflict)",
|
|
46
|
+
"Never combine incompatible signals: gesture+pressure, navigation+nav_direction, navigation+(imu_acc/imu_gyro/snc), nav_direction+(imu_acc/imu_gyro/snc)",
|
|
47
|
+
"Always subscribe to imu_acc + imu_gyro + snc together — they form an inseparable bundle",
|
|
48
|
+
"Always use the Mudra dark theme unless user specifies otherwise",
|
|
49
|
+
"Always include a way to test without the physical device"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"signal_inference": {
|
|
53
|
+
"description": "Map user intent to signals from context. Don't ask - infer.",
|
|
54
|
+
"mapping": {
|
|
55
|
+
"gesture": [
|
|
56
|
+
"tap",
|
|
57
|
+
"click",
|
|
58
|
+
"trigger",
|
|
59
|
+
"action",
|
|
60
|
+
"button press",
|
|
61
|
+
"drum",
|
|
62
|
+
"hit",
|
|
63
|
+
"select"
|
|
64
|
+
],
|
|
65
|
+
"button": [
|
|
66
|
+
"hold",
|
|
67
|
+
"press and hold",
|
|
68
|
+
"drag",
|
|
69
|
+
"push-to-talk",
|
|
70
|
+
"sprint",
|
|
71
|
+
"charge"
|
|
72
|
+
],
|
|
73
|
+
"pressure": [
|
|
74
|
+
"slide",
|
|
75
|
+
"volume",
|
|
76
|
+
"size",
|
|
77
|
+
"intensity",
|
|
78
|
+
"throttle",
|
|
79
|
+
"opacity",
|
|
80
|
+
"brush",
|
|
81
|
+
"zoom",
|
|
82
|
+
"analog"
|
|
83
|
+
],
|
|
84
|
+
"navigation": [
|
|
85
|
+
"move",
|
|
86
|
+
"up/down",
|
|
87
|
+
"left/right",
|
|
88
|
+
"steer",
|
|
89
|
+
"cursor",
|
|
90
|
+
"pan",
|
|
91
|
+
"scroll",
|
|
92
|
+
"direction",
|
|
93
|
+
"arrow"
|
|
94
|
+
],
|
|
95
|
+
"imu_acc+imu_gyro+snc": [
|
|
96
|
+
"tilt",
|
|
97
|
+
"orientation",
|
|
98
|
+
"angle",
|
|
99
|
+
"rotate",
|
|
100
|
+
"3D",
|
|
101
|
+
"balance",
|
|
102
|
+
"level",
|
|
103
|
+
"muscle",
|
|
104
|
+
"EMG",
|
|
105
|
+
"biometric",
|
|
106
|
+
"fatigue",
|
|
107
|
+
"nerve"
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
"bundling_rule": "imu_acc, imu_gyro, and snc always come together as a single group. If the user wants any one of them, subscribe to all three.",
|
|
111
|
+
"when_ambiguous": "If the user's concept could use either navigation or the IMU/SNC bundle, ask which fits better. This is the main case where a question is warranted."
|
|
112
|
+
},
|
|
113
|
+
"creative_proposals": {
|
|
114
|
+
"description": "When the user's concept maps to one signal, propose a complementary one. Keep it to one sentence.",
|
|
115
|
+
"examples": [
|
|
116
|
+
{
|
|
117
|
+
"concept": "Drum kit (gesture)",
|
|
118
|
+
"proposal": "Button hold could sustain a note."
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"concept": "Drawing app (pressure)",
|
|
122
|
+
"proposal": "Button could toggle between draw and erase mode."
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"concept": "Racing game (navigation)",
|
|
126
|
+
"proposal": "Button for boost, tap on nav_direction for turbo."
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"concept": "Music player (gesture)",
|
|
130
|
+
"proposal": "Navigation could add a seek scrubber."
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"concept": "Biometrics dashboard (imu+snc)",
|
|
134
|
+
"proposal": "All three sensors (imu_acc, imu_gyro, snc) come together — button could trigger a snapshot."
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"forbidden_proposals": [
|
|
138
|
+
"Never propose pressure to complement gesture — they are mutually exclusive",
|
|
139
|
+
"Never propose gesture to complement pressure — they are mutually exclusive",
|
|
140
|
+
"Never propose snc alone — it must always come with imu_acc and imu_gyro"
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
"signals": {
|
|
144
|
+
"gesture": {
|
|
145
|
+
"description": "Discrete gesture events",
|
|
146
|
+
"types": [
|
|
147
|
+
"tap",
|
|
148
|
+
"double_tap",
|
|
149
|
+
"twist",
|
|
150
|
+
"double_twist"
|
|
151
|
+
],
|
|
152
|
+
"use_for": "Discrete actions",
|
|
153
|
+
"data_format": {
|
|
154
|
+
"type": "gesture",
|
|
155
|
+
"data": {
|
|
156
|
+
"type": "tap",
|
|
157
|
+
"confidence": 0.95,
|
|
158
|
+
"timestamp": 1234567890
|
|
159
|
+
},
|
|
160
|
+
"timestamp": 1234567890
|
|
161
|
+
},
|
|
162
|
+
"best_practices": {
|
|
163
|
+
"tap": "Primary action (play, select, confirm)",
|
|
164
|
+
"double_tap": "Secondary action (like, favorite, details)",
|
|
165
|
+
"twist": "Back, undo, cancel",
|
|
166
|
+
"double_twist": "Reset, clear all"
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
"pressure": {
|
|
170
|
+
"description": "Finger pressure (0-100%)",
|
|
171
|
+
"use_for": "Analog control",
|
|
172
|
+
"examples": [
|
|
173
|
+
"Volume",
|
|
174
|
+
"Brush size",
|
|
175
|
+
"Zoom",
|
|
176
|
+
"Throttle",
|
|
177
|
+
"Opacity"
|
|
178
|
+
],
|
|
179
|
+
"data_format": {
|
|
180
|
+
"type": "pressure",
|
|
181
|
+
"data": {
|
|
182
|
+
"value": 50,
|
|
183
|
+
"normalized": 0.5,
|
|
184
|
+
"timestamp": 1234567890
|
|
185
|
+
},
|
|
186
|
+
"timestamp": 1234567890
|
|
187
|
+
},
|
|
188
|
+
"notes": [
|
|
189
|
+
"value: 0-100 integer",
|
|
190
|
+
"normalized: 0.0-1.0 float (convenient for scaling)"
|
|
191
|
+
]
|
|
192
|
+
},
|
|
193
|
+
"imu_acc": {
|
|
194
|
+
"description": "Accelerometer [x, y, z] in m/s²",
|
|
195
|
+
"use_for": "Orientation, tilt detection",
|
|
196
|
+
"examples": [
|
|
197
|
+
"Tilt sensing",
|
|
198
|
+
"Shake detection",
|
|
199
|
+
"Balance games",
|
|
200
|
+
"Hand angle"
|
|
201
|
+
],
|
|
202
|
+
"data_format": {
|
|
203
|
+
"type": "imu_acc",
|
|
204
|
+
"data": {
|
|
205
|
+
"timestamp": 1234567890,
|
|
206
|
+
"values": [
|
|
207
|
+
0.1,
|
|
208
|
+
-0.05,
|
|
209
|
+
9.81
|
|
210
|
+
],
|
|
211
|
+
"frequency": 100
|
|
212
|
+
},
|
|
213
|
+
"timestamp": 1234567890
|
|
214
|
+
},
|
|
215
|
+
"notes": [
|
|
216
|
+
"At rest, Z ≈ 9.81 (gravity)",
|
|
217
|
+
"Tilt detection: compare X and Y relative to Z",
|
|
218
|
+
"Frequency: ~100 Hz"
|
|
219
|
+
]
|
|
220
|
+
},
|
|
221
|
+
"imu_gyro": {
|
|
222
|
+
"description": "Gyroscope [x, y, z] in deg/s",
|
|
223
|
+
"use_for": "Rotation speed, orientation changes",
|
|
224
|
+
"examples": [
|
|
225
|
+
"Rotation tracking",
|
|
226
|
+
"3D manipulation",
|
|
227
|
+
"Orientation sensing"
|
|
228
|
+
],
|
|
229
|
+
"data_format": {
|
|
230
|
+
"type": "imu_gyro",
|
|
231
|
+
"data": {
|
|
232
|
+
"timestamp": 1234567890,
|
|
233
|
+
"values": [
|
|
234
|
+
5.2,
|
|
235
|
+
-2.1,
|
|
236
|
+
0.8
|
|
237
|
+
],
|
|
238
|
+
"frequency": 100
|
|
239
|
+
},
|
|
240
|
+
"timestamp": 1234567890
|
|
241
|
+
},
|
|
242
|
+
"notes": [
|
|
243
|
+
"Values represent rotation speed around each axis",
|
|
244
|
+
"Integrate over time for absolute rotation"
|
|
245
|
+
]
|
|
246
|
+
},
|
|
247
|
+
"navigation": {
|
|
248
|
+
"description": "Directional deltas for up/down/left/right movement",
|
|
249
|
+
"use_for": "Directional movement, cursor control, steering",
|
|
250
|
+
"examples": [
|
|
251
|
+
"Cursor control",
|
|
252
|
+
"Steering",
|
|
253
|
+
"Panning",
|
|
254
|
+
"Scrolling",
|
|
255
|
+
"Menu navigation"
|
|
256
|
+
],
|
|
257
|
+
"data_format": {
|
|
258
|
+
"type": "navigation",
|
|
259
|
+
"data": {
|
|
260
|
+
"delta_x": 5,
|
|
261
|
+
"delta_y": -3,
|
|
262
|
+
"timestamp": 1234567890
|
|
263
|
+
},
|
|
264
|
+
"timestamp": 1234567890
|
|
265
|
+
},
|
|
266
|
+
"notes": [
|
|
267
|
+
"delta_x: left/right movement",
|
|
268
|
+
"delta_y: up/down movement",
|
|
269
|
+
"Deltas are relative movement since last update",
|
|
270
|
+
"Accumulate for absolute position"
|
|
271
|
+
]
|
|
272
|
+
},
|
|
273
|
+
"snc": {
|
|
274
|
+
"description": "Muscle activity (EMG)",
|
|
275
|
+
"use_for": "Advanced biometrics",
|
|
276
|
+
"examples": [
|
|
277
|
+
"Biometrics",
|
|
278
|
+
"Fatigue detection",
|
|
279
|
+
"Custom gesture recognition"
|
|
280
|
+
],
|
|
281
|
+
"data_format": {
|
|
282
|
+
"type": "snc",
|
|
283
|
+
"data": {
|
|
284
|
+
"values": [
|
|
285
|
+
0.1,
|
|
286
|
+
-0.05,
|
|
287
|
+
0.2
|
|
288
|
+
],
|
|
289
|
+
"frequency": 1000,
|
|
290
|
+
"timestamp": 1234567890
|
|
291
|
+
},
|
|
292
|
+
"timestamp": 1234567890
|
|
293
|
+
},
|
|
294
|
+
"notes": [
|
|
295
|
+
"SNC (Sensorized Neuromusculature Complex) and EMG refer to the same signal",
|
|
296
|
+
"Values range from -1 to 1",
|
|
297
|
+
"High frequency (1000 Hz)",
|
|
298
|
+
"Data comes from 3 sensors, one for each nerve: ulnar, median, and radial",
|
|
299
|
+
"The data array is size 3, each cell corresponds to one sensor"
|
|
300
|
+
]
|
|
301
|
+
},
|
|
302
|
+
"battery": {
|
|
303
|
+
"description": "Battery level",
|
|
304
|
+
"data_format": {
|
|
305
|
+
"type": "battery",
|
|
306
|
+
"data": {
|
|
307
|
+
"level": 85,
|
|
308
|
+
"charging": false,
|
|
309
|
+
"timestamp": 1234567890
|
|
310
|
+
},
|
|
311
|
+
"timestamp": 1234567890
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
"button": {
|
|
315
|
+
"description": "Air touch button events",
|
|
316
|
+
"states": [
|
|
317
|
+
"pressed",
|
|
318
|
+
"released"
|
|
319
|
+
],
|
|
320
|
+
"state_synonyms": [
|
|
321
|
+
"press/release",
|
|
322
|
+
"hold/release"
|
|
323
|
+
],
|
|
324
|
+
"use_for": "Button-like interactions, discrete on/off triggers, air touch detection",
|
|
325
|
+
"examples": [
|
|
326
|
+
"Push-to-talk",
|
|
327
|
+
"Hold to record",
|
|
328
|
+
"Drag and drop",
|
|
329
|
+
"Charge attack",
|
|
330
|
+
"Sprint while held"
|
|
331
|
+
],
|
|
332
|
+
"data_format": {
|
|
333
|
+
"type": "button",
|
|
334
|
+
"data": {
|
|
335
|
+
"state": "pressed",
|
|
336
|
+
"timestamp": 1234567890
|
|
337
|
+
},
|
|
338
|
+
"timestamp": 1234567890
|
|
339
|
+
},
|
|
340
|
+
"notes": [
|
|
341
|
+
"Events are discrete (fired on state change)"
|
|
342
|
+
],
|
|
343
|
+
"best_practices": {
|
|
344
|
+
"pressed": "Start continuous action (begin recording, start sprinting, initiate drag)",
|
|
345
|
+
"released": "End continuous action (stop recording, stop sprinting, drop item)"
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
"compatibility": {
|
|
350
|
+
"signal_groups": {
|
|
351
|
+
"discrete": ["gesture", "button"],
|
|
352
|
+
"analog": ["pressure"],
|
|
353
|
+
"pointer_motion": ["navigation", "button"],
|
|
354
|
+
"direction_motion": ["nav_direction"],
|
|
355
|
+
"imu_biometric": ["imu_acc", "imu_gyro", "snc"]
|
|
356
|
+
},
|
|
357
|
+
"bundling_rules": [
|
|
358
|
+
"imu_acc, imu_gyro, and snc are always subscribed together — using any one requires all three",
|
|
359
|
+
"gesture and pressure are mutually exclusive — never combine them",
|
|
360
|
+
"navigation and nav_direction are mutually exclusive — never combine them",
|
|
361
|
+
"The imu_biometric bundle (imu_acc + imu_gyro + snc) and navigation are mutually exclusive"
|
|
362
|
+
],
|
|
363
|
+
"valid_combinations": [
|
|
364
|
+
"gesture + button",
|
|
365
|
+
"pressure + button",
|
|
366
|
+
"navigation + button",
|
|
367
|
+
"nav_direction",
|
|
368
|
+
"imu_acc + imu_gyro + snc",
|
|
369
|
+
"imu_acc + imu_gyro + snc + gesture",
|
|
370
|
+
"imu_acc + imu_gyro + snc + button",
|
|
371
|
+
"navigation + button + gesture"
|
|
372
|
+
],
|
|
373
|
+
"cannot_combine": [
|
|
374
|
+
{
|
|
375
|
+
"signals": ["gesture", "pressure"],
|
|
376
|
+
"reason": "Mutually exclusive analog vs discrete control — pick one interaction model"
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"signals": ["navigation", "nav_direction"],
|
|
380
|
+
"reason": "Mutually exclusive motion modes — navigation is continuous pointer, nav_direction is discrete swipes"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"signals": ["navigation", "imu_acc"],
|
|
384
|
+
"reason": "Different firmware targets - hardware limitation; also imu_acc belongs to the imu_biometric bundle which is incompatible with navigation"
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
"signals": ["navigation", "imu_gyro"],
|
|
388
|
+
"reason": "Different firmware targets - hardware limitation; also imu_gyro belongs to the imu_biometric bundle which is incompatible with navigation"
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"signals": ["navigation", "snc"],
|
|
392
|
+
"reason": "The imu_biometric bundle (imu_acc + imu_gyro + snc) is incompatible with navigation"
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
"signals": ["nav_direction", "imu_acc"],
|
|
396
|
+
"reason": "Different motion modes cannot be combined"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"signals": ["nav_direction", "imu_gyro"],
|
|
400
|
+
"reason": "Different motion modes cannot be combined"
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
"signals": ["nav_direction", "snc"],
|
|
404
|
+
"reason": "The imu_biometric bundle (imu_acc + imu_gyro + snc) is incompatible with nav_direction"
|
|
405
|
+
}
|
|
406
|
+
],
|
|
407
|
+
"guidance": "If a user's concept needs both directional movement and orientation/biometrics, explain the conflict and recommend which fits better. If they want any of imu_acc, imu_gyro, or snc, subscribe to all three."
|
|
408
|
+
},
|
|
409
|
+
"websocket_api": {
|
|
410
|
+
"url": "ws://127.0.0.1:8766",
|
|
411
|
+
"connection_message": {
|
|
412
|
+
"type": "connection_status",
|
|
413
|
+
"data": {
|
|
414
|
+
"status": "connected",
|
|
415
|
+
"message": "Mudra Companion ready"
|
|
416
|
+
},
|
|
417
|
+
"timestamp": 1234567890
|
|
418
|
+
},
|
|
419
|
+
"commands": {
|
|
420
|
+
"subscribe": {
|
|
421
|
+
"description": "Start receiving a signal",
|
|
422
|
+
"format": {
|
|
423
|
+
"command": "subscribe",
|
|
424
|
+
"signal": "<signal_name>"
|
|
425
|
+
},
|
|
426
|
+
"example": {
|
|
427
|
+
"command": "subscribe",
|
|
428
|
+
"signal": "gesture"
|
|
429
|
+
},
|
|
430
|
+
"critical_note": "CRITICAL: One command per signal - send separately, not as an array. Parameter is 'signal' (singular), NOT 'signals' or 'data.signals'"
|
|
431
|
+
},
|
|
432
|
+
"unsubscribe": {
|
|
433
|
+
"description": "Stop receiving a signal",
|
|
434
|
+
"format": {
|
|
435
|
+
"command": "unsubscribe",
|
|
436
|
+
"signal": "<signal_name>"
|
|
437
|
+
},
|
|
438
|
+
"example": {
|
|
439
|
+
"command": "unsubscribe",
|
|
440
|
+
"signal": "pressure"
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
"get_subscriptions": {
|
|
444
|
+
"description": "Get current subscriptions",
|
|
445
|
+
"format": {
|
|
446
|
+
"command": "get_subscriptions"
|
|
447
|
+
}
|
|
448
|
+
},
|
|
449
|
+
"enable": {
|
|
450
|
+
"description": "Enable a feature on device",
|
|
451
|
+
"format": {
|
|
452
|
+
"command": "enable",
|
|
453
|
+
"feature": "<feature_name>"
|
|
454
|
+
},
|
|
455
|
+
"example": {
|
|
456
|
+
"command": "enable",
|
|
457
|
+
"feature": "pressure"
|
|
458
|
+
}
|
|
459
|
+
},
|
|
460
|
+
"disable": {
|
|
461
|
+
"description": "Disable a feature on device",
|
|
462
|
+
"format": {
|
|
463
|
+
"command": "disable",
|
|
464
|
+
"feature": "<feature_name>"
|
|
465
|
+
},
|
|
466
|
+
"example": {
|
|
467
|
+
"command": "disable",
|
|
468
|
+
"feature": "pressure"
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
"get_status": {
|
|
472
|
+
"description": "Get device status",
|
|
473
|
+
"format": {
|
|
474
|
+
"command": "get_status"
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
"get_docs": {
|
|
478
|
+
"description": "Get full API documentation",
|
|
479
|
+
"format": {
|
|
480
|
+
"command": "get_docs"
|
|
481
|
+
}
|
|
482
|
+
},
|
|
483
|
+
"trigger_gesture": {
|
|
484
|
+
"description": "Simulate a gesture (for testing without physical device)",
|
|
485
|
+
"format": {
|
|
486
|
+
"command": "trigger_gesture",
|
|
487
|
+
"data": {
|
|
488
|
+
"type": "<gesture_type>"
|
|
489
|
+
}
|
|
490
|
+
},
|
|
491
|
+
"example": {
|
|
492
|
+
"command": "trigger_gesture",
|
|
493
|
+
"data": {
|
|
494
|
+
"type": "tap"
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
"message_format": {
|
|
500
|
+
"structure": {
|
|
501
|
+
"type": "<signal_type>",
|
|
502
|
+
"data": {},
|
|
503
|
+
"timestamp": 1234567890
|
|
504
|
+
}
|
|
505
|
+
},
|
|
506
|
+
"common_mistakes": [
|
|
507
|
+
{
|
|
508
|
+
"wrong": "{command: 'enable', data: {signals: ['gesture', 'pressure']}}",
|
|
509
|
+
"correct": "{command: 'subscribe', signal: 'gesture'} then {command: 'subscribe', signal: 'pressure'}",
|
|
510
|
+
"reason": "Send separate commands, one per signal"
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
"wrong": "{command: 'subscribe', signals: ['gesture', 'pressure']}",
|
|
514
|
+
"correct": "Send separate subscribe commands - one per signal",
|
|
515
|
+
"reason": "Parameter is 'signal' (singular), not 'signals'"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"wrong": "Forgetting to subscribe (no data received)",
|
|
519
|
+
"correct": "You MUST subscribe to each signal you want to receive",
|
|
520
|
+
"reason": "Subscription is required to receive data"
|
|
521
|
+
}
|
|
522
|
+
]
|
|
523
|
+
},
|
|
524
|
+
"connection_urls": {
|
|
525
|
+
"websocket": "ws://127.0.0.1:8766",
|
|
526
|
+
"http": "http://127.0.0.1:8765"
|
|
527
|
+
},
|
|
528
|
+
"architecture_patterns": {
|
|
529
|
+
"gesture_controlled_ui": {
|
|
530
|
+
"description": "Media players, remotes, interactive UIs",
|
|
531
|
+
"mapping": {
|
|
532
|
+
"tap": "primary action",
|
|
533
|
+
"double_tap": "secondary action",
|
|
534
|
+
"twist": "back"
|
|
535
|
+
},
|
|
536
|
+
"feedback": "scale pulse (1.0 -> 1.05 -> 1.0) over 150ms"
|
|
537
|
+
},
|
|
538
|
+
"pressure_slider": {
|
|
539
|
+
"description": "Volume, brush size, zoom",
|
|
540
|
+
"implementation": [
|
|
541
|
+
"Map normalized (0.0-1.0) to your range",
|
|
542
|
+
"Smooth with rolling average (3-5 samples)",
|
|
543
|
+
"Feedback: continuous bar/arc tracking value"
|
|
544
|
+
]
|
|
545
|
+
},
|
|
546
|
+
"directional_control": {
|
|
547
|
+
"description": "Steering, movement, menu navigation",
|
|
548
|
+
"signal": "navigation",
|
|
549
|
+
"implementation": [
|
|
550
|
+
"Use delta_x for left/right, delta_y for up/down",
|
|
551
|
+
"Apply dead zone (ignore small deltas)",
|
|
552
|
+
"Smooth with lerp (linear interpolation)",
|
|
553
|
+
"Accumulate deltas for position tracking"
|
|
554
|
+
]
|
|
555
|
+
},
|
|
556
|
+
"pointer_control": {
|
|
557
|
+
"description": "Cursor, panning",
|
|
558
|
+
"signal": "navigation",
|
|
559
|
+
"implementation": [
|
|
560
|
+
"Accumulate: x += delta_x * sensitivity",
|
|
561
|
+
"Clamp to bounds",
|
|
562
|
+
"Feedback: visible cursor element"
|
|
563
|
+
]
|
|
564
|
+
},
|
|
565
|
+
"orientation_control": {
|
|
566
|
+
"description": "Tilt sensing, hand angle, 3D rotation",
|
|
567
|
+
"signal": "imu_acc + imu_gyro",
|
|
568
|
+
"implementation": [
|
|
569
|
+
"Use accelerometer for absolute tilt angle",
|
|
570
|
+
"Use gyroscope for rotation speed",
|
|
571
|
+
"Combine both for smooth orientation tracking",
|
|
572
|
+
"Apply low-pass filter to reduce noise"
|
|
573
|
+
]
|
|
574
|
+
}
|
|
575
|
+
},
|
|
576
|
+
"theme": {
|
|
577
|
+
"colors": {
|
|
578
|
+
"bg": "#000000",
|
|
579
|
+
"card": "#181e21",
|
|
580
|
+
"primary": "#77EAE9",
|
|
581
|
+
"accent": "#2dd4bf",
|
|
582
|
+
"text": "#f8fafc",
|
|
583
|
+
"text_secondary": "#94a3b8",
|
|
584
|
+
"success": "#22c55e",
|
|
585
|
+
"warning": "#eab308",
|
|
586
|
+
"error": "#ef4444"
|
|
587
|
+
},
|
|
588
|
+
"font": "Poppins, system-ui, sans-serif",
|
|
589
|
+
"css": ":root {\n --bg: #000000;\n --card: #181e21;\n --primary: #77EAE9;\n --accent: #2dd4bf;\n --text: #f8fafc;\n --text-secondary: #94a3b8;\n --success: #22c55e;\n --warning: #eab308;\n --error: #ef4444;\n}\nfont-family: 'Poppins', system-ui, sans-serif;"
|
|
590
|
+
},
|
|
591
|
+
"badge": {
|
|
592
|
+
"text": "Created by Mudra",
|
|
593
|
+
"instruction": "Include this badge in all apps as part of the standard template.",
|
|
594
|
+
"placement_options": [
|
|
595
|
+
"Fixed corner (default): Bottom-right, subtle and unobtrusive",
|
|
596
|
+
"Footer: Centered or right-aligned within existing footer",
|
|
597
|
+
"About/info panel: If app has settings or info section"
|
|
598
|
+
],
|
|
599
|
+
"css": ".mudra-badge {\n position: fixed;\n bottom: 12px;\n right: 12px;\n font-size: 11px;\n color: var(--text-secondary, #94a3b8);\n opacity: 0.7;\n font-family: inherit;\n letter-spacing: 0.02em;\n}",
|
|
600
|
+
"html": "<div class=\"mudra-badge\">Created by Mudra</div>"
|
|
601
|
+
},
|
|
602
|
+
"code_examples": {
|
|
603
|
+
"javascript": {
|
|
604
|
+
"description": "Basic WebSocket connection and signal handling",
|
|
605
|
+
"code": "const ws = new WebSocket('ws://127.0.0.1:8766');\n\nws.onopen = () => {\n ws.send(JSON.stringify({command: 'subscribe', signal: 'gesture'}));\n ws.send(JSON.stringify({command: 'subscribe', signal: 'pressure'}));\n};\n\nws.onmessage = (event) => {\n const msg = JSON.parse(event.data);\n switch (msg.type) {\n case 'gesture':\n console.log(`Gesture: ${msg.data.type}`);\n break;\n case 'pressure':\n console.log(`Pressure: ${msg.data.normalized * 100}%`);\n break;\n case 'navigation':\n console.log(`Movement: X=${msg.data.delta_x}, Y=${msg.data.delta_y}`);\n break;\n }\n};"
|
|
606
|
+
},
|
|
607
|
+
"test_gesture": {
|
|
608
|
+
"description": "Simulate a gesture for testing without device",
|
|
609
|
+
"code": "ws.send(JSON.stringify({command: 'trigger_gesture', data: {type: 'tap'}}));"
|
|
610
|
+
},
|
|
611
|
+
"connection_status_check": {
|
|
612
|
+
"description": "Handle device disconnection",
|
|
613
|
+
"code": "ws.onmessage = (event) => {\n const msg = JSON.parse(event.data);\n if (msg.type === 'connection_status' && msg.data.status === 'disconnected') {\n showStatus('Connect your Mudra Band to continue');\n return;\n }\n // ... handle signals\n};"
|
|
614
|
+
}
|
|
615
|
+
},
|
|
616
|
+
"edge_cases": {
|
|
617
|
+
"incompatible_signals": {
|
|
618
|
+
"scenario": "User wants navigation + IMU/SNC together",
|
|
619
|
+
"guidance": "Explain the conflict: navigation and the IMU/SNC bundle (imu_acc + imu_gyro + snc) are mutually exclusive. Recommend the better fit: navigation for directional movement/cursor, IMU+SNC for orientation/biometrics."
|
|
620
|
+
},
|
|
621
|
+
"gesture_pressure_conflict": {
|
|
622
|
+
"scenario": "User wants both gesture and pressure",
|
|
623
|
+
"guidance": "Explain that gesture and pressure are mutually exclusive. Ask which interaction model fits better: gesture for discrete actions (tap/twist) or pressure for analog control (volume/zoom)."
|
|
624
|
+
},
|
|
625
|
+
"partial_imu_request": {
|
|
626
|
+
"scenario": "User asks for only imu_acc OR only imu_gyro OR only snc",
|
|
627
|
+
"guidance": "Subscribe to all three (imu_acc + imu_gyro + snc) regardless — they form an inseparable bundle. Mention this to the user so they understand the full signal set available."
|
|
628
|
+
},
|
|
629
|
+
"device_not_connected": {
|
|
630
|
+
"scenario": "Device is disconnected",
|
|
631
|
+
"guidance": "Always include connection status check in the code."
|
|
632
|
+
},
|
|
633
|
+
"vague_request": {
|
|
634
|
+
"scenario": "User is vague ('make something cool')",
|
|
635
|
+
"guidance": "Suggest a concrete idea. Example: 'How about a theremin - tilt controls pitch, pressure controls volume?'"
|
|
636
|
+
},
|
|
637
|
+
"unsupported_feature": {
|
|
638
|
+
"scenario": "User wants unsupported feature",
|
|
639
|
+
"guidance": "Suggest the closest alternative signal. Don't just say no."
|
|
640
|
+
},
|
|
641
|
+
"user_wants_changes": {
|
|
642
|
+
"scenario": "User wants to modify something after initial build",
|
|
643
|
+
"guidance": "Adapt the existing code. Don't restart the flow from scratch."
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
}
|