json-prompt-engine

json-prompt-engine is a skill for Claude Code, Codex from alecs5am/ralphy. It costs 270 tokens per session (3,810 once invoked), scanned A, original, Apache-2.0.

A tool that examines a reference image or video frame and produces a structured JSON description for recreating its visual appearance with an image generator.

In plain words
What is it for?
Use it for image-to-prompt work, recreating a visual style, preparing prompts for a carousel, or analyzing a frame for image generation.
Why use it?
It turns visual details such as composition, materials, lighting, and style into a reusable prompt instead of requiring manual description.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents); mentions AGENTS.md.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/alecs5am/ralphy/json-prompt-engine
Any agent
npx skills add alecs5am/ralphy --skill json-prompt-engine
Clone the repo
git clone --depth 1 https://github.com/alecs5am/ralphy

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for json-prompt-engine

README.md
[![agentmods](https://agentmods.dev/badge/skills/alecs5am/ralphy/json-prompt-engine.svg)](https://agentmods.dev/skills/alecs5am/ralphy/json-prompt-engine)
Your own site
<a href="https://agentmods.dev/skills/alecs5am/ralphy/json-prompt-engine"><img src="https://agentmods.dev/badge/skills/alecs5am/ralphy/json-prompt-engine.svg" alt="Measured on agentmods" height="20"></a>
Per session 270 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,810 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00270 $0.03810
Opus 5 $0.00135 $0.01905
Sonnet 5 $0.00054 $0.00762
Haiku 4.5 $0.00027 $0.00381

Measured 6d ago against content hash 540d0b7a495a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

json-prompt-engine scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- **Route through `ralphy generate image --prompt-file <path>`.** Never paste raw provider API code, never `curl` openrouter, never call a model SDK directly (AGENTS.md invariant #1/#2). The JSON you emit is the *prompt
.agents/skills/json-prompt-engine/SKILL.md · 185 lines

How it starts

The opening of the file, as written. The whole thing — 185 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Trigger

FIRES when the user has a reference (an uploaded image, a local path, a frame pulled from a video) and wants the prompt that would reproduce it: "give me a JSON prompt for this", "image-to-prompt", "reverse-engineer this image", "recreate this look", "describe this in structured prompt format", "what prompt makes this", "turn this reference into a prompt", "per-slide prompts for this carousel style".

DO NOT FIRE when:

  • The user asks a conversational visual question — "what is in this image", "is this photoshopped" — that is plain vision, not a prompt request.
  • The user wants to edit an existing image (inpaint, swap, restyle) -> that is an iteration-edit generation, route to the art-director playbook.
  • The user already has a written brief and just wants assets generated -> .agents/skills/art-director/SKILL.md drives that; this skill is only for the image -> prompt direction.
  • The user points at a video URL for style analysis across the whole clip -> use ralphy ref analyze-video (memory: feedback_ralphy_ref_analyze_video) or the /researcher skill, then optionally come back here to emit the JSON for one extracted frame.

What this skill is

The inverse of docs/prompts/image/ (the mode-by-mode prompt cookbook). The cookbook takes a brief and fills slots; this skill takes a finished image and recovers the dense prompt that would regenerate it. The output is one valid JSON object per reference, written to .ralphy/workspaces/<ws>/projects/<id>/prompts/<slot>.json and fed to ralphy generate image --prompt-file. It is a craft overlay on the art-director step, not a replacement for it.

Hard invariants

  • Route through ralphy generate image --prompt-file <path>. Never paste raw provider API code, never curl openrouter, never call a model SDK directly (AGENTS.md invariant #1/#2). The JSON you emit is the prompt body — JSON-structured prompts are an established ralphy pattern (the carousel and fb-creatives skills use the same STYLE + QUALITY block shape).
  • Read MODELS.md before naming any model id. The stack below is the default as of 2026-05-20, not a hardcode. Default image model: google/gemini-3-pro-image-preview (multi-ref consistency). Premium typography / legible-label work: openai/gpt-5.4-image-2. Match the model to the quality profile you write (see Cookbook).
  • Reference-required gate still fires. If the recovered prompt names a real person, a recognizable branded product, or an IP (AGENTS.md invariant #3), the source image itself is the ref — pass it on the generate call with --ref <path>. If the user only wants the JSON text and no generation, that is fine; the gate fires when they ask to generate.
  • Fold in the matching guideline. If the reference sits in a register the guideline library covers (photoreal humans, broadcast realism, anti-AI-slop), run ralphy guideline show <slug> and merge its avoid cluster and required tokens into the JSON quality block before handing the prompt off (AGENTS.md invariant #13). The quality.avoid array is exactly where the anti-AI-slop negative cluster belongs.
  • Quality gate refuses, not warns. When you do generate, two failed scoreImage in a row -> stop and report concrete options. Do not keep re-rolling silently.
  • English only on disk. Every JSON value you write to a prompts/*.json file is English, even if the user is chatting in another language.

Read the full file on GitHub · 185 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 185 lines · 270 tokens per session scan A 540d0b7a495a

Subscribe to this mod's changes

json-prompt-engine is a skill published in the GitHub repository alecs5am/ralphy (129 stars, last pushed 11d ago), licensed Apache-2.0. It adds 270 tokens to every session and 3,810 once invoked, about $0.0014 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

prompt-writing

Create, refine, and optimize high-quality YAML prompts for AI assistants. Use when working with prompt templates, system prompts, agent prompts, or any prompt engineering tasks. Provides structure guidelines, template patterns, and quality standards for YAML-based prompts.

ModelEngine-Group/nexent · 51 tokens

llm-redteam-overview

LLM red team category — full AATMF v3 tactic coverage (T01–T15). Routing skill: read this first to identify which tactic applies, then load the matching sub-skill. Maps to MITRE ATLAS where overlap exists.

PurpleAILAB/Decepticon · 58 tokens

histolab

Lightweight WSI tile extraction and preprocessing. Use for basic slide processing tissue detection, tile extraction, stain normalization for H&E images. Best for simple pipelines, dataset preparation, quick tile-based analysis. For advanced spatial proteomics, multiplexed imaging, or deep learning pipelines use pathml.

synthetic-sciences/openscience · 62 tokens

together-ai-inference

Serverless inference, fine-tuning, embeddings, image generation, and batch processing on 200+ open-source models via an OpenAI-compatible API. Use when you need fast, cost-effective access to open-source LLMs without managing infrastructure.

synthetic-sciences/openscience · 55 tokens

torch-geometric

Graph Neural Networks (PyG). Node/graph classification, link prediction, GCN, GAT, GraphSAGE, heterogeneous graphs, molecular property prediction, for geometric deep learning.

synthetic-sciences/openscience · 41 tokens

zarr-python

Chunked N-D arrays for cloud storage. Compressed arrays, parallel I/O, S3/GCS integration, NumPy/Dask/Xarray compatible, for large-scale scientific computing pipelines.

synthetic-sciences/openscience · 42 tokens