browser-setup
Interactive wizard that wires up @playwright/mcp end-to-end — detects the user's browsers, walks through Playwright MCP Bridge extension install, captures the per-install token, registers the MCP server in the AIWG registry with --extension and the env block, injects into the active provider's config, and verifies the connection.
What this skill does
# Browser Setup Skill (DRAFT)
> Status: DRAFT — scaffolded from PoC. Implementation pending Inception outputs.
## Purpose
End-to-end interactive wizard that takes a user from "AIWG agent can't drive a browser" to "AIWG agent is connected to my real, logged-in browser via the Playwright MCP Bridge extension" without the user needing to know the underlying MCP plumbing, token semantics, or AIWG CLI surface.
## When This Skill Applies
- User asks the agent to "open a website" or "log into X for me" and AIWG detects no browser MCP is configured
- User explicitly requests browser-control setup
- `browser-doctor` reports the addon is installed but unwired
## Inputs
| Field | Source | Notes |
|---|---|---|
| Provider | `aiwg runtime-info` | Auto-detect; user can override |
| Target browser | OS-specific detection | Recommend based on `--extension` support |
| Token | Interactive (AskUserQuestion) | Pasted by user after installing extension |
## Walkthrough (planned)
### Step 1: Pre-flight
Confirm AIWG is initialized in the workspace and the active provider supports MCP servers with `env` blocks. Bail with explicit guidance if not.
### Step 2: Detect installed browsers
Linux:
- `which google-chrome google-chrome-stable microsoft-edge microsoft-edge-stable chromium chromium-browser brave-browser vivaldi opera`
- `flatpak list --app 2>/dev/null | grep -iE 'chrome|chromium|edge|brave|vivaldi'`
macOS:
- `mdfind 'kMDItemContentType == "com.apple.application-bundle"'` filtered by known bundle IDs (`com.google.Chrome`, `com.microsoft.edgemac`, `org.chromium.Chromium`, `com.brave.Browser`)
Windows:
- Read `HKLM\SOFTWARE\Clients\StartMenuInternet\` and standard install paths
Classify each detected browser by extension-mode support:
- **Native extension support**: Chrome, Edge
- **CDP fallback only**: Chromium, Brave, Vivaldi, Arc, Opera
### Step 3: Recommend a browser
Present detected browsers ranked by:
1. Already installed AND supports `--extension`
2. Already installed but needs CDP fallback (note caveats)
3. Not installed (provide install URL but don't auto-install)
Recommend the dedicated-agent-browser pattern: keep your daily browser separate. Suggest the apt-installed Chrome (if present) or Edge as the agent's browser; leave Flatpak Chromium etc. for personal use.
### Step 4: Walk through extension install
Print:
- Web Store URL: https://chromewebstore.google.com/detail/playwright-mcp-bridge/mmlmfjhmonkocbjadbfplnigmagldckm
- Optionally open via `xdg-open` / `open` / `start <url>` (with permission)
- Wait for the user to confirm install + pin the extension icon
### Step 5: Capture the token
Use `AskUserQuestion` (or markdown prompt on providers without native UX):
> "Click the Playwright MCP Bridge extension icon in your browser. Copy the token shown there and paste it below."
Validate: non-empty, alphanumeric-with-hyphens-and-underscores, length ≥ 16.
### Step 6: Store the token
```bash
mkdir -p ~/.config/playwright-mcp
chmod 700 ~/.config/playwright-mcp
# Write token to ~/.config/playwright-mcp/token (mode 600)
chmod 600 ~/.config/playwright-mcp/token
```
Per `token-security` rule: never echo, never log, never include in error output.
### Step 7: Register the MCP server
```bash
TOKEN=$(cat ~/.config/playwright-mcp/token)
aiwg mcp add playwright \
--type stdio \
--command npx \
--args '-y,@playwright/mcp@latest,--extension' \
--env "PLAYWRIGHT_MCP_EXTENSION_TOKEN=${TOKEN}" \
--description 'Playwright MCP — browser automation via accessibility tree' \
|| aiwg mcp update playwright \
--command npx \
--args '-y,@playwright/mcp@latest,--extension' \
--env "PLAYWRIGHT_MCP_EXTENSION_TOKEN=${TOKEN}"
```
**Known gap**: the token lands in plaintext in `~/.aiwg/mcp-servers.json`. Final addon release depends on AIWG core supporting `${file:...}` substitution. Document this in the setup-complete report.
### Step 8: Inject into provider
```bash
PROVIDER=$(aiwg runtime-info --json | jq -r '.provider')
aiwg mcp inject --provider "$PROVIDER" --servers playwright
```
### Step 9: Verify
Spawn a probe MCP process briefly with env var set, send JSON-RPC `initialize` + `tools/list`, check for `browser_tabs` in the response. Kill the probe.
If probe succeeds: setup-complete report.
If probe fails: collect diagnostics and hand off to `browser-doctor`.
### Step 10: Setup-complete report
| Field | Value |
|---|---|
| Browser | `<binary path>` |
| Token file | `~/.config/playwright-mcp/token` |
| MCP registered | `playwright` |
| Provider injected | `<provider name>` |
| Next | Restart the provider; ask agent to "list browser tabs" |
Reset / rotate instructions: `aiwg run skill browser-reset`
Health check: `aiwg run skill browser-doctor`
## Constraints
- Token never echoed in any output (including error paths)
- Setup wizard prompts for `human-authorization` before:
- Writing the token file
- Modifying the AIWG MCP registry
- Modifying the provider's config file
- Activity log entry after each significant step
## Cross-platform notes
- Linux: most common, fully scripted
- macOS: same shape, different binary detection
- Windows: detection via PowerShell registry queries; path normalization for MCP env strings
## Open implementation questions
1. Should the wizard scaffold `.aiwg/browser-allowlist.yaml` immediately, or defer to first agent use?
2. If user has both Chrome and Edge installed, should we prefer one based on which has the extension already installed?
3. Should the wizard offer to install the extension via load-unpacked from `node_modules/@playwright/mcp/lib/extension/` if Web Store access is blocked?
## References
- `.aiwg/architecture/adr-remote-browser-control.md` — architectural context
- `.aiwg/working/browser-control-feature-plan.md` — full design
- `rules/browser-control-safety.md` — enforcement (this addon)
- `.claude/rules/token-security.md` — token-handling discipline
- `.claude/rules/human-authorization.md` — authorization gates
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.