Skip to main content
rule CX Codex

json-structured-prompting — Claude Code rule: what it does

json-structured-prompting defines a JSON architecture for complex image prompts with multiple subjects, explicit positioning, and variable templates.

AGPL-3.0 ★ 78,316 updated 2026-10-24

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/json-structured-prompting.md
Open on GitHub

What json-structured-prompting does

This rule establishes a standard schema for describing visual compositions using structured fields instead of loose sentences. Prompts are separated into isolated blocks: environment parameters, an array of subjects with specific coordinates and actions, artistic medium details, and camera settings such as focal length or lighting angle.

The framework covers multi-entity interactions via assigned identifiers, multi-layered spatial depth, and parameter placeholders for automated asset generation. Each segment maintains dedicated keys for hex color accents and composition balance.

Raw JSON must be flattened into descriptive prose before feeding it into image models, as diffusion pipelines interpret natural descriptive sentences far better than nested syntax.

What it helps with

  • organize multi-character scenes with clear spatial positions
  • isolate lighting and camera settings from artistic style
  • build reusable prompt templates with variable replacement
  • separate foreground, midground, and background focus levels

Example prompts for the agent

  • Structure a multi-character detective scene using the json-structured-prompting schema
  • Create a product photography JSON layout with specific hex color values and lighting
  • Convert this scene JSON definition into natural language prose for image generation

How to install json-structured-prompting

Manually: put the files in place

.claude/rules/json-structured-prompting.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about json-structured-prompting

How to install json-structured-prompting in Claude Code?

Place the rule file into your project at .claude/rules/json-structured-prompting.md.

What is the purpose of json-structured-prompting?

It prevents attribute bleeding in complex scenes by separating subjects, environmental mood, camera setup, and stylistic references into dedicated keys.

Should the raw JSON be passed directly to the image generator?

No, the guideline requires converting the completed JSON object into fluent descriptive prose before executing the generation call.

Similar IDE rules

All IDE rules for AI and ML →

From the same set101

The whole set →
create-video The create-video skill for Claude Code turns a text description into a finished video with a script, avatar, voiceover, visuals, and captions for demos, explainers, and promos. CX Codex +1 1,200installs video-toolkit video-toolkit automates video creation: generates voiceovers, background music, animates talking heads, and composes scenes with Remotion. Requires Node.js, Python3, ffmpeg, and cloud GPU access (Modal or RunPod). CX Codex +1 1,200installs azure-speech-to-text azure-speech-to-text transcribes local audio files into text with word-level timestamps and speaker diarization using Azure AI Speech. Speeds up subtitle creation and audio processing in OpenMontage pipelines. CX Codex +1 913installs azure-text-to-speech azure-text-to-speech synthesizes neural voiceover audio using the Azure AI Speech REST API. Ideal for OpenMontage pipelines that need multilingual narration voices. CX Codex +1 738installs i2i-prompting i2i-prompting — a rule for writing image-to-image editing prompts with FLUX.2. Use it for targeted changes, style transfers, text edits, and staged transformations. CX Codex +1 ★ 78,316repo stars flux2-models Rule with prompting patterns for FLUX.2 models: klein, max, pro, flex, and dev. Shows the agent how to write generation and editing prompts for each variant. CX Codex +1 ★ 78,316repo stars hyperframes-core hyperframes-core defines the technical contract for rendering video from HTML in HyperFrames, covering track timing data attributes, deterministic rules, and sub-compositions. CX Codex +1 ★ 78,316repo stars hyperframes-animation The hyperframes-animation skill for Claude Code builds HyperFrames motion from reusable rules and scene blueprints. Consult runtime-specific API notes when authoring choreography or auditing a composition. CX Codex +1 ★ 78,316repo stars

More in the catalog

Project sponsors

Companies that keep this analytics open