Schema Sleuth for Openclaw

A zero-dependency developer utility to instantly infer clean, type-safe Pydantic, Zod, TypeScript, and Go schemas from messy, real-world sample data.

phy041
v1.0.3
Mar 23, 2026
0
756
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install phy-schema-sleuth

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install phy-schema-sleuth using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Schema Sleuth?

Schema Sleuth is a highly specialized developer utility designed to streamline code-generation and data-modeling tasks within your AI coding workflows. By analyzing up to five samples of unstructured or messy data—including nested JSON objects, API responses, CSV sheets, and raw LLM text—this tool identifies field nullability, marks optional parameters, and detects complex semantic structures such as UUIDs, email addresses, and ISO timestamps. Unlike simpler single-pass converters, it leverages advanced multi-sample logic to build a comprehensive field inventory, ensuring your target language definitions are accurate, robust, and clean.

Integrating this tool with your workspace via Openclaw Skills allows your AI coding assistant to operate as an intelligent systems architect. By validating and modeling sample payloads on the fly without any reliance on external APIs, it delivers secure, private, and localized code generation for Python, TypeScript, and Go backend-to-frontend pipelines.

Schema Sleuth Use Cases

  • Mapping Untyped API Deliveries: Instantly convert undocumented JSON payloads from external REST or GraphQL APIs into valid runtime schemas.
  • Validating Legacy Data Ingestion: Parse diverse raw CSV or NDJSON collections into typed application interfaces or database models.
  • Frontend-Backend Contract Alignment: Synchronize models by generating matching Python Pydantic models and TypeScript Zod schemas in a single query.
  • Normalizing AI Agent Outputs: Structurally validate raw LLM textual and JSON responses against strict, pre-compiled application expectations.

How Schema Sleuth Works

  1. Input Normalization: The skill identifies raw input formats (JSON, CSV, TSV, YAML, or plain text) and splits multi-sample datasets into distinct objects.
  2. Field Inventory Profiling: It evaluates fields across all samples to track observed values, marking a field as optional or nullable if it is absent or null in even a single sample.
  3. Semantic Typology Mapping: Regular expressions and pattern checking identify nested structures, lists, and specific fields such as dates, emails, hex colors, and UUIDs.
  4. Schema Blueprint Synthesizing: Clean schema code is concurrently formatted for Pydantic v2 (Python), Zod and plain interfaces (TypeScript), Draft 7 JSON Schema, and native Go structs.
  5. Verification Analysis Reporting: The tool displays an analytical markdown table highlighting data types, confidence metrics, potential edge cases, and human-in-the-loop validation advice.

Schema Sleuth Setup

Integrate this schema inference tool natively within your developer workflows using the following environment setup:

# Create the local skills directory for your agent profile
mkdir -p ~/.config/openclaw/skills

# Pull down the Schema Sleuth skill file to initialize capability tracking
curl -fsSL https://raw.githubusercontent.com/PHY041/schema-sleuth/main/SKILL.md -o ~/.config/openclaw/skills/schema-sleuth.md

Once added, Openclaw Skills dynamically indexes this resource to handle commands like /schema-sleuth or natural language queries like infer schema across your development console.

Schema Sleuth Data Schema & Taxonomy

The utility maps input data elements to target validation schemas using the following taxonomic structure:

Native Format Detected Semantic Pattern Pydantic v2 (Python) Zod Schema (TS) TypeScript Interface Go Struct Type
String Standard alphanumeric text str z.string() string string
String (Email) user@domain address structure EmailStr z.string().email() string string
String (UUID) v4 format compliant string UUID z.string().uuid() string string
String (Date) ISO 8601 formatted datetime datetime z.string().datetime() string time.Time
Integer Positive or negative integers int z.number().int() number int
Float Fractional decimal numbers float z.number() number float64
Mixed / Null Optional or empty fields Optional[T] = None z.lazy().nullable() T or null *T
Object Nested keys and child models BaseModel subclass z.object() interface struct

Schema Sleuth Advanced Features

  • Auto-Generated Parsing Scripts: Produces boilerplate parsing templates in Python and TypeScript (e.g., standard safeParse wrapper loops) to fast-track script integration.
  • Implicit Enum Extraction: Evaluates field datasets and builds rigid typescript literals or Pydantic string enums when 8 or fewer distinct values are found.
  • Dynamic Type Promotion: Mitigates parsing mismatches by automatically promoting mixed integer and float fields to floating-point representation.
  • Complex Nested Object Recursion: Deeply maps objects nested multiple levels down, compiling required sub-structures and references automatically.
  • Native Openclaw Skills Integration: Plugs directly into your multi-agent coding framework to automate backend data modeling as you ingest API configurations.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*