Prompts for code generation, data analysis, and docs.
Use these prompts to generate maintainable code, analyze data, and write documentation that other engineers actually want to read.
Write a function named [name] that [responsibility]. Signature: [language + types]. Requirements: pure, total, documented, and with 5 table-driven tests.
Given this stack trace and snippet, identify the root cause, minimal reproduction, and the smallest safe fix. Include a test.
In [language], load [dataset]. Output: schema, missingness, 3 key distributions, outliers, and 2 hypotheses. Provide plotting code and a summary paragraph.
Code quality
Create a refactor plan for [module]. Goals, risks, test strategy, and a step-by-step migration plan.
Backend
Design an API for [resource]. Include OpenAPI spec, error model, pagination, and auth notes.
Docs
Generate docstrings for this file using [style]. Include param/returns, invariants, and complexity notes.
Data
Analyze this SQL for performance issues. Suggest indexes, rewrite joins, and provide EXPLAIN rationale.