# linhnguyendang-web/playwright-skill architecture

> Architecture diagram of the GitHub repository linhnguyendang-web/playwright-skill, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/linhnguyendang-web/playwright-skill
- Repository: https://github.com/linhnguyendang-web/playwright-skill

## Overview

Playwright Skill equips a coding agent to create and run task-specific browser automation: the agent loads the skill guidance, writes a script, and invokes the portable executor, which runs it with the skill’s Playwright dependency. Optional helpers cover browser setup, contexts, screenshots, cookie banners, and local dev-server detection; results include automation output and artifacts. The graph includes documented reference material and capabilities, but source excerpts do not show how SKILL.md or API_REFERENCE.md is consumed internally.

Main entry points: [`skills/playwright-skill/lib/helpers.js`](https://github.com/linhnguyendang-web/playwright-skill/blob/main/skills/playwright-skill/lib/helpers.js) (Automation Helpers), [`skills/playwright-skill/run.js`](https://github.com/linhnguyendang-web/playwright-skill/blob/main/skills/playwright-skill/run.js) (Universal Executor), [`skills/playwright-skill/package.json`](https://github.com/linhnguyendang-web/playwright-skill/blob/main/skills/playwright-skill/package.json) (Playwright Package), [`skills/playwright-skill/SKILL.md`](https://github.com/linhnguyendang-web/playwright-skill/blob/main/skills/playwright-skill/SKILL.md) (Skill Instructions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guidance["Agent Guidance"]
  node_skill["Skill Instructions<br/>[SKILL.md]"]
  node_api["API Reference<br/>[API_REFERENCE.md]"]
end

subgraph group_execution["Script Execution"]
  node_script["Custom Automation"]
  node_executor["Universal Executor<br/>[run.js]"]
  node_playwright["Playwright Package<br/>[package.json]"]
end

subgraph group_helpers["Browser Helpers"]
  node_helpers["Automation Helpers<br/>[helpers.js]"]
  node_browser["Browser Runtime"]
  node_devserver["Local Dev Servers"]
end

node_agent(("Coding Agent"))
node_target["Web Pages"]
node_results["Output and Artifacts"]

node_agent -->|"loads guidance"| node_skill
node_agent -.->|"consults reference"| node_api
node_agent -->|"writes automation"| node_script
node_script -->|"runs through"| node_executor
node_executor -->|"resolves dependency"| node_playwright
node_executor -->|"loads for eval"| node_helpers
node_executor -->|"spawns script"| node_script
node_helpers -->|"uses browser APIs"| node_playwright
node_helpers -->|"launches browser"| node_browser
node_helpers -->|"probes ports"| node_devserver
node_script -.->|"automates pages"| node_target
node_script -.->|"produces output"| node_results
node_helpers -->|"saves screenshots"| node_results

click node_skill "https://github.com/linhnguyendang-web/playwright-skill/blob/main/skills/playwright-skill/SKILL.md"
click node_api "https://github.com/linhnguyendang-web/playwright-skill/blob/main/skills/playwright-skill/API_REFERENCE.md"
click node_executor "https://github.com/linhnguyendang-web/playwright-skill/blob/main/skills/playwright-skill/run.js"
click node_playwright "https://github.com/linhnguyendang-web/playwright-skill/blob/main/skills/playwright-skill/package.json"
click node_helpers "https://github.com/linhnguyendang-web/playwright-skill/blob/main/skills/playwright-skill/lib/helpers.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_skill,node_api toneBlue
class node_script,node_executor,node_playwright toneAmber
class node_helpers,node_browser,node_devserver toneMint
class node_agent,node_target,node_results toneIndigo
```

## Components

### Agent Guidance

- [Skill Instructions](https://github.com/linhnguyendang-web/playwright-skill/blob/main/skills/playwright-skill/SKILL.md): `skills/playwright-skill/SKILL.md`
- [API Reference](https://github.com/linhnguyendang-web/playwright-skill/blob/main/skills/playwright-skill/API_REFERENCE.md): `skills/playwright-skill/API_REFERENCE.md`

### Script Execution

- **Custom Automation**
- [Universal Executor](https://github.com/linhnguyendang-web/playwright-skill/blob/main/skills/playwright-skill/run.js): `skills/playwright-skill/run.js`
- [Playwright Package](https://github.com/linhnguyendang-web/playwright-skill/blob/main/skills/playwright-skill/package.json): `skills/playwright-skill/package.json`

### Browser Helpers

- [Automation Helpers](https://github.com/linhnguyendang-web/playwright-skill/blob/main/skills/playwright-skill/lib/helpers.js): `skills/playwright-skill/lib/helpers.js`
- **Browser Runtime**
- **Local Dev Servers**

### Other components

- **Coding Agent**
- **Web Pages**
- **Output and Artifacts**

## Connections

- Coding Agent → Skill Instructions: loads guidance (evidence: `README.md`)
- Coding Agent → API Reference: consults reference (evidence: `README.md`)
- Coding Agent → Custom Automation: writes automation (evidence: `README.md`)
- Custom Automation → Universal Executor: runs through (evidence: `README.md`)
- Universal Executor → Playwright Package: resolves dependency (evidence: `skills/playwright-skill/run.js`)
- Universal Executor → Automation Helpers: loads for eval (evidence: `skills/playwright-skill/run.js`)
- Universal Executor → Custom Automation: spawns script (evidence: `skills/playwright-skill/run.js`)
- Automation Helpers → Playwright Package: uses browser APIs (evidence: `skills/playwright-skill/lib/helpers.js`)
- Automation Helpers → Browser Runtime: launches browser (evidence: `skills/playwright-skill/lib/helpers.js`)
- Automation Helpers → Local Dev Servers: probes ports (evidence: `skills/playwright-skill/lib/helpers.js`)
- Custom Automation → Web Pages: automates pages (evidence: `README.md`)
- Custom Automation → Output and Artifacts: produces output (evidence: `README.md`)
- Automation Helpers → Output and Artifacts: saves screenshots (evidence: `skills/playwright-skill/lib/helpers.js`)
