2026年5月22日金曜日

Google Antigravityで売り上げ分析とAPEX 26.1のアプリケーション生成を試してみる

最近GoogleよりリリースされたAntigravity 2.0とCLIを使用して、以前にClaude Cowork/CodeやOpenAI Codexで実施した以下の作業を行ってみます。

  1. Antigravityのデストップ・アプリからMCPサーバーを通してOracle Databaseに接続し、Agent Skillsを使った販売分析を実行する。
  2. Antigravity CLIを使ってAPEX 26.1のアプリケーションを生成する。
Google Antigravity 2.0のアナウンスはこちら[Introducing Google Antigravity 2.0]、Antigravity CLIのアナウンスはこちら[Google Antigravity CLI]です。

作業はApple Macbook Proで実施しています。使用しているOracle DatabaseやAPEXについては、United Codes社が公開しているUC Local APEX Devを使って作業環境を作成しています。

macOSでのUC Local APEX Devを使った作業環境の作成について、以下の記事で紹介しています。

United CodesのUC Local APEX Devを使ってOracle APEXのローカル開発環境を作成する

サンプル・スキーマSales Historyのインストールについて、以下の記事で紹介しています。


以下は、これからの作業の前提です。
  1. ローカルで実行しているOracle AI Database 26ai Freeに、APEXワークスペースとしてAPEXDEV(スキーマAPEXDEV)が作成されている。
  2. スキーマSHにSales Historyのサンプル・データがインストールされている。
  3. SQLclの接続としてlocal-26ai-sys、local-26ai-apexdevが作成されている。
Google Antigravityのダウンロードとインストールについては、Googleのdownload pageを参照してください。Antigravity 2.0とAntigravity CLIの両方をインストールします。


Google Antigravityで売り上げ分析



Gemini CLIでの作業は、記事「Gemini CLIからOracle Databaseに接続するMCPサーバーを呼び出す」で紹介しています。この作業の対象を、Google Antigravityのデスクトップ・アプリに変更します。Gemini CLIからの移行ガイド[Migrating from Gemini CLI]を参照して、Gemini CLI向けの設定をAntigravity向けに変更します。

スキルのインストールにMicrosoft APMを使用します。APMは最新版に更新します。以前からターゲットとしてgeminiは指定できましたが、APMの新しいバージョンでは、ワークスペース単位のスキルを.gemini以下から.agents以下にコピーするように変更されています。Migration Guideによると、Antigravityは.agents/skills/のみを参照し、.gemini/skills/は参照しません。

今回の作業では、APM 0.14.1を使用しています。

apm --version

Documents % apm --version

Agent Package Manager (APM) CLI version 0.14.1 (90edce4)

Documents % 


以前に作成したスキルを流用するため、GitHubのリポジトリsh-sales-analysisをクローンします。

git clone https://github.com/ujnak/sh-sales-analysis.git
cd sh-sales-analysis


Documents % git clone https://github.com/ujnak/sh-sales-analysis.git

Cloning into 'sh-sales-analysis'...

remote: Enumerating objects: 28, done.

remote: Counting objects: 100% (28/28), done.

remote: Compressing objects: 100% (21/21), done.

remote: Total 28 (delta 3), reused 27 (delta 2), pack-reused 0 (from 0)

Receiving objects: 100% (28/28), 10.77 KiB | 2.15 MiB/s, done.

Resolving deltas: 100% (3/3), done.

Documents % cd sh-sales-analysis

sh-sales-analysis % 


リポジトリに含まれる販売分析のスキルを、Gemini CLI向けにインストールします。MCPサーバーについては(おそらく)適切にインストールされないと思ったので、インストール対象から外しています。

apm install --only apm --target gemini

.agents以下にスキルがコピーされます。

sh-sales-analysis % apm install --only apm --target gemini                                      

[>] Installing dependencies from apm.yml...

[i] Targets: gemini  (source: --target flag)

  [+] <project root> (local)

  |-- 4 skill(s) integrated -> .agents/skills/


[*] Installed 1 APM dependency in 0.4s.

sh-sales-analysis % 


新しいAPMのcompileコマンドは、Antigravityが参照できるファイルを生成するようなので実行します。

apm compile --target gemini

APMにinstructions/sh-schema.instructions.mdとして登録したファイルから、AGENTS.mdとGEMINI.mdが生成されます。

sh-sales-analysis % apm compile --target gemini

[*] Starting context compilation...

[i] Targets: gemini  (source: --target flag)

[i] Compiling for GEMINI.md + .gemini/commands/ + .gemini/skills/ + .gemini/settings.json (MCP/hooks) - explicit --target flag

[i] Analyzing project structure...

|- 1 directories scanned (max depth: 0)

|- 3 files analyzed across 3 file types (md, yaml, yml)

+- 1 instruction patterns detected


Optimizing placements...

                                                                                                                    

  Pattern                     Source                 Coverage    

Placement                   Metrics               

 ────────────────────────────────────────────────────────────────────────────────────────────────────────────────── 

  **                          sh-schema.instructi…   1/1          ./AGENTS.md

   rel: 100%             

                                                                                                                    



Generated 1 AGENTS.md file

+- Context efficiency:    100.0%

+- Generation time:       1ms


Placement Distribution

+- .                              1 instruction from 1 source

[i] Generated GEMINI.md (imports AGENTS.md)

[+] Compilation completed successfully!

[!] Compilation completed with 2 warning(s):

[!]   .apm/instructions/sh-schema.instructions.md: Missing 'description' in frontmatter

[!]   .apm/instructions/sh-schema.instructions.md: Missing 'description' in frontmatter

sh-sales-analysis % ls

AGENTS.md apm_modules apm.lock.yaml apm.yml GEMINI.md README.md

sh-sales-analysis % 


ローカルのOracle Databaseに接続するMCPサーバーを設定します。Antigravityでは.agents/mcp_config.jsonにMCPサーバーを設定するように変わっています。

以下の内容を.agents/mcp_config.jsonに記述します。
{
  "mcp": {
    "allowed": ["oracle-sh"],
    "excluded": []
  },
  "mcpServers": {
    "oracle-sh": {
      "command": "/opt/homebrew/Caskroom/sqlcl/26.1.2.132.1334/sqlcl/bin/sql",
      "args": ["-R", "4", "-mcp"]
    }
  }
}
以上でプロジェクトに追加するフォルダの準備ができました。

Antigravityのデスクトップ・アプリを起動し、プロジェクトを追加します。

ProjectsからNew Projectを実行します。


Add Folderをクリックし、先ほどまで作業していたsh-sales-analysisを追加します。


プロジェクトを作成します。


インストールしたスキルやMCPサーバーを使用して、チャットができる状態になりました。


MCPサーバーoracle-shで利用可能な接続を一覧します。

「 oracle-shで利用できる接続を一覧して。」


ローカルで実行しているデータベースへの接続local-26ai-apexdevに接続します。

「local-26ai-apexdevに接続して。」


スキルを参照した検索を実行します。

「 売り上げの地域別のランキングを調べて。」


この後にも色々な回答が続きましたが、どうもスキルは参照していないようでした。

「スキルは参照しましたか?」

スキルファイルは参照していかなったので、rankingとsales-analysisを参照して分析をやり直してくれました。


/を入力すると、custom-analysis、ranking、sales-analysis、trendが利用できることが確認できます。


以上でGoogle Antigravityを使って、Oracle Databaseに接続して分析作業が行えることが確認できました。


Antigravity CLIでAPEX 26.1のアプリケーション生成



記事「CodexとClaude CodeでAPEX 26.1のAPEXlangによるアプリケーション生成を試してみる」にて実施した作業を、Antigravity CLIで行います。

表EMPをAPEXアプリケーションのソースとして使用するため、APEXのワークスペースにサンプル・データセットのEMP/DEPTをインストールしておきます。

作業ディレクトリとしてemp-crud-agyを作成し、移動します。

mkdir emp-crud-agy
cd emp-crud-agy


Documents % mkdir emp-crud-agy

Documents % cd emp-crud-agy

emp-crud-agy % 


Gitで管理する予定はありませんが、初期化だけしておきます。

git init

emp-crud-agy % git init

Initialized empty Git repository in /Users/username/Documents/emp-crud-agy/.git/

emp-crud-agy % 


Oracle Corporationから提供されているAgent SkillsをMicrosoft APMを使ってインストールします。

以下の内容で、ファイルapm.ymlを作成します。
name: emp-crud
version: 0.1.0
description: Oracle APEX 26.1のAPEXlangを使ってアプリケーションを作成する。
author: Yuji
dependencies:
  apm:
    # Oracle Database Skills
    - git: https://github.com/oracle/skills
      path: db
      ref: main
    # Oracle APEX Skills
    - git: https://github.com/oracle/skills
      path: apex
      ref: main

apm.ymlを作成した後、Antigravity向けにインストールします。

apm install --target gemini

emp-crud-agy % apm install --target gemini

[>] Installing dependencies from apm.yml...

[>] Resolving skills-apex...

[>] Resolving skills-db...

[i] Targets: gemini  (source: --target flag)

  [+] github.com/oracle/skills/apex#main #main @11e528de

  |-- Skill integrated -> .agents/skills/

  [+] github.com/oracle/skills/db#main #main @11e528de

  |-- Skill integrated -> .agents/skills/

[i] Added apm_modules/ to .gitignore


[*] Installed 2 APM dependencies in 1.3s.

emp-crud-agy % 


Oracle Databaseにアクセスできるように、SQLclのMCPサーバーを設定します。

以下の内容を、ファイル.agents/mcp_config.jsonに記述します。MCPサーバーの名前はoracle-apexdevとしています。
{
  "mcp": {
    "allowed": ["oracle-apexdev"],
    "excluded": []
  },
  "mcpServers": {
    "oracle-apexdev": {
      "command": "/opt/homebrew/Caskroom/sqlcl/26.1.2.132.1334/sqlcl/bin/sql",
      "args": ["-R", "4", "-mcp"]
    }
  }
}
以上で、Antigravity CLIを使ってAPEXアプリケーションを生成する準備ができました。

Antigravity CLIを起動します。

agy

Antigravity CLIが作業ディレクトリを操作する権限を要求してくるので、Yesとして許可を与えます。

Accessing workspace:


/Users/username/Documents/emp-crud-agy


Do you trust the contents of this project?


Antigravity CLI requires permission to read, edit, and execute files here.


> Yes, I trust this folder

  No, exit


  ↑/↓ Navigate · enter Confirm

                                                         Gemini 3.5 Flash (High)


Antigravityがプロンプトを受け付ける状態になります。

emp-crud-agy % agy



              Antigravity CLI 1.0.1

           yuji.nkks@gmail.com (Google AI Pro)

          Gemini 3.5 Flash (High)

           ~/Documents/emp-crud-agy

       


────────────────────────────────────────────────────────────────────────────────

>

────────────────────────────────────────────────────────────────────────────────

? for shortcuts                                          Gemini 3.5 Flash (High)


以下のプロンプトを与えて、APEXアプリケーションを作成します。
1. MCPサーバーoracle-apexdevで、データベースlocal-26ai-apexdevに接続してください。
2. local-26ai-apexdevはユーザーapexdevで接続されています。これはAPEXワークスペースAPEXDEVのパーシング・スキーマです。
3. スキーマAPEXDEVには表EMPが存在します。
4. APEXlangのスキルを参照して、表EMPの一覧を表示する対話モード・レポートのページと、従業員の作成、更新、削除ができるフォームを持つAPEXアプリケーションEMP_CRUDを作成してください。
5. アプリケーションはディレクトリapplications以下にEMP_CRUDとして作成してください。
6. アプリケーションのインポートはMCPサーバーではなく、applications/EMP_CRUDに移動した後に、"sql -name local-26ai-apexdev"でSQLclを起動し、"apex import"を実行することで、APEXアプリケーションのインポートを行なってください。

              Antigravity CLI 1.0.1

           yuji.nkks@gmail.com (Google AI Pro)

          Gemini 3.5 Flash (High)

           ~/Documents/emp-crud-agy

       


────────────────────────────────────────────────────────────

> 1. MCPサーバーoracle-apexdevで、データベースlocal-26ai-

  apexdevに接続してください。

  2. local-26ai-

  apexdevはユーザーapexdevで接続されています。これはAPEXワークスペースAPEXDEVの

  ーシング・スキーマです。

  3. スキーマAPEXDEVには表EMPが存在します。

  4.

  APEXlangのスキルを参照して、表EMPの一覧を表示する対話モード・レポートのページ

  、従業員の作成、更新、削除ができるフォームを持つAPEXアプリケーションEMP_CRUDを

  作成してください。

  5.

  アプリケーションはディレクトリapplications以下にEMP_CRUDとして作成してください

 

  6.

  アプリケーションのインポートはMCPサーバーではなく、applications/EMP_CRUDに移動

  した後に、"sql -name local-26ai-apexdev"でSQLclを起動し、"apex

  import"を実行することで、APEXアプリケーションのインポートを行なってください。


Read(/Users/ynakakoshi/Documents/emp-crud-agy/.agents/skills/apex/SKILL.md)

ListDir(/Users/ynakakoshi/Documents/emp-...agy/.agents/skills/apex/apexlang)

Read(/Users/ynakakoshi/Documents/emp-cr...ents/skills/apex/apexlang/SKILL.md)

ListDir(/Users/ynakakoshi/Documents/emp-.../skills/apex/apexlang/references)

ListDir(/Users/ynakakoshi/Documents/emp-...ex/apexlang/references/workflows)

Read(/Users/ynakakoshi/Documents/emp-cr...ences/workflows/apex-generation.md)

ListDir(/Users/ynakakoshi/Documents/emp-...gents/skills/apex/apexlang/tools)

ListPermissions(You have read and write access to the following

workspace(s)...)

Bash(node tools/apexctl.mjs workspace probe)

ListDir(/Users/ynakakoshi/Documents/emp-crud-agy)

ListDir(/Users/ynakakoshi/Documents/emp-...ents/skills/apex/apexlang/assets)

Bash(node tools/apexctl.mjs --help) (ctrl+o to expand)


Command

────────────────────────────────────────────────────────────────────────────────


  Requesting permission for: node tools/apexctl.mjs --help


Do you want to proceed?

> 1. Yes

  2. No


  ↑/↓ Navigate · tab Amend · e edit command

esc to cancel                                            Gemini 3.5 Flash (High)



色々と処理を行った後に、Antigravityが、I have created the implementation plan for the ...と実装のプランを作成してた上で、確認を求めてきました。

approvedと入力して、実装を開始します。

  I have created the implementation plan for the  EMP_CRUD  APEX application.


  Please review implementation_plan.md and let me know if you approve so I can

  proceed with the execution phase.


────────────────────────────────────────────────────────────

> approved


▸ Thought for 2s, 371 tokens

  Initiating Execution Phase


色々と紆余曲折がありましたが最終的にはAPEXアプリケーションが作成されて、APEXのワークスペースにインポートされました。

Bash(sql -name local-26ai-apexdev <<EOF) (ctrl+o to expand)


  I will wait for the import task to finish in the background.


▸ Thought for 3s, 542 tokens

  Confirming Successful Import

  I will update the  walkthrough.md  artifact to document the successful

  compilation and import of the application using SQLcl, including how the

  page alias filename mismatch warning was addressed.


Create(/Users/ynakakoshi/.gemi...289d719b/walkthrough.md) (ctrl+o to expand)


  I will update the  task.md  file to reflect that all import tasks and

  verification steps are complete.


Create(/Users/ynakakoshi/.gemi...60-b8ea289d719b/task.md) (ctrl+o to expand)


  I have completed the import process and finalized the application.


  ### Summary of Work Done


  1. Executed SQLcl APEX Import:

  Imported the  EMP_CRUD  application into the  APEXDEV  workspace using

  SQLcl. The initial import generated a compilation warning about a mismatch

  between the filename and the defined page alias.

  2. Resolved Page Alias Warning:

  Updated the page alias inside p00003-employee-form.apx from  EMPLOYEE-DETAILS

to    

  EMPLOYEE-FORM  to match the filename.

  3. Re-executed Import:

  Successfully imported the application (Application ID:  111 ) with zero

  warnings or errors.


  Please check the updated walkthrough.md and task.md for full

  execution logs and details.


                                               2 artifacts · /artifact to review

────────────────────────────────────────────────────────────────────────────────

>

────────────────────────────────────────────────────────────────────────────────

? for shortcuts                                          Gemini 3.5 Flash (High)


作成されたアプリケーションを実行してみます。

対話モード・レポートのページは作成されていますが、ORA-00904が発生しています。


ページ・デザイナで確認したところ、レポート列の名前が小文字でした。列の同期化を実行する必要があります。


列の同期化を実行して、対話モード・レポートの列を調整すると、とりあえずはアプリケーションが動作するようになりました。


今回の記事は以上になります。