jpskill.com
💼 ビジネス コミュニティ

cs-math

CS math: discrete math, combinatorics, probability, linear algebra, calculus for ML, information theory

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

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

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

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

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して cs-math.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → cs-math フォルダができる
  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-18
取得日時
2026-05-18
同梱ファイル
1
📖 Claude が読む原文 SKILL.md(中身を展開)

この本文は AI(Claude)が読むための原文(英語または中国語)です。日本語訳は順次追加中。

cs-math

Purpose

This skill enables OpenClaw to perform computations in computer science mathematics, covering discrete math (e.g., sets, graphs), combinatorics (e.g., permutations), probability (e.g., distributions), linear algebra (e.g., matrix operations), and calculus for ML (e.g., gradients), using optimized algorithms.

When to Use

Use this skill for tasks involving mathematical computations in code, such as calculating probabilities in algorithms, solving linear systems for ML models, or analyzing combinatorics in data structures. Apply it when precise, programmatic math is needed, like in optimization problems or statistical analysis, rather than general queries.

Key Capabilities

  • Compute discrete math operations: permutations, combinations, graph traversals (e.g., via adjacency matrices).
  • Handle probability: calculate expected values, binomial probabilities, or simulate distributions.
  • Perform linear algebra: matrix multiplication, determinants, inverses, and eigenvalue calculations.
  • Support calculus for ML: compute gradients, partial derivatives for loss functions.
  • Integrate with data: process arrays or vectors from inputs, returning results as JSON.

Usage Patterns

Invoke the skill via OpenClaw's CLI or API by specifying an operation and parameters. Always pass inputs as a JSON object for consistency. For example, in Python code: import openclaw; result = openclaw.invoke_skill('cs-math', {'operation': 'permutation', 'n': 5, 'r': 3}). Handle outputs as dictionaries, e.g., check for a 'result' key. Use try-except blocks for API calls to catch failures. If reusing parameters, store them in a config file like JSON: {"default_n": 5}, and load it before invoking.

Common Commands/API

Use the OpenClaw CLI: openclaw cs-math --operation calculate --params '{"type": "permutation", "n": 5, "r": 3}' --output json For API, send a POST to /api/skills/cs-math/execute with headers {'Authorization': 'Bearer $OPENCLAW_API_KEY'} and body: {"operation": "matrix_multiply", "A": [[1,2],[3,4]], "B": [[5,6],[7,8]]} Config format: Parameters must be JSON objects, e.g., {"operation": "probability", "distribution": "binomial", "n": 10, "p": 0.5}. Common flags: --verbose for debug output, --timeout 30 for setting API timeouts in seconds. Code snippet for Python: import openclaw params = {"operation": "gradient", "function": "x2 + y2", "at": [1,1]} result = openclaw.invoke('cs-math', params) print(result['value']) # Outputs the gradient vector

Integration Notes

Integrate by setting the environment variable for authentication: export OPENCLAW_API_KEY=your_api_key_value. In code, import the OpenClaw library and call skills like: openclaw.set_api_key(os.environ['OPENCLAW_API_KEY']); openclaw.invoke('cs-math', params). For web apps, use the SDK to handle retries: openclaw.configure(retries=3). Ensure inputs are validated against schema, e.g., use JSON Schema for params. If embedding in larger workflows, chain with other skills via OpenClaw's event system, like triggering 'algorithms' skill after a math computation.

Error Handling

Always check the response for an 'error' key, e.g., if result.get('error'), raise a custom exception. Common errors: InvalidInputError for non-numeric params (e.g., negative 'n' in permutations), handle with: try: openclaw.invoke('cs-math', {'operation': 'permutation', 'n': -1}) except ValueError as e: log_error(e). For API timeouts, use --timeout flag and catch HTTP errors: if response.status_code == 504, retry up to 3 times. Validate inputs beforehand, e.g., ensure matrices are square for inverses using: if not all(len(row) == len(matrix) for row in matrix): raise Error. Log detailed errors with --verbose flag for debugging.

Concrete Usage Examples

  1. Calculate permutations for arranging 5 items taken 3 at a time: Use code: import openclaw; params = {"operation": "permutation", "n": 5, "r": 3}; result = openclaw.invoke('cs-math', params); print(result['result']) # Outputs: 10
  2. Perform matrix multiplication for two 2x2 matrices: Use code: import openclaw; A = [[1,2],[3,4]]; B = [[5,6],[7,8]]; params = {"operation": "matrix_multiply", "A": A, "B": B}; result = openclaw.invoke('cs-math', params); print(result['result']) # Outputs: [[19,22],[43,50]]

Graph Relationships

  • Belongs to cluster: computer-science
  • Related tags: math, discrete, probability, linear-algebra, combinatorics, statistics
  • Connected skills: algorithms (for applying math to sorting/complexity), data-science (for statistical integrations), ml-foundations (for calculus in training models)