Skip to content

andreahaku/JSON_promting_skill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

JSON Prompting Skill for Claude Code

A Claude Code skill that generates structured JSON prompts across 7 domains: image generation, video generation, LLM structured outputs, product photography, UI/UX mockups, commercial advertising, and batch/programmatic generation.

Why JSON Prompting?

JSON prompting uses structured data instead of free-form text to instruct AI systems. The results speak for themselves:

  • ~92% precision for visual generation vs ~68% for natural language prompts
  • 99%+ schema adherence for LLM structured outputs
  • 60% reduction in AI errors across enterprise deployments
  • No concept bleeding - adjectives stay isolated to their target element
  • Reproducible - same structure, consistent results
  • Batch-scalable - swap variables programmatically for mass generation

The 7 Domains

1. Image Generation

Generate structured prompts for AI image models with camera metadata, lighting specs, and composition controls.

Platforms: Nano Banana Pro, GPT-Image, Flux 2, Midjourney, Stable Diffusion

2. Video Generation

Create multi-scene sequences with camera movements, transitions, audio design, and entity consistency.

Platforms: Veo 3, Sora 2, Runway Gen-4, Kling 2

3. LLM Structured Output

Force consistent, parseable responses from any LLM with schema enforcement, data type declarations, and few-shot examples. Covers data extraction, content generation, analysis/classification, API response formatting, meeting summaries, bug triage, and more.

Platforms: Claude, GPT-4o/o3, Gemini 2.5, or any LLM via prompt-level JSON

4. Product Photography

E-commerce and commercial product shots with brand preservation, surface/background control, and lighting precision.

Variants: Marketplace packshots, lifestyle context, flat lay grids, hero shots

5. UI/UX Mockups

App screen designs with device frames, design systems, layout hierarchies, and component specifications.

6. Commercial Advertising

Brand-consistent ad creatives with text overlays, CTA elements, format adaptation, and logo placement.

7. Batch/Programmatic Generation

Wrap any domain in a template system with {{variable}} placeholders for mass customization. Generate hundreds of variations from a single template.

Strategies: Color variants, background swap, platform adaptation, language localization, A/B testing, SKU catalogs

Installation

Copy the skill into your Claude Code skills directory:

mkdir -p ~/.claude/skills/json-prompt/references
cp SKILL.md ~/.claude/skills/json-prompt/
cp references/schemas.md ~/.claude/skills/json-prompt/references/
cp references/examples.md ~/.claude/skills/json-prompt/references/
cp references/showcase.md ~/.claude/skills/json-prompt/references/

Usage

Invoke the skill in Claude Code with /json-prompt or let it auto-trigger:

/json-prompt image cyberpunk street scene at night with neon reflections
/json-prompt video product launch reveal for a smartwatch
/json-prompt product premium headphones on marble surface
/json-prompt llm extract contact information from emails
/json-prompt ui fitness app dashboard for iOS
/json-prompt ad Instagram carousel for a coffee brand
/json-prompt batch generate hero shots for 50 sneaker colorways

Skill Structure

json-prompt/
  SKILL.md                     # Main skill - 7 domain workflows, all JSON schemas
  references/
    schemas.md                 # Complete field reference for all platforms and domains
    examples.md                # 15 practical examples across all 7 domains
    showcase.md                # 8 detailed walkthroughs with user request -> JSON -> expected output

Examples Included

# Domain Example
1 Image Editorial portrait with camera metadata
2 Image Product packshot for e-commerce
3 Image Multi-character scene (concept bleeding prevention)
4 Image App UI mockup
5 Image Brand advertisement with text overlays
6 Video Multi-scene product launch sequence
7 Image Fantasy concept art with artist references
8 Image Flat lay lifestyle composition
9 LLM Data extraction from unstructured text
10 LLM Content generation with brand voice constraints
11 LLM Customer feedback analysis and classification
12 LLM Meeting transcript summarization
13 Batch Product photography across SKU variants
14 Batch Social media ad platform/language adaptation
15 Batch + LLM Support ticket triage at scale

Showcase: Detailed Walkthroughs

The references/showcase.md file contains 8 in-depth walkthroughs showing real user requests turned into complete JSON prompts with expected AI outputs. Each includes creative reasoning explaining why specific fields were chosen.

# User Request Domain Highlights
1 "Make me a cozy coffee shop scene for Instagram" Image Film stock selection, warm/cool light mixing, mood-driven composition
2 "15-second TikTok video ad for energy drink VOLT" Video 3-scene hook-build-payoff, speed ramps, audio design, 9:16 vertical
3 "Extract job posting info and rate my resume fit" LLM Dual-task extraction + analysis, match scoring, gap analysis with mitigations
4 "Luxury watch product photo for our website" Product Low-key lighting, selective metal highlights, premium positioning
5 "Analyze our app's user reviews and find patterns" LLM Per-review tagging + pattern clustering + business impact ranking. Full input/output shown
6 "Design a fintech app onboarding screen" UI Mockup Dark mode, trust signals, progressive disclosure, iOS 18 design system
7 "6 social media headers for our SaaS launch" Batch + Ad Single template producing Twitter, LinkedIn, Facebook, YouTube, Instagram, Discord variants
8 "Convert competitor landing page into structured analysis" LLM Messaging teardown, pricing psychology, competitive gaps. Full input/output shown
9 "Generate a REST API endpoint with validation and tests" LLM (Code) Full stack generation: Zod schemas, Drizzle ORM, Hono routes, bun:test, SQL migration, API docs
10 "Refactor this function and explain what changed" LLM (Code) Refactored code + diff summary + behavioral change flags + complexity metrics
11 "Generate TypeScript types from this API response" LLM (Code) Infers interfaces from raw JSON, generates typed fetch wrapper, documents type decisions

Core Principles

Visual Domains

  1. Separate subjects into distinct objects - Each character gets its own JSON block
  2. Use camera/lens metadata - Aperture, focal length, ISO for photorealism
  3. Be a Creative Director - Natural language descriptions, not keyword tags
  4. Constrain your palette - Use color_palette to prevent drift

LLM Structured Output

  1. Always define data types - string, number, boolean in your schema
  2. Use enums for categories - "low|medium|high" not free text
  3. Include few-shot examples - 1-3 examples are the biggest accuracy boost
  4. Set strict: true - Prevents unexpected fields

Batch Generation

  1. Validate variable names - Every {{placeholder}} needs a matching batch key
  2. Test with one item first - Before scaling to hundreds
  3. Version your templates - Track iterations with template_id

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors