Loading...
Loading...
Use before writing or editing any Python code — scripts, functions, bug fixes, cron jobs, data-processing one-offs, or additions to an existing .py file — even if the request sounds quick, casual, or "just a simple script." Applies whether the user names a .py file, describes what the script should do, or asks you to add/fix a function in Python. Covers required standards: type hints, no global variables, logging instead of print, wrapping any I/O (HTTP, DB, subprocess, file) in try/except, commenting the why not the what, writing a real test, and where to place design docs. Does not apply to conceptual Python questions with no code to write (e.g. explaining language features, comparing list vs tuple, explaining what an existing traceback means when the user hasn't asked for a fix, package install help, or learning-resource recommendations), and does not apply to non-Python languages.
npx skill4agent add caanio/agent-skills python-coding-standards.pyglobalMAX_RETRIES = 3DEFAULT_HEADERS = {...}logger = logging.getLogger(__name__)loggingprint()print()logging.basicConfig(level=logging.INFO, format=...)if __name__ == "__main__":level=logger.infobasicConfigprint().venvrequirements.txtpytestpytestpytest_doc/