Skip to content
Back to skills

Plans

ASecurity

> Date: 2026-10-22 > Author: Supergraph Core Engineer > Objective: Nâng cấp toàn diện skill `browser-agent`, templates ma trận kiểm thử ISTQB và script khởi tạo `init-qa.sh` nhằm khắc phục xung đột session giữa các agent worker song song, sửa bảng công cụ MCP, hỗ trợ WebMCP, kiểm thử tự động Accessibility (axe-core WCAG 2.1 AA), đo lường Web Vitals / React Hydration và quay video bằng chứng tái hiện lỗi (repro video). ---

  • 23 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 9, 2026
ai-agentsrustshellbashreactnodegitfullstack

Works with

  • cursor
  • mcp

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned November 9, 2026

npx -y skills add datit309/supergraph --skill plans --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Plans?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Plans
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/datit309-plans-supergraph/badge)](https://www.skillsdirectory.com/skills/datit309-plans-supergraph)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Plan: Cải tiến Skill browser-agent (Native Rust CDP & ISTQB QA Engine)

> Date: 2026-10-22
> Author: Supergraph Core Engineer
> Objective: Nâng cấp toàn diện skill `browser-agent`, templates ma trận kiểm thử ISTQB và script khởi tạo `init-qa.sh` nhằm khắc phục xung đột session giữa các agent worker song song, sửa bảng công cụ MCP, hỗ trợ WebMCP, kiểm thử tự động Accessibility (axe-core WCAG 2.1 AA), đo lường Web Vitals / React Hydration và quay video bằng chứng tái hiện lỗi (repro video).

---

## Architecture & Contracts

### 1. Session Isolation Invariant
Mọi lệnh thực thi `agent-browser` hoặc công cụ MCP `agent_browser_*` trong môi trường Supergraph Team (đa worker, song song trên Git Worktree) **bắt buộc** phải sử dụng session định danh cô lập:
```bash
export AGENT_BROWSER_SESSION="$(agent-browser session id --scope worktree --prefix sg-task)"
```
Khi dùng chung CDP port (`--cdp`): phải kích hoạt `--pin-tab` để session gắn chặt vào tab riêng, tránh cướp tab của worker khác.

### 2. WebMCP First Discovery Contract
Khi mở URL, agent kiểm tra danh mục WebMCP trước khi thao tác DOM:
- Nếu trang web expose tool phù hợp mục tiêu kiểm thử: gọi trực tiếp qua `webmcp list` / `webmcp invoke`.
- Nếu không có WebMCP: chuyển sang tương tác DOM qua `snapshot -i`.

### 3. Token Efficiency Invariant
- Sử dụng `snapshot -i --delta` sau thao tác đầu tiên để chỉ nhận phần thay đổi, giảm ~80% context tokens.
- Sử dụng `screenshot --if-changed` để bỏ qua ảnh trùng lặp.
- Sử dụng `-s "<css-selector>"` khi cần scope vào component cụ thể.

### 4. Non-Functional Verification Standards
- **Accessibility:** 0 vi phạm nghiêm trọng chuẩn WCAG 2.1 AA (`agent-browser a11y --tags wcag2a,wcag2aa`).
- **Web Vitals:** LCP < 2.5s, CLS < 0.1, TTFB < 800ms, 0 cảnh báo React Hydration Mismatch (`agent-browser vitals`).
- **Evidence:** Defect tương tác (interactive/behavioral) bắt buộc có video `.webm` (`agent-browser record start ... --cursor --contact-sheet`). Defect tĩnh (static/layout) dùng ảnh chụp annotate.

---

## Environment Context
- **Language / Runtime:** Node.js (ESM) / Bash
- **Test Command:** `node --test plugins/supergraph/tests/*.mjs`
- **Lint Command:** `bash -n plugins/supergraph/skills/browser-agent/scripts/init-qa.sh`
- **Branch:** `master`
- **MCP Servers:** `supergraph-browser`, `codebase-memory`, `serena`, `supergraph-team`

---

## Task 1: Overhaul browser-agent SKILL.md specification
Wave: 1
Status: pending
Risk: medium
Dependencies: none
Model: inherit

Files:
- Modify: plugins/supergraph/skills/browser-agent/SKILL.md
- Test: plugins/supergraph/tests/test-browser-agent-skill.mjs

Blast radius:
- plugins/supergraph/skills/browser-agent/SKILL.md
- plugins/supergraph/skills/integration/SKILL.md

Acceptance:
- Bảng Available Tools map chính xác các typed MCP tools (`agent_browser_console`, `agent_browser_errors`, `agent_browser_network_requests`, `agent_browser_a11y`, `agent_browser_vitals`, `agent_browser_record_start`, `agent_browser_record_stop`, `agent_browser_diff_screenshot`, `agent_browser_set_viewport`, `agent_browser_set_media`, `agent_browser_react_tree`).
- Quy định bắt buộc Session Isolation (`AGENT_BROWSER_SESSION` và `--pin-tab`) cho Supergraph Team.
- Hướng dẫn WebMCP discovery & invocation pattern.
- Hướng dẫn tối ưu token (`--delta`, `-c`, `-s`, `--if-changed`).
- Quy chuẩn Wait (loại bỏ khuyến nghị bare `wait <ms>` và `networkidle` trap).
- Bổ sung quy trình kiểm thử A11y (axe-core WCAG 2.1 AA) và Web Vitals.

TDD:
- Behavior: `test-browser-agent-skill.mjs` kiểm tra nội dung `SKILL.md` chứa đầy đủ các contract mới (session isolation, typed MCP tools, webmcp, a11y, vitals).
- Test file: plugins/supergraph/tests/test-browser-agent-skill.mjs
- Test name: browser-agent SKILL.md contract & MCP tool mapping
- 🔴 RED command: node --test plugins/supergraph/tests/test-browser-agent-skill.mjs
- Expected 🔴 RED failure: Missing test file or missing contract assertions in SKILL.md
- Minimal 🟢 GREEN change: Tạo test trước và cập nhật `SKILL.md` đáp ứng toàn bộ assertions.
- Refactor candidates: Giữ định dạng markdown mạch lạc, súc tích, theo phong cách Supergraph.
- Mocking: none

Steps:
1. 🔴 RED: Viết `plugins/supergraph/tests/test-browser-agent-skill.mjs` kiểm tra các hợp đồng văn bản của SKILL.md và templates.
   Command: node --test plugins/supergraph/tests/test-browser-agent-skill.mjs
   Expected: FAIL (file chưa tồn tại hoặc test fail)
2. 🟢 GREEN: Viết nội dung mới chuẩn hóa cho `plugins/supergraph/skills/browser-agent/SKILL.md`.
   Command: node --test plugins/supergraph/tests/test-browser-agent-skill.mjs
   Expected: PASS phần test cho SKILL.md
3. REFACTOR: Rà soát từ ngữ kỹ thuật, đảm bảo không có filler words.
4. VERIFY:
   - npm test

Checkpoint:
- Files: plugins/supergraph/skills/browser-agent/SKILL.md plugins/supergraph/tests/test-browser-agent-skill.mjs
- Commit: docs(browser-agent): overhaul skill spec with session isolation, webmcp, and full mcp tools

---

## Task 2: Upgrade QA Templates with Accessibility, Web Vitals & Video Repro
Wave: 2
Status: pending
Risk: low
Dependencies: Task 1
Model: flash

Files:
- Modify: plugins/supergraph/skills/browser-agent/templates/test-matrix-template.md
- Modify: plugins/supergraph/skills/browser-agent/templates/test-matrix-fullstack-template.md
- Modify: plugins/supergraph/skills/browser-agent/templates/bug-report-template.md
- Test: plugins/supergraph/tests/test-browser-agent-skill.mjs

Blast radius:
- plugins/supergraph/skills/browser-agent/templates/*

Acceptance:
- `test-matrix-template.md` có thêm test case Accessibility WCAG 2.1 AA (`TC-{{PREFIX}}-008`), Responsive Mobile Viewport (`TC-{{PREFIX}}-009`), và mục kiểm tra Web Vitals (CLS/LCP) trong Checklist.
- `test-matrix-fullstack-template.md` được bổ sung phần Accessibility & Web Vitals tương ứng.
- `bug-report-template.md` hỗ trợ đính kèm video tái hiện lỗi (`.webm` với `--cursor --contact-sheet`) cho các lỗi tương tác (Interactive Bugs), tách bạch với ảnh tĩnh cho lỗi hiển thị (Static Bugs).

TDD:
- Behavior: `test-browser-agent-skill.mjs` kiểm tra các template chứa placeholder và cấu trúc video repro, a11y, vitals.
- Test file: plugins/supergraph/tests/test-browser-agent-skill.mjs
- Test name: QA templates contain a11y, vitals and video repro sections
- 🔴 RED command: node --test plugins/supergraph/tests/test-browser-agent-skill.mjs
- Expected 🔴 RED failure: Assertion fails for missing sections in templates
- Minimal 🟢 GREEN change: Bổ sung các section vào 3 file template.
- Refactor candidates: none
- Mocking: none

Steps:
1. 🔴 RED: Mở rộng test assertion trong `test-browser-agent-skill.mjs` cho các template.
   Command: node --test plugins/supergraph/tests/test-browser-agent-skill.mjs
   Expected: FAIL (template thiếu các mục mới)
2. 🟢 GREEN: Cập nhật `test-matrix-template.md`, `test-matrix-fullstack-template.md`, `bug-report-template.md`.
   Command: node --test plugins/supergraph/tests/test-browser-agent-skill.mjs
   Expected: PASS
3. REFACTOR: Đảm bảo bảng ma trận căn lề chuẩn markdown.
4. VERIFY:
   - npm test

Checkpoint:
- Files: plugins/supergraph/skills/browser-agent/templates/*
- Commit: feat(browser-agent): add a11y, vitals, and video repro to qa templates

---

## Task 3: Enhance init-qa.sh with Dev Server Auto-Detection
Wave: 3
Status: pending
Risk: low
Dependencies: Task 2
Model: inherit

Files:
- Modify: plugins/supergraph/skills/browser-agent/scripts/init-qa.sh
- Test: plugins/supergraph/tests/test-browser-agent-skill.mjs

Blast radius:
- plugins/supergraph/skills/browser-agent/scripts/init-qa.sh

Acceptance:
- `init-qa.sh` tự động quét các port phổ biến (`3000`, `5173`, `8080`, `4321`, `8000`) khi target-url không được truyền vào hoặc đang ở default.
- Điền đúng port đang active vào ma trận thay vì cố định gán `3000`.
- Cập nhật số lượng testcase mặc định (`TOTAL_TC`) phản ánh đúng số lượng test case mới (bao gồm A11y & Responsive).
- Hỗ trợ scaffold trường video repro trong lệnh `init-qa.sh bug`.
- Chạy qua kiểm tra cú pháp bash: `bash -n plugins/supergraph/skills/browser-agent/scripts/init-qa.sh`.

TDD:
- Behavior: Chạy thử `init-qa.sh matrix sample ui` sinh ra file ma trận có đủ TC a11y/vitals, và `init-qa.sh bug` sinh ra bug report có trường video.
- Test file: plugins/supergraph/tests/test-browser-agent-skill.mjs
- Test name: init-qa.sh generation and port probe integration
- 🔴 RED command: node --test plugins/supergraph/tests/test-browser-agent-skill.mjs
- Expected 🔴 RED failure: TOTAL_TC mismatch or video section missing
- Minimal 🟢 GREEN change: Nâng cấp script `init-qa.sh`.
- Refactor candidates: Dùng subshell an toàn, xử lý biến quote đầy đủ.
- Mocking: none

Steps:
1. 🔴 RED: Thêm test case chạy `init-qa.sh` vào `test-browser-agent-skill.mjs`.
   Command: node --test plugins/supergraph/tests/test-browser-agent-skill.mjs
   Expected: FAIL
2. 🟢 GREEN: Viết logic auto-probe port và cập nhật template substitution trong `init-qa.sh`.
   Command: node --test plugins/supergraph/tests/test-browser-agent-skill.mjs
   Expected: PASS
3. REFACTOR: Dọn dẹp file tạm tạo ra trong test.
4. VERIFY:
   - bash -n plugins/supergraph/skills/browser-agent/scripts/init-qa.sh
   - npm test

Checkpoint:
- Files: plugins/supergraph/skills/browser-agent/scripts/init-qa.sh
- Commit: feat(browser-agent): add port auto-detection and video repro scaffold to init-qa.sh

Files in this skill

  • 2026-06-10-serena-integration.md13.7 KB
  • 2026-07-05-multi-platform-support.md12.8 KB
  • 2026-07-06-codex-marketplace-install.md6.3 KB
  • 2026-07-06-opencode-support.md5.7 KB
  • 2026-07-10-codebase-memory-migration.md47.5 KB
  • 2026-07-11-fix-windows-hook-bash-resolution.md3.6 KB
  • 2026-07-11-refresh-plugin-documentation.md3.8 KB
  • 2026-07-12-codex-hook-contract-audit.md9.1 KB
  • 2026-07-12-codex-marketplace-name.md2.7 KB
  • 2026-07-12-user-prompt-submit-json.md3.1 KB
  • 2026-07-13-one-command-plugin-installer.md11.3 KB
  • 2026-07-13-platform-update-notification.md6.9 KB
  • 2026-08-26-review-speed.md6.6 KB
  • 2026-08-26-subagent-trim.md6.8 KB
  • 2026-08-26-token-trim-safe.md10.4 KB
  • 2026-08-27-caveman-always-on.md3.3 KB
  • 2026-08-27-perf-skills.md12.2 KB
  • 2026-09-04-sdd-skill.md6.5 KB
  • 2026-09-04-wave-parallelism.md4.8 KB
  • 2026-09-16-codebase-memory-0-10-8-compatibility.md12.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.