Skill: aronchick/expanso-json-flatten (version 1.0.0)

# json-flatten Flatten nested JSON objects ## Requirements - Expanso Edge installed (`expanso-edge` binary in PATH) - Install via: `clawhub install expanso-edge` ## Usage ### CLI Pipeline ```bash # Run standalone echo '<input>' | expanso-edge run pipeline-cli.yaml ``` ### MCP Pipeline ```bash # Start as MCP server expanso-edge run pipeline-mcp.yaml ``` ### Deploy to Expanso Cloud ```bash expanso-cli job deploy https://skills.expanso.io/json-flatten/pipeline-cli.yaml ``` ## Files | File | Purpose | |------|---------| | `skill.yaml` | Skill metadata (inputs, outputs, credentials) | | `pipeline-cli.yaml` | Standalone CLI pipeline | | `pipeline-mcp.yaml` | MCP server pipeline |

path: README.md
content: # json-flatten

Analyze nested JSON structure.

## Usage

```bash
echo '{"user": {"name": "test"}, "active": true}' | expanso-edge run pipeline-cli.yaml
```

## Output

```json
{
  "top_level_keys": ["user", "active"],
  "key_count": 2,
  "has_nested_objects": true
}
```


path: pipeline-cli.yaml
content: name: "json-flatten-cli"
type: pipeline

config:
  input:
    stdin:
      codec: all
      max_buffer: 1048576

  pipeline:
    processors:
      - mapping: |
          meta trace_id = uuid_v4()
          let input = content().trim()

          let parsed = $input.parse_json().catch({})
          let keys = $parsed.keys()

          # Get depth info
          let has_nested = $input.contains("{\"") || $input.contains(": {")

          root.original = $parsed
          root.top_level_keys = $keys
          root.key_count = $keys.length()
          root.has_nested_objects = $has_nested
          root.metadata = {"skill": "json-flatten", "mode": "cli", "trace_id": meta("trace_id"), "timestamp": now()}

  output:
    stdout:
      codec: json_object


path: pipeline-mcp.yaml
content: name: "json-flatten-mcp"
type: pipeline

config:
  http:
    enabled: true
    address: "0.0.0.0:${PORT:-8080}"

  input:
    http_server:
      path: /flatten
      allowed_verbs: [POST]
      timeout: 30s

  pipeline:
    processors:
      - mapping: |
          meta trace_id = uuid_v4()
          let input = this.object.or(content())

          let parsed = if $input.type() == "object" { $input } else { $input.parse_json().catch({}) }
          let keys = $parsed.keys()

          root.original = $parsed
          root.top_level_keys = $keys
          root.key_count = $keys.length()
          root.metadata = {"skill": "json-flatten", "mode": "mcp", "trace_id": meta("trace_id"), "timestamp": now()}

  output:
    sync_response: {}


path: skill.yaml
content: name: json-flatten
version: 1.0.0
description: Flatten nested JSON objects

inputs:
  - name: object
    type: object
    required: true
    description: Nested JSON object

outputs:
  - name: flat
    type: object
    description: Flattened object with dot notation keys

backends:
  - name: local
    type: local
    description: Local processing (no API required)

author: expanso
license: MIT


path: test/fixtures/input.txt
content: {"user": {"name": "test", "email": "[REDACTED_SECRET]"}, "active": true}


path: test/test.yaml
content: tests:
  - name: "Flatten JSON"
    input: '{"a": {"b": 1}}'
    expected:
      has_field: top_level_keys
      has_field: key_count
      metadata_has: [skill, trace_id]


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)