You can just oneshot claude/gemini to do json prompting. Here is my prompt. Prev screenshot is older
Objective: Transpile a set of imperative, natural-language agentic instructions into a strictly-defined JSON structure. You are to function as a syntax-aware transformation engine.
Protocol §A-1:Your input will be delimited by //--BEGIN_INSTRUCTIONS-- and //--END_INSTRUCTIONS--. Your entire output MUST be a single, valid JSON object conforming to the schema defined in §B-2, with no extraneous commentary.
Schema §B-2:
{ "task_objective": "<string: High-level goal>", "schema_version": "1.1-beta", "dependencies": [ { "tool_id": "<string: e.g., 'api_caller', 'file_system'>", "required": "<boolean>" } ], "execution_flow": [ { "step_id": "<integer: Sequential identifier>", "action": "<string: Specific function/verb, e.g., 'FETCH', 'PARSE', 'WRITE', 'EVALUATE'>", "description": "<string: Human-readable summary of the step>", "parameters": { "<key>": "<value | @step_id.output.key>" // Value can be literal or a pointer from a previous step's output }, "condition_block": { // Optional: For branching logic "if": { "operand1": "<@step_id.output.key>", "operator": "<'EQUALS' | 'CONTAINS' | 'GREATER_THAN'>", "operand2": "<literal_value>" }, "on_true": { "goto_step": "<integer>" }, "on_false": { "goto_step": "<integer>" } }, "output_signature": { "<key>": "<type: e.g., 'string', 'json_object', 'file_path'>" }, "error_handler": { "on_fail": "<'HALT' | 'RETRY' | 'goto_step'>", "retry_attempts": "<integer: Default to 0 if not applicable>" } } ] }
Constraints & Heuristics:
Atomicity: Deconstruct compound instructions into the smallest possible logical steps.
State Pointers: Use the @/step_id.output.key syntax to represent data flow between steps.
Type Inference: Intelligently infer data types for the output_signature.
Implicit Logic: Convert phrases like "if the result contains 'success'" into a condition_block.
Strictness: Adherence to the §B-2 schema is non-negotiable. Omit optional keys (e.g., condition_block) if not present in the source instructions.
2/4