jpskill.com
🛠️ 開発・MCP コミュニティ 🔴 エンジニア向け 👤 エンジニア・AI開発者

🛠️ Get Available Resources

get-available-resources

計算負荷の高い分析やモデル学習などを始める前に、利用

⏱ MCPサーバー実装 1日 → 2時間

📺 まず動画で見る(YouTube)

▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗

※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。

📜 元の英語説明(参考)

This skill should be used at the start of any computationally intensive scientific task to detect and report available system resources (CPU cores, GPUs, memory, disk space). It creates a JSON file with resource information and strategic recommendations that inform computational approach decisions such as whether to use parallel processing (joblib, multiprocessing), out-of-core computing (Dask, Zarr), GPU acceleration (PyTorch, JAX), or memory-efficient strategies. Use this skill before running analyses, training models, processing large datasets, or any task where resource constraints matter.

🇯🇵 日本人クリエイター向け解説

一言でいうと

計算負荷の高い分析やモデル学習などを始める前に、利用

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o get-available-resources.zip https://jpskill.com/download/4163.zip && unzip -o get-available-resources.zip && rm get-available-resources.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/4163.zip -OutFile "$d\get-available-resources.zip"; Expand-Archive "$d\get-available-resources.zip" -DestinationPath $d -Force; ri "$d\get-available-resources.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して get-available-resources.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → get-available-resources フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-18
同梱ファイル
2

💬 こう話しかけるだけ — サンプルプロンプト

  • Get Available Resources を使って、最小構成のサンプルコードを示して
  • Get Available Resources の主な使い方と注意点を教えて
  • Get Available Resources を既存プロジェクトに組み込む方法を教えて

これをClaude Code に貼るだけで、このSkillが自動発動します。

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

利用可能なリソースの取得

概要

利用可能な計算リソースを検出し、科学計算タスクのための戦略的な推奨事項を生成します。このスキルは、CPUの機能、GPUの利用可能性(NVIDIA CUDA、AMD ROCm、Apple Silicon Metal)、メモリの制約、ディスク容量を自動的に特定し、計算アプローチについて情報に基づいた意思決定を行うのに役立ちます。

このスキルを使用するタイミング

計算負荷の高いタスクの前に、このスキルを積極的に使用してください。

  • データ分析の前: データセットをメモリにロードできるか、またはアウトオブコア処理が必要かを判断します。
  • モデルトレーニングの前: GPUアクセラレーションが利用可能か、どのバックエンドを使用するかを確認します。
  • 並列処理の前: joblib、multiprocessing、またはDaskに最適なワーカー数を特定します。
  • 大規模ファイル操作の前: 十分なディスク容量と適切なストレージ戦略を確認します。
  • プロジェクト初期化時: アーキテクチャ上の決定を行うためのベースライン機能を理解します。

使用例:

  • 「この50GBのゲノミクスデータセットを分析するのを手伝ってください」→ Dask/Zarrが必要かどうかを判断するために、まずこのスキルを使用します。
  • 「このデータでニューラルネットワークをトレーニングしてください」→ 利用可能なGPUとバックエンドを検出するために、このスキルを使用します。
  • 「10,000個のファイルを並列処理してください」→ 最適なワーカー数を決定するために、このスキルを使用します。
  • 「計算負荷の高いシミュレーションを実行してください」→ リソースの制約を理解するために、このスキルを使用します。

このスキルの仕組み

リソース検出

このスキルは scripts/detect_resources.py を実行し、以下を自動的に検出します。

  1. CPU情報

    • 物理コア数と論理コア数
    • プロセッサアーキテクチャとモデル
    • CPU周波数情報
  2. GPU情報

    • NVIDIA GPU: nvidia-smi経由で検出し、VRAM、ドライバーバージョン、計算能力を報告します。
    • AMD GPU: rocm-smi経由で検出します。
    • Apple Silicon: MetalをサポートするM1/M2/M3/M4チップとユニファイドメモリを検出します。
  3. メモリ情報

    • 合計RAMと利用可能なRAM
    • 現在のメモリ使用率
    • スワップ領域の利用可能性
  4. ディスク容量情報

    • 作業ディレクトリの合計ディスク容量と利用可能なディスク容量
    • 現在の使用率
  5. オペレーティングシステム情報

    • OSタイプ(macOS、Linux、Windows)
    • OSバージョンとリリース
    • Pythonバージョン

出力形式

このスキルは、現在の作業ディレクトリに .claude_resources.json ファイルを生成します。このファイルには以下が含まれます。

{
  "timestamp": "2025-10-23T10:30:00",
  "os": {
    "system": "Darwin",
    "release": "25.0.0",
    "machine": "arm64"
  },
  "cpu": {
    "physical_cores": 8,
    "logical_cores": 8,
    "architecture": "arm64"
  },
  "memory": {
    "total_gb": 16.0,
    "available_gb": 8.5,
    "percent_used": 46.9
  },
  "disk": {
    "total_gb": 500.0,
    "available_gb": 200.0,
    "percent_used": 60.0
  },
  "gpu": {
    "nvidia_gpus": [],
    "amd_gpus": [],
    "apple_silicon": {
      "name": "Apple M2",
      "type": "Apple Silicon",
      "backend": "Metal",
      "unified_memory": true
    },
    "total_gpus": 1,
    "available_backends": ["Metal"]
  },
  "recommendations": {
    "parallel_processing": {
      "strategy": "high_parallelism",
      "suggested_workers": 6,
      "libraries": ["joblib", "multiprocessing", "dask"]
    },
    "memory_strategy": {
      "strategy": "moderate_memory",
      "libraries": ["dask", "zarr"],
      "note": "Consider chunking for datasets > 2GB"
    },
    "gpu_acceleration": {
      "available": true,
      "backends": ["Metal"],
      "suggested_libraries": ["pytorch-mps", "tensorflow-metal", "jax-metal"]
    },
    "large_data_handling": {
      "strategy": "disk_abundant",
      "note": "Sufficient space for large intermediate files"
    }
  }
}

戦略的な推奨事項

このスキルは、コンテキストに応じた推奨事項を生成します。

並列処理の推奨事項:

  • 高並列性(8コア以上): Dask、joblib、またはmultiprocessingを、ワーカー数 = コア数 - 2 で使用します。
  • 中並列性(4-7コア): joblibまたはmultiprocessingを、ワーカー数 = コア数 - 1 で使用します。
  • シーケンシャル(4コア未満): オーバーヘッドを避けるため、シーケンシャル処理を優先します。

メモリ戦略の推奨事項:

  • メモリ制約あり(利用可能4GB未満): アウトオブコア処理のためにZarr、Dask、またはH5pyを使用します。
  • 中程度のメモリ(利用可能4-16GB): 2GBを超えるデータセットにはDask/Zarrを使用します。
  • メモリ豊富(利用可能16GB超): ほとんどのデータセットを直接メモリにロードできます。

GPUアクセラレーションの推奨事項:

  • NVIDIA GPUが検出された場合: PyTorch、TensorFlow、JAX、CuPy、またはRAPIDSを使用します。
  • AMD GPUが検出された場合: PyTorch-ROCmまたはTensorFlow-ROCmを使用します。
  • Apple Siliconが検出された場合: MPSバックエンドを備えたPyTorch、TensorFlow-Metal、またはJAX-Metalを使用します。
  • GPUが検出されない場合: CPU最適化ライブラリを使用します。

大規模データ処理の推奨事項:

  • ディスク制約あり(10GB未満): ストリーミングまたは圧縮戦略を使用します。
  • 中程度のディスク(10-100GB): Zarr、H5py、またはParquet形式を使用します。
  • ディスク豊富(100GB超): 大規模な中間ファイルを自由に作成できます。

使用方法

ステップ1: リソース検出の実行

計算負荷の高いタスクの開始時に、検出スクリプトを実行します。

python scripts/detect_resources.py

オプションの引数:

  • -o, --output <path>: カスタム出力パスを指定します(デフォルト: .claude_resources.json)。
  • -v, --verbose: 完全なリソース情報を標準出力に表示します。

ステップ2: 推奨事項の読み取りと適用

検出を実行した後、生成された .claude_resources.json ファイルを読み取り、計算上の決定に役立てます。

# 例: コード内で推奨事項を使用する
import json

with open('.claude_resources.json', 'r') as f:
    resources = json.load(f)

# 並列処理戦略を確認する
if resources['recommendations']['parallel_processing']['strategy'] == 'high_parallelism':
    n_jobs = resources['recommendations']['parallel_processing']['suggested_workers']
    # n_jobsワーカーでjoblib、Dask、またはmultiprocessingを使用する

# メモリ戦略を確認する
if resources['recommendations']['memory_strategy']['strategy'] == 'memory_constrained':
    # Dask、Zarr、
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Get Available Resources

Overview

Detect available computational resources and generate strategic recommendations for scientific computing tasks. This skill automatically identifies CPU capabilities, GPU availability (NVIDIA CUDA, AMD ROCm, Apple Silicon Metal), memory constraints, and disk space to help make informed decisions about computational approaches.

When to Use This Skill

Use this skill proactively before any computationally intensive task:

  • Before data analysis: Determine if datasets can be loaded into memory or require out-of-core processing
  • Before model training: Check if GPU acceleration is available and which backend to use
  • Before parallel processing: Identify optimal number of workers for joblib, multiprocessing, or Dask
  • Before large file operations: Verify sufficient disk space and appropriate storage strategies
  • At project initialization: Understand baseline capabilities for making architectural decisions

Example scenarios:

  • "Help me analyze this 50GB genomics dataset" → Use this skill first to determine if Dask/Zarr are needed
  • "Train a neural network on this data" → Use this skill to detect available GPUs and backends
  • "Process 10,000 files in parallel" → Use this skill to determine optimal worker count
  • "Run a computationally intensive simulation" → Use this skill to understand resource constraints

How This Skill Works

Resource Detection

The skill runs scripts/detect_resources.py to automatically detect:

  1. CPU Information

    • Physical and logical core counts
    • Processor architecture and model
    • CPU frequency information
  2. GPU Information

    • NVIDIA GPUs: Detects via nvidia-smi, reports VRAM, driver version, compute capability
    • AMD GPUs: Detects via rocm-smi
    • Apple Silicon: Detects M1/M2/M3/M4 chips with Metal support and unified memory
  3. Memory Information

    • Total and available RAM
    • Current memory usage percentage
    • Swap space availability
  4. Disk Space Information

    • Total and available disk space for working directory
    • Current usage percentage
  5. Operating System Information

    • OS type (macOS, Linux, Windows)
    • OS version and release
    • Python version

Output Format

The skill generates a .claude_resources.json file in the current working directory containing:

{
  "timestamp": "2025-10-23T10:30:00",
  "os": {
    "system": "Darwin",
    "release": "25.0.0",
    "machine": "arm64"
  },
  "cpu": {
    "physical_cores": 8,
    "logical_cores": 8,
    "architecture": "arm64"
  },
  "memory": {
    "total_gb": 16.0,
    "available_gb": 8.5,
    "percent_used": 46.9
  },
  "disk": {
    "total_gb": 500.0,
    "available_gb": 200.0,
    "percent_used": 60.0
  },
  "gpu": {
    "nvidia_gpus": [],
    "amd_gpus": [],
    "apple_silicon": {
      "name": "Apple M2",
      "type": "Apple Silicon",
      "backend": "Metal",
      "unified_memory": true
    },
    "total_gpus": 1,
    "available_backends": ["Metal"]
  },
  "recommendations": {
    "parallel_processing": {
      "strategy": "high_parallelism",
      "suggested_workers": 6,
      "libraries": ["joblib", "multiprocessing", "dask"]
    },
    "memory_strategy": {
      "strategy": "moderate_memory",
      "libraries": ["dask", "zarr"],
      "note": "Consider chunking for datasets > 2GB"
    },
    "gpu_acceleration": {
      "available": true,
      "backends": ["Metal"],
      "suggested_libraries": ["pytorch-mps", "tensorflow-metal", "jax-metal"]
    },
    "large_data_handling": {
      "strategy": "disk_abundant",
      "note": "Sufficient space for large intermediate files"
    }
  }
}

Strategic Recommendations

The skill generates context-aware recommendations:

Parallel Processing Recommendations:

  • High parallelism (8+ cores): Use Dask, joblib, or multiprocessing with workers = cores - 2
  • Moderate parallelism (4-7 cores): Use joblib or multiprocessing with workers = cores - 1
  • Sequential (< 4 cores): Prefer sequential processing to avoid overhead

Memory Strategy Recommendations:

  • Memory constrained (< 4GB available): Use Zarr, Dask, or H5py for out-of-core processing
  • Moderate memory (4-16GB available): Use Dask/Zarr for datasets > 2GB
  • Memory abundant (> 16GB available): Can load most datasets into memory directly

GPU Acceleration Recommendations:

  • NVIDIA GPUs detected: Use PyTorch, TensorFlow, JAX, CuPy, or RAPIDS
  • AMD GPUs detected: Use PyTorch-ROCm or TensorFlow-ROCm
  • Apple Silicon detected: Use PyTorch with MPS backend, TensorFlow-Metal, or JAX-Metal
  • No GPU detected: Use CPU-optimized libraries

Large Data Handling Recommendations:

  • Disk constrained (< 10GB): Use streaming or compression strategies
  • Moderate disk (10-100GB): Use Zarr, H5py, or Parquet formats
  • Disk abundant (> 100GB): Can create large intermediate files freely

Usage Instructions

Step 1: Run Resource Detection

Execute the detection script at the start of any computationally intensive task:

python scripts/detect_resources.py

Optional arguments:

  • -o, --output <path>: Specify custom output path (default: .claude_resources.json)
  • -v, --verbose: Print full resource information to stdout

Step 2: Read and Apply Recommendations

After running detection, read the generated .claude_resources.json file to inform computational decisions:

# Example: Use recommendations in code
import json

with open('.claude_resources.json', 'r') as f:
    resources = json.load(f)

# Check parallel processing strategy
if resources['recommendations']['parallel_processing']['strategy'] == 'high_parallelism':
    n_jobs = resources['recommendations']['parallel_processing']['suggested_workers']
    # Use joblib, Dask, or multiprocessing with n_jobs workers

# Check memory strategy
if resources['recommendations']['memory_strategy']['strategy'] == 'memory_constrained':
    # Use Dask, Zarr, or H5py for out-of-core processing
    import dask.array as da
    # Load data in chunks

# Check GPU availability
if resources['recommendations']['gpu_acceleration']['available']:
    backends = resources['recommendations']['gpu_acceleration']['backends']
    # Use appropriate GPU library based on available backend

Step 3: Make Informed Decisions

Use the resource information and recommendations to make strategic choices:

For data loading:

memory_available_gb = resources['memory']['available_gb']
dataset_size_gb = 10

if dataset_size_gb > memory_available_gb * 0.5:
    # Dataset is large relative to memory, use Dask
    import dask.dataframe as dd
    df = dd.read_csv('large_file.csv')
else:
    # Dataset fits in memory, use pandas
    import pandas as pd
    df = pd.read_csv('large_file.csv')

For parallel processing:

from joblib import Parallel, delayed

n_jobs = resources['recommendations']['parallel_processing'].get('suggested_workers', 1)

results = Parallel(n_jobs=n_jobs)(
    delayed(process_function)(item) for item in data
)

For GPU acceleration:

import torch

if 'CUDA' in resources['gpu']['available_backends']:
    device = torch.device('cuda')
elif 'Metal' in resources['gpu']['available_backends']:
    device = torch.device('mps')
else:
    device = torch.device('cpu')

model = model.to(device)

Dependencies

The detection script requires the following Python packages:

uv pip install psutil

All other functionality uses Python standard library modules (json, os, platform, subprocess, sys, pathlib).

Platform Support

  • macOS: Full support including Apple Silicon (M1/M2/M3/M4) GPU detection
  • Linux: Full support including NVIDIA (nvidia-smi) and AMD (rocm-smi) GPU detection
  • Windows: Full support including NVIDIA GPU detection

Best Practices

  1. Run early: Execute resource detection at the start of projects or before major computational tasks
  2. Re-run periodically: System resources change over time (memory usage, disk space)
  3. Check before scaling: Verify resources before scaling up parallel workers or data sizes
  4. Document decisions: Keep the .claude_resources.json file in project directories to document resource-aware decisions
  5. Use with versioning: Different machines have different capabilities; resource files help maintain portability

Troubleshooting

GPU not detected:

  • Ensure GPU drivers are installed (nvidia-smi, rocm-smi, or system_profiler for Apple Silicon)
  • Check that GPU utilities are in system PATH
  • Verify GPU is not in use by other processes

Script execution fails:

  • Ensure psutil is installed: uv pip install psutil
  • Check Python version compatibility (Python 3.6+)
  • Verify script has execute permissions: chmod +x scripts/detect_resources.py

Inaccurate memory readings:

  • Memory readings are snapshots; actual available memory changes constantly
  • Close other applications before detection for accurate "available" memory
  • Consider running detection multiple times and averaging results

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。