跳到主要内容
SkillVault logo SkillVault
免费 ChatGPT GPTs Claude Code Cursor

get-available-resources

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.

0 次下载 0 次浏览 更新于 Oct 31, 2026 v1.0.0
get-available-resources skill cover

下方技能配置(提示词、变量、安装步骤)保留英文原文。.aiskill 文件直接面向 AI 智能体,统一使用英文以确保跨平台行为一致。

概述

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.

Source: https://github.com/DenDen047/claude-scientific-skills · MIT LICENSE · © 2025 K-Dense Inc.

系统提示词

定义智能体角色、规则与输出格式的指令块。

system-prompt.txt
# 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:

```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"
    }
  }
}
```

### 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:

```bash
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:

```python
# 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:**
```python
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:**
```python
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:**
```python
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:

```bash
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

用户提示词模板

填充变量后发送,即可运行该技能: {{variables}}

user-template.txt

变量

名称 必填 说明 示例

完整技能配置

标准 .aiskill 文件,提供 JSON 与 YAML 两种格式。

get-available-resources.aiskill (JSON)
{
  "format": "aiskill/v1",
  "skill": {
    "name": "get-available-resources",
    "slug": "get-available-resources",
    "version": "1.0.0",
    "description": "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.",
    "category": "Research",
    "tags": [
      "research-science"
    ],
    "platforms": [
      "chatgpt",
      "claude-code",
      "cursor"
    ],
    "tested_environment": "Agent Skills convention (SKILL.md) — works with Claude Code, Cursor, ChatGPT/Codex and compatible agents",
    "license": "MIT LICENSE"
  },
  "prompts": {
    "system": "# Get Available Resources\r\n\r\n## Overview\r\n\r\nDetect 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.\r\n\r\n## When to Use This Skill\r\n\r\nUse this skill proactively before any computationally intensive task:\r\n\r\n- **Before data analysis**: Determine if datasets can be loaded into memory or require out-of-core processing\r\n- **Before model training**: Check if GPU acceleration is available and which backend to use\r\n- **Before parallel processing**: Identify optimal number of workers for joblib, multiprocessing, or Dask\r\n- **Before large file operations**: Verify sufficient disk space and appropriate storage strategies\r\n- **At project initialization**: Understand baseline capabilities for making architectural decisions\r\n\r\n**Example scenarios:**\r\n- \"Help me analyze this 50GB genomics dataset\" → Use this skill first to determine if Dask/Zarr are needed\r\n- \"Train a neural network on this data\" → Use this skill to detect available GPUs and backends\r\n- \"Process 10,000 files in parallel\" → Use this skill to determine optimal worker count\r\n- \"Run a computationally intensive simulation\" → Use this skill to understand resource constraints\r\n\r\n## How This Skill Works\r\n\r\n### Resource Detection\r\n\r\nThe skill runs `scripts/detect_resources.py` to automatically detect:\r\n\r\n1. **CPU Information**\r\n   - Physical and logical core counts\r\n   - Processor architecture and model\r\n   - CPU frequency information\r\n\r\n2. **GPU Information**\r\n   - NVIDIA GPUs: Detects via nvidia-smi, reports VRAM, driver version, compute capability\r\n   - AMD GPUs: Detects via rocm-smi\r\n   - Apple Silicon: Detects M1/M2/M3/M4 chips with Metal support and unified memory\r\n\r\n3. **Memory Information**\r\n   - Total and available RAM\r\n   - Current memory usage percentage\r\n   - Swap space availability\r\n\r\n4. **Disk Space Information**\r\n   - Total and available disk space for working directory\r\n   - Current usage percentage\r\n\r\n5. **Operating System Information**\r\n   - OS type (macOS, Linux, Windows)\r\n   - OS version and release\r\n   - Python version\r\n\r\n### Output Format\r\n\r\nThe skill generates a `.claude_resources.json` file in the current working directory containing:\r\n\r\n```json\r\n{\r\n  \"timestamp\": \"2025-10-23T10:30:00\",\r\n  \"os\": {\r\n    \"system\": \"Darwin\",\r\n    \"release\": \"25.0.0\",\r\n    \"machine\": \"arm64\"\r\n  },\r\n  \"cpu\": {\r\n    \"physical_cores\": 8,\r\n    \"logical_cores\": 8,\r\n    \"architecture\": \"arm64\"\r\n  },\r\n  \"memory\": {\r\n    \"total_gb\": 16.0,\r\n    \"available_gb\": 8.5,\r\n    \"percent_used\": 46.9\r\n  },\r\n  \"disk\": {\r\n    \"total_gb\": 500.0,\r\n    \"available_gb\": 200.0,\r\n    \"percent_used\": 60.0\r\n  },\r\n  \"gpu\": {\r\n    \"nvidia_gpus\": [],\r\n    \"amd_gpus\": [],\r\n    \"apple_silicon\": {\r\n      \"name\": \"Apple M2\",\r\n      \"type\": \"Apple Silicon\",\r\n      \"backend\": \"Metal\",\r\n      \"unified_memory\": true\r\n    },\r\n    \"total_gpus\": 1,\r\n    \"available_backends\": [\"Metal\"]\r\n  },\r\n  \"recommendations\": {\r\n    \"parallel_processing\": {\r\n      \"strategy\": \"high_parallelism\",\r\n      \"suggested_workers\": 6,\r\n      \"libraries\": [\"joblib\", \"multiprocessing\", \"dask\"]\r\n    },\r\n    \"memory_strategy\": {\r\n      \"strategy\": \"moderate_memory\",\r\n      \"libraries\": [\"dask\", \"zarr\"],\r\n      \"note\": \"Consider chunking for datasets > 2GB\"\r\n    },\r\n    \"gpu_acceleration\": {\r\n      \"available\": true,\r\n      \"backends\": [\"Metal\"],\r\n      \"suggested_libraries\": [\"pytorch-mps\", \"tensorflow-metal\", \"jax-metal\"]\r\n    },\r\n    \"large_data_handling\": {\r\n      \"strategy\": \"disk_abundant\",\r\n      \"note\": \"Sufficient space for large intermediate files\"\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n### Strategic Recommendations\r\n\r\nThe skill generates context-aware recommendations:\r\n\r\n**Parallel Processing Recommendations:**\r\n- **High parallelism (8+ cores)**: Use Dask, joblib, or multiprocessing with workers = cores - 2\r\n- **Moderate parallelism (4-7 cores)**: Use joblib or multiprocessing with workers = cores - 1\r\n- **Sequential (< 4 cores)**: Prefer sequential processing to avoid overhead\r\n\r\n**Memory Strategy Recommendations:**\r\n- **Memory constrained (< 4GB available)**: Use Zarr, Dask, or H5py for out-of-core processing\r\n- **Moderate memory (4-16GB available)**: Use Dask/Zarr for datasets > 2GB\r\n- **Memory abundant (> 16GB available)**: Can load most datasets into memory directly\r\n\r\n**GPU Acceleration Recommendations:**\r\n- **NVIDIA GPUs detected**: Use PyTorch, TensorFlow, JAX, CuPy, or RAPIDS\r\n- **AMD GPUs detected**: Use PyTorch-ROCm or TensorFlow-ROCm\r\n- **Apple Silicon detected**: Use PyTorch with MPS backend, TensorFlow-Metal, or JAX-Metal\r\n- **No GPU detected**: Use CPU-optimized libraries\r\n\r\n**Large Data Handling Recommendations:**\r\n- **Disk constrained (< 10GB)**: Use streaming or compression strategies\r\n- **Moderate disk (10-100GB)**: Use Zarr, H5py, or Parquet formats\r\n- **Disk abundant (> 100GB)**: Can create large intermediate files freely\r\n\r\n## Usage Instructions\r\n\r\n### Step 1: Run Resource Detection\r\n\r\nExecute the detection script at the start of any computationally intensive task:\r\n\r\n```bash\r\npython scripts/detect_resources.py\r\n```\r\n\r\nOptional arguments:\r\n- `-o, --output <path>`: Specify custom output path (default: `.claude_resources.json`)\r\n- `-v, --verbose`: Print full resource information to stdout\r\n\r\n### Step 2: Read and Apply Recommendations\r\n\r\nAfter running detection, read the generated `.claude_resources.json` file to inform computational decisions:\r\n\r\n```python\r\n# Example: Use recommendations in code\r\nimport json\r\n\r\nwith open('.claude_resources.json', 'r') as f:\r\n    resources = json.load(f)\r\n\r\n# Check parallel processing strategy\r\nif resources['recommendations']['parallel_processing']['strategy'] == 'high_parallelism':\r\n    n_jobs = resources['recommendations']['parallel_processing']['suggested_workers']\r\n    # Use joblib, Dask, or multiprocessing with n_jobs workers\r\n\r\n# Check memory strategy\r\nif resources['recommendations']['memory_strategy']['strategy'] == 'memory_constrained':\r\n    # Use Dask, Zarr, or H5py for out-of-core processing\r\n    import dask.array as da\r\n    # Load data in chunks\r\n\r\n# Check GPU availability\r\nif resources['recommendations']['gpu_acceleration']['available']:\r\n    backends = resources['recommendations']['gpu_acceleration']['backends']\r\n    # Use appropriate GPU library based on available backend\r\n```\r\n\r\n### Step 3: Make Informed Decisions\r\n\r\nUse the resource information and recommendations to make strategic choices:\r\n\r\n**For data loading:**\r\n```python\r\nmemory_available_gb = resources['memory']['available_gb']\r\ndataset_size_gb = 10\r\n\r\nif dataset_size_gb > memory_available_gb * 0.5:\r\n    # Dataset is large relative to memory, use Dask\r\n    import dask.dataframe as dd\r\n    df = dd.read_csv('large_file.csv')\r\nelse:\r\n    # Dataset fits in memory, use pandas\r\n    import pandas as pd\r\n    df = pd.read_csv('large_file.csv')\r\n```\r\n\r\n**For parallel processing:**\r\n```python\r\nfrom joblib import Parallel, delayed\r\n\r\nn_jobs = resources['recommendations']['parallel_processing'].get('suggested_workers', 1)\r\n\r\nresults = Parallel(n_jobs=n_jobs)(\r\n    delayed(process_function)(item) for item in data\r\n)\r\n```\r\n\r\n**For GPU acceleration:**\r\n```python\r\nimport torch\r\n\r\nif 'CUDA' in resources['gpu']['available_backends']:\r\n    device = torch.device('cuda')\r\nelif 'Metal' in resources['gpu']['available_backends']:\r\n    device = torch.device('mps')\r\nelse:\r\n    device = torch.device('cpu')\r\n\r\nmodel = model.to(device)\r\n```\r\n\r\n## Dependencies\r\n\r\nThe detection script requires the following Python packages:\r\n\r\n```bash\r\nuv pip install psutil\r\n```\r\n\r\nAll other functionality uses Python standard library modules (json, os, platform, subprocess, sys, pathlib).\r\n\r\n## Platform Support\r\n\r\n- **macOS**: Full support including Apple Silicon (M1/M2/M3/M4) GPU detection\r\n- **Linux**: Full support including NVIDIA (nvidia-smi) and AMD (rocm-smi) GPU detection\r\n- **Windows**: Full support including NVIDIA GPU detection\r\n\r\n## Best Practices\r\n\r\n1. **Run early**: Execute resource detection at the start of projects or before major computational tasks\r\n2. **Re-run periodically**: System resources change over time (memory usage, disk space)\r\n3. **Check before scaling**: Verify resources before scaling up parallel workers or data sizes\r\n4. **Document decisions**: Keep the `.claude_resources.json` file in project directories to document resource-aware decisions\r\n5. **Use with versioning**: Different machines have different capabilities; resource files help maintain portability\r\n\r\n## Troubleshooting\r\n\r\n**GPU not detected:**\r\n- Ensure GPU drivers are installed (nvidia-smi, rocm-smi, or system_profiler for Apple Silicon)\r\n- Check that GPU utilities are in system PATH\r\n- Verify GPU is not in use by other processes\r\n\r\n**Script execution fails:**\r\n- Ensure psutil is installed: `uv pip install psutil`\r\n- Check Python version compatibility (Python 3.6+)\r\n- Verify script has execute permissions: `chmod +x scripts/detect_resources.py`\r\n\r\n**Inaccurate memory readings:**\r\n- Memory readings are snapshots; actual available memory changes constantly\r\n- Close other applications before detection for accurate \"available\" memory\r\n- Consider running detection multiple times and averaging results",
    "user_template": ""
  },
  "variables": [],
  "install": {
    "steps": [
      {
        "title": "Download & unzip",
        "detail": "Download the .zip package from SkillVault and unzip it. The get-available-resources/ folder contains SKILL.md plus any companion scripts, references and assets."
      },
      {
        "title": "Copy into your agent skills directory",
        "detail": "Move the folder into your agent's skills directory — e.g. ~/.claude/skills/ (Claude Code), .codex/skills/, .cursor/skills/ or your project's .claude/skills/ folder — then restart or reload the session."
      },
      {
        "title": "Use it",
        "detail": "Describe the task in natural language; the agent loads the skill automatically when the request matches the skill description."
      }
    ]
  },
  "usage": {
    "steps": []
  },
  "metadata": {
    "author": "SkillVault",
    "source": "https://skillvault.top/skills/get-available-resources",
    "exported_at": "2026-11-03T07:44:28.501Z"
  }
}
get-available-resources.aiskill (YAML)
format: aiskill/v1
skill:
  name: get-available-resources
  slug: get-available-resources
  version: 1.0.0
  description: >-
    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.
  category: Research
  tags:
    - research-science
  platforms:
    - chatgpt
    - claude-code
    - cursor
  tested_environment: >-
    Agent Skills convention (SKILL.md) — works with Claude Code, Cursor, ChatGPT/Codex and
    compatible agents
  license: MIT LICENSE
prompts:
  system: "# Get Available Resources\r\n\r\n## Overview\r\n\r\nDetect 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.\r\n\r\n## When to Use This Skill\r\n\r\nUse this skill proactively before any computationally intensive task:\r\n\r\n- **Before data analysis**: Determine if datasets can be loaded into memory or require out-of-core processing\r\n- **Before model training**: Check if GPU acceleration is available and which backend to use\r\n- **Before parallel processing**: Identify optimal number of workers for joblib, multiprocessing, or Dask\r\n- **Before large file operations**: Verify sufficient disk space and appropriate storage strategies\r\n- **At project initialization**: Understand baseline capabilities for making architectural decisions\r\n\r\n**Example scenarios:**\r\n- \"Help me analyze this 50GB genomics dataset\" → Use this skill first to determine if Dask/Zarr are needed\r\n- \"Train a neural network on this data\" → Use this skill to detect available GPUs and backends\r\n- \"Process 10,000 files in parallel\" → Use this skill to determine optimal worker count\r\n- \"Run a computationally intensive simulation\" → Use this skill to understand resource constraints\r\n\r\n## How This Skill Works\r\n\r\n### Resource Detection\r\n\r\nThe skill runs `scripts/detect_resources.py` to automatically detect:\r\n\r\n1. **CPU Information**\r\n   - Physical and logical core counts\r\n   - Processor architecture and model\r\n   - CPU frequency information\r\n\r\n2. **GPU Information**\r\n   - NVIDIA GPUs: Detects via nvidia-smi, reports VRAM, driver version, compute capability\r\n   - AMD GPUs: Detects via rocm-smi\r\n   - Apple Silicon: Detects M1/M2/M3/M4 chips with Metal support and unified memory\r\n\r\n3. **Memory Information**\r\n   - Total and available RAM\r\n   - Current memory usage percentage\r\n   - Swap space availability\r\n\r\n4. **Disk Space Information**\r\n   - Total and available disk space for working directory\r\n   - Current usage percentage\r\n\r\n5. **Operating System Information**\r\n   - OS type (macOS, Linux, Windows)\r\n   - OS version and release\r\n   - Python version\r\n\r\n### Output Format\r\n\r\nThe skill generates a `.claude_resources.json` file in the current working directory containing:\r\n\r\n```json\r\n{\r\n  \"timestamp\": \"2025-10-23T10:30:00\",\r\n  \"os\": {\r\n    \"system\": \"Darwin\",\r\n    \"release\": \"25.0.0\",\r\n    \"machine\": \"arm64\"\r\n  },\r\n  \"cpu\": {\r\n    \"physical_cores\": 8,\r\n    \"logical_cores\": 8,\r\n    \"architecture\": \"arm64\"\r\n  },\r\n  \"memory\": {\r\n    \"total_gb\": 16.0,\r\n    \"available_gb\": 8.5,\r\n    \"percent_used\": 46.9\r\n  },\r\n  \"disk\": {\r\n    \"total_gb\": 500.0,\r\n    \"available_gb\": 200.0,\r\n    \"percent_used\": 60.0\r\n  },\r\n  \"gpu\": {\r\n    \"nvidia_gpus\": [],\r\n    \"amd_gpus\": [],\r\n    \"apple_silicon\": {\r\n      \"name\": \"Apple M2\",\r\n      \"type\": \"Apple Silicon\",\r\n      \"backend\": \"Metal\",\r\n      \"unified_memory\": true\r\n    },\r\n    \"total_gpus\": 1,\r\n    \"available_backends\": [\"Metal\"]\r\n  },\r\n  \"recommendations\": {\r\n    \"parallel_processing\": {\r\n      \"strategy\": \"high_parallelism\",\r\n      \"suggested_workers\": 6,\r\n      \"libraries\": [\"joblib\", \"multiprocessing\", \"dask\"]\r\n    },\r\n    \"memory_strategy\": {\r\n      \"strategy\": \"moderate_memory\",\r\n      \"libraries\": [\"dask\", \"zarr\"],\r\n      \"note\": \"Consider chunking for datasets > 2GB\"\r\n    },\r\n    \"gpu_acceleration\": {\r\n      \"available\": true,\r\n      \"backends\": [\"Metal\"],\r\n      \"suggested_libraries\": [\"pytorch-mps\", \"tensorflow-metal\", \"jax-metal\"]\r\n    },\r\n    \"large_data_handling\": {\r\n      \"strategy\": \"disk_abundant\",\r\n      \"note\": \"Sufficient space for large intermediate files\"\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n### Strategic Recommendations\r\n\r\nThe skill generates context-aware recommendations:\r\n\r\n**Parallel Processing Recommendations:**\r\n- **High parallelism (8+ cores)**: Use Dask, joblib, or multiprocessing with workers = cores - 2\r\n- **Moderate parallelism (4-7 cores)**: Use joblib or multiprocessing with workers = cores - 1\r\n- **Sequential (< 4 cores)**: Prefer sequential processing to avoid overhead\r\n\r\n**Memory Strategy Recommendations:**\r\n- **Memory constrained (< 4GB available)**: Use Zarr, Dask, or H5py for out-of-core processing\r\n- **Moderate memory (4-16GB available)**: Use Dask/Zarr for datasets > 2GB\r\n- **Memory abundant (> 16GB available)**: Can load most datasets into memory directly\r\n\r\n**GPU Acceleration Recommendations:**\r\n- **NVIDIA GPUs detected**: Use PyTorch, TensorFlow, JAX, CuPy, or RAPIDS\r\n- **AMD GPUs detected**: Use PyTorch-ROCm or TensorFlow-ROCm\r\n- **Apple Silicon detected**: Use PyTorch with MPS backend, TensorFlow-Metal, or JAX-Metal\r\n- **No GPU detected**: Use CPU-optimized libraries\r\n\r\n**Large Data Handling Recommendations:**\r\n- **Disk constrained (< 10GB)**: Use streaming or compression strategies\r\n- **Moderate disk (10-100GB)**: Use Zarr, H5py, or Parquet formats\r\n- **Disk abundant (> 100GB)**: Can create large intermediate files freely\r\n\r\n## Usage Instructions\r\n\r\n### Step 1: Run Resource Detection\r\n\r\nExecute the detection script at the start of any computationally intensive task:\r\n\r\n```bash\r\npython scripts/detect_resources.py\r\n```\r\n\r\nOptional arguments:\r\n- `-o, --output <path>`: Specify custom output path (default: `.claude_resources.json`)\r\n- `-v, --verbose`: Print full resource information to stdout\r\n\r\n### Step 2: Read and Apply Recommendations\r\n\r\nAfter running detection, read the generated `.claude_resources.json` file to inform computational decisions:\r\n\r\n```python\r\n# Example: Use recommendations in code\r\nimport json\r\n\r\nwith open('.claude_resources.json', 'r') as f:\r\n    resources = json.load(f)\r\n\r\n# Check parallel processing strategy\r\nif resources['recommendations']['parallel_processing']['strategy'] == 'high_parallelism':\r\n    n_jobs = resources['recommendations']['parallel_processing']['suggested_workers']\r\n    # Use joblib, Dask, or multiprocessing with n_jobs workers\r\n\r\n# Check memory strategy\r\nif resources['recommendations']['memory_strategy']['strategy'] == 'memory_constrained':\r\n    # Use Dask, Zarr, or H5py for out-of-core processing\r\n    import dask.array as da\r\n    # Load data in chunks\r\n\r\n# Check GPU availability\r\nif resources['recommendations']['gpu_acceleration']['available']:\r\n    backends = resources['recommendations']['gpu_acceleration']['backends']\r\n    # Use appropriate GPU library based on available backend\r\n```\r\n\r\n### Step 3: Make Informed Decisions\r\n\r\nUse the resource information and recommendations to make strategic choices:\r\n\r\n**For data loading:**\r\n```python\r\nmemory_available_gb = resources['memory']['available_gb']\r\ndataset_size_gb = 10\r\n\r\nif dataset_size_gb > memory_available_gb * 0.5:\r\n    # Dataset is large relative to memory, use Dask\r\n    import dask.dataframe as dd\r\n    df = dd.read_csv('large_file.csv')\r\nelse:\r\n    # Dataset fits in memory, use pandas\r\n    import pandas as pd\r\n    df = pd.read_csv('large_file.csv')\r\n```\r\n\r\n**For parallel processing:**\r\n```python\r\nfrom joblib import Parallel, delayed\r\n\r\nn_jobs = resources['recommendations']['parallel_processing'].get('suggested_workers', 1)\r\n\r\nresults = Parallel(n_jobs=n_jobs)(\r\n    delayed(process_function)(item) for item in data\r\n)\r\n```\r\n\r\n**For GPU acceleration:**\r\n```python\r\nimport torch\r\n\r\nif 'CUDA' in resources['gpu']['available_backends']:\r\n    device = torch.device('cuda')\r\nelif 'Metal' in resources['gpu']['available_backends']:\r\n    device = torch.device('mps')\r\nelse:\r\n    device = torch.device('cpu')\r\n\r\nmodel = model.to(device)\r\n```\r\n\r\n## Dependencies\r\n\r\nThe detection script requires the following Python packages:\r\n\r\n```bash\r\nuv pip install psutil\r\n```\r\n\r\nAll other functionality uses Python standard library modules (json, os, platform, subprocess, sys, pathlib).\r\n\r\n## Platform Support\r\n\r\n- **macOS**: Full support including Apple Silicon (M1/M2/M3/M4) GPU detection\r\n- **Linux**: Full support including NVIDIA (nvidia-smi) and AMD (rocm-smi) GPU detection\r\n- **Windows**: Full support including NVIDIA GPU detection\r\n\r\n## Best Practices\r\n\r\n1. **Run early**: Execute resource detection at the start of projects or before major computational tasks\r\n2. **Re-run periodically**: System resources change over time (memory usage, disk space)\r\n3. **Check before scaling**: Verify resources before scaling up parallel workers or data sizes\r\n4. **Document decisions**: Keep the `.claude_resources.json` file in project directories to document resource-aware decisions\r\n5. **Use with versioning**: Different machines have different capabilities; resource files help maintain portability\r\n\r\n## Troubleshooting\r\n\r\n**GPU not detected:**\r\n- Ensure GPU drivers are installed (nvidia-smi, rocm-smi, or system_profiler for Apple Silicon)\r\n- Check that GPU utilities are in system PATH\r\n- Verify GPU is not in use by other processes\r\n\r\n**Script execution fails:**\r\n- Ensure psutil is installed: `uv pip install psutil`\r\n- Check Python version compatibility (Python 3.6+)\r\n- Verify script has execute permissions: `chmod +x scripts/detect_resources.py`\r\n\r\n**Inaccurate memory readings:**\r\n- Memory readings are snapshots; actual available memory changes constantly\r\n- Close other applications before detection for accurate \"available\" memory\r\n- Consider running detection multiple times and averaging results"
  user_template: ""
variables: []
install:
  steps:
    - title: Download & unzip
      detail: >-
        Download the .zip package from SkillVault and unzip it. The get-available-resources/ folder
        contains SKILL.md plus any companion scripts, references and assets.
    - title: Copy into your agent skills directory
      detail: >-
        Move the folder into your agent's skills directory — e.g. ~/.claude/skills/ (Claude Code),
        .codex/skills/, .cursor/skills/ or your project's .claude/skills/ folder — then restart or
        reload the session.
    - title: Use it
      detail: >-
        Describe the task in natural language; the agent loads the skill automatically when the
        request matches the skill description.
usage:
  steps: []
metadata:
  author: SkillVault
  source: https://skillvault.top/skills/get-available-resources
  exported_at: "2026-11-03T07:44:28.501Z"

安装指南

  1. 1

    Download & unzip

    Download the .zip package from SkillVault and unzip it. The get-available-resources/ folder contains SKILL.md plus any companion scripts, references and assets.

  2. 2

    Copy into your agent skills directory

    Move the folder into your agent's skills directory — e.g. ~/.claude/skills/ (Claude Code), .codex/skills/, .cursor/skills/ or your project's .claude/skills/ folder — then restart or reload the session.

  3. 3

    Use it

    Describe the task in natural language; the agent loads the skill automatically when the request matches the skill description.

使用方法

平台兼容性

ChatGPT GPTs

OpenAI

将系统提示词粘贴到 GPT 的「Instructions」字段,并把用户模板作为起始消息使用。

官方文档

Claude Code

Anthropic

将导出的 .aiskill JSON 保存为项目中的技能文件,或将系统提示词粘贴进 CLAUDE.md / 斜杠命令 Markdown 文件。

官方文档

Cursor

Anysphere

将系统提示词复制到 .cursor/rules/*.mdc(或设置中的 Project Rules),并在智能体提示词中引用用户模板。

官方文档

相关技能

aeon AI agent skill cover
免费
ChatGPT GPTs Claude Code Cursor

aeon

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.

#research-science
0 0 v1.0.0
astropy AI agent skill cover
免费
ChatGPT GPTs Claude Code Cursor

astropy

Comprehensive Python library for astronomy and astrophysics. This skill should be used when working with astronomical data including celestial coordinates, physical units, FITS files, cosmological calculations, time systems, tables, world coordinate systems (WCS), and astronomical data analysis. Use when tasks involve coordinate transformations, unit conversions, FITS file manipulation, cosmological distance calculations, time scale conversions, or astronomical data processing.

#research-science#python
0 0 v1.0.0
bgpt-paper-search AI agent skill cover
免费
ChatGPT GPTs Claude Code Cursor

bgpt-paper-search

Search scientific papers and retrieve structured experimental data extracted from full-text studies via the BGPT MCP server. Returns 25+ fields per paper including methods, results, sample sizes, quality scores, and conclusions. Use for literature reviews, evidence synthesis, and finding experimental details not available in abstracts alone.

#research-science#mcp#research
0 0 v1.0.0