@kraftapps-ai/kai 1.1.2 → 1.3.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.
- package/kai +63 -0
- package/package.json +1 -1
package/kai
CHANGED
|
@@ -47,6 +47,55 @@ Add your project-specific context here. The more you provide, the better Kai per
|
|
|
47
47
|
EOF
|
|
48
48
|
fi
|
|
49
49
|
|
|
50
|
+
# ── Ensure Playwright MCP is available ────────────────
|
|
51
|
+
|
|
52
|
+
playwright_available=false
|
|
53
|
+
|
|
54
|
+
# Check if Playwright MCP is configured anywhere
|
|
55
|
+
for config in \
|
|
56
|
+
".mcp.json" \
|
|
57
|
+
".claude/settings.local.json" \
|
|
58
|
+
"$HOME/.claude/settings.local.json" \
|
|
59
|
+
"$HOME/.claude/settings.json"; do
|
|
60
|
+
if [ -f "$config" ] && grep -q "playwright" "$config" 2>/dev/null; then
|
|
61
|
+
playwright_available=true
|
|
62
|
+
break
|
|
63
|
+
fi
|
|
64
|
+
done
|
|
65
|
+
|
|
66
|
+
# Check Claude Code plugins
|
|
67
|
+
if [ "$playwright_available" = false ]; then
|
|
68
|
+
for plugin_dir in "$HOME/.claude/plugins"/*/external_plugins/playwright/; do
|
|
69
|
+
if [ -f "${plugin_dir}.mcp.json" ]; then
|
|
70
|
+
playwright_available=true
|
|
71
|
+
break
|
|
72
|
+
fi
|
|
73
|
+
done
|
|
74
|
+
fi
|
|
75
|
+
|
|
76
|
+
if [ "$playwright_available" = false ]; then
|
|
77
|
+
echo "Setting up Playwright browser testing..."
|
|
78
|
+
mkdir -p .playwright-mcp
|
|
79
|
+
|
|
80
|
+
# Add to project-level MCP config
|
|
81
|
+
if [ -f ".mcp.json" ]; then
|
|
82
|
+
# Merge with existing config
|
|
83
|
+
if ! grep -q "playwright" .mcp.json 2>/dev/null; then
|
|
84
|
+
jq '. + {"playwright": {"command": "npx", "args": ["@playwright/mcp@latest"]}}' .mcp.json > .mcp.json.tmp && mv .mcp.json.tmp .mcp.json
|
|
85
|
+
fi
|
|
86
|
+
else
|
|
87
|
+
cat > .mcp.json << 'MCPEOF'
|
|
88
|
+
{
|
|
89
|
+
"playwright": {
|
|
90
|
+
"command": "npx",
|
|
91
|
+
"args": ["@playwright/mcp@latest"]
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
MCPEOF
|
|
95
|
+
fi
|
|
96
|
+
echo " Playwright MCP configured in .mcp.json"
|
|
97
|
+
fi
|
|
98
|
+
|
|
50
99
|
# ── Create the implementation loop script ─────────────
|
|
51
100
|
|
|
52
101
|
cat > "$LOOP_SCRIPT" << 'LOOPEOF'
|
|
@@ -214,6 +263,7 @@ exec claude --system-prompt "You are Kai — an AI product manager and tech lead
|
|
|
214
263
|
3. **Run the dev loop** — Execute \`.kai/loop.sh\` to have an AI developer implement all stories autonomously
|
|
215
264
|
4. **Check progress** — Read kai.json and kai-progress.txt to report status
|
|
216
265
|
5. **Adjust the plan** — Edit stories, reprioritize, add new ones, reset failed ones
|
|
266
|
+
6. **Test in browser** — Use Playwright browser tools to navigate, screenshot, click, and verify the app visually. Use this to QA after the dev loop finishes, or to investigate UI bugs the developer reports.
|
|
217
267
|
|
|
218
268
|
## How stories work
|
|
219
269
|
|
|
@@ -221,6 +271,19 @@ Stories live in kai.json. Each has: id, title, description, acceptanceCriteria,
|
|
|
221
271
|
To add stories, edit kai.json directly using the Edit or Write tool.
|
|
222
272
|
To run implementation, execute: \`nohup .kai/loop.sh > .kai/loop.log 2>&1 &\` then monitor with \`tail -f .kai/loop.log\`
|
|
223
273
|
|
|
274
|
+
## Browser testing (Playwright)
|
|
275
|
+
|
|
276
|
+
You have access to browser tools via Playwright MCP. Use them to:
|
|
277
|
+
- Navigate to the app URL and take screenshots to verify UI
|
|
278
|
+
- Click through pages and test user flows
|
|
279
|
+
- Check for console errors, layout issues, broken elements
|
|
280
|
+
- Take before/after screenshots when fixing UI bugs
|
|
281
|
+
|
|
282
|
+
Key tools: browser_navigate, browser_take_screenshot, browser_snapshot, browser_click, browser_run_code
|
|
283
|
+
Use browser_snapshot (accessibility tree) for actions, browser_take_screenshot for visual verification.
|
|
284
|
+
|
|
285
|
+
When the developer asks you to test or QA the app, proactively navigate to every page and report what you find.
|
|
286
|
+
|
|
224
287
|
## Rules for good stories
|
|
225
288
|
- Each story: independently committable, 5-15 min of work
|
|
226
289
|
- Acceptance criteria must be objectively verifiable
|