Browser devtools

From drvoss/everything-copilot-cli · View interactive version

Browser devtools is an AI agent skill from the GitHub repository drvoss/everything-copilot-cli. Use when verifying frontend behavior at runtime — DOM validation, network inspection, performance profiling with browser DevTools

How to use this skill

Skill file

Browser DevTools Testing

When to Use

Prerequisites

Workflow

1. DOM 상태 검증

// Console에서 실행
// 요소 존재 확인
document.querySelector('[data-testid="submit-button"]') !== null

// 요소 상태 확인
const btn = document.querySelector('button[type="submit"]');
console.log({
  disabled: btn.disabled,
  'aria-label': btn.getAttribute('aria-label'),
  visible: btn.offsetParent !== null
});

// 폼 데이터 확인
new FormData(document.querySelector('form')).entries().next()

2. 네트워크 탭으로 API 검증

확인 항목:

// fetch를 인터셉트해서 로깅
const originalFetch = window.fetch;
window.fetch = function(...args) {
  console.log('fetch:', args[0], args[1]);
  return originalFetch.apply(this, args);
};

3. Performance 탭 — Core Web Vitals 측정

// CLS 측정 (layout-shift)
new PerformanceObserver((list) => {
  let cls = 0;
  list.getEntries().forEach(entry => { if (!entry.hadRecentInput) cls += entry.value; });
  console.log('CLS:', cls);
}).observe({ entryTypes: ['layout-shift'] });

// LCP 측정
new PerformanceObserver((list) => {
  const entries = list.getEntries();
  const lcp = entries[entries.length - 1];
  console.log('LCP:', lcp.startTime, 'ms');
}).observe({ entryTypes: ['largest-contentful-paint'] });

// Long Task 측정 (INP 프록시)
new PerformanceObserver((list) => {
  list.getEntries().forEach(entry => {
    console.log('Long task:', entry.duration, 'ms');
  });
}).observe({ entryTypes: ['longtask'] }); // Chrome 지원; 다른 브라우저는 'long-animation-frame' 사용

목표치:

3-A. 재현 가능한 성능 게이트로 굳히기

브라우저 DevTools에서 병목을 찾았으면, 같은 문제를 CI에서도 다시 잡을 수 있게

반복 가능한 측정으로 굳힌다.

# Lighthouse CLI로 동일 경로를 반복 측정
npx lighthouse https://example.com --output=json --output-path=./lighthouse-report.json

확인 항목:

원칙:

4. Accessibility 탭

// axe-core를 콘솔에서 실행
// (axe-core CDN 주입 후)
axe.run().then(results => {
  results.violations.forEach(v => {
    console.error(v.id, v.description, v.nodes.map(n => n.html));
  });
});

5. Playwright 테스트로 전환

DevTools에서 검증한 선택자를 Playwright 테스트로 변환:

// DevTools에서 확인한 선택자로 테스트 작성
test('submit button is accessible', async ({ page }) => {
  await page.goto('/form');
  
  const btn = page.getByRole('button', { name: 'Submit' });
  await expect(btn).toBeVisible();
  await expect(btn).toBeEnabled();
await expect(btn).toHaveAttribute('type', 'submit');
});

With Chrome DevTools MCP (Automated)

If Chrome DevTools MCP is configured, Copilot can inspect the live browser runtime

directly. This mode is especially useful for:

Example prompts:

Use Chrome DevTools MCP to inspect the network requests for /api/users
and report any 4xx or 5xx responses.
Use Chrome DevTools MCP to inspect the checkout form DOM state,
verify the submit button accessibility attributes, and summarize any issues.

When available, use automation as an accelerator for reproducing issues and gathering

evidence quickly — not as a replacement for understanding the manual DevTools workflow.

Additional tips:

references/performance-checklist.md

references/accessibility-checklist.md

How do I use Chrome DevTools to profile React rendering bottlenecks? use context7

Common Rationalizations

| Rationalization | Reality |

|----------------|---------|

| "유닛 테스트가 통과했으니 브라우저에서도 된다" | 렌더링, 레이아웃, 네트워크 타이밍은 유닛 테스트로 잡을 수 없다. |

| "로컬에서 잘 되면 됐다" | 성능 문제는 실제 네트워크 조건에서 나타난다. DevTools의 throttling을 사용한다. |

| "스크린샷으로 충분하다" | 스크린샷은 DOM 상태, 접근성, 성능을 보여주지 않는다. |

Red Flags

Verification

Tips

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.