/claude-skills-plugin:page-agentfrom claude-skills-plugin
Page Agent 集成助手 - 帮助开发者在 Web 项目中集成和配置阿里巴巴 Page Agent AI 助手。用于初始化 Page Agent、配置自定义 LLM(通义千问、OpenAI 等)、实现智能表单填写、开发自然语言 UI 交互、配置 Chrome 扩展实现跨页面任务。
Ships in claude-skills-plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
帮助在 Web 项目中快速集成阿里巴巴 Page Agent,实现自然语言控制网页界面。
Page Agent 是运行在网页内的 JavaScript Agent,不是浏览器自动化工具:
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/iife/page-agent.demo.js" crossorigin="true"></script>
⚠️ 注意: 使用 Demo LLM,仅适合技术评估,需遵守使用条款。
npm install page-agent
import { PageAgent } from 'page-agent'
const agent = new PageAgent({
model: 'qwen-max', // 或 gpt-4o, claude-3-5-sonnet-20241022 等
baseURL: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
apiKey: 'YOUR_API_KEY',
language: 'zh-CN', // 或 'en-US'
})
await agent.execute('点击登录按钮')
<template>
<div>
<input v-model="userInput" placeholder="输入指令..." @keyup.enter="execute">
<button @click="execute">执行</button>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { PageAgent } from 'page-agent'
const agent = ref(null)
const userInput = ref('')
onMounted(() => {
agent.value = new PageAgent({
model: 'qwen-max',
baseURL: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
apiKey: 'YOUR_API_KEY',
language: 'zh-CN',
})
})
const execute = async () => {
await agent.value.execute(userInput.value)
}
</script>
import { useEffect, useState, useRef } from 'react'
import { PageAgent } from 'page-agent'
export function PageAgentComponent() {
const agentRef = useRef<PageAgent | null>(null)
const [input, setInput] = useState('')
useEffect(() => {
agentRef.current = new PageAgent({
model: 'gpt-4o',
baseURL: 'https://api.openai.com/v1',
apiKey: 'YOUR_API_KEY',
language: 'en-US',
})
}, [])
const handleExecute = async () => {
await agentRef.current?.execute(input)
}
return (
<div>
<input
value={input}
onChange={(e) => setInput(e.target.value)}
onKeyDown={(e) => e.key === 'Enter' && handleExecute()}
placeholder="Enter command..."
/>
<button onClick={handleExecute}>Execute</button>
</div>
)
}
const agent = new PageAgent({
model: 'qwen-max', // qwen-max, qwen-plus, qwen-turbo
baseURL: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
apiKey: 'sk-xxx',
language: 'zh-CN',
})
const agent = new PageAgent({
model: 'gpt-4o', // gpt-4o, gpt-4o-mini, gpt-3.5-turbo
baseURL: 'https://api.openai.com/v1',
apiKey: 'sk-xxx',
language: 'en-US',
})
const agent = new PageAgent({
model: 'claude-3-5-sonnet-20241022',
baseURL: 'https://api.anthropic.com/v1',
apiKey: 'sk-ant-xxx',
language: 'en-US',
})
const agent = new PageAgent({
model: 'your-model-name',
baseURL: 'https://your-api-endpoint/v1',
apiKey: 'your-api-key',
language: 'zh-CN',
})
// 用户说:"帮我填写注册表单,姓名张三,邮箱[email protected]"
await agent.execute('填写注册表单:姓名张三,邮箱[email protected]')
// 或者分步引导
await agent.execute('找到注册表单的姓名输入框')
await agent.execute('填写张三到姓名输入框')
await agent.execute('填写 [email protected] 到邮箱输入框')
const agent = new PageAgent({
model: 'gpt-4o',
baseURL: 'https://api.openai.com/v1',
apiKey: 'YOUR_API_KEY',
language: 'en-US',
onBeforeAction: async (action) => {
// 在执行操作前请求用户确认
const confirmed = confirm(`即将执行: ${action.description}\n确认继续?`)
return confirmed
},
})
// 中文环境
const agentZh = new PageAgent({
model: 'qwen-max',
baseURL: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
apiKey: 'YOUR_API_KEY',
language: 'zh-CN', // 指令使用中文
})
// 英文环境
const agentEn = new PageAgent({
model: 'gpt-4o',
baseURL: 'https://api.openai.com/v1',
apiKey: 'YOUR_API_KEY',
language: 'en-US', // 指令使用英文
})
try {
await agent.execute('点击提交按钮')
} catch (error) {
if (error.message.includes('element not found')) {
console.error('未找到目标元素')
// 提供更友好的错误提示或备选方案
} else if (error.message.includes('permission denied')) {
console.error('操作被拒绝,可能需要权限')
}
}
跨页面任务需要安装 Chrome 扩展:
# 安装扩展(从 Page Agent 官方文档获取)
# 在 manifest.json 中配置权限
扩展配置示例:
{
"manifest_version": 3,
"permissions": ["activeTab", "scripting"],
"background": {
"service_worker": "background.js"
}
}
onBeforeAction 请求用户确认language 参数应与用户界面语言一致| 限制 | 说明 |
|---|---|
| 无法打开新页面 | 只能在已加载的网页内工作 |
| 跨域限制 | 受浏览器同源策略限制 |
| DOM 依赖 | 依赖网页的 DOM 结构,结构变化可能影响效果 |
| LLM 成本 | 每次操作都会调用 LLM,产生 API 费用 |
| 不适合自动化测试 | 不是为测试框架设计,无法替代 Cypress/Playwright |
问题: 找不到元素
问题: API 调用失败
问题: 操作不响应
execute() 被 awaitWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub echoleesong/claude-skills-plugin --plugin claude-skills-plugin41 skills in this plugin
/academic-paper12-agent academic paper writing pipeline. 10 modes (full/plan/outline/revision/revision-coach/abstract/lit-review/format-convert/citation-check/disclosure). 6 paper types, 5 citation formats, bilingual abstracts, LaTeX/DOCX-via-Pandoc/PDF output. Style Calibration + Writing Quality Check + Anti-Patterns with IRON RULE markers. Triggers: write paper, academic paper, guide my paper, parse reviews, AI disclosure, 寫論文, 學術論文, 引導我寫論文, 審查意見./academic-paper-reviewerMulti-perspective academic paper review with dynamic reviewer personas. Simulates 5 independent reviewers (EIC + 3 peer reviewers + Devil's Advocate) with field-specific expertise. Supports full review, re-review (verification), quick assessment, methodology focus, Socratic guided, and calibration modes. Triggers on: review paper, peer review, manuscript review, referee report, review my paper, critique paper, simulate review, editorial review, calibrate reviewer, reviewer calibration, measure reviewer accuracy./academic-pipelineOrchestrator for the full academic research pipeline: research -> write -> integrity check -> review -> revise -> re-review -> re-revise -> final integrity check -> finalize. Coordinates deep-research, academic-paper, and academic-paper-reviewer into a seamless 10-stage workflow with mandatory integrity verification, two-stage peer review, and reproducible quality gates. Triggers on: academic pipeline, research to paper, full paper workflow, paper pipeline, end-to-end paper, research-to-publication, complete paper workflow./brandkitPremium brand-kit image generation skill for creating high-end brand-guidelines boards, logo systems, identity decks, and visual-world presentations. Trained for minimalist, cinematic, editorial, dark-tech, luxury, cultural, security, gaming, developer-tool, and consumer-app brand systems. Optimized for intentional logo concepting, refined composition, sparse typography, strong symbolic meaning, premium mockups, art-directed imagery, and flexible grid layouts./industrial-brutalist-uiRaw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints./chinese-novelist分章节创作引人入胜的中文小说。支持各种题材(悬疑/言情/奇幻/科幻/历史等),支持10-50章长篇创作,每章3000-5000字,结尾设置悬念钩子。强调深度润色去除AI痕迹,确保文字自然流畅。
当用户要求:写小说、创作故事、分章节写作、连续剧情、章节悬念、长篇小说时使用。