Communitygithub.com

am-will/gemini-computer-use

Gemini 2.5 Computer Use ブラウザ制御エージェントを Playwright で構築・実行します。Web ブラウザタスクの自動化、エージェントループ(スクリーンショット→関数呼び出し→アクション→関数応答)、リスクのある UI 操作に対する安全確認の統合に使用します。

gemini-computer-use とは?

このスキルは、Google Gemini 2.5 モデルの Computer Use 機能を Playwright と組み合わせて利用し、ブラウザを自律的に操作するエージェントを構築・実行するためのものです。ユーザーは、Web フォームの入力、データのスクレイピング、複数ページにわたるワークフローの自動化など、ブラウザベースのタスクを指示するだけで、エージェントがスクリーンショットを取得し、適切な関数(クリック、入力、スクロールなど)を呼び出し、その応答に基づいて次のアクションを決定するループを繰り返します。特に、安全性が重要な操作(例:削除、送信)に対しては、確認プロンプトを挟むことで誤った自動実行を防ぎます。このスキルは、Claude Code や Cursor などの AI エージェントに追加することで、ブラウザのライブ操作を可能にします。詳細な SKILL.md には、セットアップ手順、環境変数の設定、Playwright のインストール方法、エージェントループの実装例、安全確認の統合方法が含まれています。

対応~Claude Code~Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/am-will/codex-skills/tree/main/skills/gemini-computer-use

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

gemini-computer-use は何をしますか?

Gemini 2.5 Computer Use ブラウザ制御エージェントを Playwright で構築・実行します。ユーザーが Web ブラウザタスクを自動化したい場合、エージェントループ(スクリーンショット → function_call → アクション → function_response)が必要な場合、またはリスクのある UI 操作に対する安全確認の統合を求められた場合に使用します。

概要

このスキルは Google の Gemini 2.5 モデルの Computer Use 機能を利用して、ブラウザを自律的に操作するエージェントを作成します。Playwright を使用してブラウザを制御し、モデルがスクリーンショットを分析し、適切なアクションを決定・実行するループを実装します。

前提条件

  • Python 3.10 以上
  • Google AI Studio または Vertex AI の API キー(GEMINI_API_KEY または GOOGLE_API_KEY)
  • Playwright ブラウザのインストール

インストール

pip install google-generativeai playwright pillow
playwright install chromium

環境変数

export GEMINI_API_KEY="your-api-key-here"
# または
export GOOGLE_API_KEY="your-api-key-here"

使用方法

基本的なエージェントループ

import asyncio
from gemini_computer_use import GeminiComputerUseAgent

async def main():
    agent = GeminiComputerUseAgent()
    
    # タスクを実行
    result = await agent.run_task(
        task="Google 検索で 'Playwright Python' と検索し、最初の結果をクリックしてください",
        headless=False  # ブラウザを表示
    )
    print(result)

asyncio.run(main())

安全確認の統合

リスクのある操作(例:削除、フォーム送信)に対して安全確認を統合できます。

async def safety_callback(action_type, details):
    if action_type in ["click_submit", "delete_element"]:
        print(f"警告: {details['description']}")
        confirm = input("この操作を実行しますか? (y/n): ")
        return confirm.lower() == 'y'
    return True

agent = GeminiComputerUseAgent(safety_callback=safety_callback)

カスタマイズ

  • モデルの指定: model_name="gemini-2.5-pro" のように指定可能。
  • ブラウザの種類: Chromium、Firefox、WebKit から選択可能。
  • タイムアウト: timeout=60000 でミリ秒単位で設定。

トラブルシューティング

  • API キーが設定されていない場合: GEMINI_API_KEY または GOOGLE_API_KEY が設定されているか確認。
  • Playwright ブラウザが見つからない場合: playwright install chromium を実行。
  • タイムアウトエラー: timeout パラメータを増やすか、タスクを分割。

ライセンス

MIT

Individual skills in this repo

This repo contains 17 individual skills — each has its own dedicated page.

am-will/agent-browser

A fast Rust-based headless browser automation CLI with Node.js fallback that enables AI agents to navigate, click, type, and snapshot pages via structured commands.

am-will/context7

Fetch up-to-date library documentation via Context7 CLI. Use PROACTIVELY when: (1) Working with ANY external library (React, Next.js, Supabase, etc.) (2) User asks about library APIs, patterns, or best practices (3) Implementing features that rely on third-party packages (4) Debugging library-specific issues (5) Need current documentation beyond training data cutoff (6) AND MOST IMPORTANTLY, when you are installing dependencies, libraries, or frameworks you should ALWAYS check the docs to see what the latest versions are. Do not rely on outdated knowledge. Always prefer this over guessing library APIs or using outdated knowledge.

am-will/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

am-will/frontend-responsive-design-standards

Build responsive, mobile-first layouts using fluid containers, flexible units, media queries, and touch-friendly design that works across all screen sizes. Use this skill when creating or modifying UI layouts, responsive grids, breakpoint styles, mobile navigation, or any interface that needs to adapt to different screen sizes. Apply when working with responsive CSS, media queries, viewport settings, flexbox/grid layouts, mobile-first styling, breakpoint definitions (mobile, tablet, desktop), touch target sizing, relative units (rem, em, %), image optimization for different screens, or testing layouts across multiple devices. Use for any task involving multi-device support, responsive design patterns, or adaptive layouts.

am-will/llm-council

Orchestrate a configurable, multi-member CLI planning council (Codex, Claude Code, Gemini, OpenCode, or custom) to produce independent implementation plans, anonymize and randomize them, then judge and merge into one final plan. Use when you need a robust, bias-resistant planning workflow, structured JSON outputs, retries, and failure handling across multiple CLI agents.

am-will/markdown-url

Route any website you need to visit through markdown.new by prefixing the URL. **WHEN TO USE:** - You would normally open a website link to read content (docs, blog posts, changelogs, GitHub issues, etc.) - You need a cleaner, Markdown-friendly view for copying notes or summarizing

am-will/openai-docs-skill

Query the OpenAI developer documentation via the OpenAI Docs MCP server using CLI (curl/jq). Use whenever a task involves the OpenAI API (Responses, Chat Completions, Realtime, etc.), OpenAI SDKs, ChatGPT Apps SDK, Codex, MCP integrations, endpoint schemas, parameters, limits, or migrations and you need up-to-date official guidance.

am-will/parallel-task

Only to be triggered by explicit /parallel-task commands.

am-will/parallel-task-spark

Only to be triggered by explicit /parallel-task-spark commands.

am-will/plan-harder

Use when user specfically says 'plan harder'.

am-will/planner

Create comprehensive, phased implementation plans with sprints and atomic tasks. Use when user says: "make a plan", "create a plan", "plan this out", "plan the implementation", "help me plan", "design a plan", "draft a plan", "write a plan", "outline the steps", "break this down into tasks", "what's the plan for", or any similar planning request. Also triggers on explicit "/planner" or "/plan" commands.

am-will/read-github

Read and search GitHub repository documentation via gitmcp.io MCP service. **WHEN TO USE:** - User provides a GitHub URL - User mentions a specific repo in owner/repo format - User asks "what does this repo do?", "read the docs for X repo", or similar - User wants to search code or docs within a repo

am-will/role-creator

Create and update Codex custom agents using standalone custom-agent TOML files.

am-will/super-swarm-spark

Only to be triggered by explicit super-swarm-spark commands.

am-will/swarm-planner

[EXPLICIT INVOCATION ONLY] Creates dependency-aware implementation plans optimized for parallel multi-agent execution.

am-will/tdd-test-writer

Writes failing tests first for test-driven development and hands off a strict implementation contract that requires agents to make those tests pass without weakening the tests. Use when users ask for test-first workflows, RED/GREEN cycles, or behavior-gating tasks with automated tests.

am-will/vercel-react-best-practices

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

関連スキル