@verygoodplugins/mcp-freescout 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.
@@ -0,0 +1,422 @@
1
+ ---
2
+ allowed-tools: Bash(curl:*), Bash(jq:*), Bash(gh:*), Bash(find:*), Bash(grep:*), Bash(git:*), Bash(ls:*), Bash(mkdir:*), Bash(cp:*), Bash(awk:*), Bash(wc:*), Bash(tr:*), Bash(./vendor/bin/*), mcp_playwright_browser_navigate, mcp_playwright_browser_take_screenshot, mcp_playwright_browser_click, mcp_playwright_browser_type, mcp_playwright_browser_resize, mcp_playwright_browser_close
3
+ auto-approve: true
4
+ description: Implement FreeScout ticket with testing, PR creation, customer reply, and documentation updates
5
+ argument-hint: <ticket-number> [additional context] | <freescout-ticket-url> [additional context]
6
+ ---
7
+
8
+ # Implement FreeScout Ticket with Full Workflow
9
+
10
+ Please implement the FreeScout ticket following this comprehensive workflow using structured XML tags for clarity.
11
+
12
+ <input>
13
+ $ARGUMENTS (FreeScout ticket ID or URL, with optional context)
14
+ </input>
15
+
16
+ <project_context>
17
+ **Note**: This workflow is plugin-agnostic. The AI will understand the specific project name, scope, and coding standards from the project's CLAUDE.md and instructions.md files. References to "the plugin" in this workflow refer to the current project being worked on.
18
+ </project_context>
19
+
20
+ <instructions>
21
+ ## Interactive Setup
22
+
23
+ **IMPORTANT**: Before starting, check if $ARGUMENTS is empty or just contains whitespace.
24
+
25
+ If $ARGUMENTS is empty, STOP and ask the user:
26
+ <prompt_template>
27
+ "What FreeScout ticket would you like me to implement? Please provide:
28
+ - A ticket number (e.g., 12345)
29
+ - A FreeScout ticket URL
30
+ - Or the ticket ID
31
+ - Optionally include additional context or suggestions after the ticket ID"
32
+ </prompt_template>
33
+
34
+ Wait for their response before proceeding.
35
+
36
+ ## Parse Arguments
37
+ <argument_parsing>
38
+ 1. **Extract ticket ID**: First argument should be the ticket ID or URL
39
+ 2. **Extract additional context**: Everything after the ticket ID is treated as additional context/suggestions
40
+ 3. **Store context**: Save any additional context to reference during implementation
41
+ </argument_parsing>
42
+ </instructions>
43
+
44
+ <setup_steps>
45
+ ## Setup Steps
46
+
47
+ <ticket_extraction>
48
+ 4. **Extract ticket ID from argument**:
49
+ - If numeric: Use directly as ticket ID
50
+ - If URL: Extract ticket ID from URL pattern
51
+ </ticket_extraction>
52
+
53
+ <api_integration>
54
+ 5. **Get ticket details via FreeScout API**:
55
+ ```bash
56
+ # Get conversation with threads included
57
+ curl -s -H "X-FreeScout-API-Key: $FREESCOUT_API_KEY" \
58
+ "$FREESCOUT_URL/api/conversations/$TICKET_ID?embed=threads" | jq '.'
59
+ ```
60
+
61
+ <api_response_structure>
62
+ **FreeScout API Response Structure**:
63
+ - `_embedded.threads[]`: Array of conversation messages
64
+ - `_embedded.threads[].type`: The type of message (note, customer, user)
65
+ - `_embedded.threads[].body`: HTML content of the message
66
+ - `_embedded.threads[].created_by_customer`: Boolean for customer messages
67
+ - `_embedded.customer`: Customer details (email, first_name, last_name)
68
+ - `status`: The status of the ticket (active, pending, closed, spam)
69
+ - `user_id`: Currently assigned user ID
70
+ </api_response_structure>
71
+ </api_integration>
72
+
73
+ <information_extraction>
74
+ 6. **Extract key information**:
75
+ - Customer email and name from `_embedded.customer`
76
+ - Issue description from customer messages (type=customer)
77
+ - Any code snippets or error messages from thread bodies
78
+ - Check internal notes (type=note) for mentions of testing done by a team member
79
+ - Extract any attachment URLs from `_embedded.threads[].attachments[]`
80
+ </information_extraction>
81
+
82
+ <attachment_handling>
83
+ 7. **Check for attachments**:
84
+ - If attachments exist, list them and ask user to provide local paths if needed
85
+ - Note any visual requirements or screenshots provided
86
+ </attachment_handling>
87
+ </setup_steps>
88
+
89
+ <testing_phase>
90
+ ## Testing Phase
91
+
92
+ <testing_decision>
93
+ 8. **Determine if testing is needed**:
94
+ - Skip if issue in ticket has already been confirmed reproducible by a team member
95
+ - Skip if customer provided their own code solution
96
+ - Otherwise, reproduce the issue:
97
+ <reproduction_steps>
98
+ a. Set up test environment based on ticket details
99
+ b. Use Playwright browser if UI testing is needed
100
+ c. Document reproduction steps
101
+ d. Take "before" screenshot if applicable
102
+ </reproduction_steps>
103
+ </testing_decision>
104
+ </testing_phase>
105
+
106
+ <analysis_and_planning>
107
+ ## Analysis & Planning
108
+
109
+ <code_research>
110
+ 9. **Search for related code**:
111
+ - Use ticket keywords to find relevant files
112
+ - For complex searches across multiple files, use Task tool to manage context
113
+ - Check for similar past issues or patterns
114
+ - Search for known limitations or third-party plugin conflicts
115
+ </code_research>
116
+
117
+ <issue_analysis>
118
+ 10. **Analyze the issue and plan solution**:
119
+ - Review ticket details, customer messages, and any provided context
120
+ <bug_classification>
121
+ - **First determine if this is a bug we can fix**:
122
+ - Is it a third-party plugin limitation (like Elementor copy/paste issues)?
123
+ - Is it expected behavior that needs clarification?
124
+ - Is it a configuration issue rather than a bug?
125
+ </bug_classification>
126
+ - If it's NOT a bug, skip to drafting explanatory reply
127
+ - If it IS a bug, identify root cause and plan implementation
128
+ - Consider multiple solution approaches
129
+ - Factor in any additional context provided by user
130
+ - Plan implementation strategy
131
+ </issue_analysis>
132
+
133
+ <solution_review>
134
+ 11. **Present solution for review**:
135
+ - STOP before implementing and present the proposed solution:
136
+ <solution_template>
137
+ ```
138
+ "Based on the ticket analysis, here's my proposed solution:
139
+
140
+ ## Issue Summary:
141
+ [Brief description of the problem]
142
+
143
+ ## Root Cause:
144
+ [What's causing the issue]
145
+
146
+ ## Proposed Solution:
147
+ [Detailed plan for the fix]
148
+
149
+ ## Files to Modify:
150
+ [List of files that will be changed]
151
+
152
+ ## Additional Context Considered:
153
+ [Reference any user-provided context]
154
+
155
+ ## Alternative Approaches:
156
+ [Other options considered]
157
+
158
+ Would you like me to proceed with this implementation, or do you have feedback/modifications? (proceed/modify)"
159
+ ```
160
+ </solution_template>
161
+ - Wait for user approval or feedback before continuing
162
+ - If user provides modifications, incorporate them into the plan
163
+ </solution_review>
164
+ </analysis_and_planning>
165
+
166
+ <alternative_workflow>
167
+ ## Alternative: Explanatory Reply (No Code Changes Needed)
168
+
169
+ <explanatory_reply>
170
+ **If the issue is NOT a plugin bug that can be fixed**, skip implementation and go directly to:
171
+
172
+ 11a. **Draft explanatory reply**:
173
+ <research_requirements>
174
+ - Research the actual cause (third-party limitations, expected behavior, etc.)
175
+ - Use WebSearch to find supporting evidence (GitHub issues, documentation, forums)
176
+ - Use WebFetch to examine specific issue pages or documentation
177
+ - Draft a clear explanation for the customer with specific evidence
178
+ - Include links to evidence and suggest workarounds if available
179
+ </research_requirements>
180
+ - Skip to step 18 to add the draft reply to FreeScout
181
+ </explanatory_reply>
182
+ </alternative_workflow>
183
+
184
+ <implementation>
185
+ ## Implementation
186
+
187
+ <fix_implementation>
188
+ 12. **Implement the fix** (only if this IS a plugin bug that can be fixed):
189
+ <implementation_requirements>
190
+ - Follow project coding standards (reference CLAUDE.md or instructions.md)
191
+ - Ensure backward compatibility
192
+ - Add appropriate error handling
193
+ </implementation_requirements>
194
+
195
+ <behavior_change_check>
196
+ - **Check for behavior changes**: If the implementation modifies existing functionality, STOP and ask:
197
+ <behavior_change_template>
198
+ ```
199
+ "This fix/feature will change existing behavior:
200
+ - Current behavior: [describe current functionality]
201
+ - New behavior: [describe what will change]
202
+ - Affected users: [who might be impacted]
203
+
204
+ This could affect customers who rely on the current behavior.
205
+ Should I proceed with this change? (y/n)
206
+
207
+ Alternative: [suggest a backward-compatible approach if possible]"
208
+ ```
209
+ </behavior_change_template>
210
+ - Only proceed with behavior changes after explicit approval
211
+ </behavior_change_check>
212
+ </fix_implementation>
213
+
214
+ <implementation_testing>
215
+ 13. **Test the implementation**:
216
+ <testing_requirements>
217
+ - Verify the fix resolves the issue
218
+ - Check for side effects
219
+ - Take "after" screenshot if UI-related
220
+ - Run `phpcbf` and `phpcs` on any modified files
221
+ </testing_requirements>
222
+ </implementation_testing>
223
+ </implementation>
224
+
225
+ <git_workflow>
226
+ ## Git Workflow with Worktrees
227
+
228
+ <worktree_setup>
229
+ 14. **Create dedicated worktree for this ticket**:
230
+ ```bash
231
+ # Create a new worktree WITHIN the project directory for Claude Code compatibility
232
+ BRANCH_NAME="fix/freescout-$TICKET_ID-brief-description"
233
+ WORKTREE_DIR="./worktrees/ticket-$TICKET_ID"
234
+
235
+ # Create worktrees directory if it doesn't exist
236
+ mkdir -p ./worktrees
237
+
238
+ # Create worktree from master branch within project directory
239
+ git worktree add "$WORKTREE_DIR" -b "$BRANCH_NAME" master
240
+
241
+ # Switch to the new worktree (staying within allowed directories)
242
+ cd "$WORKTREE_DIR"
243
+
244
+ echo "✅ Created worktree at: $WORKTREE_DIR"
245
+ echo "✅ Working on branch: $BRANCH_NAME"
246
+ echo "✅ This allows parallel development without affecting your main workspace"
247
+ echo "✅ Worktree is within project directory for Claude Code compatibility"
248
+
249
+ # Add worktrees directory to .gitignore if not already present
250
+ if ! grep -q "^worktrees/$" .gitignore 2>/dev/null; then
251
+ echo "worktrees/" >> .gitignore
252
+ echo "✅ Added worktrees/ to .gitignore"
253
+ fi
254
+ ```
255
+
256
+ <worktree_benefits>
257
+ **Benefits of using worktrees**:
258
+ - Work on multiple tickets simultaneously without branch switching
259
+ - Keep your main workspace clean and unaffected
260
+ - Test changes in isolation
261
+ - Maintain separate development environments
262
+ - Compatible with Claude Code's directory restrictions
263
+ - Organized within project structure (`./worktrees/ticket-ID/`)
264
+ </worktree_benefits>
265
+ </worktree_setup>
266
+ </git_workflow>
267
+
268
+ <commit_and_pr>
269
+ 15. **Commit changes with descriptive message**:
270
+ <commit_requirements>
271
+ - Reference the FreeScout ticket
272
+ - Describe what was fixed
273
+ - Include any breaking changes
274
+ - Include any areas that might need human testing
275
+ - Include any areas that might affect the functionality and require documentation updates
276
+ </commit_requirements>
277
+
278
+ 16. **Create Pull Request**:
279
+ ```bash
280
+ gh pr create --title "Fix: [Brief description] (FreeScout #$TICKET_ID)" \
281
+ --body "## Summary
282
+ Fixes issue reported in FreeScout ticket #$TICKET_ID: $FREESCOUT_URL/conversation/$TICKET_ID
283
+
284
+ ## Changes
285
+ - [List changes made]
286
+
287
+ ## Testing
288
+ - [Describe testing performed]
289
+
290
+ ## Areas for Human Testing
291
+ - [List areas that might need human testing]
292
+
293
+ ## Areas for Documentation Updates
294
+ - [List areas that might need documentation updates]
295
+
296
+ ## Customer Context
297
+ [Brief summary of customer's issue]
298
+
299
+ 🤖 Generated with Claude Code"
300
+ ```
301
+
302
+ 17. **Clean up worktree automatically**:
303
+ ```bash
304
+ # Return to main workspace
305
+ cd ../../
306
+
307
+ # Remove the worktree (frees up the branch for normal Git workflow)
308
+ git worktree remove "./worktrees/ticket-$TICKET_ID"
309
+
310
+ echo "✅ Worktree cleaned up - you can now use normal Git workflow for PR revisions"
311
+ echo "💡 To make changes: git checkout fix/freescout-$TICKET_ID-brief-description"
312
+ ```
313
+ </commit_and_pr>
314
+
315
+ <freescout_updates>
316
+ ## FreeScout Updates
317
+
318
+ <customer_reply_draft>
319
+ 18. **Draft customer reply**:
320
+ ```bash
321
+ REPLY_BODY="Hi [Customer Name],
322
+
323
+ Thanks. We were able to reproduce it on our end. We've implemented a fix that [briefly describe what was fixed].
324
+
325
+ The fix has been submitted for review and will be included in the next plugin update. You'll receive the update through WordPress's automatic update system.
326
+
327
+ Here's what was changed:
328
+ - [List key changes in user-friendly terms]
329
+
330
+ Please let me know if you have any questions!
331
+
332
+ Best regards,
333
+ Jack"
334
+ ```
335
+ </customer_reply_draft>
336
+
337
+ <api_updates>
338
+ 19. **Update ticket via API**:
339
+ <api_operations>
340
+ - Add a note (internal thread) with draft reply for Jack to review
341
+ - Set status to "active"
342
+ - Assign to Jack (user_id: 1)
343
+ </api_operations>
344
+
345
+ ```bash
346
+ # Add internal note with draft reply for Jack
347
+ # Use jq to properly format JSON with escaped characters
348
+ jq -n --arg text "Draft reply for customer:\n\n$REPLY_BODY" --argjson user 1 \
349
+ '{type: "note", text: $text, user: $user}' | \
350
+ curl -X POST -H "X-FreeScout-API-Key: $FREESCOUT_API_KEY" \
351
+ -H "Content-Type: application/json" \
352
+ "$FREESCOUT_URL/api/conversations/$TICKET_ID/threads" \
353
+ -d @-
354
+
355
+ # Update ticket status and assignment
356
+ curl -X PUT -H "X-FreeScout-API-Key: $FREESCOUT_API_KEY" \
357
+ -H "Content-Type: application/json" \
358
+ "$FREESCOUT_URL/api/conversations/$TICKET_ID" \
359
+ -d '{
360
+ "status": "active",
361
+ "assignTo": 1,
362
+ "byUser": 1
363
+ }'
364
+ ```
365
+ </api_updates>
366
+ </freescout_updates>
367
+
368
+ <completion>
369
+ ## Completion
370
+
371
+ <summary>
372
+ 20. **Provide summary** with:
373
+ <summary_requirements>
374
+ - Link to created PR
375
+ - Brief description of changes
376
+ - Confirmation that FreeScout ticket was updated
377
+ - Any follow-up actions needed
378
+ </summary_requirements>
379
+ </summary>
380
+
381
+
382
+
383
+ <documentation_updates>
384
+ 21. **Documentation Update Prompt**:
385
+ <documentation_scope>
386
+ - **Skip for bug fixes** - documentation updates are only needed for:
387
+ - New features or functionality
388
+ - Changes to existing behavior that affect how customers use the plugin
389
+ - Breaking changes (rare - should only happen with explicit user approval)
390
+ </documentation_scope>
391
+
392
+ - If this is a new feature or behavior change, ask user:
393
+ <documentation_prompt>
394
+ ```
395
+ "Would you like to update the documentation for this feature? (y/n)
396
+
397
+ The following areas may need documentation updates:
398
+ - [List from PR body's "Areas for Documentation Updates"]
399
+
400
+ Feature implemented: [Brief description]
401
+ Component affected: [Integration/Module/Core feature name]
402
+
403
+ Note: Bug fixes typically don't require documentation updates."
404
+ ```
405
+ </documentation_prompt>
406
+
407
+ - If user responds with 'y' or 'yes':
408
+ - Execute: `/update-docs [Component]: [Feature description] - [Relevant docs URL if known]`
409
+ - Example: `/update-docs MemberPress: Added support for course completion tags - [documentation URL]`
410
+ </documentation_updates>
411
+ </completion>
412
+
413
+ <implementation_notes>
414
+ ## Implementation Notes
415
+ <guidelines>
416
+ - Consider edge cases and backward compatibility
417
+ - Use the project's logging system for debugging (if available)
418
+ - Follow the coding standards in CLAUDE.md
419
+ - Track documentation needs during implementation for the prompt
420
+ - Leverage worktrees for parallel development without disrupting your main workspace
421
+ </guidelines>
422
+ </implementation_notes>
@@ -0,0 +1,7 @@
1
+ {
2
+ "folders": [
3
+ {
4
+ "path": ".."
5
+ }
6
+ ]
7
+ }
@@ -0,0 +1,60 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Edit",
5
+ "Write",
6
+ "MultiEdit",
7
+ "Read",
8
+ "Bash(composer:*)",
9
+ "Bash(npm:*)",
10
+ "Bash(gulp:*)",
11
+ "Bash(phpunit:*)",
12
+ "Bash(phpcs:*)",
13
+ "Bash(phpcbf:*)",
14
+ "Bash(phpstan:*)",
15
+ "Bash(git:*)",
16
+ "Bash(wp:*)",
17
+ "Bash(find:*)",
18
+ "Bash(grep:*)",
19
+ "Bash(cat:*)",
20
+ "Bash(ls:*)",
21
+ "Bash(mkdir:*)",
22
+ "Bash(cp:*)",
23
+ "Bash(mv:*)",
24
+ "Bash(rm:*)",
25
+ "Bash(chmod:*)",
26
+ "Bash(curl:*)",
27
+ "Bash(wget:*)",
28
+ "Bash(jq:*)",
29
+ "Bash(echo:*)",
30
+ "Bash(gh:*)",
31
+ "Bash(php -l:*)",
32
+ "WebFetch",
33
+ "WebFetch(domain:wpfusion.com)",
34
+ "WebSearch",
35
+ "Bash(curl -s \"https://wpfusion.com/wp-json/*\")",
36
+ "Bash(curl -u \"$WPF_DOCS_USER:$WPF_DOCS_PASSWORD\" \"https://wpfusion.com/wp-json/*\")",
37
+ "Bash(curl -H \"Authorization: Basic*\" \"https://wpfusion.com/wp-json/*\")",
38
+ "Bash(curl -s -H \"Authorization: Basic*\" \"$WPF_DOCS_URL/wp-json/*\")",
39
+ "Bash(curl -X POST:*)",
40
+ "Bash(curl -X PUT:*)",
41
+ "Bash(curl -X PATCH:*)",
42
+ "Bash(curl -H \"Content-Type: application/json\":*)",
43
+ "Bash(base64:*)",
44
+ "Bash(fi)",
45
+ "Bash(./vendor/bin/*)"
46
+ ],
47
+ "deny": [
48
+ "Bash(sudo:*)",
49
+ "Bash(su:*)",
50
+ "Bash(rm -rf /*)",
51
+ "Bash(format:*)",
52
+ "Bash(fdisk:*)"
53
+ ]
54
+ },
55
+ "env": {
56
+ "CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR": "true",
57
+ "DISABLE_COST_WARNINGS": "0",
58
+ "BASH_MAX_OUTPUT_LENGTH": "50000"
59
+ }
60
+ }
package/.gitattributes ADDED
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto