@muggleai/works 4.0.0 → 4.0.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/README.md CHANGED
@@ -36,6 +36,14 @@ In Claude Code, run:
36
36
  /plugin install muggleai@muggle-works
37
37
  ```
38
38
 
39
+ If you install via npm instead:
40
+
41
+ ```bash
42
+ npm install -g @muggleai/works
43
+ ```
44
+
45
+ `npm install` updates the CLI and syncs `muggle-*` skills to `~/.cursor/skills/` for Cursor discovery. Claude slash commands are plugin-managed, so update those with `/plugin update muggleai@muggle-works`.
46
+
39
47
  This installs the Muggle AI plugin with:
40
48
 
41
49
  - `/muggle:muggle` — command router and menu
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "muggle",
3
3
  "description": "Run real-browser QA tests on your web app from any AI coding agent. Generate test scripts from plain English, replay them on localhost, capture screenshots, and validate user flows like signup, checkout, and dashboards. Works across Claude Code, Cursor, Codex, and Windsurf.",
4
- "version": "4.0.0",
4
+ "version": "4.0.1",
5
5
  "author": {
6
6
  "name": "Muggle AI",
7
7
  "email": "support@muggle-ai.com"
@@ -2,7 +2,7 @@
2
2
  "name": "muggle",
3
3
  "displayName": "Muggle AI",
4
4
  "description": "Ship quality products with AI-powered QA that validates your app's user experience — from Claude Code and Cursor to PR.",
5
- "version": "4.0.0",
5
+ "version": "4.0.1",
6
6
  "author": {
7
7
  "name": "Muggle AI",
8
8
  "email": "support@muggle-ai.com"
@@ -9,6 +9,14 @@ Ship quality products with AI-powered QA that validates your app's user experien
9
9
  /plugin install muggleai@muggle-works
10
10
  ```
11
11
 
12
+ For npm installs:
13
+
14
+ ```bash
15
+ npm install -g @muggleai/works
16
+ ```
17
+
18
+ This updates the CLI and syncs `muggle-*` skills into `~/.cursor/skills/` for Cursor. Claude slash commands remain plugin-managed, so use `/plugin update muggleai@muggle-works` to refresh them.
19
+
12
20
  ## Skills
13
21
 
14
22
  Type `muggle` to discover the full command family.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@muggleai/works",
3
3
  "mcpName": "io.github.multiplex-ai/muggle",
4
- "version": "4.0.0",
4
+ "version": "4.0.1",
5
5
  "description": "Ship quality products with AI-powered QA that validates your app's user experience — from Claude Code and Cursor to PR.",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "muggle",
3
3
  "description": "Run real-browser QA tests on your web app from any AI coding agent. Generate test scripts from plain English, replay them on localhost, capture screenshots, and validate user flows like signup, checkout, and dashboards. Works across Claude Code, Cursor, Codex, and Windsurf.",
4
- "version": "4.0.0",
4
+ "version": "4.0.1",
5
5
  "author": {
6
6
  "name": "Muggle AI",
7
7
  "email": "support@muggle-ai.com"
@@ -2,7 +2,7 @@
2
2
  "name": "muggle",
3
3
  "displayName": "Muggle AI",
4
4
  "description": "Ship quality products with AI-powered QA that validates your app's user experience — from Claude Code and Cursor to PR.",
5
- "version": "4.0.0",
5
+ "version": "4.0.1",
6
6
  "author": {
7
7
  "name": "Muggle AI",
8
8
  "email": "support@muggle-ai.com"
package/plugin/README.md CHANGED
@@ -9,6 +9,14 @@ Ship quality products with AI-powered QA that validates your app's user experien
9
9
  /plugin install muggleai@muggle-works
10
10
  ```
11
11
 
12
+ For npm installs:
13
+
14
+ ```bash
15
+ npm install -g @muggleai/works
16
+ ```
17
+
18
+ This updates the CLI and syncs `muggle-*` skills into `~/.cursor/skills/` for Cursor. Claude slash commands remain plugin-managed, so use `/plugin update muggleai@muggle-works` to refresh them.
19
+
12
20
  ## Skills
13
21
 
14
22
  Type `muggle` to discover the full command family.
@@ -8,6 +8,7 @@
8
8
  import { createHash } from "crypto";
9
9
  import { exec } from "child_process";
10
10
  import {
11
+ cpSync,
11
12
  readFileSync,
12
13
  appendFileSync,
13
14
  createReadStream,
@@ -19,15 +20,19 @@ import {
19
20
  writeFileSync,
20
21
  } from "fs";
21
22
  import { homedir, platform } from "os";
22
- import { join } from "path";
23
+ import { dirname, join } from "path";
23
24
  import { pipeline } from "stream/promises";
24
25
  import { createRequire } from "module";
26
+ import { fileURLToPath } from "url";
25
27
 
26
28
  const require = createRequire(import.meta.url);
27
29
  const VERSION_DIRECTORY_NAME_PATTERN = /^\d+\.\d+\.\d+(?:[-+][A-Za-z0-9.-]+)?$/;
28
30
  const INSTALL_METADATA_FILE_NAME = ".install-metadata.json";
29
31
  const LOG_FILE_NAME = "postinstall.log";
30
32
  const VERSION_OVERRIDE_FILE_NAME = "electron-app-version-override.json";
33
+ const CURSOR_SKILLS_DIRECTORY_NAME = ".cursor";
34
+ const CURSOR_SKILLS_SUBDIRECTORY_NAME = "skills";
35
+ const MUGGLE_SKILL_PREFIX = "muggle";
31
36
 
32
37
  /**
33
38
  * Get the path to the postinstall log file.
@@ -111,6 +116,59 @@ function getDataDir() {
111
116
  return join(homedir(), ".muggle-ai");
112
117
  }
113
118
 
119
+ /**
120
+ * Get the package root directory.
121
+ * @returns {string} Path to package root
122
+ */
123
+ function getPackageRootDir() {
124
+ return join(dirname(fileURLToPath(import.meta.url)), "..");
125
+ }
126
+
127
+ /**
128
+ * Sync packaged muggle skills into Cursor user skills.
129
+ * This enables npm installs to refresh locally available `muggle-*` skills.
130
+ */
131
+ function syncCursorSkills() {
132
+ const sourceSkillsDirectoryPath = join(getPackageRootDir(), "plugin", "skills");
133
+ if (!existsSync(sourceSkillsDirectoryPath)) {
134
+ log("Cursor skill sync skipped: packaged plugin skills directory not found.");
135
+ return;
136
+ }
137
+
138
+ const cursorSkillsDirectoryPath = join(
139
+ homedir(),
140
+ CURSOR_SKILLS_DIRECTORY_NAME,
141
+ CURSOR_SKILLS_SUBDIRECTORY_NAME,
142
+ );
143
+ mkdirSync(cursorSkillsDirectoryPath, { recursive: true });
144
+
145
+ const skillEntries = readdirSync(sourceSkillsDirectoryPath, { withFileTypes: true });
146
+ let syncedSkillCount = 0;
147
+
148
+ for (const skillEntry of skillEntries) {
149
+ if (!skillEntry.isDirectory()) {
150
+ continue;
151
+ }
152
+
153
+ if (!skillEntry.name.startsWith(MUGGLE_SKILL_PREFIX)) {
154
+ continue;
155
+ }
156
+
157
+ const sourceSkillDirectoryPath = join(sourceSkillsDirectoryPath, skillEntry.name);
158
+ const sourceSkillFilePath = join(sourceSkillDirectoryPath, "SKILL.md");
159
+ if (!existsSync(sourceSkillFilePath)) {
160
+ continue;
161
+ }
162
+
163
+ const targetSkillDirectoryPath = join(cursorSkillsDirectoryPath, skillEntry.name);
164
+ rmSync(targetSkillDirectoryPath, { recursive: true, force: true });
165
+ cpSync(sourceSkillDirectoryPath, targetSkillDirectoryPath, { recursive: true });
166
+ syncedSkillCount += 1;
167
+ }
168
+
169
+ log(`Synced ${syncedSkillCount} muggle skill(s) to ${cursorSkillsDirectoryPath}`);
170
+ }
171
+
114
172
  /**
115
173
  * Get the Electron app directory.
116
174
  * @returns {string} Path to ~/.muggle-ai/electron-app
@@ -592,4 +650,5 @@ async function extractTarGz(tarPath, destDir) {
592
650
  // Run postinstall
593
651
  initLogFile();
594
652
  removeVersionOverrideFile();
653
+ syncCursorSkills();
595
654
  downloadElectronApp().catch(logError);