Python Script Generator
Specifying type hints, error handling, and docstrings upfront means you get production-quality code instead of a quick hack. The standard library constraint prevents dependency bloat.
Write a Python script that {{task_description}}. Requirements: - Use type hints on all function signatures - Include error handling for common failure cases - Add docstrings explaining what each function does - Print a usage example at the bottom in an if __name__ == "__main__" block - Use only standard library modules unless I specify otherwise Input: {{input_format}} Output: {{output_format}}
Variables to customize
Why this prompt works
Specifying type hints, error handling, and docstrings upfront means you get production-quality code instead of a quick hack. The standard library constraint prevents dependency bloat.
Save this prompt to your library
Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.
Related prompts
Forcing the agent to plan before acting prevents premature execution and wasted steps. Explicit dependency mapping enables parallel execution and catches logical gaps early.
Tool Selection AgentThe ReAct pattern (Reason + Act) creates an explicit reasoning trace that improves tool selection accuracy. The error-handling rule prevents infinite retry loops.
Prompt CompressorExplicitly requiring all functional requirements to be preserved prevents the model from over-compressing and losing critical instructions.
Memory Management AgentExplicit memory read/write instructions create agents that improve over time. Categorization keeps memories organized, and the deduplication rule prevents context bloat.