Basit Mustafa

Deep Research (Gemini)

AI 智慧體v2.1.3
作者:Basit Mustafa更新於 2026-05-11共 14 個版本 · 最新版本釋出於 2026-02-25agent-deep-research@clawhub_24601/agent-deep-research
任務自動化上下文管理#Local Files#Json#Rag

據 AlphaMoat 統計,截至 2026-09,Deep Research (Gemini) 累計下載 4,800 次、獲 4 個星標,在全部 5,078 個 AI 技能中排名第 1,962 位,在「AI 智慧體」分類(969 個)中排名第 371 位。

累計安裝
189
累計下載
4800
星標
4
全站排名
#1,962
全站前 39% · 「AI 智慧體」前 39%
平台累計安裝累計下載星標評論
ClawHub ↗15147083-
SkillHub ↗18948004—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

需要 uv、網路及 GOOGLE_API_KEY、GEMINI_API_KEY、GEMINI_DEEP_RESEARCH_API_KEY 之一。支援研究狀態、後續提問、檔案庫問答和結構化報告。--context 會上傳指定檔案到 Google,過濾敏感與二進位檔案,單檔案上限 100 MB;研究後預設刪除臨時庫,--keep-context 會保留。非互動式模式跳過確認,應先用 --dry-run 檢視上傳與啟發式費用估算,可設 --max-cost;估算不是帳單。指定輸出會等待完成,非同步啟動需另查狀態。PDF 匯出另需 weasyprint。

資料釋出於 2026-10-26

可以用來做什麼

  • 圍繞資料開展研究並儲存報告與引用

什麼時候用

  • 需要結合檔案證據或管理非同步研究會話時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

先預覽這些文件的上傳範圍和費用估算,再準備研究問題。

月度資料趨勢

累計下載4800
2722383849542026-03 · 累計下載 28762026-05 · 累計下載 37762026-06 · 累計下載 39792026-07 · 累計下載 43772026-08 · 累計下載 45602026-09 · 累計下載 480026-0326-09
星標4
3442026-03 · 星標 32026-05 · 星標 32026-06 · 星標 32026-07 · 星標 42026-08 · 星標 42026-09 · 星標 426-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-094800—4
2026-084560+4.2%4
2026-074377+10.0%4
2026-063979+5.4%3
2026-053776—3
2026-032876—3

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

15 KB · ClawHub v2.1.3
---
name: deep-research
description: "Async deep research via Gemini Interactions API (no Gemini CLI dependency). RAG-ground queries on local files (--context), preview costs (--dry-run), structured JSON output, adaptive polling. Universal skill for 30+ AI agents including Claude Code, Amp, Codex, and Gemini CLI."
license: MIT
compatibility: "Requires uv and one of GOOGLE_API_KEY / GEMINI_API_KEY / GEMINI_DEEP_RESEARCH_API_KEY. Optional env vars for model config: GEMINI_DEEP_RESEARCH_AGENT, GEMINI_DEEP_RESEARCH_MODEL, GEMINI_MODEL. Network access to Google Gemini API. --context uploads local files to ephemeral stores (auto-deleted)."
allowed-tools: "Bash(uv:*) Bash(python3:*) Read"
metadata:
  version: "2.1.2"
  author: "24601"
  clawdbot:
展開全部(共 359 行)
    emoji: "🔬"
    category: "research"
    primaryEnv: "GOOGLE_API_KEY"
    homepage: "https://github.com/24601/agent-deep-research"
    requires:
      bins:
        - "uv"
      env:
        - "GOOGLE_API_KEY"
        - "GEMINI_API_KEY"
        - "GEMINI_DEEP_RESEARCH_API_KEY"
        - "GEMINI_DEEP_RESEARCH_AGENT"
        - "GEMINI_DEEP_RESEARCH_MODEL"
        - "GEMINI_MODEL"
    install:
      - kind: "uv"
        label: "uv (Python package runner)"
        package: "uv"
    config:
      requiredEnv:
        - "GOOGLE_API_KEY"
        - "GEMINI_API_KEY"
        - "GEMINI_DEEP_RESEARCH_API_KEY"
      example: "export GOOGLE_API_KEY=your-key-from-aistudio.google.com"
---

# Deep Research Skill

Perform deep research powered by Google Gemini's deep research agent. Upload documents to file search stores for RAG-grounded answers. Manage research sessions with persistent workspace state.

## For AI Agents

Get a full capabilities manifest, decision trees, and output contracts:

```bash
uv run {baseDir}/scripts/onboard.py --agent
```

See [AGENTS.md]({baseDir}/AGENTS.md) for the complete structured briefing.

| Command | What It Does |
|---------|-------------|
| `uv run {baseDir}/scripts/research.py start "question"` | Launch deep research |
| `uv run {baseDir}/scripts/research.py start "question" --context ./path --dry-run` | Estimate cost |
| `uv run {baseDir}/scripts/research.py start "question" --context ./path --output report.md` | RAG-grounded research |
| `uv run {baseDir}/scripts/store.py query <name> "question"` | Quick Q&A against uploaded docs |

## Security & Transparency

**Credentials**: This skill requires a Google/Gemini API key (one of `GOOGLE_API_KEY`, `GEMINI_API_KEY`, or `GEMINI_DEEP_RESEARCH_API_KEY`). The key is read from environment variables and passed to the `google-genai` SDK. It is never logged, written to files, or transmitted anywhere other than the Google Gemini API.

**File uploads**: The `--context` flag uploads local files to Google's ephemeral file search stores for RAG grounding. Sensitive files are automatically excluded: `.env*`, `credentials.json`, `secrets.*`, private keys (`.pem`, `.key`), and auth tokens (`.npmrc`, `.pypirc`, `.netrc`). Binary files are rejected by MIME type filtering. Build directories (`node_modules`, `__pycache__`, `.git`, `dist`, `build`) are skipped. The ephemeral store is auto-deleted after research completes unless `--keep-context` is specified. Use `--dry-run` to preview what would be uploaded without sending anything. Only files you explicitly point `--context` at are uploaded -- no automatic scanning of parent directories or home folders.

**Non-interactive mode**: When stdin is not a TTY (agent/CI use), confirmation prompts are automatically skipped. This is by design for agent integration but means an autonomous agent with file system access could trigger uploads. Restrict the paths agents can access, or use `--dry-run` and `--max-cost` guards.

**No obfuscation**: All code is readable Python with PEP 723 inline metadata. No binary blobs, no minified scripts, no telemetry, no analytics. The full source is auditable at [github.com/24601/agent-deep-research](https://github.com/24601/agent-deep-research).

**Local state**: Research session state is written to `.gemini-research.json` in the working directory. This file contains interaction IDs, store mappings, and upload hashes -- no credentials or research content. Use `state.py gc` to clean up orphaned stores from crashed runs.

## Prerequisites

- A Google API key (`GOOGLE_API_KEY` or `GEMINI_API_KEY` environment variable)
- [uv](https://docs.astral.sh/uv/) installed (see [uv install docs](https://docs.astral.sh/uv/getting-started/installation/))

## Quick Start

```bash
# Run a deep research query
uv run {baseDir}/scripts/research.py "What are the latest advances in quantum computing?"

# Check research status
uv run {baseDir}/scripts/research.py status <interaction-id>

# Save a completed report
uv run {baseDir}/scripts/research.py report <interaction-id> --output report.md

# Research grounded in local files (auto-creates store, uploads, cleans up)
uv run {baseDir}/scripts/research.py start "How does auth work?" --context ./src --output report.md

# Export as HTML or PDF
uv run {baseDir}/scripts/research.py start "Analyze the API" --context ./src --format html --output report.html

# Auto-detect prompt template based on context files
uv run {baseDir}/scripts/research.py start "How does auth work?" --context ./src --prompt-template auto --output report.md
```

## Environment Variables

Set one of the following (checked in order of priority):

| Variable | Description |
|----------|-------------|
| `GEMINI_DEEP_RESEARCH_API_KEY` | Dedicated key for this skill (highest priority) |
| `GOOGLE_API_KEY` | Standard Google AI key |
| `GEMINI_API_KEY` | Gemini-specific key |

Optional model configuration:

| Variable | Description | Default |
|----------|-------------|---------|
| `GEMINI_DEEP_RESEARCH_MODEL` | Model for file search queries | `gemini-3.1-pro-preview` |
| `GEMINI_MODEL` | Fallback model name | `gemini-3.1-pro-preview` |
| `GEMINI_DEEP_RESEARCH_AGENT` | Deep research agent identifier | `deep-research-pro-preview-12-2025` |

## Research Commands

### Start Research

```bash
uv run {baseDir}/scripts/research.py start "your research question"
```

| Flag | Description |
|------|-------------|
| `--report-format FORMAT` | Output structure: `executive_summary`, `detailed_report`, `comprehensive` |
| `--store STORE_NAME` | Ground research in a file search store (display name or resource ID) |
| `--no-thoughts` | Hide intermediate thinking steps |
| `--follow-up ID` | Continue a previous research session |
| `--output FILE` | Wait for completion and save report to a single file |
| `--output-dir DIR` | Wait for completion and save structured results to a directory (see below) |
| `--timeout SECONDS` | Maximum wait time when polling (default: 1800 = 30 minutes) |
| `--no-adaptive-poll` | Disable history-adaptive polling; use fixed interval curve instead |
| `--context PATH` | Auto-create ephemeral store from a file or directory for RAG-grounded research |
| `--context-extensions EXT` | Filter context uploads by extension (e.g. `py,md` or `.py .md`) |
| `--keep-context` | Keep the ephemeral context store after research completes (default: auto-delete) |
| `--dry-run` | Estimate costs without starting research (prints JSON cost estimate) |
| `--format {md,html,pdf}` | Output format for the report (default: md; pdf requires weasyprint) |
| `--prompt-template {typescript,python,general,auto}` | Domain-specific prompt prefix; auto detects from context file extensions |
| `--depth {quick,standard,deep}` | Research depth: quick (~2-5min), standard (~5-15min), deep (~15-45min) |
| `--max-cost USD` | Abort if estimated cost exceeds this limit (e.g. `--max-cost 3.00`) |
| `--input-file PATH` | Read the research query from a file instead of positional argument |
| `--no-cache` | Skip research cache and force a fresh run |

The `start` subcommand is the default, so `research.py "question"` and `research.py start "question"` are equivalent.

**Important**: When `--output` or `--output-dir` is used, the command blocks until research completes (2-10+ minutes). Do not background it with `&`. Use non-blocking mode (omit `--output`) to get an ID immediately, then poll with `status` and save with `report`.

### Check Status

```bash
uv run {baseDir}/scripts/research.py status <interaction-id>
```

Returns the current status (`in_progress`, `completed`, `failed`) and outputs if available.

### Save Report

```bash
uv run {baseDir}/scripts/research.py report <interaction-id>
```

| Flag | Description |
|------|-------------|
| `--output FILE` | Save report to a specific file path (default: `report-<id>.md`) |
| `--output-dir DIR` | Save structured results to a directory |

## Structured Output (`--output-dir`)

When `--output-dir` is used, results are saved to a structured directory:

```
<output-dir>/
  research-<id>/
    report.md          # Full final report
    metadata.json      # Timing, status, output count, sizes
    interaction.json   # Full interaction data (all outputs, thinking steps)
    sources.json       # Extracted source URLs/citations
```

A compact JSON summary (under 500 chars) is printed to stdout:

```json
{
  "id": "interaction-123",
  "status": "completed",
  "output_dir": "research-output/research-interaction-1/",
  "report_file": "research-output/research-interaction-1/report.md",
  "report_size_bytes": 45000,
  "duration_seconds": 154,
  "summary": "First 200 chars of the report..."
}
```

This is the recommended pattern for AI agent integration -- the agent receives a small JSON payload while the full report is written to disk.

## Adaptive Polling

When `--output` or `--output-dir` is used, the script polls the Gemini API until research completes. By default, it uses **history-adaptive polling** that learns from past research completion times:

- Completion times are recorded in `.gemini-research.json` under `researchHistory` (last 50 entries, separate curves for grounded vs non-grounded research).
- When 3+ matching data points exist, the poll interval is tuned to the historical distribution:
  - Before any research has ever completed: slow polling (30s)
  - In the likely completion window (p25-p75): aggressive polling (5s)
  - In the tail (past p75): moderate polling (15-30s)
  - Unusually long runs (past 1.5x the longest ever): slow polling (60s)
- All intervals are clamped to [2s, 120s] as a fail-safe.

When history is insufficient (<3 data points) or `--no-adaptive-poll` is passed, a fixed escalating curve is used: 5s (first 30s), 10s (30s-2min), 30s (2-10min), 60s (10min+).

## Cost Estimation (`--dry-run`)

Preview estimated costs before running research:

```bash
uv run {baseDir}/scripts/research.py start "Analyze security architecture" --context ./src --dry-run
```

Outputs a JSON cost estimate to stdout with context upload costs, research query costs, and a total. Estimates are heuristic-based (the Gemini API does not return token counts or billing data) and clearly labeled as such.

After research completes with `--output-dir`, the `metadata.json` file includes a `usage` key with post-run cost estimates based on actual output size and duration.

## File Search Store Commands

Manage file search stores for RAG-grounded research and Q&A.

### Create a Store

```bash
uv run {baseDir}/scripts/store.py create "My Project Docs"
```

### List Stores

```bash
uv run {baseDir}/scripts/store.py list
```

### Query a Store

```bash
uv run {baseDir}/scripts/store.py query <store-name> "What does the auth module do?"
```

| Flag | Description |
|------|-------------|
| `--output-dir DIR` | Save response and metadata to a directory |

### Delete a Store

```bash
uv run {baseDir}/scripts/store.py delete <store-name>
```

Use `--force` to skip the confirmation prompt. When stdin is not a TTY (e.g., called by an AI agent), the prompt is automatically skipped.

## File Upload

Upload files or entire directories to a file search store.

```bash
uv run {baseDir}/scripts/upload.py ./src fileSearchStores/abc123
```

| Flag | Description |
|------|-------------|
| `--smart-sync` | Skip files that haven't changed (hash comparison) |
| `--extensions EXT [EXT ...]` | File extensions to include (comma or space separated, e.g. `py,ts,md` or `.py .ts .md`) |

Hash caches are always saved on successful upload, so a subsequent `--smart-sync` run will correctly skip unchanged files even if the first upload did not use `--smart-sync`.

### MIME Type Support

36 file extensions are natively supported by the Gemini File Search API. Common programming files (JS, TS, JSON, CSS, YAML, etc.) are automatically uploaded as `text/plain` via a fallback mechanism. Binary files are rejected. See `references/file_search_guide.md` for the full list.

**File size limit**: 100 MB per file.

## Session Management

Research IDs and store mappings are cached in `.gemini-research.json` in the current working directory.

### Show Session State

```bash
uv run {baseDir}/scripts/state.py show
```

### Show Research Sessions Only

```bash
uv run {baseDir}/scripts/state.py research
```

### Show Stores Only

```bash
uv run {baseDir}/scripts/state.py stores
```

### JSON Output for Agents

Add `--json` to any state subcommand to output structured JSON to stdout:

```bash
uv run {baseDir}/scripts/state.py --json show
uv run {baseDir}/scripts/state.py --json research
uv run {baseDir}/scripts/state.py --json stores
```

### Clear Session State

```bash
uv run {baseDir}/scripts/state.py clear
```

Use `-y` to skip the confirmation prompt. When stdin is not a TTY (e.g., called by an AI agent), the prompt is automatically skipped.

## Non-Interactive Mode

All confirmation prompts (`store.py delete`, `state.py clear`) are automatically skipped when stdin is not a TTY. This allows AI agents and CI pipelines to call these commands without hanging on interactive prompts.

## Workflow Example

A typical grounded research workflow:

```bash
# 1. Create a file search store
STORE_JSON=$(uv run {baseDir}/scripts/store.py create "Project Codebase")
STORE_NAME=$(echo "$STORE_JSON" | python3 -c "import sys,json; print(json.load(sys.stdin)['name'])")

# 2. Upload your documents
uv run {baseDir}/scripts/upload.py ./docs "$STORE_NAME" --smart-sync

# 3. Query the store directly
uv run {baseDir}/scripts/store.py query "$STORE_NAME" "How is authentication handled?"

# 4. Start grounded deep research (blocking, saves to directory)
uv run {baseDir}/scripts/research.py start "Analyze the security architecture" \
  --store "$STORE_NAME" --output-dir ./research-output --timeout 3600

# 5. Or start non-blocking and check later
RESEARCH_JSON=$(uv run {baseDir}/scripts/research.py start "Analyze the security architecture" --store "$STORE_NAME")
RESEARCH_ID=$(echo "$RESEARCH_JSON" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")

# 6. Check progress
uv run {baseDir}/scripts/research.py status "$RESEARCH_ID"

# 7. Save the report when completed
uv run {baseDir}/scripts/research.py report "$RESEARCH_ID" --output-dir ./research-output
```

## Output Convention

All scripts follow a dual-output pattern:
- **stderr**: Rich-formatted human-readable output (tables, panels, progress bars)
- **stdout**: Machine-readable JSON for programmatic consumption

This means `2>/dev/null` hides the human output, and piping stdout gives clean JSON.

「AI 智慧體」分類下的熱門技能

self-improving agentAI 智慧體

記錄自身發現以實現自我改進的技能

↓ 129萬★ 4521pskoett
Find SkillsAI 智慧體

幫助使用者發現和安裝智慧體技能,當用戶詢問如「如何做X」、「找X的技能」、「有能做...的嗎」等問題時

↓ 110.3萬★ 1778桂皮
Agent BrowserAI 智慧體

給 AI agent 用的瀏覽器自動化命令列技能。

↓ 90.9萬★ 991Nicolas Kleiber
Self-Improving + Proactive AgentAI 智慧體

自我反思+自我批評+自我學習+自組織記憶。智慧體評估自身工作、發現錯誤並持續改進。

↓ 44.4萬★ 1606Iván
Skill VetterAI 智慧體

在安裝第三方技能之前,按清單審查來源、許可權與危險模式的技能。

↓ 33萬★ 1323spclaudehome
ontologyAI 智慧體

類型化知識圖譜,用於結構化智慧體記憶與可組合技能。適用於以下場景:建立/查詢實體(人物、專案、任務、事件、文件)、關聯相關物件、強制執行約束、將多步操作規劃為圖譜變換,或當技能需要共享狀態時。觸發關鍵詞包括"記住""我知道關於什麼""將X連結到Y""顯示依賴關係"、實體增刪改查操作,以及跨技能資料訪問。

↓ 29.4萬★ 788oswalpalash
Proactive AgentAI 智慧體

將 AI 代理從任務執行者轉變為能夠預見需求、持續最佳化的主動夥伴。現已支援 WAL Protocol、Working Buffer、Autonomous Crons 及經過實戰驗證的模式。屬於 Hal Stack 🦞。

↓ 28.8萬★ 913halthelobster
Skill CreatorAI 智慧體

建立有效技能指南。當用戶希望建立新技能(或更新現有技能)以利用專業知識、工作流程或工具整合擴充套件 Claude 的能力時,應使用此技能。

↓ 23.8萬★ 473chindden

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。