cs-algorithms
Algorithms: sorting, searching, BFS/DFS/A*, dynamic programming, greedy, backtracking, Big-O
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o cs-algorithms.zip https://jpskill.com/download/22159.zip && unzip -o cs-algorithms.zip && rm cs-algorithms.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/22159.zip -OutFile "$d\cs-algorithms.zip"; Expand-Archive "$d\cs-algorithms.zip" -DestinationPath $d -Force; ri "$d\cs-algorithms.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
cs-algorithms.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
cs-algorithmsフォルダができる - 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
📖 Claude が読む原文 SKILL.md(中身を展開)
この本文は AI(Claude)が読むための原文(英語または中国語)です。日本語訳は順次追加中。
cs-algorithms
Purpose
This skill equips OpenClaw with tools for implementing and analyzing computer science algorithms, focusing on sorting, searching, graph traversals, dynamic programming, greedy approaches, backtracking, and Big-O complexity analysis. Use it to generate code snippets, optimize algorithms, or explain concepts in responses.
When to Use
Apply this skill when handling algorithmic problems in coding tasks, such as optimizing search in large datasets, solving graph problems in networks, or analyzing time complexity in performance-critical applications. Use it for educational responses, code reviews, or when users ask about specific algorithms like BFS for pathfinding.
Key Capabilities
- Sorting: Implement quicksort, mergesort, or bubblesort with configurable pivots or stability checks.
- Searching: Binary search, linear search, with options for recursive or iterative variants.
- Graph Traversals: BFS, DFS, and A* for pathfinding, including handling weighted graphs.
- Dynamic Programming: Memoization and tabulation for problems like knapsack or longest common subsequence.
- Greedy and Backtracking: Solve scheduling or subset sum problems with backtracking constraints.
- Big-O Analysis: Compute and explain time/space complexity, e.g., O(n log n) for mergesort.
- Additional: Handle edge cases like sorted arrays or disconnected graphs.
Usage Patterns
To use this skill, invoke it via OpenClaw's API or CLI by specifying the algorithm type and inputs. Always pass required parameters like data arrays or graph structures. For example, chain it with other skills by outputting results to variables. Prefix calls with authentication via $OPENCLAW_API_KEY in environment variables. In code, import the skill and call methods directly; in CLI, use subcommands for quick execution.
Common Commands/API
Use the OpenClaw CLI for direct runs or the Python API for integration. Authentication requires setting $OPENCLAW_API_KEY as an environment variable.
-
CLI Example:
openclaw run cs-algorithms --algorithm sort --input "[1,3,2]" --method quickThis sorts the array using quicksort. -
API Example:
import openclaw openclaw.set_api_key(os.environ['OPENCLAW_API_KEY']) sorted_array = openclaw.algorithms.sort([1,3,2], method='quick') -
Common Flags:
--algorithm [sort|search|bfs|...]: Specifies the algorithm to run.--input [JSON string]: Provides input data, e.g., arrays or graphs as JSON.--config { "method": "quick", "depth": 5 }: JSON config for parameters like recursion depth.
-
API Endpoints:
openclaw.algorithms.sort(array, method='quick'): Returns sorted array.openclaw.algorithms.bfs(graph, start_node): Returns traversed nodes.- For dynamic programming:
openclaw.algorithms.dp_solve(problem='knapsack', items=[...], capacity=10).
Config formats are JSON-based; for graphs, use adjacency lists like {"A": ["B", "C"]}.
Integration Notes
Integrate by adding OpenClaw as a dependency in your project (e.g., pip install openclaw). Set up authentication in your environment with export OPENCLAW_API_KEY=your_key. For asynchronous use, wrap API calls in async functions, e.g., await openclaw.algorithms.bfs_async(graph). Ensure inputs are validated (e.g., arrays must be lists), and handle outputs as JSON. If combining with other skills, use OpenClaw's output piping, like openclaw run cs-algorithms --output var1 | openclaw run another-skill --input var1.
Error Handling
Common errors include invalid inputs (e.g., non-array for sort) or authentication failures. Check for InvalidInputError by wrapping calls in try-except blocks. For CLI, errors return non-zero exit codes with messages like "Error: Array must be a list". In API, catch exceptions:
try:
result = openclaw.algorithms.sort([1, 'a'], method='quick') # Type mismatch error
except openclaw.errors.InvalidInputError as e:
print(f"Handle error: {e} - Ensure all elements are numbers")
Always validate inputs before calling, e.g., use isinstance(array, list). For Big-O analysis, handle cases where complexity can't be computed (e.g., infinite loops) by setting timeouts.
Concrete Usage Examples
-
Sorting an Array: To sort a user-provided list, use:
openclaw run cs-algorithms --algorithm sort --input "[5,2,9,1]" --method mergesort". This outputs[1,2,5,9]. In code:import openclaw openclaw.set_api_key(os.environ['OPENCLAW_API_KEY']) sorted_list = openclaw.algorithms.sort([5,2,9,1], method='mergesort') print(sorted_list) # [1, 2, 5, 9]Analyze complexity: Add
--analyze-complexityflag for "O(n log n) time". -
BFS on a Graph: For graph traversal, run:
openclaw run cs-algorithms --algorithm bfs --input '{"A": ["B"], "B": ["C"]}' --start "A". Output:["A", "B", "C"]. In API:graph = {"A": ["B"], "B": ["C"]} traversal = openclaw.algorithms.bfs(graph, "A") print(traversal) # ['A', 'B', 'C']Use for pathfinding in AI responses.
Graph Relationships
- Related Clusters: computer-science (parent cluster for algorithmic topics).
- Related Skills: data-structures (for array/graph implementations), machine-learning (for A* in optimization).
- Tags Connections: "algorithms" links to optimization skills; "sorting" and "searching" connect to efficiency-focused tools; "complexity" relates to performance-analysis skills.