2026年5月21日木曜日

SQLclのskillsコマンドを使用してみる

SQLcl 26.1.2よりskillsコマンドが追加されています。各種のAIツールまたはAIエージェント向けに、Oracle Corporationが提供しているAgent Skillsをインストールするときに使用します。

確認作業に、macOS上のSQLclを使用しています。SQLclのバージョンは以下です。

% sql -v

SQLcl: リリース26.1.2.0 Production ビルド: 26.1.2.132.1334

%


SQLcl 26.1.2のHELP SKILLSを実行すると、以下のように表示されます。
Manages SQLcl DBTools skills.

サブコマンド:
  LIST
    Lists available DBTools skills.

    使用方法:
      list|ls {OPTIONS}

    オプション:
      -debug|-de
        Prints debug output.

      -verbose|-v
        Prints verbose progress output.


  SYNC
    Synchronizes the Oracle DBTools skills repository.

    使用方法:
      sync|sy {OPTIONS}

    オプション:
      -skill-name|-sn <skill-name>
        Comma-separated list of skill names to install.

      -version|-ve <version>
        Blessed skills version to install. Defaults to latest.

      -force|-fo
        Overwrites existing skill directories.

      -debug|-de
        Prints debug output.

      -verbose|-v
        Prints verbose progress output.


Examples:
  The skills command is the entry point for DBTools skill management.

  - List available skills:
      SQL> skills list

  - Synchronize the Oracle skills repository:
      SQL> skills sync

  - Synchronize and install selected skills:
      SQL> skills sync --skill-name apexlang,sqlcl

  - Synchronize a blessed skills version:
      SQL> skills sync --version v1

  - Force overwrite existing skill directories:
      SQL> skills sync --force
オラクルが提供しているAgent Skillsの確認にはlistサブコマンド、インストールにはsyncサブコマンドを使用します。

最初にAgent Skillsをリストしてみます。skills listを実行します。

skills list -v -de

SQL> skills list -v -de

DEBUG: Handling DBTools skills command: skills list -v -de


INFO: Listing DBTools skills from /Users/ynakakoshi/.dbtools/skills/repositories/oracle-skills.

DEBUG: Checked DBTools skills updates on main. Local commit: 11e528de5ea0686b53adf1d853c909a4bf9ed4d9. Remote commit: 11e528de5ea0686b53adf1d853c909a4bf9ed4d9.

+========+=========+=============================================================================================+

+ Skill  + Status  + Agents                                                                                      +

+========+=========+=============================================================================================+

| apex   | MISSING | claude-code, cline, codex, cursor, dexto, gemini-cli, github-copilot, goose, opencode, warp |

+--------+---------+---------------------------------------------------------------------------------------------+

| db     | MISSING | claude-code, cline, codex, cursor, dexto, gemini-cli, github-copilot, goose, opencode, warp |

+--------+---------+---------------------------------------------------------------------------------------------+

| fusion | MISSING | claude-code, cline, codex, cursor, dexto, gemini-cli, github-copilot, goose, opencode, warp |

+--------+---------+---------------------------------------------------------------------------------------------+

| graal  | MISSING | claude-code, cline, codex, cursor, dexto, gemini-cli, github-copilot, goose, opencode, warp |

+--------+---------+---------------------------------------------------------------------------------------------+

| oci    | MISSING | claude-code, cline, codex, cursor, dexto, gemini-cli, github-copilot, goose, opencode, warp |

+--------+---------+---------------------------------------------------------------------------------------------+


SQL> 


現時点ではskills syncを一度も実行していない(正確には、skills syncの実行でインストールされたskillsを全て削除した)ため、StatusはMISSINGになっています。

利用可能なスキルとして、apexdbfusiongraalociがリストされています。

これらのスキルの実態は、GitHubのリポジトリhttps://github.com/oracle/skillsに存在します。skills syncを実行すると、このリポジトリにあるファイルが手元にダウンロードされます。

apexとdbのスキルをインストールしてみます。-verboseおよび-debugオプションをつけて実行します。

skills sync -skill-name apex,db -de -v

SQL> skills sync -skill-name apex,db -de -v

DEBUG: Handling DBTools skills command: skills sync -skill-name apex,db -de -v


INFO: DBTools skills sync log: /Users/username/.dbtools/skills/logs/skills-sync-20260521T063459.505Z.log

INFO: Preparing DBTools skills registry: /Users/username/.dbtools/skills/skills.json

INFO: Synchronizing repository oracle-skills from https://github.com/oracle/skills into /Users/username/.dbtools/skills/repositories/oracle-skills

INFO: Cloning or fetching repository...

SUCCESS: Synchronized DBTools skills repository to /Users/username/.dbtools/skills/repositories/oracle-skills version latest (refs/heads/main -> 11e528de5ea0686b53adf1d853c909a4bf9ed4d9).

INFO: Installing synced skills into detected agent global locations...

INFO: Requested skills: apex, db

INFO: Detected agent locations: claude-code, cline, codex, cursor, dexto, gemini-cli, github-copilot, goose, opencode, warp

SUCCESS: Installed 20 entries into agent skill locations.

SUCCESS: DBTools skills sync log: /Users/username/.dbtools/skills/logs/skills-sync-20260521T063459.505Z.log

SQL> 


SQLclのExamplesに、skills syncの例として以下が記載されています。

skills sync --skill-name apexlang,sqlcl

SQL> skills sync --skill-name apexlang,sqlcl

SUCCESS: Synchronized DBTools skills repository to /Users/ynakakoshi/.dbtools/skills/repositories/oracle-skills version latest (refs/heads/main -> 11e528de5ea0686b53adf1d853c909a4bf9ed4d9).

WARN: Requested skills not found: apexlang, sqlcl

SUCCESS: Installed 0 entries into agent skill locations.

SUCCESS: DBTools skills sync log: /Users/ynakakoshi/.dbtools/skills/logs/skills-sync-20260521T064109.564Z.log

SQL> 


HELPのSYNCサブコマンドのヘルプにはスキルを指定するオプションは'-skill-name'と記載されていますが、'--skill-name'(ハイフンがふたつ)でもオプションとしては受け付けるようです。一般的には、長いオプション名は'--'で始まり、短縮名は'-'で始まります。

メッセージに'Requested skills not found: apexlang, sqlcl'と表示されています。この例で指定されているapexlangのスキルは、正しくはapex/apexlangに存在します。sqlclはdb/sqlclです。認識しているスキルはapex、db、fusion、graal、ociに限られているため、現時点では、この例にある指定は不可です。

すでにskills sync -skill-name apex,dbを実行しています。インストールされたスキルを確認します。

skills list

SQL> skills list

+========+===========+=============================================================================================+

+ Skill  + Status    + Agents                                                                                      +

+========+===========+=============================================================================================+

| apex   | INSTALLED | claude-code, cline, codex, cursor, dexto, gemini-cli, github-copilot, goose, opencode, warp |

+--------+-----------+---------------------------------------------------------------------------------------------+

| db     | INSTALLED | claude-code, cline, codex, cursor, dexto, gemini-cli, github-copilot, goose, opencode, warp |

+--------+-----------+---------------------------------------------------------------------------------------------+

| fusion | MISSING   | claude-code, cline, codex, cursor, dexto, gemini-cli, github-copilot, goose, opencode, warp |

+--------+-----------+---------------------------------------------------------------------------------------------+

| graal  | MISSING   | claude-code, cline, codex, cursor, dexto, gemini-cli, github-copilot, goose, opencode, warp |

+--------+-----------+---------------------------------------------------------------------------------------------+

| oci    | MISSING   | claude-code, cline, codex, cursor, dexto, gemini-cli, github-copilot, goose, opencode, warp |

+--------+-----------+---------------------------------------------------------------------------------------------+


Agent Skillsのapexとdbについては、StatusがINSTALLEDに変わっています。

skills syncの実行時に--debugオプションを付加しているため、作業ログが出力されています。その作業ログの内容を確認してみます。

ログからRegistry File(全体の設定ファイル)として、~/.dbtools/skills/skills.jsonが使用されていることがわかります。skills.jsonの先頭で、以下のようにリポジトリが定義されています。
    "repositories": [
        {
            "id": "oracle-skills",
            "url": "https://github.com/oracle/skills",
            "branch": "main",
            "localPath": "~/.dbtools/skills/repositories/oracle-skills",
            "lastSync": "2026-05-21T06:48:09.678712Z",
            "commit": "11e528de5ea0686b53adf1d853c909a4bf9ed4d9",
            "versionRefs": {
                "latest": "refs/tags/v1",
                "v1": "refs/tags/v1"
            },
            "requestedVersion": "latest",
            "resolvedRef": "refs/heads/main",
            "resolvedCommit": "11e528de5ea0686b53adf1d853c909a4bf9ed4d9"
        }
    ],
urlとして指定されているhttps://github.com/oracle/skillsを、localPath~/.dbtools/skills/repositories/oracle-skillsにクローンしています。skill-nameの指定に関わらず、リポジトリ全体がダウンロードされています。

git show-refを実行すると、mainブランチの最新がクローンされていることがわかります。

% cd ~/.dbtools/skills/repositories/oracle-skills 

oracle-skills % git show-ref

11e528de5ea0686b53adf1d853c909a4bf9ed4d9 refs/heads/main

4e91e91590124502af8255d05594319445e9f39a refs/remotes/origin/add-mle-javascript-skill-to-index

4c30742e3d587c0476e02955c3a8069deaa3b471 refs/remotes/origin/add-sql-best-practices-skill

1862eed20c7297516be563150fa7bae8b11b0049 refs/remotes/origin/apex-lite-overview

4efe6c1a8cf3eaef238df1cdee2e4eea90b4a28e refs/remotes/origin/copilot/review-oracle-database-skills

ec862d19e600f51d1aa602b5a1ddbc925be84be4 refs/remotes/origin/deep-review-oracle-skills-pr

1babcdd643cea35cebd866cbd8c13a771590d5f7 refs/remotes/origin/integrate/pending-prs-after-restructure

11e528de5ea0686b53adf1d853c909a4bf9ed4d9 refs/remotes/origin/main

f7675b072a690f25e8cc4446bf14470130b8e663 refs/remotes/origin/mle-javascript-skill

11e7bd3127cbf023b39bd52da2b805aeaab6eb34 refs/remotes/origin/restructure/oracle-domains

5e0cb6a28bd4939b1161e35259d50e27d2b31044 refs/remotes/origin/root-skill-domains

1d0cd74648639fffb94f3130c4373a8a1f6060bd refs/remotes/origin/sqlcl-enhancements

2be594451cf526c5ea6a23da2ddb18fbe7abb286 refs/remotes/origin/tw/add-db-skill-metadata

oracle-skills % ls

CONTRIBUTING.md README.md SKILL_AUTHORING_GUIDE.md db graal

LICENSE.txt SECURITY.md apex fusion oci

oracle-skills % 


versionRefsとしてlatestやv1の設定がありますが、リポジトリにtagが設定されていないため、version指定は使えないはずです。今後、リポジトリ側にtagが付加されると、バージョン指定(--versionまたは-veオプション)が使えるようになる可能性はあります。


ログから確認する範囲では、skills syncは以下の処理を実施しています。
  1. リポジトリ.dbtools/skills/repositories/oracle-skillsを最新に更新する。
  2. SQLclを実行しているホストに実装されているAIエージェントを検出する。
  3. 検出したAIエージェントが認識できるように、リポジトリにクローンしたスキルをコピーする。コピー対象は--skill-nameで指定したスキルに限定される。
ログを見る範囲では、私の環境ではclaude-code、cline、codex、cursor、dexto、gemini-cli、github-copilot、goose、opencode、warpが見つかっています。

[2026-05-21T07:17:27.519946Z] detectedAgents: claude-code, cline, codex, cursor, dexto, gemini-cli, github-copilot, goose, opencode, warp

[2026-05-21T07:17:27.520090Z] missingAgents: adal, aider-desk, amp, antigravity, augment, bob, codearts-agent, codebuddy, codemaker, codestudio, command-code, continue, cortex, crush, deepagents, devin, droid, firebender, forgecode, iflow-cli, junie, kilo, kimi-cli, kiro-cli, kode, mcpjam, mistral-vibe, mux, neovate, openclaw, openhands, pi, pochi, qoder, qwen-code, replit, roo, rovodev, tabnine-cli, trae, trae-cn, universal, windsurf, zencoder


Claude Code、Codex、Gemini CLI、OpenCodeは使用していますが、その他は使用していません。cline、cursor、github-copilotは使用したことがあるため検出されるのも分かりますが、dexto、goose、warpについては使用した覚えがありません。

検出されたエージェントについては、スキルのコピーが実施されます。以下はClaude Code向けの作業ログです。

[2026-05-21T07:17:27.520571Z] result: INSTALLED agent=claude-code displayName=Claude Code projectPath=.claude/skills/ globalPath=~/.claude/skills/ entry=apex target=/Users/username/.claude/skills/apex

[2026-05-21T07:17:27.520589Z] result: INSTALLED agent=claude-code displayName=Claude Code projectPath=.claude/skills/ globalPath=~/.claude/skills/ entry=db target=/Users/username/.claude/skills/db


projectPathおよびglobalPathが表示されていますが、Agent Skillsは常にtargetにコピーされているようです。つまりグローバル設定にコピーされ、プロジェクトパスにはコピーされていません。将来はprojectPathにコピーできるようになるかもしれませんが、現時点ではskills syncの宛先にプロジェクトを指定するオプションはありません。

skill-nameで指定したスキルのコピーは、検出したすべてのエージェントを対象に実行されます。すべてグローバル設定です。

Claude Codeでは~/.claude/skills以下、Clineでは~/.agents/skills、Codexは~/.codex/skills、Cursorは~/.cursor/skills、Gemini CLIは~/.gemini/skills、GitHub Copilotでは~/.copilot/skills、OpenCodeでは~/.config/opencode/skillsがコピー先となっていました。

一旦インストールされたAgent Skills、特にグローバル設定としてインストールされたAgent Skillsを削除するときは、上記のディレクトリ以下にコピーされたスキル名のディレクトリを削除します。

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