GitHub Copilot Claude opencode Skill

jqschema

Infer JSON structure and types with jq-based schema discovery.

LLM Mart · 0 points · 1 views 0 listing impressions 0 install-command copies
Download rshade-finfocus-.github_skills_jqschema-835e5f9.zip · 1 KB

Install

skills CLI npx skills add https://github.com/rshade/finfocus/tree/main/.github/skills/jqschema
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install rshade-finfocus@llmmart
Git git clone https://github.com/rshade/finfocus.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole rshade/finfocus collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

jqschema - JSON Schema Discovery

Use ./.github/skills/jqschema/jqschema.sh directly from the repository skill folder to discover complex JSON structure.

Purpose

Generate a compact structural schema (keys + types) from JSON input. Use it when:

  • Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories)
  • Exploring API responses with large payloads
  • Understanding the structure of unfamiliar data without verbose output
  • Planning queries before fetching full data

Usage

# Analyze a file
cat data.json | ./.github/skills/jqschema/jqschema.sh

# Analyze command output
echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | ./.github/skills/jqschema/jqschema.sh

# Analyze GitHub search results
gh api search/repositories?q=language:go | ./.github/skills/jqschema/jqschema.sh

How It Works

The script transforms JSON data by:

  1. Replacing object values with their type names ("string", "number", "boolean", "null")
  2. Reducing arrays to their first element's structure (or empty array if empty)
  3. Recursively processing nested structures
  4. Outputting compact (minified) JSON

Example

Input:

{
  "total_count": 1000,
  "items": [
    {"login": "user1", "id": 123, "verified": true},
    {"login": "user2", "id": 456, "verified": false}
  ]
}

Output:

{"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]}

Best Practices

Use this script when:

  • You need to understand the structure of tool outputs before requesting full data
  • GitHub search tools return large datasets (use perPage: 1 and pipe through schema minifier first)
  • Exploring unfamiliar APIs or data structures
  • Planning data extraction strategies

Example workflow for GitHub search tools:

# Step 1: Get schema with minimal data (fetch just 1 result)
# This helps understand the structure before requesting large datasets
echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | ./.github/skills/jqschema/jqschema.sh

# Output shows the schema:
# {"incomplete_results":"boolean","items":[{...}],"total_count":"number"}

# Step 2: Review schema to understand available fields

# Step 3: Request full data with confidence about structure
# Now you know what fields are available and can query efficiently

Using with GitHub MCP tools: When using tools like search_code, search_issues, or search_repositories, pipe the output through jqschema to discover available fields:

# Save a minimal search result to a file
gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json

# Generate schema to understand structure
cat /tmp/sample.json | ./.github/skills/jqschema/jqschema.sh

# Now you know which fields exist and can use them in your analysis
Files (finfocus)
  • SKILL.md 3 KB
    ---
    name: jqschema
    description: Infer JSON structure and types with jq-based schema discovery.
    tools:
      bash:
        - "jq *"
        - "./.github/skills/jqschema/jqschema.sh"
        - "git"
    ---
    
    ## jqschema - JSON Schema Discovery
    
    Use `./.github/skills/jqschema/jqschema.sh` directly from the repository skill folder to discover complex JSON structure.
    
    ### Purpose
    
    Generate a compact structural schema (keys + types) from JSON input. Use it when:
    - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories)
    - Exploring API responses with large payloads
    - Understanding the structure of unfamiliar data without verbose output
    - Planning queries before fetching full data
    
    ### Usage
    
    ```bash
    # Analyze a file
    cat data.json | ./.github/skills/jqschema/jqschema.sh
    
    # Analyze command output
    echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | ./.github/skills/jqschema/jqschema.sh
    
    # Analyze GitHub search results
    gh api search/repositories?q=language:go | ./.github/skills/jqschema/jqschema.sh
    ```
    
    ### How It Works
    
    The script transforms JSON data by:
    1. Replacing object values with their type names ("string", "number", "boolean", "null")
    2. Reducing arrays to their first element's structure (or empty array if empty)
    3. Recursively processing nested structures
    4. Outputting compact (minified) JSON
    
    ### Example
    
    **Input:**
    ```json
    {
      "total_count": 1000,
      "items": [
        {"login": "user1", "id": 123, "verified": true},
        {"login": "user2", "id": 456, "verified": false}
      ]
    }
    ```
    
    **Output:**
    ```json
    {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]}
    ```
    
    ### Best Practices
    
    **Use this script when:**
    - You need to understand the structure of tool outputs before requesting full data
    - GitHub search tools return large datasets (use `perPage: 1` and pipe through schema minifier first)
    - Exploring unfamiliar APIs or data structures
    - Planning data extraction strategies
    
    **Example workflow for GitHub search tools:**
    ```bash
    # Step 1: Get schema with minimal data (fetch just 1 result)
    # This helps understand the structure before requesting large datasets
    echo '{}' | gh api search/repositories -f q="language:go" -f per_page=1 | ./.github/skills/jqschema/jqschema.sh
    
    # Output shows the schema:
    # {"incomplete_results":"boolean","items":[{...}],"total_count":"number"}
    
    # Step 2: Review schema to understand available fields
    
    # Step 3: Request full data with confidence about structure
    # Now you know what fields are available and can query efficiently
    ```
    
    **Using with GitHub MCP tools:**
    When using tools like `search_code`, `search_issues`, or `search_repositories`, pipe the output through jqschema to discover available fields:
    ```bash
    # Save a minimal search result to a file
    gh api search/code -f q="jq in:file language:bash" -f per_page=1 > /tmp/sample.json
    
    # Generate schema to understand structure
    cat /tmp/sample.json | ./.github/skills/jqschema/jqschema.sh
    
    # Now you know which fields exist and can use them in your analysis
    ```
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.