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.
/plugin marketplace add rafaelcalleja/claude-market-place/plugin install skill-extractor@claude-market-placeThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/prompt_template.txtexamples/basic_prompt.txtexamples/example_workflow.shexamples/improved_prompt.txtreferences/json_extraction_methods.mdreferences/prompt_engineering.mdscripts/extract_json_from_llm.shThis skill enables Claude to automatically convert any text into clean, structured JSON output when the user specifies desired JSON fields or structure.
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.
What this skill does:
What this skill does NOT do:
Execute these steps automatically when the user requests structured JSON:
Identify from the request:
Create a prompt specifying the exact JSON structure:
Convert the provided text into JSON with this exact structure:
{
"field1": "<description>",
"field2": ["<items>"],
"field3": {<nested>}
}
Requirements:
- field1: [constraints from request]
- field2: [constraints from request]
- field3: [constraints from request]
Return ONLY the JSON object. No explanations, no markdown code fences.
Write this to a temporary file.
Execute:
cat base_prompt.txt | fabric -p improve_prompt -o improved_prompt.txt >/dev/null 2>&1
This enhances the prompt with:
Create complete input by concatenating:
Run:
cat full_input.txt | fabric -p raw_query -m claude-3-5-haiku-latest -o output.txt >/dev/null 2>&1
Use claude-3-5-haiku-latest for speed and cost-efficiency. Use claude-3-5-sonnet-latest only if complex structuring is needed.
Execute the extraction script and validate:
bash scripts/extract_json_from_llm.sh output.txt > clean.json
if jq '.' clean.json >/dev/null 2>&1; then
cat clean.json
else
# Handle error - retry or inform user
fi
Return the validated JSON directly to the user.
User: "Need JSON with timestamp, level, and message from this log text: [2024-03-15 10:30:45] ERROR Database connection failed"
Claude does:
{
"timestamp": "2024-03-15 10:30:45",
"level": "ERROR",
"message": "Database connection failed"
}
User: "Extract JSON with: {name, contact: {email, phone}, tags: []} from this text"
Claude does:
{
"name": "John Doe",
"contact": {
"email": "john@example.com",
"phone": "+1234567890"
},
"tags": ["customer", "premium", "active"]
}
User: "Get JSON with title (max 80 chars), priority (low/medium/high), items array from README.md"
Claude does:
Automatically extract JSON from fabric output:
bash scripts/extract_json_from_llm.sh fabric_output.txt > clean.json
Works with stdin:
cat fabric_output.txt | bash scripts/extract_json_from_llm.sh > clean.json
When user shows exact JSON structure:
User: "Give me this JSON: {name: string, count: number}"
Use their structure directly in the prompt.
If field requirements are ambiguous, choose the most reasonable interpretation:
If extraction fails validation:
Choose fabric model based on task:
Always use haiku unless user explicitly needs deeper analysis.
When user says: "Convert this text to JSON with name and email: John works at john@example.com"
Execute this workflow automatically:
# 1. Create base prompt
cat > /tmp/base.txt << 'EOF'
Convert the provided text into JSON with this exact structure:
{
"name": "<person's name>",
"email": "<email address>"
}
Return ONLY JSON.
EOF
# 2. Improve
fabric -p improve_prompt -o /tmp/improved.txt < /tmp/base.txt
# 3. Combine with input
(cat /tmp/improved.txt; echo ""; echo "Text: John works at john@example.com") > /tmp/full.txt
# 4. Execute
fabric -p raw_query -m claude-3-5-haiku-latest -o /tmp/out.txt < /tmp/full.txt
# 5. Extract and validate
bash scripts/extract_json_from_llm.sh /tmp/out.txt | jq '.'
Return result to user.
Reference this template when generating base prompts. Replace placeholders with user's requirements.
For implementation details:
references/prompt_engineering.md - Prompt construction techniquesreferences/json_extraction_methods.md - Extraction method detailsFor examples:
examples/example_workflow.sh - Complete automation scriptexamples/basic_prompt.txt - Simple prompt before improvementexamples/improved_prompt.txt - After fabric enhancementWhen user requests structured JSON from any text source:
fabric -p improve_promptfabric -p raw_queryscripts/extract_json_from_llm.sh and jqThe entire workflow executes automatically—user receives only the final JSON result.
This skill focuses solely on text-to-JSON conversion. Pattern selection and content analysis decisions are outside this skill's scope.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.