classify-then-schema

Classify input text and generate a JSON Schema for a structured response.

Updated Jun 20, 2026
One-click install
npx skills add https://github.com/ensj/skill-eval-framework --skill classify-then-schema-ensj
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: classify-then-schema
Source: https://github.com/ensj/skill-eval-framework/tree/main/packaged/classify-then-schema
Command: npx skills add https://github.com/ensj/skill-eval-framework --skill classify-then-schema-ensj

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When building structured AI pipelines, you often need to first understand what kind of text you are dealing with and then design an appropriate output format for it. Doing both steps ad hoc leads to inconsistent classifications and schemas that do not fit the input. This Skill chains the two steps into a measured, reproducible composition. ## Core Features & Use Cases - Text Classification: Categorizes any input text as a question, instruction, or narrative, with a one-sentence rationale and a confidence score written to classification.json. - Schema Design: Generates a JSON Schema (type, properties, required) tailored to both the input text and its classified category, written to schema.json. - Flexible Execution: Supports canonical per-step subagent dispatch or single-context inline execution when the skill is single-model. - Use Case: Given the text "Summarize the attached report in three bullet points and send it to the team", the skill classifies it as an instruction and produces a JSON Schema with fields for the action, target, recipients, and format constraints. ## Quick Start Classify this text and design a JSON output schema for a structured response to it: "What were the main causes of the supply shortage last quarter?"

Frequently Asked Questions about classify-then-schema

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I classify text and generate a JSON schema from it?▼

Run the two-step procedure: first classify the text into question, instruction, or narrative with a rationale and confidence score, then design a JSON Schema whose properties fit both the text content and its category. Each step writes its result to a JSON file.

What categories does text classification support?▼

The classification step supports exactly three categories: question for information requests, instruction for imperative directives, and narrative for event recounts or descriptions. Each classification includes a one-sentence rationale and a confidence value between 0 and 1.

Can I run the classification and schema steps in a single context?▼

Inline execution is allowed only when the skill is single-model and the working set fits one context. If steps name different models, you must dispatch one subagent per step so per-step model directives are honored.

What makes a generated JSON schema valid for this task?▼

The schema must be a JSON object with type set to object, a non-empty properties object suited to the text and its category, and a required array listing required property names. It must reflect the specific input content rather than generic boilerplate.

When should I not use a classify-then-schema composition?▼

Avoid it when the input category is already known, since the classification step adds cost without value, or when a single fixed schema covers all inputs. It is designed for heterogeneous text streams where the response structure depends on text type.