Back to All Tags
Tag • 28 Prompts

#Clean Code

Explore all AI prompts tagged with #Clean Code.

Prompts tagged with #Clean Code

GPT-4

I want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is pwd

▸ ready to run
GPT-4

I want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is pwd

Linux Terminal Emulator for Safe Command Practice

Turns the model into a sandboxed Linux shell that replies only with terminal output and no commentary. Useful for rehearsing commands, checking expected output, or teaching shell basics without touching a real machine. Wrap anything you want said in plain English in braces.

168.3K
Claude

This function is too long and untested. Produce: (1) a characterisation test suite that pins current behaviour including its bugs, (2) a seam-by-seam extraction plan, (3) the refactored version. Behaviour changes are forbidden — flag suspected bugs in comments instead of fixing them. [PASTE FUNCTION]

▸ ready to run
Claude

This function is too long and untested. Produce: (1) a characterisation test suite that pins current behaviour including its bugs, (2) a seam-by-seam extraction plan, (3) the refactored version. Behaviour changes are forbidden — flag suspected bugs in comments instead of fixing them. [PASTE FUNCTION]

Legacy Function Strangler

A refactoring prompt that puts characterisation tests before any code movement and outlaws behaviour changes — suspected bugs get flagged, not silently fixed. The output is a safe, reviewable migration rather than a rewrite gamble.

654105
GPT-4

For this function, identify the algebraic properties it should satisfy (idempotence, inverse pairs, invariants, ordering). Write property-based tests for each using the idiomatic library for the language. Include two deliberately nasty generators: adversarial strings and boundary numerics. [PASTE FUNCTION]

▸ ready to run
GPT-4

For this function, identify the algebraic properties it should satisfy (idempotence, inverse pairs, invariants, ordering). Write property-based tests for each using the idiomatic library for the language. Include two deliberately nasty generators: adversarial strings and boundary numerics. [PASTE FUNCTION]

Property-Based Test Generator

Moves testing from example-listing to property thinking: the prompt asks which algebraic laws the code must obey, then encodes them with hostile generators. Finds the edge cases table-driven tests always miss.

48580
GPT-4

Write a pandas pipeline that ingests this CSV description, handles missing values with per-column strategies you justify, normalises dtypes, and outputs a validated DataFrame. Use method chaining, type hints, and add three assertion checks that would catch silent data corruption. [DESCRIBE COLUMNS]

▸ ready to run
GPT-4

Write a pandas pipeline that ingests this CSV description, handles missing values with per-column strategies you justify, normalises dtypes, and outputs a validated DataFrame. Use method chaining, type hints, and add three assertion checks that would catch silent data corruption. [DESCRIBE COLUMNS]

Pandas Cleanup Pipeline Builder

A data-cleaning prompt that demands per-column justification and built-in assertions — the difference between a script and a pipeline you can trust next month. Method chaining keeps the result readable in review.

713120