| ํญ๋ชฉ | ๋ด์ฉ |
|---|---|
| Invoke | /jaspr-web:setup |
| Category | cocode-web |
| Complexity | simple |
/jaspr-web setup โ ์น ์๋ํ ๋๊ตฌ ์ค์นยท์ฐ๊ฒฐ#
ํ๋ง๋๋ก#
์น ํ์ด์ง๋ฅผ ์๋์ผ๋ก ์ด์ด๋ณด๊ณ ํด๋ฆญยทํ์ธํ๋ ๋ ๊ฐ์ง ๋๊ตฌ(Playwright, Chrome DevTools)๋ฅผ ์ฒ์ ํ ๋ฒ๋ง ์ค์นํ๊ณ ์ฐ๊ฒฐํ๋ ๋จ๊ณ์ ๋๋ค. ์ ์ฌ๋ฌด์ค์ ๋ค์ด๊ฐ์ ํ๋ฆฐํฐ์ ๋ชจ๋ํฐ๋ฅผ ์ปดํจํฐ์ ์ฐ๊ฒฐํ๋ ๊ฒ๊ณผ ๊ฐ์ "์ด๊ธฐ ์ ์ "์ด์์.
๋๊ฐยท์ธ์ ์ฐ๋์#
- cocode ์น์ฌ์ดํธ(
coui.cocode.im๋ฑ)๋ฅผ ์๋์ผ๋ก ๊ฒ์ฌยทํ ์คํธํ๋ ค๋ ์ฌ๋์ด - ๋ค๋ฅธ
/jaspr-web๋ช ๋ น(audit, match ๋ฑ)์ ์ฒ์ ์ฐ๊ธฐ ์ง์ ์, ๋ฑ ํ ๋ฒ๋ง ์คํํฉ๋๋ค.
๐ ์ด๋ฏธ ๋ ๋๊ตฌ๊ฐ ์ฐ๊ฒฐ๋ผ ์๋ค๋ฉด ๋ค์ ํ ํ์ ์์ต๋๋ค.
๋ฌด์์ ํด์ฃผ๋์#
- Playwright MCP โ ์น ํ์ด์ง๋ฅผ ์๋์ผ๋ก ์ด๊ณ ์กฐ์ํ๋ ๋๊ตฌ๋ฅผ Claude์ ์ฐ๊ฒฐํฉ๋๋ค(์ฒ์ ์คํ ์ ๋ธ๋ผ์ฐ์ ํ์ผ ์ฝ 300MB๋ ํจ๊ป ์ค์น).
- Chrome DevTools MCP (์ ํ) โ ํฌ๋กฌ ๋ธ๋ผ์ฐ์ ์ ๊ฐ๋ฐ์ ๋๊ตฌ๋ฅผ ํจ๊ป ์ฐ๊ฒฐํฉ๋๋ค.
- ์ฐ๊ฒฐ ํ์ธ โ ๋ ๋๊ตฌ๊ฐ ์ ๋๋ก ๋ถ์๋์ง(
โ connected) ์ ๊ฒํ๊ณ , ๊ฐ๋ณ๊ฒ ํ ๋ฒ ๋๋ ค๋ด ๋๋ค. -
์ ๋์๊ฐ๋ฉด ๊ฒฐ๊ณผ๋ฌผ๋ก
.claude/docs/jaspr-web/<์๊ฐ>/inventory/index.jsonํ์ผ์ด ์๊ธฐ๋๋ฐ, ๋๋ฉ ํ์ด์ง์์ ๋ณด์ด๋ CoUI ์์ ๋ชฉ๋ก์ด ๋ด๊น๋๋ค.
์ด๋ป๊ฒ ์ฐ๋์#
# 1. Playwright ๋๊ตฌ ์ฐ๊ฒฐ
claude mcp add --transport stdio playwright -- npx -y @playwright/mcp@latest
# (์ ํ) ๋ธ๋ผ์ฐ์ ํ์ผ ๋ฏธ๋ฆฌ ๋ฐ์๋๊ธฐ
npx -y playwright install
# 2. Chrome DevTools ๋๊ตฌ ์ฐ๊ฒฐ (์ ํ, ๊ถ์ฅ)
claude mcp add --transport stdio chrome-devtools -- npx -y chrome-devtools-mcp@latest
# 3. ๋ ๋๊ตฌ๊ฐ ์ ์ฐ๊ฒฐ๋๋์ง ํ์ธ
claude mcp list | grep -E " playwright|chrome-devtools "
# ๊ฐ๋ณ๊ฒ ํ ๋ฒ ๋๋ ค๋ณด๊ธฐ
/jaspr-web audit --url=https://coui.cocode.im --depth=0
CI(์๋ํ ์๋ฒ)์์ ํ๋ฉด ์์ด ๋๋ฆด ๋๋ ๋๊ตฌ ์ธ์์ --headless=true๋ฅผ ๋๊ธฐ๋ฉด ๋ฉ๋๋ค.
์์์ ๋ฌด์จ ์ผ์ด ๋ฒ์ด์ง๋์#
- Playwright ์ฐ๊ฒฐ โ ์น ์๋ํ ๋๊ตฌ๋ฅผ ๋ฑ๋กํ๊ณ , ์ฒ์์ด๋ผ๋ฉด ๋ธ๋ผ์ฐ์ ํ์ผ(์ฝ 300MB)๋ ๋ฐ์ต๋๋ค.
- Chrome DevTools ์ฐ๊ฒฐ (์ ํ) โ ๋ก์ปฌ ํฌ๋กฌ์ด ํ์ํ๋ฉฐ, ๊ธฐ๋ณธ์ ์ฐฝ์ด ๋ณด์ด๋ ๋ชจ๋๋ก ๋น๋๋ค.
-
์ฐ๊ฒฐ ์ ๊ฒ โ ๋ ๋๊ตฌ ๋ชจ๋
โ connected๋ก ๋์ค๋์ง ํ์ธํ๊ณ , ์ํ audit์ ํ ๋ฒ ์คํํด ๊ฒฐ๊ณผ ํ์ผ์ด ์๊ธฐ๋์ง ๋ด ๋๋ค. -
(์ ํ) Flutter Web ์ฐ๋ โ Jaspr ํ์ด์ง ์์ Flutter ์์ ฏ๊น์ง ์๋ ์กฐ์ํ๋ ค๋ฉด, ํด๋น ์๋ฒ ๋์
main()์ semantics๋ฅผ ์ผ๋ ์ฝ๋๋ฅผ ์ถ๊ฐํฉ๋๋ค.
โ๏ธ ์์ธ ์ต์ ยท์คํ ๋ช ์ธ (๊ฐ๋ฐ์ / AI ์์ด์ ํธ์ฉ)
1. Playwright MCP#
# Register with Claude Code (downloads npm package on first invocation)
claude mcp add --transport stdio playwright -- npx -y @playwright/mcp@latestFirst call also installs Playwright's browser binaries (~300MB). To pre-install:
npx -y playwright install2. Chrome DevTools MCP (optional but recommended)#
claude mcp add --transport stdio chrome-devtools -- npx -y chrome-devtools-mcp@latestRequires a local Chrome / Chromium. The MCP launches a headed window by default; pass --headless=true in args if running on CI.
3. Sanity check#
claude mcp list | grep -E " playwright|chrome-devtools "
# expected:
# playwright โ connected
# chrome-devtools โ connectedQuick smoke:
/jaspr-web audit --url=https://coui.cocode.im --depth=0Expected to produce .claude/docs/jaspr-web/<ts>/inventory/index.json listing CoUI selectors visible on the landing page.
4. (Optional) Enable Flutter Web semantics on cocode embeds#
If you want Playwright to interact with Flutter Web widgets inside a Jaspr page (e.g. for coui.cocode.im/live-preview-poc), the Flutter Web embed must enable semantics. Add to the embed's main():
import 'package:flutter/semantics.dart';
void main() {
SemanticsBinding.instance.ensureSemantics();
runApp(const LivePreviewApp());
}
This adds a hidden <flt-semantics-host> DOM tree that mirrors the Flutter widget hierarchy, so selectors like [aria-label="Primary"] resolve into Flutter widgets.
Platform Notes#
- Headless mode: pass
--headless=truein.mcp.jsonargs for both servers. - CI: ensure Node 18+ and the browsers cache (
~/.cache/ms-playwright) is persisted between runs. - Networking:
coui.cocode.imis public โ no auth needed. For staging deployments, wire credentials via Playwright'sstorageStateand load it once withbrowser_set_storage_state.