Stdlib Code Reference
Shared utilities for JSON transformation, formatting, and I/O. Chain these in tasks via session files.
Usage
Declare the stdlib skill as a dependency, then use code bullets in task steps:
# In your skill
dependencies:
- use:
Data Utilities
# In your task
steps:
- run:
Filter JSON Array
args: ["inputPath", "status", "eq", "active", "outputPath"]
- run:
Summarize JSON Array
args: ["inputPath", "category", "10", "outputPath"]IO Utilities
| Code Bullet | Purpose | Key Args |
|---|---|---|
| Merge multiple JSON arrays into one | inputPaths (comma-sep), outputPath | |
| Split array into chunk files | inputPath, chunkSize, outputDir | |
| Read JSON/YAML, extract nested path | inputPath, arrayPath, outputPath |
Transform Utilities
| Code Bullet | Purpose | Key Args |
|---|---|---|
| Compute top-N counts, date range | inputPath, groupByField, topN, outputPath | |
| Filter by field condition | inputPath, field, operator, value, outputPath | |
| Project specific fields | inputPath, fields (comma-sep), outputPath | |
| Sort by field | inputPath, field, order, outputPath | |
| Group by field value | inputPath, field, outputPath | |
| Remove duplicates | inputPath, field, keep, outputPath | |
| Flatten nested arrays | inputPath, arrayField, outputPath |
Filter operators: eq, neq, contains, gt, lt, gte, lte, exists
Format Utilities
| Code Bullet | Purpose | Key Args |
|---|---|---|
| JSON to markdown table/list | inputPath, format, fields, outputPath | |
| JSON to CSV | inputPath, fields, outputPath | |
| JSON to YAML | inputPath, outputPath |
Text Utilities
| Code Bullet | Purpose | Key Args |
|---|---|---|
| Truncate long strings | inputPath, fields, maxLength, outputPath | |
| Search by text match | inputPath, query, fields, mode, outputPath | |
| Apply string template | inputPath, template, outputField, outputPath |
Search modes: exact, contains, fuzzy
Time Utilities
| Code Bullet | Purpose | Key Args |
|---|---|---|
| Filter by date range | inputPath, dateField, start, end, outputPath | |
| Group by time period | inputPath, dateField, bucket, outputPath |
Relative dates: 7d (7 days), 1m (1 month), now
Bucket periods: hour, day, week, month, year