[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72T5WJRVV1E22EW749FQAEH":3,"skill-same:01M72T5WJRVV1E22EW749FQAEH":49},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":28,"commitSha":29,"skillDirectory":30,"forksCount":14,"repositoryHtmlUrl":31,"repositoryHomepageUrl":31,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M72T5WJRVV1E22EW749FQAEH","page-agent-dev",null,"Development workflow for Alibaba's page-agent monorepo. Use when working with page-agent packages, building browser AI agents, or extending the page-agent architecture.","iberi22\u002Fskills","iberi22","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F10615454?v=4","01M72SQ2NXAA3GW0FSH053A5ES","Brahyan Belalcazar","01M72SQ2PYCH0SSA1K61NGEHDV",0,"MIT","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgeneral\u002Fpage-agent-dev\u002FSKILL.md",[],[],"2026-11-10 22:39:42",false,"---\nname: page-agent-dev\ndescription: Development workflow for Alibaba's page-agent monorepo. Use when working with page-agent packages, building browser AI agents, or extending the page-agent architecture.\nversion: \"1.0.0\"\nupdated: \"2026-04-23\"\nauthor: swal\nlicense: MIT\nargument-hint: 'Describe the page-agent task or feature to implement'\n---\n\n# Page Agent Development\n\nWorking with the `iberi22\u002Fpage-agent` fork or similar page-agent-based monorepos.\n\n## Monorepo Structure\n\n```\npackages\u002F\n├── core\u002F                    # PageAgentCore (headless, stateless)\n│   └── src\u002F\n│       ├── PageAgentCore.ts  # Main agent class\n│       ├── tools\u002F            # Agent tools\n│       ├── prompts\u002F          # System prompts\n│       └── types.ts         # Type definitions\n├── page-controller\u002F         # DOM operations (no LLM)\n│   └── src\u002F\n│       ├── PageController.ts # Main controller\n│       ├── actions.ts        # Element interactions\n│       └── dom\u002F              # DOM extraction\n├── llms\u002F                    # LLM client\n│   └── src\u002F\n│       ├── index.ts          # Main LLM class\n│       ├── OpenAIClient.ts   # OpenAI-compatible client\n│       └── types.ts          # MacroToolInput, AgentBrain\n├── ui\u002F                      # Panel and i18n\n├── page-agent\u002F              # Main package (core + controller + ui)\n└── website\u002F                 # Documentation site\n```\n\n## Key Commands\n\n```bash\nnpm run build        # Build all packages\nnpm run build:libs  # Build libraries only\nnpm run typecheck   # TypeScript type checking\nnpm run lint        # ESLint\n```\n\n## Architecture Principles\n\n### 1. Layered Dependencies\n```\npage-agent\n  ├── core (UI-less agent)\n  │     ├── llms (LLM client)\n  │     └── page-controller (DOM ops)\n  └── ui (Panel)\n```\n\n### 2. ReAct Agent Loop\n\n```\nobserve()  →  think()  →  act()  →  loop\n   ↓           ↓          ↓\n DOM tree   LLM call   PageController\n```\n\n### 3. Tool Definition Contract\n\nTools follow `MacroToolInput` pattern:\n\n```typescript\ninterface MacroToolInput {\n  thought: string       \u002F\u002F Reasoning\n  action: {\n    name: string         \u002F\u002F Tool name\n    args: Record\u003Cstring, unknown>\n  }\n}\n```\n\n## Adding a New Tool\n\n### Step 1: Add to PageController (if new DOM op)\n\n```typescript\n\u002F\u002F packages\u002Fpage-controller\u002Fsrc\u002Factions.ts\nexport async function newAction(controller: PageController, index: number) {\n  \u002F\u002F Implementation\n}\n```\n\n### Step 2: Expose in PageController class\n\n```typescript\n\u002F\u002F packages\u002Fpage-controller\u002Fsrc\u002FPageController.ts\nasync newAction(index: number): Promise\u003Cvoid> {\n  await actions.newAction(this, index)\n}\n```\n\n### Step 3: Create Tool\n\n```typescript\n\u002F\u002F packages\u002Fcore\u002Fsrc\u002Ftools\u002Findex.ts\nconst newTool: PageAgentTool = {\n  name: 'new_action',\n  description: 'Does something useful',\n  schema: z.object({ index: z.number() }),\n  async execute({ index }, context) {\n    await context.controller.newAction(index)\n    return { success: true }\n  }\n}\n```\n\n### Step 4: Export from tools index\n\n```typescript\n\u002F\u002F packages\u002Fcore\u002Fsrc\u002Ftools\u002Findex.ts\nexport const tools: PageAgentTool[] = [\n  \u002F\u002F ... existing tools\n  newTool\n]\n```\n\n## PageController ↔ PageAgent Communication\n\n```typescript\n\u002F\u002F All communication is async and isolated\n\n\u002F\u002F PageAgent (core) calls:\nawait this.pageController.updateTree()\nawait this.pageController.clickElement(index)\nawait this.pageController.getSimplifiedHTML()\n\n\u002F\u002F PageController exposes state via:\nconst simplifiedHTML = await this.pageController.getSimplifiedHTML()\nconst pageInfo = await this.pageController.getPageInfo()\n```\n\n## System Prompt Structure\n\n```markdown\n# Role\nYou are a web automation agent...\n\n# Capabilities\n- Click elements by index\n- Type text into input fields\n- Scroll the page\n- Wait for elements to appear\n\n# Rules\n1. Always update the DOM tree after actions\n2. Use simplified HTML for decisions\n3. Index numbers are stable until DOM changes\n\n# Output Format\n{\n  \"thought\": \"Why I'm taking this action\",\n  \"action\": { \"name\": \"click\", \"args\": { \"index\": 42 } }\n}\n```\n\n## Event System\n\n```typescript\nagent.on('statuschange', (status: AgentStatus) => {\n  \u002F\u002F idle → running → completed\u002Ferror\n})\n\nagent.on('historychange', (events: HistoricalEvent[]) => {\n  \u002F\u002F Persistent agent memory\n})\n\nagent.on('activity', (activity: AgentActivity) => {\n  \u002F\u002F Real-time UI feedback (transient)\n})\n```\n\n## Browser Integration Options\n\n| Method | Use Case |\n|--------|----------|\n| NPM import | Full control, custom UI |\n| IIFE script tag | Quick integration, no build |\n| Chrome extension | Multi-page tasks |\n| MCP Server | External agent control |\n\n## Publishing Flow\n\n```\nsrc\u002F*.ts (dev)\n    ↓ [scripts\u002Fpre-publish.js]\ndist\u002F*.ts → dist\u002F*.js (publish)\n    ↓ [scripts\u002Fpost-publish.js]\nsrc\u002F*.ts (restore)\n```\n\n## Development Workflow\n\n1. **Clone**: `git clone https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fpage-agent.git`\n2. **Install**: `npm install`\n3. **Dev**: `npm start` (website dev server)\n4. **Build**: `npm run build:libs` (for library changes)\n5. **Test**: Manual testing in browser\n6. **PR**: Follow `.github\u002FPULL_REQUEST_TEMPLATE.md`\n\n## Common Patterns\n\n### Retry with Backoff\n```typescript\nasync function withRetry\u003CT>(\n  fn: () => Promise\u003CT>,\n  maxRetries = 3\n): Promise\u003CT> {\n  for (let i = 0; i \u003C maxRetries; i++) {\n    try {\n      return await fn()\n    } catch (e) {\n      if (i === maxRetries - 1) throw e\n      await sleep(Math.pow(2, i) * 1000)\n    }\n  }\n}\n```\n\n### Reflection Before Action\n```typescript\n\u002F\u002F Before taking action, agent reflects on:\n\u002F\u002F 1. What happened in previous steps\n\u002F\u002F 2. Current page state\n\u002F\u002F 3. Whether to continue or replan\n```\n\n## File Naming Conventions\n\n| Type | Convention |\n|------|-----------|\n| Source | `camelCase.ts` |\n| Tests | `*.test.ts` |\n| Types | `types.ts` |\n| Index | `index.ts` |\n| Constants | `UPPER_SNAKE_CASE.ts` |\n","# Page Agent Development\n\nWorking with the `iberi22\u002Fpage-agent` fork or similar page-agent-based monorepos.\n\n## Monorepo Structure\n\n```\npackages\u002F\n├── core\u002F                    # PageAgentCore (headless, stateless)\n│   └── src\u002F\n│       ├── PageAgentCore.ts  # Main agent class\n│       ├── tools\u002F            # Agent tools\n│       ├── prompts\u002F          # System prompts\n│       └── types.ts         # Type definitions\n├── page-controller\u002F         # DOM operations (no LLM)\n│   └── src\u002F\n│       ├── PageController.ts # Main controller\n│       ├── actions.ts        # Element interactions\n│       └── dom\u002F              # DOM extraction\n├── llms\u002F                    # LLM client\n│   └── src\u002F\n│       ├── index.ts          # Main LLM class\n│       ├── OpenAIClient.ts   # OpenAI-compatible client\n│       └── types.ts          # MacroToolInput, AgentBrain\n├── ui\u002F                      # Panel and i18n\n├── page-agent\u002F              # Main package (core + controller + ui)\n└── website\u002F                 # Documentation site\n```\n\n## Key Commands\n\n```bash\nnpm run build        # Build all packages\nnpm run build:libs  # Build libraries only\nnpm run typecheck   # TypeScript type checking\nnpm run lint        # ESLint\n```\n\n## Architecture Principles\n\n### 1. Layered Dependencies\n```\npage-agent\n  ├── core (UI-less agent)\n  │     ├── llms (LLM client)\n  │     └── page-controller (DOM ops)\n  └── ui (Panel)\n```\n\n### 2. ReAct Agent Loop\n\n```\nobserve()  →  think()  →  act()  →  loop\n   ↓           ↓          ↓\n DOM tree   LLM call   PageController\n```\n\n### 3. Tool Definition Contract\n\nTools follow `MacroToolInput` pattern:\n\n```typescript\ninterface MacroToolInput {\n  thought: string       \u002F\u002F Reasoning\n  action: {\n    name: string         \u002F\u002F Tool name\n    args: Record\u003Cstring, unknown>\n  }\n}\n```\n\n## Adding a New Tool\n\n### Step 1: Add to PageController (if new DOM op)\n\n```typescript\n\u002F\u002F packages\u002Fpage-controller\u002Fsrc\u002Factions.ts\nexport async function newAction(controller: PageController, index: number) {\n  \u002F\u002F Implementation\n}\n```\n\n### Step 2: Expose in PageController class\n\n```typescript\n\u002F\u002F packages\u002Fpage-controller\u002Fsrc\u002FPageController.ts\nasync newAction(index: number): Promise\u003Cvoid> {\n  await actions.newAction(this, index)\n}\n```\n\n### Step 3: Create Tool\n\n```typescript\n\u002F\u002F packages\u002Fcore\u002Fsrc\u002Ftools\u002Findex.ts\nconst newTool: PageAgentTool = {\n  name: 'new_action',\n  description: 'Does something useful',\n  schema: z.object({ index: z.number() }),\n  async execute({ index }, context) {\n    await context.controller.newAction(index)\n    return { success: true }\n  }\n}\n```\n\n### Step 4: Export from tools index\n\n```typescript\n\u002F\u002F packages\u002Fcore\u002Fsrc\u002Ftools\u002Findex.ts\nexport const tools: PageAgentTool[] = [\n  \u002F\u002F ... existing tools\n  newTool\n]\n```\n\n## PageController ↔ PageAgent Communication\n\n```typescript\n\u002F\u002F All communication is async and isolated\n\n\u002F\u002F PageAgent (core) calls:\nawait this.pageController.updateTree()\nawait this.pageController.clickElement(index)\nawait this.pageController.getSimplifiedHTML()\n\n\u002F\u002F PageController exposes state via:\nconst simplifiedHTML = await this.pageController.getSimplifiedHTML()\nconst pageInfo = await this.pageController.getPageInfo()\n```\n\n## System Prompt Structure\n\n```markdown\n# Role\nYou are a web automation agent...\n\n# Capabilities\n- Click elements by index\n- Type text into input fields\n- Scroll the page\n- Wait for elements to appear\n\n# Rules\n1. Always update the DOM tree after actions\n2. Use simplified HTML for decisions\n3. Index numbers are stable until DOM changes\n\n# Output Format\n{\n  \"thought\": \"Why I'm taking this action\",\n  \"action\": { \"name\": \"click\", \"args\": { \"index\": 42 } }\n}\n```\n\n## Event System\n\n```typescript\nagent.on('statuschange', (status: AgentStatus) => {\n  \u002F\u002F idle → running → completed\u002Ferror\n})\n\nagent.on('historychange', (events: HistoricalEvent[]) => {\n  \u002F\u002F Persistent agent memory\n})\n\nagent.on('activity', (activity: AgentActivity) => {\n  \u002F\u002F Real-time UI feedback (transient)\n})\n```\n\n## Browser Integration Options\n\n| Method | Use Case |\n|--------|----------|\n| NPM import | Full control, custom UI |\n| IIFE script tag | Quick integration, no build |\n| Chrome extension | Multi-page tasks |\n| MCP Server | External agent control |\n\n## Publishing Flow\n\n```\nsrc\u002F*.ts (dev)\n    ↓ [scripts\u002Fpre-publish.js]\ndist\u002F*.ts → dist\u002F*.js (publish)\n    ↓ [scripts\u002Fpost-publish.js]\nsrc\u002F*.ts (restore)\n```\n\n## Development Workflow\n\n1. **Clone**: `git clone https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fpage-agent.git`\n2. **Install**: `npm install`\n3. **Dev**: `npm start` (website dev server)\n4. **Build**: `npm run build:libs` (for library changes)\n5. **Test**: Manual testing in browser\n6. **PR**: Follow `.github\u002FPULL_REQUEST_TEMPLATE.md`\n\n## Common Patterns\n\n### Retry with Backoff\n```typescript\nasync function withRetry\u003CT>(\n  fn: () => Promise\u003CT>,\n  maxRetries = 3\n): Promise\u003CT> {\n  for (let i = 0; i \u003C maxRetries; i++) {\n    try {\n      return await fn()\n    } catch (e) {\n      if (i === maxRetries - 1) throw e\n      await sleep(Math.pow(2, i) * 1000)\n    }\n  }\n}\n```\n\n### Reflection Before Action\n```typescript\n\u002F\u002F Before taking action, agent reflects on:\n\u002F\u002F 1. What happened in previous steps\n\u002F\u002F 2. Current page state\n\u002F\u002F 3. Whether to continue or replan\n```\n\n## File Naming Conventions\n\n| Type | Convention |\n|------|-----------|\n| Source | `camelCase.ts` |\n| Tests | `*.test.ts` |\n| Types | `types.ts` |\n| Index | `index.ts` |\n| Constants | `UPPER_SNAKE_CASE.ts` |\n",{"name":5,"author":24,"license":15,"updated":25,"version":26,"description":7,"argument-hint":27},"swal","2026-04-23","1.0.0","Describe the page-agent task or feature to implement","main","688810f2886d212632acf81e532b24e483dd8b98","skills\u002Fgeneral\u002Fpage-agent-dev","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills","https:\u002F\u002Fgithub.com\u002Fiberi22","Senior WEB Full-Stack","2026-10-12 02:46:21",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add iberi22\u002Fskills --skill page-agent-dev",{"tool":41,"command":42},"bunx","bunx skills add iberi22\u002Fskills --skill page-agent-dev",{"tool":44,"command":45},"pnpm","pnpm dlx skills add iberi22\u002Fskills --skill page-agent-dev","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgeneral\u002Fpage-agent-dev\u002FSKILL.md",true,[],[50,56,63,69,75,81],{"skillNo":51,"name":52,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M72TWQEQD46ZC9TRBAABF78P","web-design-guidelines","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fweb\u002Fweb-design-guidelines\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M72TWMQFTYD08DGXVAXRPPEB","blocked-page-recovery","Use when a fetch fails: 403\u002F429, paywall, WAF, bot wall. Recovers the page via archives and provenance-checked fallbacks.","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fweb\u002Fblocked-page-recovery\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M72TVQMS3HCTX18C8T97WTQQ","studio-coach","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftools\u002Fstudio-coach\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M72TVNA2PR9RZW0ZAXYP1G6J","src-generator","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftools\u002Fsrc-generator\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M72TVEJHHB6SAT3R3TY9MJKS","sqlite-pro","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftools\u002Fsqlite-pro\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M72TVC2EVBHQHCX96VTTYKB8","rigor-evaluator","Use when you need a quick heuristic rigor score (10 criteria, 0-2 each) for the features in a .gitcore\u002Ffeatures.json file, to decide which features are ready to ship.","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftools\u002Frigor-evaluator\u002FSKILL.md",[],[]]