cs-data-structures
Data structures: arrays, linked lists, trees BST/AVL/B-tree, heaps, hash tables, graphs, tries
What this skill does
# cs-data-structures
## Purpose
This skill equips the OpenClaw AI to generate, manipulate, and optimize code for core data structures, including arrays, linked lists, trees (BST, AVL, B-tree), heaps, hash tables, graphs, and tries, to solve programming tasks efficiently.
## When to Use
Use this skill when implementing data storage or manipulation in code, such as sorting large datasets with arrays, searching nodes in a BST, or traversing graphs for pathfinding. Apply it in scenarios requiring efficient operations like O(1) lookups in hash tables or balanced trees for sorted data.
## Key Capabilities
- Arrays: Support creation, sorting (e.g., quicksort, mergesort), and searching (e.g., binary search).
- Linked Lists: Handle singly/doubly linked lists with operations like insertion, deletion, and traversal.
- Trees: Implement BST for basic searches, AVL for self-balancing, B-tree for disk-based storage; include traversals (in-order, pre-order).
- Heaps: Manage min/max heaps for priority queues, with heapify and extract operations.
- Hash Tables: Provide hashing functions, collision resolution (chaining/open addressing), and key-value operations.
- Graphs: Support adjacency lists/matrices, BFS, DFS, shortest paths (e.g., Dijkstra), and cycle detection.
- Tries: Enable prefix-based string storage and search for autocomplete features.
## Usage Patterns
To invoke this skill, prefix commands with `openclaw ds <structure> <action>`. Always specify the structure type and action parameters for precision. For code integration, import the generated module and call functions directly. Use in a pipeline: first generate code with a command, then test it in your environment. If using in a script, set the context with `--context=project-file.py` to embed the code snippet. For repeated use, save outputs to a config file like JSON: {"structure": "bst", "action": "insert", "params": {"value": 5}}.
## Common Commands/API
Use the OpenClaw CLI for direct execution. Commands require authentication via the environment variable `$OPENCLAW_API_KEY`. Example CLI flags:
- `openclaw ds array create --size=10 --init=[1,2,3,4]` to generate an array initialization snippet.
- `openclaw ds tree bst insert --node=5 --root=var_root` to add a node to a BST (output: 2-3 lines of code).
- `openclaw ds graph bfs --vertices=5 --edges='[[0,1],[1,2]]'` for BFS traversal code.
For API integration, send HTTP requests to endpoints like POST /api/ds/{structure} with a JSON body, e.g., {"action": "sort", "params": {"array": [4,2,1], "algorithm": "quicksort"}}. Code snippets:
```python
# Example for hash table insertion
hash_table = {} # Generated by openclaw ds hash create
hash_table['key'] = 'value' # Use openclaw ds hash insert --key='key' --value='value'
```
```python
# Example for linked list traversal
node = head # From openclaw ds linkedlist create
while node: # Traverse using openclaw ds linkedlist traverse
print(node.data)
node = node.next
```
## Integration Notes
Integrate this skill into your codebase by generating snippets and importing them as modules. For authentication, set `$OPENCLAW_API_KEY` in your environment before running commands, e.g., export OPENCLAW_API_KEY=your_api_key. Use config files in YAML format for multi-step operations: structure: bst, actions: [insert, search]. Chain with other OpenClaw skills by piping outputs, e.g., `openclaw ds graph create | openclaw cs-algorithms bfs`. Ensure your project uses compatible languages like Python or C++ by specifying `--lang=python`.
## Error Handling
Always validate inputs before commands, e.g., check if structure types are valid (use `openclaw ds list` to query available structures). Common errors include invalid parameters (e.g., negative array size), handled by returning error codes like 400 with messages: "Error: Array size must be positive." In code snippets, wrap operations in try-except blocks, e.g.:
```python
try:
result = bst.search(5) # From openclaw ds tree bst search
except KeyError:
print("Node not found")
```
For API calls, check HTTP status codes and parse error responses. Retry transient errors with exponential backoff if API rate-limited.
## Graph Relationships
- Related to: cs-algorithms (for algorithms operating on these structures, e.g., sorting arrays or traversing graphs).
- Connected to: software-engineering (for best practices in implementing data structures in production code).
- Links to: cs-networks (for graph applications in network topology).
- Associated with: ai-tools (for embedding hints like data structure queries in AI prompts).
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.