@muggleai/works 2.0.0 → 3.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.
Files changed (32) hide show
  1. package/README.md +362 -213
  2. package/dist/plugin/.claude-plugin/plugin.json +8 -0
  3. package/dist/plugin/.mcp.json +12 -0
  4. package/dist/plugin/hooks/hooks.json +14 -0
  5. package/dist/plugin/scripts/ensure-electron-app.sh +12 -0
  6. package/dist/plugin/skills/muggle-do/SKILL.md +53 -0
  7. package/dist/plugin/skills/muggle-do/impact-analysis.md +34 -0
  8. package/dist/plugin/skills/muggle-do/open-prs.md +52 -0
  9. package/dist/plugin/skills/muggle-do/qa.md +89 -0
  10. package/dist/plugin/skills/muggle-do/requirements.md +33 -0
  11. package/dist/plugin/skills/muggle-do/unit-tests.md +31 -0
  12. package/dist/plugin/skills/muggle-do/validate-code.md +30 -0
  13. package/dist/plugin/skills/publish-test-to-cloud/SKILL.md +41 -0
  14. package/dist/plugin/skills/test-feature-local/SKILL.md +86 -0
  15. package/package.json +13 -7
  16. package/plugin/.claude-plugin/plugin.json +8 -0
  17. package/plugin/.mcp.json +12 -0
  18. package/plugin/hooks/hooks.json +14 -0
  19. package/plugin/scripts/ensure-electron-app.sh +12 -0
  20. package/plugin/skills/muggle-do/SKILL.md +53 -0
  21. package/plugin/skills/muggle-do/impact-analysis.md +34 -0
  22. package/plugin/skills/muggle-do/open-prs.md +52 -0
  23. package/plugin/skills/muggle-do/qa.md +89 -0
  24. package/plugin/skills/muggle-do/requirements.md +33 -0
  25. package/plugin/skills/muggle-do/unit-tests.md +31 -0
  26. package/plugin/skills/muggle-do/validate-code.md +30 -0
  27. package/plugin/skills/publish-test-to-cloud/SKILL.md +41 -0
  28. package/plugin/skills/test-feature-local/SKILL.md +86 -0
  29. package/scripts/postinstall.mjs +2 -2
  30. package/skills-dist/muggle-do.md +0 -589
  31. package/skills-dist/publish-test-to-cloud.md +0 -43
  32. package/skills-dist/test-feature-local.md +0 -344
package/README.md CHANGED
@@ -1,279 +1,334 @@
1
- # @muggleai/works
1
+ # muggle-ai-works
2
2
 
3
- Unified MCP server for Muggle AI - combines Cloud QA and Local Testing tools into a single package.
3
+ **Test your web app with AI no test code required.**
4
4
 
5
- ## Installation
5
+ One install gives your AI coding assistant the power to QA your app like a real user would: clicking through flows, catching broken experiences, and reporting results with screenshots and evidence.
6
6
 
7
- ```bash
8
- npm install -g @muggleai/works
9
- ```
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
8
+ [![npm](https://img.shields.io/npm/v/@muggleai/works)]()
9
+ [![MCP Tools](https://img.shields.io/badge/MCP_tools-70+-green)]()
10
+ [![Node](https://img.shields.io/badge/node-22+-orange)]()
10
11
 
11
- Or install directly from GitHub:
12
+ Powered by [MuggleTest](https://www.muggletest.com) the [AI-powered QA testing platform](https://www.muggletest.com).
12
13
 
13
- ```bash
14
- npm install -g github:multiplex-ai/muggle-ai-works
15
- ```
14
+ ---
16
15
 
17
- This is the canonical one-liner install path.
16
+ ## What do you get?
18
17
 
19
- It automatically:
20
- 1. Installs the package
21
- 2. Downloads the Electron app binary (via postinstall)
22
- 3. Registers/updates `~/.cursor/mcp.json` with a `muggle` server entry
23
- 4. Sets up CLI commands
18
+ muggle-ai-works gives your AI coding assistant three things it doesn't have out of the box: the ability to test your app in a real browser, a fully autonomous dev pipeline from requirements to PR, and 70+ MCP tools for building custom QA workflows.
19
+
20
+ - **Test features on localhost** — describe what to test in plain English; the AI drives a real browser, clicks through your flows, and reports results with screenshots. No test code to write, no Playwright setup.
21
+ - **Autonomous dev pipeline** — run `/muggle:muggle-do` with a requirement in English; the AI codes the feature, writes unit tests, runs QA against your app, and opens a PR — all in one command.
22
+ - **70+ MCP tools** — build custom QA workflows using tools for project management, use case discovery, test case generation, browser automation, and reporting. Works with Claude Code, Cursor, and any MCP-compatible client.
23
+
24
+ ---
24
25
 
25
26
  ## Quick Start
26
27
 
27
- ### 1. Validate your install
28
+ ### 1. Install
28
29
 
29
30
  ```bash
30
- muggle --version
31
- muggle doctor
31
+ /plugin marketplace add <marketplace-url-or-path>
32
+ /plugin install muggle@<marketplace-name>
32
33
  ```
33
34
 
34
- ### 2. Add to your MCP client (if needed)
35
+ <details>
36
+ <summary>What gets configured automatically</summary>
35
37
 
36
- **Cursor (`~/.cursor/mcp.json`):**
38
+ 1. Namespaced skills (`/muggle:muggle-do`, `/muggle:test-feature-local`, `/muggle:publish-test-to-cloud`)
39
+ 2. Plugin-managed MCP server configuration
40
+ 3. Plugin hooks for Electron QA engine provisioning
37
41
 
38
- ```json
39
- {
40
- "mcpServers": {
41
- "muggle": {
42
- "command": "muggle",
43
- "args": ["serve"]
44
- }
45
- }
46
- }
47
- ```
42
+ </details>
48
43
 
49
- ### 2. Start using MCP tools
44
+ ### 2. Verify
50
45
 
51
- Ask your AI assistant to test your application! Authentication happens automatically when needed.
46
+ ```bash
47
+ muggle --version
48
+ muggle doctor
49
+ ```
52
50
 
53
- ## CLI Commands
51
+ ### 3. Start testing
54
52
 
55
- ```bash
56
- # Server (main command - starts MCP server for AI clients)
57
- muggle serve # Start server with all tools (default)
58
- muggle serve --qa # Cloud QA tools only
59
- muggle serve --local # Local testing tools only
53
+ In Claude Code or Cursor, describe what to test:
60
54
 
61
- # Setup & Diagnostics
62
- muggle setup # Download/update Electron app
63
- muggle setup --force # Force re-download
64
- muggle doctor # Diagnose installation issues
55
+ > "Test my login flow on localhost:3000"
65
56
 
66
- # Authentication (optional - auth happens automatically)
67
- muggle login # Manually trigger login
68
- muggle logout # Clear credentials
69
- muggle status # Show auth status
57
+ Your AI assistant authenticates, finds or creates test cases, launches the browser, records and replays tests, and shows results with screenshots.
70
58
 
71
- # Info
72
- muggle --version # Show version
73
- muggle --help # Show help
74
- ```
59
+ ---
75
60
 
76
- ## Authentication
61
+ ## How does it work?
77
62
 
78
- Authentication happens automatically when you first use a tool that requires it:
63
+ muggle-ai-works separates test management from test execution. All entity management (projects, use cases, test cases) lives in the cloud via `muggle-remote-*` tools. Local execution (`muggle-local-*`) is stateless — it receives what it needs and runs the test.
79
64
 
80
- 1. A browser window opens with a verification code
81
- 2. You log in with your Muggle AI account
82
- 3. The tool call continues with your credentials
65
+ ### Entity model
83
66
 
84
- Your credentials are stored in `~/.muggle-ai/credentials.json` and persist across sessions.
67
+ ```
68
+ Project (e.g., "My App")
69
+ └── Use Case (e.g., "User Login Flow")
70
+ └── Test Case (e.g., "Login with valid credentials")
71
+ └── Test Script (recorded browser automation steps)
72
+ └── Run Result (pass/fail + screenshots)
73
+ ```
85
74
 
86
- ### Handling Expired Tokens
75
+ <details>
76
+ <summary>Test execution flow</summary>
87
77
 
88
- Tokens expire after a period of time. When this happens:
78
+ ```
79
+ Your AI assistant describes what to test
80
+
81
+ v
82
+ muggle-remote-* tools create test cases in cloud
83
+
84
+ v
85
+ muggle-local-execute-test-generation launches the QA engine
86
+
87
+ v
88
+ AI agent drives the browser step-by-step (click, type, navigate, assert)
89
+
90
+ v
91
+ Screenshots captured per step → action-script.json recorded
92
+
93
+ v
94
+ Results: pass/fail with evidence at ~/.muggle-ai/sessions/{runId}/
95
+
96
+ v
97
+ muggle-local-publish-test-script uploads to cloud
98
+ ```
89
99
 
90
- 1. **Check status**: Run `muggle status` or call `muggle-remote-auth-status` to see expiration
91
- 2. **Re-authenticate**: Run `muggle login` or call `muggle-remote-auth-login` to get fresh tokens
92
- 3. **If login fails with "unauthorized_client"**: Check your runtime target configuration (see Troubleshooting)
100
+ </details>
93
101
 
94
- The MCP server will attempt to auto-refresh tokens when possible, but manual re-authentication may be required if the refresh token has also expired.
102
+ ---
95
103
 
96
- ## Muggle Do (`/muggle-do`)
104
+ ## Three Ways to Use It
97
105
 
98
- An autonomous development pipeline that takes your code changes through requirements analysis, testing, QA, and PR creation — all inside Claude Code.
106
+ ### 1. `/muggle:test-feature-local` Test a feature on localhost
99
107
 
100
- ### How it works
108
+ Describe what to test in English. The AI finds the right project and test cases, launches a real browser, and reports results with screenshots.
101
109
 
102
110
  ```
103
- You write code on a feature branch
104
- |
105
- v
106
- /muggle-do "what I built"
107
- |
108
- Stage 1: Requirements → extracts goal + acceptance criteria
109
- Stage 2: Impact Analysis detects which repos have git changes
110
- Stage 3: Validate → checks feature branch, commits exist
111
- Stage 4: Unit Tests → runs test commands, fails fast
112
- Stage 5: QA → runs Muggle AI test cases
113
- Stage 6: Open PRs → pushes branch, creates PR with QA results
114
- |
115
- v
116
- PR ready for review
111
+ > /muggle:test-feature-local
112
+
113
+ "Test my login changes on localhost:3999"
114
+
115
+ 1. Auth check ✓
116
+ 2. Found project: "My App"
117
+ 3. Found use case: "User Login"
118
+ 4. Found 2 test cases recommend replay (minor changes detected)
119
+ 5. Launching QA engine... (approve? y)
120
+ 6. Results: 2/2 PASS
121
+ Screenshots: ~/.muggle-ai/sessions/abc123/screenshots/
122
+ 7. Publish to cloud? (y)
117
123
  ```
118
124
 
119
- ### Step by step
125
+ ### 2. `/muggle:muggle-do` — Autonomous dev pipeline
120
126
 
121
- **1. Make your changes on a feature branch:**
127
+ Full development cycle: requirements to PR in one command. The AI codes the feature, writes unit tests, runs QA against your running app, and opens a PR.
122
128
 
123
- ```bash
124
- cd /path/to/your/repo
125
- git checkout -b feat/add-login
126
- # ... write your code ...
127
- git add -A && git commit -m "feat: add login page"
129
+ ```
130
+ > /muggle:muggle-do "Add a logout button to the header"
131
+
132
+ REQUIREMENTS → Goal: Add logout button. Criteria: visible, functional, redirects.
133
+ IMPACT → frontend repo, src/components/Header.tsx
134
+ VALIDATE → Branch: feat/add-logout, 1 commit
135
+ CODING → (writes/fixes code)
136
+ UNIT_TESTS → 12/12 pass
137
+ QA → 3/3 test cases pass
138
+ OPEN_PRS → PR #42 opened
139
+ DONE → 1 iteration, all green
128
140
  ```
129
141
 
130
- **2. Configure your repos** create `muggle-repos.json` in the muggle-ai-works root:
142
+ - Session-based with crash recovery (`.muggle-do/sessions/`)
143
+ - Auto-triage: analyzes failures and loops back to fix (max 3 iterations)
144
+ - Multi-repo support via `muggle-repos.json`
145
+ - PRs include QA results and screenshots in the description
131
146
 
132
- ```json
133
- [
134
- { "name": "frontend", "path": "/absolute/path/to/frontend", "testCommand": "pnpm test" }
135
- ]
136
- ```
147
+ ### 3. Direct MCP tool calls — Build your own QA workflow
137
148
 
138
- **3. Open Claude Code and run the dev cycle:**
149
+ Use any of the 70+ MCP tools directly from your AI assistant. This is the lowest-level option and the most flexible for building custom QA workflows.
139
150
 
140
151
  ```
141
- /muggle-do "Add a login page with email/password authentication"
152
+ "Create a project called My App with URL https://myapp.com"
153
+ "Generate test cases for the checkout flow"
154
+ "Replay all test scripts against localhost:3000"
155
+ "Show me the latest QA results"
142
156
  ```
143
157
 
144
- Claude will detect your changes, run tests, trigger QA, and open a PR.
158
+ ---
145
159
 
146
- ### What if something fails?
160
+ ## What MCP tools are included?
147
161
 
148
- | Failure | What happens |
149
- |---|---|
150
- | No changes detected | Stops — make changes first, re-run |
151
- | On main/master | Stops — create a feature branch first |
152
- | Unit tests fail | Shows output, stops — fix and re-run |
153
- | QA fails | Shows failing tests — fix and re-run |
162
+ muggle-ai-works provides 70+ MCP tools organized into 8 categories: authentication, project management, use cases, test cases, test scripts, local execution, reports, and administration. These tools power all AI testing automation workflows — from one-off browser checks to full QA automation pipelines.
163
+
164
+ <details>
165
+ <summary>Authentication (muggle-remote-auth-*)</summary>
166
+
167
+ | Tool | Purpose |
168
+ |------|---------|
169
+ | `muggle-remote-auth-status` | Check authentication status |
170
+ | `muggle-remote-auth-login` | Start device-code login flow |
171
+ | `muggle-remote-auth-poll` | Poll for login completion |
172
+ | `muggle-remote-auth-logout` | Clear credentials |
154
173
 
155
- ### Repo config
174
+ </details>
156
175
 
157
- | Field | Required | Default | Description |
158
- |---|---|---|---|
159
- | `name` | yes | — | Short identifier for the repo |
160
- | `path` | yes | — | Absolute path on your machine |
161
- | `testCommand` | no | `pnpm test` | Command to run unit tests |
176
+ <details>
177
+ <summary>Project Management (muggle-remote-project-*)</summary>
162
178
 
163
- ---
179
+ | Tool | Purpose |
180
+ |------|---------|
181
+ | `muggle-remote-project-create` | Create QA project |
182
+ | `muggle-remote-project-list` | List all projects |
183
+ | `muggle-remote-project-get` | Get project details |
184
+ | `muggle-remote-project-update` | Update project |
185
+ | `muggle-remote-project-delete` | Delete project |
164
186
 
165
- ## Available Tools
187
+ </details>
166
188
 
167
- ### Cloud QA Tools (muggle-remote-*)
189
+ <details>
190
+ <summary>Use Cases (muggle-remote-use-case-*)</summary>
168
191
 
169
- Tools that work with the Muggle AI cloud backend:
192
+ | Tool | Purpose |
193
+ |------|---------|
194
+ | `muggle-remote-use-case-list` | List use cases |
195
+ | `muggle-remote-use-case-create-from-prompts` | Create from natural language |
196
+ | `muggle-remote-use-case-prompt-preview` | Preview before creating |
197
+ | `muggle-remote-use-case-update-from-prompt` | Regenerate from new prompt |
170
198
 
171
- - `muggle-remote-project-create` - Create QA project
172
- - `muggle-remote-project-list` - List projects
173
- - `muggle-remote-use-case-create-from-prompts` - Create use cases
174
- - `muggle-remote-test-case-generate-from-prompt` - Generate test cases
175
- - `muggle-remote-workflow-start-*` - Start various workflows
176
- - And more...
199
+ </details>
177
200
 
178
- ### Local QA Tools (muggle-local-*)
201
+ <details>
202
+ <summary>Test Cases (muggle-remote-test-case-*)</summary>
179
203
 
180
- Tools that work with local testing:
204
+ | Tool | Purpose |
205
+ |------|---------|
206
+ | `muggle-remote-test-case-list` | List all test cases |
207
+ | `muggle-remote-test-case-list-by-use-case` | List by use case |
208
+ | `muggle-remote-test-case-get` | Get test case details |
209
+ | `muggle-remote-test-case-create` | Create test case |
210
+ | `muggle-remote-test-case-generate-from-prompt` | Generate from prompt |
181
211
 
182
- - `muggle-local-check-status` - Check local status
183
- - `muggle-local-list-sessions` - List sessions
184
- - `muggle-local-execute-test-generation` - Generate test script
185
- - `muggle-local-execute-replay` - Replay test script
186
- - `muggle-local-run-result-list` - List run results
187
- - `muggle-local-publish-test-script` - Publish to cloud
188
- - And more...
212
+ </details>
189
213
 
190
- ## Data Directory
214
+ <details>
215
+ <summary>Test Scripts and Workflows (muggle-remote-workflow-*)</summary>
191
216
 
192
- All Muggle AI data is stored in `~/.muggle-ai/`:
217
+ | Tool | Purpose |
218
+ |------|---------|
219
+ | `muggle-remote-test-script-list` | List test scripts |
220
+ | `muggle-remote-test-script-get` | Get script details |
221
+ | `muggle-remote-workflow-start-website-scan` | Scan site for use cases |
222
+ | `muggle-remote-workflow-start-test-case-detection` | Generate test cases |
223
+ | `muggle-remote-workflow-start-test-script-generation` | Generate scripts |
224
+ | `muggle-remote-workflow-start-test-script-replay` | Replay single script |
225
+ | `muggle-remote-workflow-start-test-script-replay-bulk` | Batch replay |
193
226
 
194
- ```
195
- ~/.muggle-ai/
196
- ├── credentials.json # Auth credentials (auto-generated)
197
- ├── projects/ # Local test projects
198
- ├── sessions/ # Test execution sessions
199
- └── electron-app/ # Downloaded Electron app
200
- └── 1.0.0/
201
- └── MuggleAI.exe
202
- ```
227
+ </details>
203
228
 
204
- ## Requirements
229
+ <details>
230
+ <summary>Local Execution (muggle-local-*)</summary>
205
231
 
206
- - Node.js 22 or higher
207
- - For local testing: Electron app (downloaded automatically)
232
+ | Tool | Purpose |
233
+ |------|---------|
234
+ | `muggle-local-check-status` | Check local QA engine status |
235
+ | `muggle-local-execute-test-generation` | Generate test script locally |
236
+ | `muggle-local-execute-replay` | Replay existing script locally |
237
+ | `muggle-local-cancel-execution` | Cancel active execution |
238
+ | `muggle-local-run-result-list` | List run results |
239
+ | `muggle-local-run-result-get` | Get detailed results + screenshots |
240
+ | `muggle-local-publish-test-script` | Publish script to cloud |
208
241
 
209
- ## Development
242
+ </details>
210
243
 
211
- ### Building
244
+ <details>
245
+ <summary>Reports and Analytics (muggle-remote-report-*)</summary>
212
246
 
213
- ```bash
214
- npm install
215
- npm run build
216
- ```
247
+ | Tool | Purpose |
248
+ |------|---------|
249
+ | `muggle-remote-report-stats-summary-get` | Report statistics |
250
+ | `muggle-remote-report-cost-query` | Query cost/usage |
251
+ | `muggle-remote-report-final-generate` | Generate final report (PDF/HTML/Markdown) |
252
+ | `muggle-remote-project-test-results-summary-get` | Test results summary |
217
253
 
218
- ### Testing
254
+ </details>
219
255
 
220
- ```bash
221
- npm test # Run tests once
222
- npm run test:watch # Watch mode
223
- ```
256
+ <details>
257
+ <summary>Administration (PRD, secrets, billing, scheduling)</summary>
224
258
 
225
- ### Linting
259
+ | Category | Tools |
260
+ |----------|-------|
261
+ | PRD processing | `muggle-remote-prd-*` — upload and process product requirements docs |
262
+ | Secrets management | `muggle-remote-secret-*` — store credentials for test environments |
263
+ | Wallet and billing | `muggle-remote-wallet-*` — manage credits and payment methods |
264
+ | Scheduling | `muggle-remote-recommend-*` — get CI/CD and schedule recommendations |
265
+
266
+ </details>
226
267
 
227
- ```bash
228
- npm run lint # Auto-fix issues
229
- npm run lint:check # Check only
230
- ```
268
+ ---
231
269
 
232
- ## CI/CD Workflows
270
+ ## Works with muggle-ai-teams
233
271
 
234
- | Workflow | Trigger | Description |
235
- | :------- | :------ | :---------- |
236
- | `ci.yml` | Push/PR to `master` | Lint, test, build on multiple platforms/versions |
237
- | `publish-works.yml` | Tag `v*` or manual dispatch | Verify, package-audit, smoke-install, publish to npm |
272
+ [muggle-ai-teams](https://github.com/multiplex-ai/muggle-ai-teams) is the companion package for agent orchestration, workflow steps, and delivery. When both packages are installed, muggle-ai-teams automatically integrates QA into the development workflow at each stage.
238
273
 
239
- ### Publishing a new version
274
+ | Workflow Step | What Happens |
275
+ |--------------|-------------|
276
+ | **Plan** | QA test instructions written per implementation slice |
277
+ | **Build** | Per-slice QA via muggle-ai-works before each commit |
278
+ | **Verify** | Full regression sweep replaying all project scripts |
279
+ | **Ship** | QA results published to cloud, linked in PR description |
240
280
 
241
- 1. Update version in `package.json`
242
- 2. Commit and push
243
- 3. Create a git tag: `git tag v1.0.1 && git push --tags`
244
- 4. The `publish-works.yml` workflow publishes to npm automatically
281
+ Frontend slices get browser QA. Backend-only slices are verified by unit tests (browser QA skipped with documented reasoning).
245
282
 
246
- ## Troubleshooting
283
+ Install both: `npm install @muggleai/works @muggleai/teams`
247
284
 
248
- ### Expired Token Errors
285
+ **Muggle AI open-source ecosystem:**
249
286
 
250
- If you see authentication errors like "Not authenticated" or token expiration messages:
287
+ | Package | Purpose | Install |
288
+ |---------|---------|---------|
289
+ | **muggle-ai-works** (this repo) | QA testing MCP server + autonomous dev pipeline | `/plugin install muggle@<marketplace>` |
290
+ | **[muggle-ai-teams](https://github.com/multiplex-ai/muggle-ai-teams)** | Agent orchestration, workflow, skills, rules | `npm install @muggleai/teams` |
251
291
 
252
- 1. **Check auth status**:
253
- ```bash
254
- muggle status
255
- ```
292
+ Want the full platform experience? [MuggleTest](https://www.muggletest.com) gives you everything out of the box — no setup, no configuration.
256
293
 
257
- 2. **Re-authenticate**:
258
- ```bash
259
- muggle login
260
- ```
294
+ ---
261
295
 
262
- 3. **Clear and retry** (if login keeps failing):
263
- ```bash
264
- muggle logout
265
- muggle login
266
- ```
296
+ ## CLI Reference
267
297
 
268
- ### "unauthorized_client" Error During Login
298
+ ```bash
299
+ # Server (main command — starts MCP server for AI clients)
300
+ muggle serve # Start with all tools (default)
301
+ muggle serve --qa # Cloud QA tools only
302
+ muggle serve --local # Local QA tools only
269
303
 
270
- This error indicates a mismatch between your Auth0 client configuration and the target environment.
304
+ # Setup and Diagnostics
305
+ muggle setup # Download/update QA engine
306
+ muggle setup --force # Force re-download
307
+ muggle doctor # Diagnose installation issues
271
308
 
272
- **Cause**: The MCP is configured for one environment (dev/production) but trying to authenticate against another.
309
+ # Authentication
310
+ muggle login # Manually trigger login
311
+ muggle logout # Clear credentials
312
+ muggle status # Show auth status
313
+
314
+ # Info
315
+ muggle --version # Show version
316
+ muggle --help # Show help
317
+ ```
318
+
319
+ ---
273
320
 
274
- **Fix**: Ensure your MCP configuration matches your intended environment by setting the `MUGGLE_MCP_PROMPT_SERVICE_TARGET` environment variable in your MCP config:
321
+ ## Setup and Configuration
322
+
323
+ Authentication happens automatically when you first use a tool that requires it: a browser window opens with a verification code, you log in with your Muggle AI account, and the tool call continues. Credentials persist across sessions in `~/.muggle-ai/`.
324
+
325
+ <details>
326
+ <summary>MCP client configuration examples</summary>
327
+
328
+ When installed as a plugin, MCP server configuration is shipped by the plugin (`plugin/.mcp.json`) and does not require manual user-level file copy.
329
+
330
+ **Environment targeting** — set `MUGGLE_MCP_PROMPT_SERVICE_TARGET` to switch between production and dev:
275
331
 
276
- **For Production** (`~/.cursor/mcp.json`):
277
332
  ```json
278
333
  {
279
334
  "mcpServers": {
@@ -288,39 +343,133 @@ This error indicates a mismatch between your Auth0 client configuration and the
288
343
  }
289
344
  ```
290
345
 
291
- **For Development** (local services):
346
+ **Multi-repo config for /muggle:muggle-do** create `muggle-repos.json` in your working directory:
347
+
292
348
  ```json
293
- {
294
- "mcpServers": {
295
- "muggle": {
296
- "command": "muggle",
297
- "args": ["serve"],
298
- "env": {
299
- "MUGGLE_MCP_PROMPT_SERVICE_TARGET": "dev"
300
- }
301
- }
302
- }
303
- }
349
+ [
350
+ { "name": "frontend", "path": "/absolute/path/to/frontend", "testCommand": "pnpm test" },
351
+ { "name": "backend", "path": "/absolute/path/to/backend", "testCommand": "pnpm test" }
352
+ ]
353
+ ```
354
+
355
+ </details>
356
+
357
+ <details>
358
+ <summary>Data directory structure (~/.muggle-ai/)</summary>
359
+
360
+ ```
361
+ ~/.muggle-ai/
362
+ ├── auth.json # OAuth tokens
363
+ ├── credentials.json # API key for service calls
364
+ ├── projects/ # Local project cache
365
+ ├── sessions/ # QA sessions
366
+ │ └── {runId}/
367
+ │ ├── action-script.json # Recorded browser steps
368
+ │ ├── results.md # Step-by-step report
369
+ │ └── screenshots/ # Per-step images
370
+ └── electron-app/ # Downloaded QA engine
371
+ └── {version}/
372
+ ```
373
+
374
+ </details>
375
+
376
+ ---
377
+
378
+ ## What AI clients does it work with?
379
+
380
+ Full support for Claude Code. MCP tools work with Cursor and any MCP-compatible client. Plugin skills (`/muggle:muggle-do`, `/muggle:test-feature-local`) require Claude Code plugin support.
381
+
382
+ <details>
383
+ <summary>Platform compatibility table</summary>
384
+
385
+ | Platform | MCP Tools | /muggle:muggle-do | /muggle:test-feature-local |
386
+ |----------|-----------|-----------|-------------------|
387
+ | **Claude Code** | Yes | Yes | Yes |
388
+ | **Cursor** | Yes (via MCP) | No (needs plugin) | No (needs plugin) |
389
+ | **Others** | Via MCP if supported | No | No |
390
+
391
+ </details>
392
+
393
+ ---
394
+
395
+ <details>
396
+ <summary>Troubleshooting</summary>
397
+
398
+ ### "unauthorized_client" during login
399
+
400
+ **Cause**: MCP configured for one environment but authenticating against another.
401
+
402
+ **Fix**: Set the correct `MUGGLE_MCP_PROMPT_SERVICE_TARGET` in your MCP config and restart your client.
403
+
404
+ ### QA engine not found
405
+
406
+ ```bash
407
+ muggle setup --force # Re-download
408
+ muggle doctor # Diagnose
409
+ ```
410
+
411
+ ### Authentication keeps expiring
412
+
413
+ ```bash
414
+ muggle logout # Clear all credentials
415
+ rm ~/.muggle-ai/auth.json ~/.muggle-ai/credentials.json
416
+ muggle login # Fresh login
304
417
  ```
305
418
 
306
- After changing the configuration, restart your MCP client (e.g., restart Cursor).
419
+ </details>
307
420
 
308
- ### Credential Files
421
+ ---
422
+
423
+ ## About
424
+
425
+ Built by the team behind [MuggleTest](https://www.muggletest.com) — [AI-powered QA testing](https://www.muggletest.com) for teams who ship fast.
426
+
427
+ <details>
428
+ <summary>For contributors</summary>
429
+
430
+ ```bash
431
+ # Install dependencies
432
+ pnpm install
433
+
434
+ # Build
435
+ pnpm run build
436
+
437
+ # Dev mode (watch)
438
+ pnpm run dev
439
+
440
+ # Test
441
+ pnpm test
442
+ pnpm run test:watch
309
443
 
310
- Credentials are stored in `~/.muggle-ai/`:
444
+ # Lint
445
+ pnpm run lint # Auto-fix
446
+ pnpm run lint:check # Check only
311
447
 
312
- | File | Purpose |
313
- | :--- | :------ |
314
- | `auth.json` | OAuth tokens (access token, refresh token, expiry) |
315
- | `credentials.json` | API key for service calls |
448
+ # Typecheck
449
+ pnpm run typecheck
450
+ ```
451
+
452
+ **CI/CD**
453
+
454
+ | Workflow | Trigger | Description |
455
+ |----------|---------|-------------|
456
+ | `ci.yml` | Push/PR to `master` | Lint, test, build on multiple platforms |
457
+ | `publish-works.yml` | Tag `v*` or manual | Verify, audit, smoke-install, publish to npm |
458
+
459
+ **Publishing**
316
460
 
317
- If you need to reset authentication completely:
318
461
  ```bash
319
- rm ~/.muggle-ai/auth.json
320
- rm ~/.muggle-ai/credentials.json
321
- muggle login
462
+ # Update version in package.json
463
+ git tag v2.0.1 && git push --tags
464
+ # publish-works.yml handles the rest
322
465
  ```
323
466
 
467
+ </details>
468
+
469
+ ---
470
+
324
471
  ## License
325
472
 
326
- MIT
473
+ [MIT](LICENSE) — Use it, fork it, make it yours.
474
+
475
+ If this helps your development workflow, consider giving it a star. It helps others find it.