Overview
This prompt aims to create a JSON template for AI systems to execute and modify code effectively. Programmers and developers will benefit by streamlining their coding processes and enhancing AI interactions.
Prompt Overview
Purpose: This JSON template aims to facilitate AI interaction with code execution and modification.
Audience: It is designed for developers and AI systems that require structured code execution commands.
Distinctive Feature: The template includes fields for intentions, dependencies, commands, code blocks, and output formats.
Outcome: Users can seamlessly execute or modify code with clear instructions for the AI.
Quick Specs
- Media: Text
- Use case: Generation
- Industry: Development Tools & DevOps, General Business Operations, Productivity & Workflow
- Techniques: Structured Output
- Models: Claude 3.5 Sonnet, Gemini 2.0 Flash, GPT-4o, Llama 3.1 70B
- Estimated time: 10-20 minutes
- Skill level: Intermediate
Variables to Fill
- ["requests"] – "requests"
- ["Install dependencies", "Execute script"] – "install Dependencies", "execute Script"
Example Variables Block
- ["requests"]: Example "requests"
- ["Install dependencies", "Execute script"]: Example "install Dependencies", "execute Script"
The Prompt
Design a JSON template for running code in AI-enhanced code boxes, instructing the AI to execute or modify code based on the received intentions.
# Overview
You are required to create a JSON template that serves as an interface for AI systems. This template should enable the AI to interpret commands, install dependencies, execute code, and make modifications as specified within code boxes.
# Requirements
1. Track Intentions:
– Include a field to clearly specify the user’s intention.
2. Command Execution:
– Specify how the AI should respond with appropriate internal instructions or commands.
3. Dependency Management:
– Allow for the automatic installation of any necessary dependencies to execute the code.
4. Code Modification:
– Guide the AI on how to alter code or its environment to ensure successful execution or display.
5. Integration:
– Ensure that the template allows integration with existing systems for seamless code and AI interaction.
# JSON Structure
– intention:
– A description of the user’s goal with the code (e.g., run code, modify settings).
– dependencies:
– A list of dependencies required for code execution.
– commands:
– Internal commands or instructions needed by the AI to execute or modify the code.
– codeBlocks:
– An array of code sections or snippets to be run or modified.
– outputFormat:
– Preferred format or method for the AI to return results or changes.
# Example Template
“`json
{
“intention”: “Execute given Python script to fetch API data”,
“dependencies”: [“requests”],
“commands”: [“Install dependencies”, “Execute script”],
“codeBlocks”: [{ “language”: “python”, “code”: “import requestsnresponse = requests.get(‘https://api.example.com/data’)nprint(response.json())” }],
“outputFormat”: “Display result in console”
}
“`
# Steps
6. Define the intention clearly to direct the AI.
7. List all dependencies explicitly to ensure smooth execution.
8. Provide specific internal commands that guide the AI on actions to take.
9. Include code segments in the ‘codeBlocks’ for clarity.
10. Specify the desired output format to streamline how results are delivered.
# Notes
– Ensure all fields in the JSON are correctly populated and formatted.
– Verify that all dependencies can be installed and are necessary.
– Double-check that commands match the capabilities of the AI system.
# Output Format
Return the filled JSON template using the specified fields and adhere to formatting rules.
Screenshot Examples
How to Use This Prompt
- [intention]: User’s goal with the code.
- [dependencies]: Required libraries for execution.
- [commands]: Instructions for AI actions.
- [codeBlocks]: Code snippets to execute or modify.
- [outputFormat]: Desired result presentation method.
Tips for Best Results
- Intention: Clearly define the user’s goal for the code execution.
- Dependencies: List all necessary libraries or packages for smooth operation.
- Commands: Provide specific instructions for the AI to follow during execution.
- Code Blocks: Include relevant code snippets for clarity and context.
FAQ
- What is the purpose of the intention field?
It describes the user's goal with the code, guiding the AI's actions. - How are dependencies managed in the JSON template?
Dependencies are listed to ensure all necessary packages are installed for execution. - What should the commands field contain?
It should include internal instructions for the AI to execute or modify the code. - What is included in the codeBlocks array?
It contains code snippets that the AI will run or modify as per the user's intention.
Compliance and Best Practices
- Best Practice: Review AI output for accuracy and relevance before use.
- Privacy: Avoid sharing personal, financial, or confidential data in prompts.
- Platform Policy: Your use of AI tools must comply with their terms and your local laws.
Revision History
- Version 1.0 (February 2026): Initial release.


