@vizzly-testing/cli 0.11.0 → 0.11.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.
@@ -0,0 +1,266 @@
1
+ # Vizzly Claude Code Plugin
2
+
3
+ > Integrate Vizzly visual regression testing seamlessly into your Claude Code workflow
4
+
5
+ This plugin brings Vizzly's powerful visual testing capabilities directly into Claude Code, helping you debug visual regressions, manage baselines, and integrate visual testing into your development workflow—all with AI assistance.
6
+
7
+ ## Installation
8
+
9
+ ### From GitHub (Recommended)
10
+
11
+ ```bash
12
+ # Add the marketplace
13
+ /plugin marketplace add vizzly-testing/vizzly-cli
14
+
15
+ # Install the plugin
16
+ /plugin install vizzly@vizzly-marketplace
17
+ ```
18
+
19
+ ### From Local Source
20
+
21
+ ```bash
22
+ # Clone the repository
23
+ git clone https://github.com/vizzly-testing/vizzly-cli.git
24
+ cd vizzly-cli
25
+
26
+ # Add the marketplace
27
+ /plugin marketplace add ./.claude-plugin
28
+
29
+ # Install the plugin
30
+ /plugin install vizzly@vizzly-marketplace
31
+ ```
32
+
33
+ ## Migration Guide (v0.0.x → v0.1.0)
34
+
35
+ **⚠️ Breaking Changes:** Slash commands for status checking and debugging have been replaced with Agent Skills.
36
+
37
+ ### What Changed
38
+
39
+ **Before (v0.0.x):**
40
+ ```bash
41
+ # Manually invoke slash commands
42
+ /vizzly:tdd-status
43
+ /vizzly:debug-diff homepage
44
+ ```
45
+
46
+ **After (v0.1.0):**
47
+ ```bash
48
+ # Just ask naturally - Skills activate automatically
49
+ "How are my visual tests?"
50
+ "The homepage screenshot is failing"
51
+ ```
52
+
53
+ ### Command Migration
54
+
55
+ | Old Slash Command | New Approach | How It Works |
56
+ |-------------------|--------------|--------------|
57
+ | `/vizzly:tdd-status` | Ask: "How are my tests?" | `check-visual-tests` Skill activates automatically |
58
+ | `/vizzly:debug-diff <name>` | Say: "Debug the homepage screenshot" | `debug-visual-regression` Skill activates automatically |
59
+ | `/vizzly:setup` | Still `/vizzly:setup` | ✅ No change - explicit setup workflow |
60
+ | `/vizzly:suggest-screenshots` | Still `/vizzly:suggest-screenshots` | ✅ No change - explicit suggestions workflow |
61
+
62
+ ### Why This Change?
63
+
64
+ **Better UX:**
65
+ - No need to memorize command syntax
66
+ - Just describe what you need in natural language
67
+ - Claude understands your intent and activates the right Skill
68
+ - More intuitive and conversational workflow
69
+
70
+ **What Are Agent Skills?**
71
+
72
+ Agent Skills are model-invoked capabilities that Claude uses autonomously based on your request. Instead of explicitly typing `/command`, you simply ask questions or describe problems, and Claude will automatically use the appropriate Skill.
73
+
74
+ **Still Prefer Explicit Commands?**
75
+
76
+ You can still be explicit in your requests:
77
+ - "Check my Vizzly test status" → Activates `check-visual-tests` Skill
78
+ - "Debug the login screenshot failure" → Activates `debug-visual-regression` Skill
79
+
80
+ The Skills will activate based on your intent, not rigid command syntax.
81
+
82
+ ## Features
83
+
84
+ ### ✨ **Agent Skills** (Model-Invoked)
85
+
86
+ Claude automatically uses these Skills when you mention visual testing:
87
+
88
+ **🐛 Debug Visual Regression**
89
+ - Activated when you mention failing visual tests or screenshot differences
90
+ - Automatically analyzes visual changes, identifies root causes
91
+ - Compares baseline vs current screenshots
92
+ - Suggests whether to accept or fix changes
93
+ - Works with both local TDD and cloud modes
94
+
95
+ **🔍 Check Visual Test Status**
96
+ - Activated when you ask about test status or results
97
+ - Provides quick summary of passed/failed/new screenshots
98
+ - Shows diff percentages and threshold information
99
+ - Links to dashboard for detailed review
100
+
101
+ **Example usage:**
102
+ - Just say: *"The homepage screenshot is failing"* → Claude debugs it
103
+ - Just ask: *"How are my visual tests?"* → Claude checks status
104
+ - No slash commands needed—Claude activates Skills automatically!
105
+
106
+ ### 📋 **Slash Commands** (User-Invoked)
107
+
108
+ Explicit workflows you trigger manually:
109
+
110
+ **⚡ Quick Setup**
111
+ - `/vizzly:setup` - Initialize Vizzly configuration
112
+ - Environment variable guidance
113
+ - CI/CD integration help
114
+
115
+ **💡 Screenshot Suggestions**
116
+ - `/vizzly:suggest-screenshots` - Analyze test files for screenshot opportunities
117
+ - Framework-specific code examples
118
+ - Respect your test structure and patterns
119
+
120
+ ### Skills vs Slash Commands
121
+
122
+ **Skills** are capabilities Claude uses autonomously based on your request. Just describe what you need naturally, and Claude will use the appropriate Skill.
123
+
124
+ **Slash Commands** are explicit workflows you invoke manually when you want step-by-step guidance through a process.
125
+
126
+ ## MCP Server Tools
127
+
128
+ The plugin provides an MCP server with direct access to Vizzly data:
129
+
130
+ ### Local TDD Tools
131
+ - `detect_context` - Detect if using local TDD or cloud mode
132
+ - `get_tdd_status` - Get current TDD comparison results
133
+ - `read_comparison_details` - Detailed info for specific screenshot
134
+ - `accept_baseline` - Accept a screenshot as new baseline
135
+ - `reject_baseline` - Reject a baseline with reason
136
+
137
+ ### Cloud API Tools
138
+ - `list_recent_builds` - List recent builds with filtering
139
+ - `get_build_status` - Get build status with commit context
140
+ - `get_comparison` - Get comparison details with screenshots
141
+ - `approve_comparison` - Approve a comparison with comment
142
+ - `reject_comparison` - Reject a comparison with reason
143
+ - `create_build_comment` - Add comment to build
144
+
145
+ ## Authentication
146
+
147
+ The plugin automatically uses your Vizzly authentication with the following priority:
148
+
149
+ 1. **Explicitly provided token** (via tool parameters)
150
+ 2. **Environment variable** (`VIZZLY_TOKEN`)
151
+ 3. **Project mapping** (configured via `vizzly project:select`)
152
+ 4. **User access token** (from `vizzly login`)
153
+
154
+ ### Getting Started
155
+
156
+ **For local development:**
157
+ ```bash
158
+ vizzly login # Authenticate with your Vizzly account
159
+ vizzly project:select # Optional: set project-specific token
160
+ ```
161
+
162
+ **For CI/CD:**
163
+ ```bash
164
+ export VIZZLY_TOKEN=vzt_your_project_token
165
+ ```
166
+
167
+ The plugin will automatically use the appropriate token based on your context.
168
+
169
+ ## Requirements
170
+
171
+ - Claude Code
172
+ - Node.js 20+
173
+ - Vizzly CLI (`@vizzly-testing/cli`) installed in your project
174
+ - TDD mode running for local features
175
+ - Authentication configured (see above) for cloud features
176
+
177
+ ## How It Works
178
+
179
+ ### Agent Skills
180
+
181
+ The plugin's Skills use Claude Code's `allowed-tools` feature to restrict what actions they can perform:
182
+
183
+ **Check Visual Test Status Skill:**
184
+ - Can use: `get_tdd_status`, `detect_context`
185
+ - Purpose: Quickly check test status without modifying anything
186
+
187
+ **Debug Visual Regression Skill:**
188
+ - Can use: `Read`, `WebFetch`, `read_comparison_details`, `accept_baseline`, `approve_comparison`, `reject_comparison`
189
+ - Purpose: Analyze failures and suggest/apply fixes
190
+
191
+ ### MCP Server Integration
192
+
193
+ The plugin bundles an MCP server that provides 15 tools for interacting with Vizzly:
194
+
195
+ - **Automatic startup** - MCP server starts when plugin is enabled
196
+ - **Token resolution** - Automatically finds your authentication token
197
+ - **Dual mode** - Works with both local TDD and cloud builds
198
+ - **No configuration needed** - Just install and use
199
+
200
+ ## Troubleshooting
201
+
202
+ ### Skills not activating
203
+
204
+ If Claude isn't using the Skills automatically:
205
+
206
+ 1. Verify plugin is enabled: `/plugin`
207
+ 2. Check MCP server status: `/mcp` (should show `plugin:vizzly:vizzly`)
208
+ 3. Try being more explicit: "Check my Vizzly test status"
209
+
210
+ ### MCP server not connecting
211
+
212
+ If the MCP server shows as "failed" in `/mcp`:
213
+
214
+ 1. Check Node.js version: `node --version` (requires 20+)
215
+ 2. View logs: `claude --debug`
216
+ 3. Reinstall plugin: `/plugin uninstall vizzly@vizzly-marketplace` then `/plugin install vizzly@vizzly-marketplace`
217
+
218
+ ### TDD server not found
219
+
220
+ If Skills report "TDD server not running":
221
+
222
+ 1. Start TDD mode: `vizzly tdd start`
223
+ 2. Verify server is running: Check for `.vizzly/server.json`
224
+ 3. Run tests to generate screenshots
225
+
226
+ ## Example Workflows
227
+
228
+ ### Local TDD Development
229
+
230
+ ```bash
231
+ # Start TDD server
232
+ vizzly tdd start
233
+
234
+ # Run your tests
235
+ npm test
236
+
237
+ # Ask Claude to check status
238
+ # "How are my visual tests?"
239
+
240
+ # If failures, ask Claude to debug
241
+ # "The login page screenshot is failing"
242
+ ```
243
+
244
+ ### Cloud Build Review
245
+
246
+ ```bash
247
+ # After CI/CD runs and creates a build
248
+ # "Show me recent Vizzly builds"
249
+
250
+ # Review specific comparison
251
+ # "Analyze comparison cmp_abc123"
252
+
253
+ # Approve or reject
254
+ # Claude will suggest using approve/reject tools
255
+ ```
256
+
257
+ ## Documentation
258
+
259
+ - [Vizzly CLI](https://github.com/vizzly-testing/vizzly-cli) - Official CLI documentation
260
+ - [Vizzly Platform](https://vizzly.dev) - Web dashboard and cloud features
261
+ - [Claude Code](https://claude.com/claude-code) - Claude Code documentation
262
+ - [Agent Skills](https://docs.claude.com/en/docs/claude-code/skills) - Learn about Claude Code Skills
263
+
264
+ ## License
265
+
266
+ MIT © Vizzly Team
@@ -0,0 +1,58 @@
1
+ # Changelog
2
+
3
+ All notable changes to the Vizzly Claude Code plugin will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0] - 2025-10-18
9
+
10
+ ### Added
11
+ - ✨ **Agent Skills** - Model-invoked capabilities that activate autonomously
12
+ - `check-visual-tests` Skill - Automatically checks test status when you ask about tests
13
+ - `debug-visual-regression` Skill - Automatically analyzes failures when you mention visual issues
14
+ - 📦 MCP server configuration moved to plugin root (`.mcp.json`)
15
+ - 📝 Comprehensive README with Skills documentation, troubleshooting, and workflows
16
+ - 🔒 Tool restrictions via `allowed-tools` for better security and focused capabilities
17
+
18
+ ### Changed
19
+ - 🔧 MCP server name: `vizzly-server` → `vizzly` (cleaner naming)
20
+ - 🔧 Skills use correct tool prefix: `mcp__plugin_vizzly_vizzly__*`
21
+
22
+ ### Removed
23
+ - ❌ **BREAKING:** `/vizzly:tdd-status` slash command → Replaced by `check-visual-tests` Skill
24
+ - ❌ **BREAKING:** `/vizzly:debug-diff` slash command → Replaced by `debug-visual-regression` Skill
25
+
26
+ ### Migration Guide
27
+
28
+ **Before (v0.0.x):**
29
+ ```bash
30
+ # Manually invoke slash commands
31
+ /vizzly:tdd-status
32
+ /vizzly:debug-diff homepage
33
+ ```
34
+
35
+ **After (v0.1.0):**
36
+ ```bash
37
+ # Just ask naturally - Skills activate automatically
38
+ "How are my visual tests?"
39
+ "The homepage screenshot is failing"
40
+ ```
41
+
42
+ **What Changed:**
43
+ - **Status checks** are now autonomous - just ask about your tests
44
+ - **Debugging** happens automatically when you mention failures
45
+ - **No need to remember slash commands** - Claude understands your intent
46
+ - **Setup and suggestions** still use slash commands (`/vizzly:setup`, `/vizzly:suggest-screenshots`)
47
+
48
+ **Why This Change:**
49
+ Agent Skills provide a more natural, intuitive experience. Instead of memorizing command syntax, you can ask questions in plain language and Claude will automatically use the right tools.
50
+
51
+ **If You Prefer Explicit Commands:**
52
+ While the slash commands are removed, you can still be explicit in your requests:
53
+ - "Check my Vizzly test status" → Activates `check-visual-tests` Skill
54
+ - "Debug the homepage screenshot" → Activates `debug-visual-regression` Skill
55
+
56
+ ### Fixed
57
+ - MCP server location now follows Claude Code plugin specifications
58
+ - Tool naming consistency across Skills and MCP server
@@ -145,6 +145,35 @@ export class CloudAPIProvider {
145
145
  return data.comparison;
146
146
  }
147
147
 
148
+ /**
149
+ * Search for comparisons by name across builds
150
+ */
151
+ async searchComparisons(name, apiToken, options = {}) {
152
+ if (!name || typeof name !== 'string') {
153
+ throw new Error('name is required and must be a non-empty string');
154
+ }
155
+
156
+ let { branch, limit = 50, offset = 0, apiUrl } = options;
157
+
158
+ let queryParams = new URLSearchParams({
159
+ name,
160
+ limit: limit.toString(),
161
+ offset: offset.toString()
162
+ });
163
+
164
+ if (branch) {
165
+ queryParams.append('branch', branch);
166
+ }
167
+
168
+ let data = await this.makeRequest(
169
+ `/api/sdk/comparisons/search?${queryParams}`,
170
+ apiToken,
171
+ apiUrl
172
+ );
173
+
174
+ return data;
175
+ }
176
+
148
177
  // ==================================================================
149
178
  // BUILD COMMENTS
150
179
  // ==================================================================
@@ -21,7 +21,7 @@ class VizzlyMCPServer {
21
21
  constructor() {
22
22
  this.server = new Server(
23
23
  {
24
- name: 'vizzly-server',
24
+ name: 'vizzly',
25
25
  version: '0.1.0'
26
26
  },
27
27
  {
@@ -247,6 +247,41 @@ class VizzlyMCPServer {
247
247
  required: ['comparisonId']
248
248
  }
249
249
  },
250
+ {
251
+ name: 'search_comparisons',
252
+ description:
253
+ 'Search for comparisons by screenshot name across recent builds in the cloud. Returns matching comparisons with their build context and screenshot URLs. Use this to find all instances of a specific screenshot across different builds for debugging.',
254
+ inputSchema: {
255
+ type: 'object',
256
+ properties: {
257
+ name: {
258
+ type: 'string',
259
+ description: 'Screenshot/comparison name to search for (supports partial matching)'
260
+ },
261
+ branch: {
262
+ type: 'string',
263
+ description: 'Optional branch name to filter results'
264
+ },
265
+ limit: {
266
+ type: 'number',
267
+ description: 'Maximum number of results to return (default: 50)'
268
+ },
269
+ offset: {
270
+ type: 'number',
271
+ description: 'Offset for pagination (default: 0)'
272
+ },
273
+ apiToken: {
274
+ type: 'string',
275
+ description: 'Vizzly API token (optional, auto-resolves from user login or env)'
276
+ },
277
+ apiUrl: {
278
+ type: 'string',
279
+ description: 'API base URL (optional)'
280
+ }
281
+ },
282
+ required: ['name']
283
+ }
284
+ },
250
285
  {
251
286
  name: 'create_build_comment',
252
287
  description: 'Create a comment on a build for collaboration',
@@ -668,6 +703,24 @@ class VizzlyMCPServer {
668
703
  };
669
704
  }
670
705
 
706
+ case 'search_comparisons': {
707
+ let apiToken = await this.resolveApiToken(args);
708
+ let results = await this.cloudProvider.searchComparisons(args.name, apiToken, {
709
+ branch: args.branch,
710
+ limit: args.limit,
711
+ offset: args.offset,
712
+ apiUrl: args.apiUrl
713
+ });
714
+ return {
715
+ content: [
716
+ {
717
+ type: 'text',
718
+ text: JSON.stringify(results, null, 2)
719
+ }
720
+ ]
721
+ };
722
+ }
723
+
671
724
  case 'create_build_comment': {
672
725
  let apiToken = await this.resolveApiToken(args);
673
726
  let result = await this.cloudProvider.createBuildComment(
@@ -0,0 +1,158 @@
1
+ ---
2
+ name: Check Visual Test Status
3
+ description: Check the status of Vizzly visual regression tests. Use when the user asks about test status, test results, what's failing, how tests are doing, or wants a summary of visual tests. Works with both local TDD and cloud modes.
4
+ allowed-tools: mcp__plugin_vizzly_vizzly__get_tdd_status, mcp__plugin_vizzly_vizzly__detect_context
5
+ ---
6
+
7
+ # Check Visual Test Status
8
+
9
+ Automatically check Vizzly visual test status when the user asks about their tests. Provides a quick summary of passed, failed, and new screenshots.
10
+
11
+ ## When to Use This Skill
12
+
13
+ Activate this Skill when the user:
14
+ - Asks "How are my tests doing?"
15
+ - Asks "Are there any failing tests?"
16
+ - Asks "What's the status of visual tests?"
17
+ - Asks "Show me test results"
18
+ - Asks "What's failing?"
19
+ - Wants a summary of visual regression tests
20
+
21
+ ## How This Skill Works
22
+
23
+ 1. **Detect context** (local TDD or cloud mode)
24
+ 2. **Fetch TDD status** from the local server
25
+ 3. **Analyze results** to identify failures, new screenshots, and passes
26
+ 4. **Provide summary** with actionable information
27
+ 5. **Link to dashboard** for detailed review
28
+
29
+ ## Instructions
30
+
31
+ ### Step 1: Get TDD Status
32
+
33
+ Use the `get_tdd_status` tool from the Vizzly MCP server to fetch current comparison results.
34
+
35
+ This returns:
36
+ - Total screenshot count
37
+ - Passed, failed, and new screenshot counts
38
+ - List of all comparisons with details
39
+ - Dashboard URL (if TDD server is running)
40
+
41
+ ### Step 2: Analyze the Results
42
+
43
+ Examine the comparison data:
44
+ - Count total, passed, failed, and new screenshots
45
+ - Identify which specific screenshots failed
46
+ - Note diff percentages for failures
47
+ - Check if new screenshots need baselines
48
+
49
+ ### Step 3: Provide Clear Summary
50
+
51
+ Format the output to be scannable and actionable:
52
+
53
+ ```
54
+ Vizzly TDD Status:
55
+ ✅ Total: [count] screenshots
56
+ ✅ Passed: [count]
57
+ ❌ Failed: [count] (exceeded threshold)
58
+ 🆕 New: [count] (no baseline)
59
+
60
+ Failed Comparisons:
61
+ - [name] ([diff]% diff) - Exceeds [threshold]% threshold
62
+ - [name] ([diff]% diff) - Exceeds [threshold]% threshold
63
+
64
+ New Screenshots:
65
+ - [name] (no baseline for comparison)
66
+
67
+ Dashboard: http://localhost:47392
68
+ ```
69
+
70
+ ### Step 4: Suggest Next Steps
71
+
72
+ Based on the results, provide guidance:
73
+
74
+ **If there are failures:**
75
+ - Suggest using the debug-visual-regression Skill for detailed analysis
76
+ - Provide dashboard link for visual review
77
+ - Mention accept/reject options
78
+
79
+ **If there are new screenshots:**
80
+ - Explain that new screenshots need baseline approval
81
+ - Show how to accept them from dashboard or CLI
82
+
83
+ **If all passed:**
84
+ - Confirm tests are passing
85
+ - No action needed
86
+
87
+ ## Example Output
88
+
89
+ ```
90
+ User: "How are my tests?"
91
+
92
+ Vizzly TDD Status:
93
+ ✅ Total: 15 screenshots
94
+ ✅ Passed: 12
95
+ ❌ Failed: 2 (exceeded threshold)
96
+ 🆕 New: 1 (no baseline)
97
+
98
+ Failed Comparisons:
99
+ - homepage (2.3% diff) - Exceeds 0.1% threshold
100
+ Check .vizzly/diffs/homepage.png
101
+ - login-form (1.8% diff) - Exceeds 0.1% threshold
102
+ Check .vizzly/diffs/login-form.png
103
+
104
+ New Screenshots:
105
+ - dashboard (no baseline for comparison)
106
+
107
+ Dashboard: http://localhost:47392
108
+
109
+ Next Steps:
110
+ - Review diff images to understand what changed
111
+ - Accept baselines from dashboard if changes are intentional
112
+ - For detailed analysis of failures, ask me to debug specific screenshots
113
+ - Fix visual issues if changes are unintentional
114
+ ```
115
+
116
+ ## Example When All Pass
117
+
118
+ ```
119
+ User: "Are my visual tests passing?"
120
+
121
+ Vizzly TDD Status:
122
+ ✅ Total: 15 screenshots
123
+ ✅ All passed!
124
+
125
+ No visual regressions detected. All screenshots match their baselines.
126
+
127
+ Dashboard: http://localhost:47392
128
+ ```
129
+
130
+ ## Example When TDD Not Running
131
+
132
+ ```
133
+ User: "How are my tests?"
134
+
135
+ Vizzly TDD Status:
136
+ ❌ TDD server is not running
137
+
138
+ To start TDD mode:
139
+ vizzly tdd start
140
+
141
+ Then run your tests to capture screenshots.
142
+ ```
143
+
144
+ ## Important Notes
145
+
146
+ - **Quick status check** - Designed for fast overview, not detailed analysis
147
+ - **Use dashboard for visuals** - Link to dashboard for image review
148
+ - **Suggest next steps** - Always provide actionable guidance
149
+ - **Detect TDD mode** - Only works with local TDD server running
150
+ - **For detailed debugging** - Suggest using debug-visual-regression Skill
151
+
152
+ ## Focus on Actionability
153
+
154
+ Always end with clear next steps:
155
+ - What to investigate
156
+ - Which tools to use (dashboard, debug Skill)
157
+ - How to accept/reject baselines
158
+ - When to fix code vs accept changes