game-ai
Develops AI algorithms for games, including pathfinding, decision trees, and machine learning integration.
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o game-ai.zip https://jpskill.com/download/22217.zip && unzip -o game-ai.zip && rm game-ai.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/22217.zip -OutFile "$d\game-ai.zip"; Expand-Archive "$d\game-ai.zip" -DestinationPath $d -Force; ri "$d\game-ai.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
game-ai.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
game-aiフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
game-ai
目的
このスキルは、ゲーム向けのAIアルゴリズムを開発します。特に、パスファインディング(例:A*アルゴリズム)、NPCの行動のための意思決定ツリー、および機械学習の統合(例:TensorFlowを使用したモデルのトレーニング)に焦点を当てています。これにより、ゲーム開発ワークフローにおけるAIロジックの自動化を支援します。
使用する場面
- グリッドベースの世界で最適なパスを見つけるなど、ゲームでNPCのナビゲーションを実装する場合。
- ゲームの状態に基づいて敵AIが行動を選択するなど、意思決定システムを作成する場合。
- リアルタイムシミュレーションでプレイヤーの動きを予測するモデルをトレーニングするなど、適応型AIのためにMLを統合する場合。
主な機能
- パスファインディング:設定可能なヒューリスティックを備えたA*アルゴリズムを実装しています。最大100x100セルのグリッドベースマップをサポートします。
- 意思決定ツリー:JSON設定ファイルからツリーを構築します(例:
{"node": "if health < 50 then flee"})。1回の意思決定あたり10ms未満で評価します。 - 機械学習の統合:モデルトレーニングのためにTensorFlow APIをラップします。ゲームにおける強化学習のために、入力ベクトルとともに
/api/ml/trainのようなエンドポイントを使用します。 - 最適化:パフォーマンスチューニングのためのフラグが含まれています。例えば、
--optimize-memoryはパスファインディングルーチンでヒープ使用量を20%削減します。
使用パターン
このスキルを使用するには、OpenClawのCLIまたはAPIを介して呼び出し、必要なパラメータを渡します。認証のために環境変数$GAME_AI_API_KEYを常に設定してください。パスファインディングの場合、開始/終了点とグリッドを指定して関数を呼び出します。意思決定ツリーの場合、設定をロードして入力を評価します。API呼び出しをtry-catchブロックでラップするなど、非同期応答を処理するようにコードを構造化してください。
一般的なコマンド/API
- CLIコマンド:
openclaw game-ai pathfind --start 0,0 --end 10,10 --grid '{"width":20,"height":20,"obstacles":[[5,5]]}'- コードスニペット:
import openclaw result = openclaw.run('game-ai pathfind', {'start': '0,0', 'end': '10,10'}) print(result['path']) # Outputs: [[0,0], [1,0], ...]
- コードスニペット:
- APIエンドポイント:JSONボディ
{"tree": {"root": "if enemy_near then attack"}, "input": {"enemy_near": true}}とともに/api/game-ai/decision-treeにPOSTします。- コードスニペット:
import requests headers = {'Authorization': f'Bearer {os.environ["GAME_AI_API_KEY"]}'} response = requests.post('https://api.openclaw.com/api/game-ai/decision-tree', json={'tree': {...}}, headers=headers) print(response.json()['decision']) # e.g., 'attack'
- コードスニペット:
- 設定形式:入力にはJSONを使用します(例:
{"algorithm": "A*", "params": {"heuristic": "manhattan"}})。実行前にエラーをチェックするために--validate-configフラグで検証してください。
統合に関する注意点
OpenClaw SDKをインポートし、$GAME_AI_API_KEYで初期化して統合します。ゲームエンジン向けには、Unity(C#スクリプト経由)またはUnreal(ブループリント経由)にモジュールとして追加してください。OpenClaw SDK v2.5+を使用するなど、バージョンを一致させて互換性を確保してください。MLの場合、pip install tensorflowを追加し、$TF_MODEL_PATH=/path/to/model.h5のような環境変数で設定することで、TensorFlowのような外部ライブラリにリンクします。ゲームループの中断を避けるため、サンドボックス環境で統合をテストしてください。
エラー処理
応答コードを検査して常にAPIエラーをチェックしてください(例:認証されていない場合は401、$GAME_AI_API_KEYを使用した再試行で処理)。無効な入力の場合、詳細をログに記録するためにCLIフラグ--debugを使用します(例:openclaw game-ai pathfind --start invalid --debug)。コードでは、不正な形式のグリッドに対するValueErrorのような例外をキャッチします。
- コードスニペット:
try: path = openclaw.run('game-ai pathfind', params) except ValueError as e: print(f"Error: {e} - Fix grid format and retry")使用前に設定を検証し(例:事前チェック関数を使用)、ネットワーク障害に対しては指数関数的バックオフで最大3回まで再試行を実装してください。
具体的な使用例
- 2Dゲームでのパスファインディング:障害物の周りのNPCのパスを見つけるには、
openclaw game-ai pathfind --start 1,1 --end 5,5 --grid '{"width":10,"obstacles":[[3,3]]}'を実行します。これは座標のリストを返します。パス配列に基づいてNPCの位置を更新することで、ゲームループに統合します。 - 敵AIのための意思決定ツリー:
openclaw game-ai build-tree --config '{"root": "if player_health < 20 then heal"}'でツリーを構築し、ゲーム内で評価します。APIを使用して意思決定をチェックします(例:現在のゲーム状態とともに/api/game-ai/decision-treeにPOSTし、応答が「heal」であれば回復などのアクションをトリガーします)。
グラフ関係
- 関連クラスター:game-dev(ゲーム関連スキルに対する直接の親)。
- 関連タグ:artificial-intelligence(MLコンポーネントを共有)、pathfinding(コア機能の重複)。
- 接続:統合のために「game-engine」のようなスキルにリンクし、高度なトレーニングのために「ml-tools」にリンクします。ゲームAIをゲームエコシステムにおけるAIの中心ノードとしてサブグラフを形成します。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
game-ai
Purpose
This skill develops AI algorithms for games, focusing on pathfinding (e.g., A* algorithm), decision trees for NPC behaviors, and machine learning integration (e.g., using TensorFlow for training models). It helps automate AI logic in game development workflows.
When to Use
- When implementing NPC navigation in games, such as finding optimal paths in a grid-based world.
- For creating decision-making systems, like enemy AI choosing actions based on game states.
- Integrating ML for adaptive AI, such as training models to predict player moves in real-time simulations.
Key Capabilities
- Pathfinding: Implements A* algorithm with configurable heuristics; supports grid-based maps up to 100x100 cells.
- Decision Trees: Builds trees from JSON config files, e.g., {"node": "if health < 50 then flee"}; evaluates in under 10ms per decision.
- Machine Learning Integration: Wraps TensorFlow APIs for model training; uses endpoints like
/api/ml/trainwith input vectors for reinforcement learning in games. - Optimization: Includes flags for performance tuning, such as
--optimize-memoryto reduce heap usage by 20% in pathfinding routines.
Usage Patterns
To use this skill, invoke it via OpenClaw's CLI or API, passing required parameters. Always set the environment variable $GAME_AI_API_KEY for authentication. For pathfinding, call a function with a start/end point and grid; for decision trees, load a config and evaluate inputs. Structure code to handle asynchronous responses, e.g., wrap API calls in try-catch blocks.
Common Commands/API
- CLI Command:
openclaw game-ai pathfind --start 0,0 --end 10,10 --grid '{"width":20,"height":20,"obstacles":[[5,5]]}'- Code Snippet:
import openclaw result = openclaw.run('game-ai pathfind', {'start': '0,0', 'end': '10,10'}) print(result['path']) # Outputs: [[0,0], [1,0], ...]
- Code Snippet:
- API Endpoint: POST to
/api/game-ai/decision-treewith JSON body {"tree": {"root": "if enemy_near then attack"}, "input": {"enemy_near": true}}- Code Snippet:
import requests headers = {'Authorization': f'Bearer {os.environ["GAME_AI_API_KEY"]}'} response = requests.post('https://api.openclaw.com/api/game-ai/decision-tree', json={'tree': {...}}, headers=headers) print(response.json()['decision']) # e.g., 'attack'
- Code Snippet:
- Config Format: Use JSON for inputs, e.g., {"algorithm": "A*", "params": {"heuristic": "manhattan"}}; validate with
--validate-configflag to check for errors before execution.
Integration Notes
Integrate by importing the OpenClaw SDK and initializing with $GAME_AI_API_KEY. For game engines, add as a module in Unity (via C# scripts) or Unreal (via Blueprints). Ensure compatibility by matching versions, e.g., use OpenClaw SDK v2.5+. For ML, link to external libraries like TensorFlow by adding pip install tensorflow and configuring via env vars, e.g., $TF_MODEL_PATH=/path/to/model.h5. Test integrations in a sandbox environment to avoid game loop interruptions.
Error Handling
Always check for API errors by inspecting response codes (e.g., 401 for unauthorized, handled via retry with $GAME_AI_API_KEY). For invalid inputs, use CLI flag --debug to log details, e.g., openclaw game-ai pathfind --start invalid --debug. In code, catch exceptions like ValueError for malformed grids:
- Code Snippet:
try: path = openclaw.run('game-ai pathfind', params) except ValueError as e: print(f"Error: {e} - Fix grid format and retry")Validate configs before use, e.g., with a pre-check function, and implement retries for network failures up to 3 attempts with exponential backoff.
Concrete Usage Examples
- Pathfinding in a 2D Game: To find a path for an NPC around obstacles, run
openclaw game-ai pathfind --start 1,1 --end 5,5 --grid '{"width":10,"obstacles":[[3,3]]}'. This returns a list of coordinates; integrate into your game loop by updating the NPC's position based on the path array. - Decision Tree for Enemy AI: Build a tree with
openclaw game-ai build-tree --config '{"root": "if player_health < 20 then heal"}', then evaluate in-game: Use the API to check decisions, e.g., POST to/api/game-ai/decision-treewith current game state, and trigger actions like healing if the response is "heal".
Graph Relationships
- Related Clusters: game-dev (direct parent for game-related skills).
- Related Tags: artificial-intelligence (shares ML components), pathfinding (core functionality overlap).
- Connections: Links to skills like "game-engine" for integration, and "ml-tools" for advanced training; forms a subgraph with "game-ai" as a central node for AI in gaming ecosystems.