structured-output-fabric
This skill should be used when the user requests "get JSON with fields X, Y, Z", "need JSON output from this text", "create structured JSON from", or provides a JSON schema they want extracted from input data. Use this for converting ANY text into structured JSON format.
npx skills add majiayu000/claude-skill-registry --skill structured-output-fabric --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Text to Structured JSON Conversion This skill enables Claude to automatically convert any text into clean, structured JSON output when the user specifies desired JSON fields or structure. ## Purpose When users request structured data extraction (e.g., "I need JSON with name, tags, and summary from this text"), Claude executes an automated workflow to deliver clean JSON matching the requested schema. ## Scope **What this skill does:** - Converts ANY text input into structured JSON with specified fields - Accepts text from any source: files, API responses, command output, user input, or other tools - Generates prompts that enforce strict JSON-only output - Validates and cleans the resulting JSON **What this skill does NOT do:** - Does NOT decide which analysis patterns to use (pattern selection is outside this skill's scope) - Does NOT determine what fields to extract (user or calling skill specifies the schema) - Does NOT interpret or analyze content meaning (only structures it as JSON) ## Core Workflow Execute these steps automatically when the user requests structured JSON: ### 1. Parse JSON Requirements Identify from the request: - Desired JSON field names - Field types (string
- Purpose
- Scope
- Core Workflow
- 1. Parse JSON Requirements
- 2. Generate Base Prompt
- 3. Improve Prompt with Fabric
- 4. Combine Prompt with Source Text
- 5. Execute with Fabric rawquery
- 6. Extract and Validate Clean JSON
- Example User Interactions
- Example 1: Converting Log Output to JSON
- Example 2: Nested Structure from API Response
- Example 3: With Constraints from File Content
- Using the Provided Scripts
cat base_prompt.txt | fabric -p improve_prompt -o improved_prompt.txt >/dev/null 2>&1 cat full_input.txt | fabric -p raw_query -m claude-3-5-haiku-latest -o output.txt >/dev/null 2>&1 bash scripts/extract_json_from_llm.sh output.txt > clean.json if jq '.' clean.json >/dev/null 2>&1; then cat clean.json else fi bash scripts/extract_json_from_llm.sh fabric_output.txt > clean.json cat fabric_output.txt | bash scripts/extract_json_from_llm.sh > clean.json cat > /tmp/base.txt << 'EOF'
What does the structured-output-fabric skill do?
This skill should be used when the user requests "get JSON with fields X, Y, Z", "need JSON output from this text", "create structured JSON from", or provides a JSON schema they want extracted from input data. Use this for converting ANY text into structured JSON format.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill structured-output-fabric --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
