cc-dev-template 0.1.31 → 0.1.32
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/package.json
CHANGED
|
@@ -79,8 +79,8 @@ if [ "$__size" -gt "$__max" ]; then
|
|
|
79
79
|
|
|
80
80
|
echo "=== OUTPUT TRUNCATED (${__lines} lines, ~${__tokens} tokens) ==="
|
|
81
81
|
echo ""
|
|
82
|
-
echo "--- First
|
|
83
|
-
head -n
|
|
82
|
+
echo "--- First 5 lines ---"
|
|
83
|
+
head -n 5 "$__tmpfile"
|
|
84
84
|
echo ""
|
|
85
85
|
echo "--- Last 5 lines ---"
|
|
86
86
|
tail -n 5 "$__tmpfile"
|
|
@@ -4,7 +4,7 @@ MCP server that spawns a Claude sub-agent for frontend visual inspection.
|
|
|
4
4
|
|
|
5
5
|
## Problem
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Playwright MCP adds ~20k tokens to context just from tool definitions, even when browser inspection isn't needed. This wastes context in long sessions.
|
|
8
8
|
|
|
9
9
|
## Solution
|
|
10
10
|
|
|
@@ -15,11 +15,13 @@ Main Conversation (~500 tokens)
|
|
|
15
15
|
│
|
|
16
16
|
└── mcp__qa__inspect_frontend
|
|
17
17
|
│
|
|
18
|
-
└── Sub-agent with
|
|
18
|
+
└── Sub-agent with @playwright/mcp (full browser control)
|
|
19
19
|
│
|
|
20
20
|
└── Returns QA report
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
**Note:** No system Chrome installation is required. Playwright automatically downloads and manages its own Chromium browser.
|
|
24
|
+
|
|
23
25
|
## Installation
|
|
24
26
|
|
|
25
27
|
```bash
|
|
@@ -50,10 +52,10 @@ Or in `~/.claude.json`:
|
|
|
50
52
|
|
|
51
53
|
## After Setup
|
|
52
54
|
|
|
53
|
-
Remove
|
|
55
|
+
Remove Playwright MCP from your main config to save tokens (if previously added):
|
|
54
56
|
|
|
55
57
|
```bash
|
|
56
|
-
claude mcp remove
|
|
58
|
+
claude mcp remove playwright
|
|
57
59
|
```
|
|
58
60
|
|
|
59
61
|
## Usage
|
|
@@ -94,11 +96,11 @@ The sub-agent will:
|
|
|
94
96
|
|
|
95
97
|
## Sub-agent Capabilities
|
|
96
98
|
|
|
97
|
-
The spawned sub-agent uses Opus (best visual understanding) and has access to:
|
|
99
|
+
The spawned sub-agent uses Opus (best visual understanding) and has access to Playwright MCP tools:
|
|
98
100
|
|
|
99
|
-
- **Navigation**:
|
|
100
|
-
- **Inspection**:
|
|
101
|
-
- **Interaction**:
|
|
101
|
+
- **Navigation**: browser_navigate, browser_tab_new, browser_tab_list, browser_tab_select, browser_wait_for
|
|
102
|
+
- **Inspection**: browser_screenshot, browser_snapshot, browser_console_messages
|
|
103
|
+
- **Interaction**: browser_click, browser_type, browser_hover, browser_press_key, browser_handle_dialog
|
|
102
104
|
|
|
103
105
|
## Token Savings
|
|
104
106
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* This server exposes a single `inspect_frontend` tool that:
|
|
6
6
|
* 1. Takes a URL and task description
|
|
7
|
-
* 2. Spawns a Claude sub-agent with
|
|
7
|
+
* 2. Spawns a Claude sub-agent with Playwright MCP access
|
|
8
8
|
* 3. The sub-agent navigates, screenshots, clicks, and inspects
|
|
9
9
|
* 4. Returns a structured QA report
|
|
10
10
|
*
|
|
@@ -110,16 +110,17 @@ Task: ${task}
|
|
|
110
110
|
**Context:** A developer needs verification that this frontend is working correctly. Your assessment helps them catch issues before users do.
|
|
111
111
|
|
|
112
112
|
**Available tools:**
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
113
|
+
- browser_navigate: Go to the URL
|
|
114
|
+
- browser_take_screenshot: See the visual state (use this to understand what the page looks like)
|
|
115
|
+
- browser_click: Click elements
|
|
116
|
+
- browser_fill: Fill form fields
|
|
117
|
+
- browser_get_text: Read page content
|
|
118
|
+
- browser_wait_for: Wait for elements or conditions
|
|
118
119
|
|
|
119
120
|
**Success criteria:** Provide a clear QA report covering visual state, console errors, task completion, and overall pass/fail assessment.
|
|
120
121
|
`;
|
|
121
122
|
|
|
122
|
-
// Spawn sub-agent with
|
|
123
|
+
// Spawn sub-agent with Playwright MCP access
|
|
123
124
|
const result = query({
|
|
124
125
|
prompt: taskPrompt,
|
|
125
126
|
options: {
|
|
@@ -127,30 +128,22 @@ Task: ${task}
|
|
|
127
128
|
cwd: process.cwd(),
|
|
128
129
|
systemPrompt: QA_SYSTEM_PROMPT,
|
|
129
130
|
mcpServers: {
|
|
130
|
-
"
|
|
131
|
+
"playwright": {
|
|
131
132
|
command: "npx",
|
|
132
|
-
args: ["
|
|
133
|
+
args: ["@playwright/mcp@latest", "--vision", "--headless"],
|
|
133
134
|
},
|
|
134
135
|
},
|
|
135
136
|
allowedTools: [
|
|
136
|
-
|
|
137
|
-
"
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
"
|
|
141
|
-
"
|
|
142
|
-
|
|
143
|
-
"
|
|
144
|
-
"
|
|
145
|
-
"
|
|
146
|
-
"mcp__chrome-devtools__get_console_message",
|
|
147
|
-
// Interaction
|
|
148
|
-
"mcp__chrome-devtools__click",
|
|
149
|
-
"mcp__chrome-devtools__fill",
|
|
150
|
-
"mcp__chrome-devtools__fill_form",
|
|
151
|
-
"mcp__chrome-devtools__hover",
|
|
152
|
-
"mcp__chrome-devtools__press_key",
|
|
153
|
-
"mcp__chrome-devtools__handle_dialog",
|
|
137
|
+
"mcp__playwright__browser_navigate",
|
|
138
|
+
"mcp__playwright__browser_click",
|
|
139
|
+
"mcp__playwright__browser_fill",
|
|
140
|
+
"mcp__playwright__browser_take_screenshot",
|
|
141
|
+
"mcp__playwright__browser_wait_for",
|
|
142
|
+
"mcp__playwright__browser_get_text",
|
|
143
|
+
"mcp__playwright__browser_hover",
|
|
144
|
+
"mcp__playwright__browser_press_key",
|
|
145
|
+
"mcp__playwright__browser_scroll",
|
|
146
|
+
"mcp__playwright__browser_get_url",
|
|
154
147
|
],
|
|
155
148
|
},
|
|
156
149
|
});
|