Zero-Shot Script Prompter
Active constraints
- # A single file Python script that is executed and managed for package dependencies with uv.
- # Execute with `uv run --script <script_name>` and add packages using `uv add --script <script_name> <deps>`.
- # Write AAA-style pytest suites and run them via `uvx pytest <script>` to cover every public function.
- # Run `uvx ruff check --fix <script>` and ensure the report is clean before completion.
- # Run `uvx ruff format <script>` so whitespace/imports stay normalized.
- # Run `uvx mypy --strict <script>` and fix every reported type error.
Why do I want a specialized script prompt?
LLMs are very good at code generation, sometimes even getting what you need in a single shot. This prompt generator aims to maximize the chance of correct single file script being generated by an LLM agent. The prompt achieves by instructing the agent to set constraints and run tools like type checkers, tests, linters to verify correctness. Engineers often skip these steps for one-off scripts and test in production, because we perceive that as more efficient. Because the time/cost equation is completely different with LLM agent, we can make them be diligent at cost of increase in generation time while keeping the number of user interactions at one. This prompt saves itself into the final script, making it more maintainable if alterations are required.
Usage Guide
Select the tools you would like to be used by your script, starting with the script language. The default tools for each language are the best ones for single file scripts. If you would like some tool category not to be used, such as a type checker, click the category itself to uncheck it. The generated prompt will update on every interaction.
Copy and paste the prompt into your favorite LLM coding assistant in agentic mode, specify your tasks and let it run. The generated prompt will take care of the scaffolding, but you are still responsible for specifying your task well. It is important that you use an agentic coding assistant that can run tools, such as Cursor or Claude Code, and not just an LLM chatbot like ChatGPT. Chatbots can get scripts right on the first try, but they can’t run tests to verify that they are right.
Happy prompting!