This skill should be used when the user asks about "browser tools", "DOM manipulation", "element labeling", "screenshot", "script injection", "page navigation", "browser automation", or needs to work with browser-related functionality in XSky.
Enables browser automation through element labeling and screenshot analysis for interacting with web pages. Triggered when users request browser tools, DOM manipulation, page navigation, or web automation tasks in XSky.
/plugin marketplace add anujkumar001111/xsky-agent/plugin install anujkumar001111-xsky-dev-team@anujkumar001111/xsky-agentThis skill inherits all available tools. When active, it can use any tool Claude has access to.
This skill provides knowledge for browser automation in XSky.
BaseBrowserAgent (abstract)
├── BaseBrowserLabelsAgent
│ └── Uses element labeling for interaction
└── BaseBrowserScreenAgent
└── Uses screenshot analysis for interaction
| Package | Class | Platform |
|---|---|---|
| ai-agent-electron | BrowserAgent | Electron WebContentsView |
| ai-agent-nodejs | BrowserAgent | Playwright |
| ai-agent-web | BrowserAgent | Same-origin pages |
| ai-agent-extension | BrowserAgent | Chrome Extension API |
Every browser agent must implement:
// Take screenshot
protected abstract screenshot(ctx: AgentContext): Promise<{
imageBase64: string;
imageType: "image/jpeg" | "image/png";
}>;
// Navigate to URL
protected abstract navigate_to(ctx: AgentContext, url: string): Promise<{
url: string;
title?: string;
}>;
// Execute script in page context
protected abstract execute_script(
ctx: AgentContext,
fn: Function,
args: any[]
): Promise<any>;
// Get all tabs
protected abstract get_all_tabs(ctx: AgentContext): Promise<Array<{
tabId: number;
url: string;
title: string;
}>>;
// Switch to tab
protected abstract switch_tab(ctx: AgentContext, tabId: number): Promise<{
tabId: number;
url: string;
title: string;
}>;
// Go back in history
protected abstract go_back(ctx: AgentContext): Promise<void>;
BaseBrowserLabelsAgent provides these tools:
web_navigate - Go to URLweb_click - Click element by labelweb_type - Type textweb_scroll - Scroll pageweb_extract - Extract contentweb_screenshot - Capture pageThe labeling approach:
For Electron with contextIsolation:
// Secure mode via preload
if (securityOptions.useContextIsolation) {
await window.xskyAgent.executeScript(fn, args);
} else {
// Legacy direct execution
await webContents.executeJavaScript(code);
}
| File | Purpose |
|---|---|
packages/ai-agent-core/src/agent/browser/browser_base.ts | Base browser agent |
packages/ai-agent-core/src/agent/browser/browser_labels.ts | Labels agent |
packages/ai-agent-electron/src/browser.ts | Electron implementation |
packages/ai-agent-nodejs/src/browser.ts | Playwright implementation |
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.